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

[Upgrade guide entry] Upgrade entry for new Pages editing architecture for field components #1815

Merged
merged 6 commits into from
Jun 12, 2024

Conversation

yavorsk
Copy link
Contributor

@yavorsk yavorsk commented Jun 6, 2024

Description / Motivation

This PR adds upgrade entry for new Pages editing architecture for field components

Testing Details

  • Unit Test Added
  • Manual Test/Other (Please elaborate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Upgrade guide entry

@yavorsk yavorsk requested a review from a team June 6, 2024 12:42
Copy link
Contributor

@art-alexeyenko art-alexeyenko left a comment

Choose a reason for hiding this comment

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

Looks good

@@ -113,3 +113,5 @@
* Introduce a new _lib/graphql-editing-service.ts_ file to initialize a _graphQLEditingService_ to support a new Editing Metadata Mode. Can be done by adding this file from the latest version introduced in _nextjs-xmcloud_ base template.

* Update _lib/page-props-factory/plugins/preview-mode_ plugin to support a new Editing Metadata Mode. Can be done by replacing this file with the latest version introduced in _nextjs-xmcloud_ base template.

* To support editing for fields in Pages, the new editing metadata architecture relies on the new metadata property 'field.metadata' (instead of on 'field.editable', which won't be used in this scenario). If you are using the new editing arhitecture in Pages (EditMode.Metadata) and have custom field component that manipulates or relies on 'field.editable' in some way, it may need to be reworked.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you provide some code sample, please? Customer will still need to support field.editable since it's required for Experience Editor support

...
export const Banner = (props: ImageProps): JSX.Element => {
...
const isMetadataMode = sitecoreContext?.editMode === EditMode.Metadata;
Copy link
Contributor

Choose a reason for hiding this comment

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

let's show how to access sitecoreContext variable, and add required imports for useSitecoreContext and EditMode variables

@yavorsk yavorsk merged commit 5d2a6e9 into dev Jun 12, 2024
1 check passed
@yavorsk yavorsk deleted the feature/JSS-3404-upgrade-guide-metadata-fields branch June 12, 2024 12:43
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