feat: implement group schema utilities and add unit tests#1000
Merged
umeshmore45 merged 2 commits intodevfrom Mar 18, 2026
Merged
feat: implement group schema utilities and add unit tests#1000umeshmore45 merged 2 commits intodevfrom
umeshmore45 merged 2 commits intodevfrom
Conversation
Contributor
shobhitupadhyayy
commented
Mar 16, 2026
- Added utility functions and to manage group field mapping based on nesting depth.
- Introduced unit tests for the new utility functions to ensure correct behavior.
- Updated component to utilize the new utilities for improved schema processing.
- Modified to include test configuration.
- Updated for dependency version updates.
- Added utility functions and to manage group field mapping based on nesting depth. - Introduced unit tests for the new utility functions to ensure correct behavior. - Updated component to utilize the new utilities for improved schema processing. - Modified to include test configuration. - Updated for dependency version updates.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces utilities to control how group fields are surfaced/matched during schema option-building (based on nesting), adds unit tests for those utilities, and refactors part of ContentMapper’s schema re-sync logic when a Contentstack content type schema changes.
Changes:
- Added
shouldAddGroupOption/shouldRecurseIntoNestedDestGrouputilities plus unit tests. - Updated
ContentMapperto use the new utilities and added a schema-flattening helper to re-map stale selections after schema updates. - Adjusted UI Vitest/Vite configuration and changed upload-api default
cmsType.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| upload-api/src/config/index.ts | Changes default cmsType fallback to aem. |
| ui/vite.config.ts | Adds a test block and switches defineConfig import to vitest/config. |
| ui/src/components/ContentMapper/index.tsx | Uses new group utilities; adds flattenSchemaToUidMap and refactors schema-change reconciliation logic. |
| ui/src/components/ContentMapper/groupSchema.utils.ts | New group-schema helper utilities. |
| ui/src/components/ContentMapper/tests/groupSchema.utils.test.ts | Unit tests for the new utilities. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
vikrantraut
reviewed
Mar 18, 2026
vikrantraut
approved these changes
Mar 18, 2026
umeshmore45
approved these changes
Mar 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.