Skip to content

Commit 863f15f

Browse files
authored
[IndexFilters] Use context provider for IndexFilters mode state (#10490)
### WHY are these changes introduced? Linked to Shopify/web#96682 We want to perform actions in other components whenever we enter the non-default mode of the IndexFilters. This currently is limited to disabling the actions in the `Page` component, but could be extended in the future. ### WHAT is this pull request doing? Adding a new context manager, `IndexFiltersManager`, which allows both the IndexFilters component to use the `mode`, but also allows other components, within Polaris and also within consumers of Polaris, to react to the changes of the `mode`. <!-- ℹ️ Delete the following for small / trivial changes --> ### How to 🎩 🖥 [Local development instructions](https://github.com/Shopify/polaris/blob/main/README.md#local-development) 🗒 [General tophatting guidelines](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md) 📄 [Changelog guidelines](https://github.com/Shopify/polaris/blob/main/.github/CONTRIBUTING.md#changelog) - Spinstance: https://admin.web.if-disable-buttons.marc-thomas.eu.spin.dev/store/shop1/orders?inContextTimeframe=none - Storybook: https://5d559397bae39100201eedc1-objwwxomnz.chromatic.com/?path=/story/all-components-indexfilters--wrapped-in-a-page ### 🎩 checklist - [x] Tested on [mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing) - [x] Tested on [multiple browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers) - [x] Tested for [accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md) - [x] Updated the component's `README.md` with documentation changes - [x] [Tophatted documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md) changes in the style guide
1 parent 05c1379 commit 863f15f

File tree

23 files changed

+452
-324
lines changed

23 files changed

+452
-324
lines changed

.changeset/lucky-wombats-push.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/polaris': minor
3+
---
4+
5+
Add new `IndexFiltersManager` for allowing disabling of Page Header actions when in Filtering or EditingColumns mode

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
ScrollLockManager,
1313
ScrollLockManagerContext,
1414
} from '../../utilities/scroll-lock-manager';
15+
import {IndexFiltersManager} from '../../utilities/index-filters';
1516
import {
1617
StickyManager,
1718
StickyManagerContext,
@@ -179,7 +180,7 @@ export class AppProvider extends Component<AppProviderProps, State> {
179180
<PortalsManager>
180181
<FocusManager>
181182
<EphemeralPresenceManager>
182-
{children}
183+
<IndexFiltersManager>{children}</IndexFiltersManager>
183184
</EphemeralPresenceManager>
184185
</FocusManager>
185186
</PortalsManager>

0 commit comments

Comments
 (0)