Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,21 @@ export const getPreview = (values: DatagridDropdownFilterPreviewProps, isDarkMod
export function check(_props: DatagridDropdownFilterPreviewProps): Problem[] {
const errors: Problem[] = [];

const isEmpty = (value: string | undefined): boolean => !value || value.trim() === "";

if (_props.baseType === "ref") {
if (_props.refCaptionSource === "attr" && isEmpty(_props.refCaption)) {
errors.push({
property: "refCaption",
message: "Caption cannot be empty if the source is attribute"
});
} else if (_props.refCaptionSource === "exp" && isEmpty(_props.refCaptionExp)) {
errors.push({
property: "refCaptionExp",
message: "Caption cannot be empty if the source is expression"
});
}
}

return errors;
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@
<enumerationValue key="exp">Expression</enumerationValue>
</enumerationValues>
</property>
<property key="refCaption" type="attribute" dataSource="refOptions" required="false">
<property key="refCaption" type="attribute" dataSource="refOptions" required="true">
<caption>Caption</caption>
<description />
<attributeTypes>
<attributeType name="String" />
</attributeTypes>
</property>
<property key="refCaptionExp" type="expression" dataSource="refOptions" required="false">
<property key="refCaptionExp" type="expression" dataSource="refOptions" required="true">
<caption>Caption</caption>
<description />
<returnType type="String" />
Expand Down
4 changes: 4 additions & 0 deletions packages/pluggableWidgets/datagrid-web/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

### Added

- We fixed an issue where missing consistency checks for the captions were causing runtime errors instead of in Studio Pro

## [3.6.0] - 2025-10-01

### Fixed
Expand Down
Loading