Skip to content

feat: implement group schema utilities and add unit tests#1000

Merged
umeshmore45 merged 2 commits intodevfrom
bugfix/cmg-821
Mar 18, 2026
Merged

feat: implement group schema utilities and add unit tests#1000
umeshmore45 merged 2 commits intodevfrom
bugfix/cmg-821

Conversation

@shobhitupadhyayy
Copy link
Contributor

  • 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.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 / shouldRecurseIntoNestedDestGroup utilities plus unit tests.
  • Updated ContentMapper to 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.

@umeshmore45 umeshmore45 merged commit bf1b707 into dev Mar 18, 2026
9 checks passed
@umeshmore45 umeshmore45 deleted the bugfix/cmg-821 branch March 18, 2026 08:42
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.

4 participants