Skip to content
This repository was archived by the owner on Sep 30, 2025. It is now read-only.

Commit c495732

Browse files
sirgalletochloericemrcthms
authored
Apply suggestions from code review
Co-authored-by: Chloe Rice <chloerice@users.noreply.github.com> Co-authored-by: Marc Thomas <marc.thomas@shopify.com>
1 parent 10cb148 commit c495732

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

.changeset/strange-bananas-obey.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
'@shopify/polaris': minor
33
---
44

5-
Add Edit Columns button on `IndexFilters` when showEditColumns flag is true
5+
Added the `showEditColumnsButton` prop to `IndexFilters`

polaris-react/locales/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@
194194
}
195195
},
196196
"EditColumnsButton": {
197-
"editColumns": "Edit columns"
197+
"accessibilityLabel": "Customize table column order and visibility"
198198
},
199199
"UpdateButtons": {
200200
"cancel": "Cancel",

polaris-react/src/components/IndexFilters/IndexFilters.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ export interface IndexFiltersProps
103103
closeOnChildOverlayClick?: boolean;
104104
/** Optional override to the default keyboard shortcuts available */
105105
disableKeyboardShortcuts?: boolean;
106-
/** Shows the edit columns button */
107-
showEditColumns?: boolean;
106+
/** Whether to display the edit columns button with the other default mode filter actions */
107+
showEditColumnsButton?: boolean;
108108
}
109109

110110
export function IndexFilters({
@@ -143,7 +143,7 @@ export function IndexFilters({
143143
hideQueryField,
144144
closeOnChildOverlayClick,
145145
disableKeyboardShortcuts,
146-
showEditColumns,
146+
showEditColumnsButton,
147147
}: IndexFiltersProps) {
148148
const i18n = useI18n();
149149
const {mdDown} = useBreakpoints();
@@ -288,7 +288,7 @@ export function IndexFilters({
288288
beginEdit(IndexFiltersMode.EditingColumns);
289289
}
290290

291-
const editColumnsMarkup = showEditColumns ? (
291+
const editColumnsMarkup = showEditColumnsButton ? (
292292
<EditColumnsButton
293293
onClick={handleClickEditColumnsButon}
294294
disabled={disabled}

polaris-react/src/components/IndexFilters/components/EditColumnsButton/EditColumnsButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export function EditColumnsButton({onClick, disabled}: EditColumnsButtonProps) {
3333
onClick={onClick}
3434
icon={polarisSummerEditions2023 ? Columns3Minor : undefined}
3535
label={i18n.translate(
36-
'Polaris.IndexFilters.EditColumnsButton.editColumns',
36+
'Polaris.IndexFilters.EditColumnsButton.accessibilityLabel',
3737
)}
3838
disabled={disabled}
3939
>

polaris-react/src/components/IndexFilters/tests/IndexFilters.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ describe('IndexFilters', () => {
441441
});
442442

443443
describe('EditColumnsButton', () => {
444-
it('renders when showEditColumns is true', () => {
444+
it('renders when showEditColumnsButton is true', () => {
445445
const wrapper = mountWithApp(
446446
<IndexFilters {...defaultProps} showEditColumns />,
447447
);

0 commit comments

Comments
 (0)