Skip to content

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

Merged
merged 5 commits into from
May 19, 2025

Conversation

lariciamota
Copy link
Contributor

@lariciamota lariciamota commented May 15, 2025

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.
Screenshot 2025-05-15 at 10 30 42

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** and Product 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 😣).

PLP Search Page
Screenshot 2025-05-15 at 09 59 40 Screenshot 2025-05-15 at 10 09 08
Screenshot 2025-05-15 at 10 15 40 Screenshot 2025-05-15 at 10 16 30
Screenshot 2025-05-15 at 10 17 37 Screenshot 2025-05-15 at 10 18 05

Starters Deploy Preview

References

Copy link

codesandbox-ci bot commented May 15, 2025

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.

@lariciamota lariciamota changed the title Feat/global sections settings feat: Create Global Sections Settings tab May 15, 2025
@lariciamota lariciamota self-assigned this May 15, 2025
@lariciamota lariciamota added the enhancement New feature or request label May 15, 2025
@lariciamota lariciamota marked this pull request as ready for review May 15, 2025 13:38
@lariciamota lariciamota requested a review from a team as a code owner May 15, 2025 13:38
@lariciamota lariciamota requested review from gabpaladino, renatomaurovtex, lucasfp13 and beatrizmilhomem and removed request for a team, gabpaladino and renatomaurovtex May 15, 2025 13:38
Copy link

@beatrizmilhomem beatrizmilhomem left a 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.

Comment on lines 43 to 46
const context = usePage<SearchPageContext | PLPContext>()
const globalDeliverySettingsData =
context?.globalSectionsSettings?.regionalization?.deliverySettings ?? {}
const cmsData = deepmerge(globalDeliverySettingsData, deliverySettings ?? {})
Copy link
Contributor

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?

Copy link
Contributor Author

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

@lariciamota lariciamota merged commit 8fe10c6 into feat/delivery-promise-1.2 May 19, 2025
4 of 6 checks passed
@lariciamota lariciamota deleted the feat/global-sections-settings branch May 19, 2025 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants