-
Notifications
You must be signed in to change notification settings - Fork 64
feat: Create Global Sections Settings tab #2845
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Create Global Sections Settings tab #2845
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could make the deprecated
message simpler/shorter and create documentation related to deprecated fields. A suggestion for the message: [Deprecated] Use the fields from Global Sections / Settings.
const context = usePage<SearchPageContext | PLPContext>() | ||
const globalDeliverySettingsData = | ||
context?.globalSectionsSettings?.regionalization?.deliverySettings ?? {} | ||
const cmsData = deepmerge(globalDeliverySettingsData, deliverySettings ?? {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will we need this deep merge in every component that will use this global settings? If so, maybe move this logic to a separated function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great suggestion! Since it'll be used exactly like that in FilterSlider, I've extracted it to a utils file
What's the purpose of this pull request?
It creates a new tab inside the Global Sections CMS. In the new Settings tab, it will be possible to configure settings related to regionalization, which will be used by components such as the Region Modal and Region Popover.
This PR doesn't update all components/sections, it'll be done after. In this PR, there is an update to
FilterDesktop
so we can validate the change.How it works?
The merchant will be able to configure their regionalization-related message in a single place (Global Sections Settings tab) instead of duplicate messages through sections.
To avoid introducing breaking changes, I haven't removed the messages from the sections yet - this will be done in v4. I've added a deprecation notice in every field that was created in the Settings tab.
In v3, the components/sections will use the messages defined in the sections CMS; if they're blank, they will use the messages in the Global Sections Settings tab.

How to test it?
In the CMS of the vendemo store, I've added messages in the Global Sections Settings tab using a
[GS]
at the beginning of every message so we can identify the ones that are coming from this tab.PLP
I've only removed (left blank) the messages in
Product List Page > Product Gallery > Filter > Delivery Settings > **Delivery Section description**
andProduct List Page > Product Gallery > Filter > Delivery Settings > Delivery Custom labels > **Shipping label**
, those are the ones that should use the GS one.Search page
The messages from
Search Page > Product Gallery > Filter > Delivery Settings
were all left blank (we hadn't updated this page to add the messages -- so this page didn't have messages defined for those cases, and we hadn't noticed 😣).Starters Deploy Preview
References