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

[Editing Integration] Integrate /editing/render endpoint #1806

Merged
merged 13 commits into from
Jun 3, 2024

Conversation

illiakovalenko
Copy link
Contributor

@illiakovalenko illiakovalenko commented May 30, 2024

Description / Motivation

  • [next.js] Integrated a new Metadata Edit Mode in /api/editing/render endpoint.
    • Exported new EditingMetadataPreviewData type and isEditingMetadataPreviewData guard function.
    • Introduced GraphQLEditingService class to fetch editing data in Metadata Edit Mode.
    • Introduced /lib/graphql-editing-service to fetch editing data in Metadata Edit Mode.
    • Added a new page-props-factory/plugins/preview-mode plugin to handle both Chromes and Metadata Edit Mode.
    • Removed cors header for API endpoints from lib/next-config/plugins/cors-header plugin since cors is handled by API handlers / middlewares
  • [sitecore-jss] Introduced /editing submodule that contains all editing related functionality. Editing utils are now available in /editing submodule. Editing utils exported from /utils marked as deprecated.
  • GraphQLRequestClient now can accept custom 'headers' in the constructor or via createClientFactory

Testing Details

  • Unit Test Added
  • Manual Test/Other Tested manually a new GET method using /api/editing/render endpoint

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)

@@ -83,7 +87,7 @@ export type GraphQLRequestClientConfig = {
* @returns An instance of a GraphQL Request Client ready to send GraphQL requests.
*/
export type GraphQLRequestClientFactory = (
config: Omit<GraphQLRequestClientConfig, 'apiKey'>
config?: Omit<GraphQLRequestClientConfig, 'apiKey'>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

NOTE: made config argument optional since initially it didn't match the interface we have here

@illiakovalenko illiakovalenko requested a review from a team May 30, 2024 11:54
Copy link
Contributor

@ambrauer ambrauer left a comment

Choose a reason for hiding this comment

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

This is looking great! See some feedback.

Copy link
Contributor

@ambrauer ambrauer left a comment

Choose a reason for hiding this comment

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

👍

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.

Just left one comment for now, I'll do another look around with a fresh mind later

@illiakovalenko illiakovalenko merged commit 529d8d1 into dev Jun 3, 2024
1 check passed
@illiakovalenko illiakovalenko deleted the feature/JSS-2951 branch June 3, 2024 14:30
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.

None yet

4 participants