Skip to content
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: Multiple global content types #2668

Merged
merged 9 commits into from
Feb 26, 2025

Conversation

eduardoformiga
Copy link
Member

@eduardoformiga eduardoformiga commented Feb 3, 2025

βœ… πŸŽ—οΈ delete both content types in storeframework account after PR got merged.
βœ… πŸŽ—οΈ sync FS + hCMS in vtex account.

What's the purpose of this pull request?

This pull request handles multiple global content types. Now the global sections are expected to have:
globalHeaderSections and globalFooterSections.

How it works?

Added globalHeaderSections and globalFooterSections
globalHeaderSections - injected before the Children section from globalSections content type.
globalHeaderFooter - injected after the Children section from globalSections content type.

All the pages now are fetching these content types if they exist and merging all global sections.

How to test it?

with the version of this PR in the starter:

  1. login in your account vtex switch <account>
  2. if the account didn't have the globalHeaderSections and globalFooterSections content types, sync the hCMS with the command: yarn cms-sync. you can use the dry option yarn cms-sync -d (just for tests before really sync).
  3. in the hCMS, add the 2 new documents with sections using the new content types globalHeaderSections and globalFooterSections.
  4. make sure the sections are shown in the expected places: globalHeaderSections before the Children and globalFooterSections after the children.

hCMS
Screenshot 2025-02-04 at 12 42 17

globalHeaderSections globalFooterSections
Screenshot 2025-02-04 at 12 18 01 Screenshot 2025-02-04 at 12 18 14

Starters Deploy Preview

you can check the section in this preview
https://storeframework-cm652ufll028lmgv665a6xv0g-isf4taa08.b.vtex.app/

References

https://vtex.slack.com/archives/C02JMH9AYR1/p1738007781146059

Copy link

codesandbox-ci bot commented Feb 3, 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.

@eduardoformiga eduardoformiga changed the title Feat: Multiple global content types feat: Multiple global content types Feb 3, 2025
@eduardoformiga eduardoformiga marked this pull request as ready for review February 4, 2025 15:47
@eduardoformiga eduardoformiga requested a review from a team as a code owner February 4, 2025 15:47
@eduardoformiga eduardoformiga requested review from renatamottam and lucasfp13 and removed request for a team February 4, 2025 15:47
Copy link
Contributor

@lariciamota lariciamota left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!
It'd be good to update our doc

@eduardoformiga
Copy link
Member Author

Nice! It'd be good to update our doc

yeah, the docs @mariana-caetano already started to create.

@eduardoformiga eduardoformiga merged commit 8555310 into main Feb 26, 2025
10 checks passed
@eduardoformiga eduardoformiga deleted the feat/multiple-global-content-types-SFS-2120 branch February 26, 2025 20:04
eduardoformiga added a commit that referenced this pull request Feb 26, 2025
## What's the purpose of this pull request?

- #2668
introduces a bug in its last commit. This PR removes the checking for
the MissingContentError in getPage

## How it works?

<!--- Tell us the role of the new feature, or component, in its context.
Provide details about what you have implemented and screenshots if
applicable. --->

## How to test it?

<!--- Describe the steps with bullet points. Is there any external link
that can be used to better test it or an example? --->

### Starters Deploy Preview

<!--- Add a link to a deploy preview from `starter.store` with this
branch being used. --->

<!--- Tip: You can get an installable version of this branch from the
CodeSandbox generated when this PR is created. --->

## References

<!--- Spread the knowledge: is there any content you used to create this
PR that is worth sharing? --->

<!--- Extra tip: adding references to related issues or mentioning
people important to this PR may be good for the documentation and
reviewing process --->

## Checklist

<em>You may erase this after checking them all πŸ˜‰</em>

**PR Title and Commit Messages**

- [ ] PR title and commit messages follow the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification
- Available prefixes: `feat`, `fix`, `chore`, `docs`, `style`,
`refactor`, `ci` and `test`

**PR Description**

- [ ] Added a label according to the PR goal - `breaking change`, `bug`,
`contributing`, `performance`, `documentation`..

**Dependencies**

- [ ] Committed the `pnpm-lock.yaml` file when there were changes to the
packages

**Documentation**

- [ ] PR description
- [ ] For documentation changes, ping `@Mariana-Caetano` to review and
update (Or submit a doc request)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants