-
Notifications
You must be signed in to change notification settings - Fork 8
fix/CMG-737 refactor: enhance JSON handling in processFieldsRecursive function of… #813
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
Conversation
… aem.service.ts to support string and object types for content
…elds to AssetJSON interface, implementing helper functions for HTML sanitization and field value extraction, and improving asset deduplication logic Resolved Bugs - CMG-743 CMG-747 CMG-748 CMG-758
sayalijoshi27
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add null checks in both the files and resolve security scan failed test
There was a problem hiding this 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 enhances JSON handling in the AEM service to support both string and object content types, and introduces UID normalization across field mappings to ensure consistent UID formatting throughout the migration process.
Key changes:
- Added
normalizeFieldUidsfunction with recursive UID correction for field mappings, blocks, and schema items - Refactored asset deduplication logic to use filename-based tracking instead of creating duplicates
- Enhanced field processing to support flexible content types (string/object) in JSON RTE fields
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| upload-api/migration-aem/helper/fieldMappings.merge.ts | Introduces UID normalization functions and integrates them into content model processing pipeline |
| api/src/services/aem.service.ts | Refactors asset creation to deduplicate by filename, adds helper functions for field value extraction and HTML sanitization, and enhances field type handling with support for flexible content types |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ge.ts by adding optional chaining to prevent runtime errors
… aem.service.ts to support string and object types for content