Skip to content

Commit 1bf0d92

Browse files
committed
refactor: rename property and adjust visibility
1 parent 34f11ea commit 1bf0d92

6 files changed

Lines changed: 13 additions & 9 deletions

File tree

packages/pluggableWidgets/datagrid-web/src/Datagrid.editorConfig.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,10 @@ function hideSelectionProperties(defaultProperties: Properties, values: Datagrid
170170
"enableSelectAll"
171171
]);
172172
}
173+
174+
if (itemSelection !== "Single") {
175+
hidePropertyIn(defaultProperties, values, "singleSelectionColumnLabel");
176+
}
173177
}
174178

175179
export const getPreview = (

packages/pluggableWidgets/datagrid-web/src/Datagrid.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,8 @@
446446
<translation lang="nl_NL">Selecteer alle rijen</translation>
447447
</translations>
448448
</property>
449-
<property key="selectSingleRowLabel" type="textTemplate" required="false">
450-
<caption>Select single row label</caption>
449+
<property key="singleSelectionColumnLabel" type="textTemplate" required="false">
450+
<caption>Single selection column label</caption>
451451
<description>If single selection is enabled, assistive technology will read this for the selection column header.</description>
452452
<translations>
453453
<translation lang="en_US">Select single row</translation>

packages/pluggableWidgets/datagrid-web/src/components/CheckboxColumnHeader.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { useDatagridConfig, useSelectActions, useSelectionHelper, useTexts } fro
66

77
export function CheckboxColumnHeader(): ReactElement {
88
const { selectAllCheckboxEnabled, checkboxColumnEnabled } = useDatagridConfig();
9-
const { selectSingleRowLabel } = useTexts();
9+
const { singleSelectionColumnLabel } = useTexts();
1010
const selectionHelper = useSelectionHelper();
1111

1212
if (checkboxColumnEnabled === false) {
@@ -19,7 +19,7 @@ export function CheckboxColumnHeader(): ReactElement {
1919
<Checkbox />
2020
</If>
2121
<If condition={selectionHelper?.type === "Single"}>
22-
<span className="sr-only">{selectSingleRowLabel || "Select single row"}</span>
22+
<span className="sr-only">{singleSelectionColumnLabel || "Select single row"}</span>
2323
</If>
2424
</div>
2525
);

packages/pluggableWidgets/datagrid-web/src/model/services/Texts.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ export class TextsService {
2727
return this.props.selectAllRowsLabel?.value;
2828
}
2929

30-
get selectSingleRowLabel(): string | undefined {
31-
return this.props.selectSingleRowLabel?.value;
30+
get singleSelectionColumnLabel(): string | undefined {
31+
return this.props.singleSelectionColumnLabel?.value;
3232
}
3333

3434
get headerAriaLabel(): string | undefined {

packages/pluggableWidgets/datagrid-web/typings/DatagridProps.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export interface DatagridContainerProps {
142142
cancelExportLabel?: DynamicValue<string>;
143143
selectRowLabel?: DynamicValue<string>;
144144
selectAllRowsLabel?: DynamicValue<string>;
145-
selectSingleRowLabel?: DynamicValue<string>;
145+
singleSelectionColumnLabel?: DynamicValue<string>;
146146
selectingAllLabel?: DynamicValue<string>;
147147
cancelSelectionLabel?: DynamicValue<string>;
148148
selectedCountTemplateSingular?: DynamicValue<string>;
@@ -209,7 +209,7 @@ export interface DatagridPreviewProps {
209209
cancelExportLabel: string;
210210
selectRowLabel: string;
211211
selectAllRowsLabel: string;
212-
selectSingleRowLabel: string;
212+
singleSelectionColumnLabel: string;
213213
selectingAllLabel: string;
214214
cancelSelectionLabel: string;
215215
selectedCountTemplateSingular: string;

packages/pluggableWidgets/datagrid-web/typings/MainGateProps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export type MainGateProps = Pick<
3636
| "selectAllText"
3737
| "selectionCounterPosition"
3838
| "selectRowLabel"
39-
| "selectSingleRowLabel"
39+
| "singleSelectionColumnLabel"
4040
| "showNumberOfRows"
4141
| "showPagingButtons"
4242
| "storeFiltersInPersonalization"

0 commit comments

Comments
 (0)