Enhance LoadSelectCms and LoadUploadFile components to preserve exist…#955
Open
Enhance LoadSelectCms and LoadUploadFile components to preserve exist…#955
Conversation
…ing file details during validation failures. Merge config data with Redux state to maintain user input integrity. Update Migration page logic to ensure non-empty values are prioritized, improving overall data consistency.
…e modules. Upgrade axios to version 1.13.5 and jsonpath to version 1.2.0. Clean up package.json and package-lock.json files by removing deprecated and unnecessary entries to enhance project maintainability.
…grade @contentstack/cli-utilities to version 1.17.1, axios to version 1.13.5, and qs to version 6.14.2. Add new dependencies and ensure all packages are up-to-date for improved functionality and security.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances data preservation logic in the migration workflow to prevent loss of user-entered file details during validation failures. The changes modify three React components (LoadSelectCms, LoadUploadFile, and Migration page) to merge configuration data with existing Redux state, ensuring that non-empty user inputs are retained when validation fails or when configuration returns empty values.
Changes:
- Enhanced LoadSelectCms and LoadUploadFile components to preserve existing file_details from Redux when validation fails or config data is unavailable
- Updated Migration page to implement data merging logic that prioritizes non-empty values over potentially empty config values
- Reorganized package dependencies across multiple package.json files, moving helmet from devDependencies to dependencies in upload-api, and removing unused dependencies
Reviewed changes
Copilot reviewed 8 out of 13 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| ui/src/pages/Migration/index.tsx | Added logic to merge config data with existing Redux state when file validation fails, with fallback to preserve user input |
| ui/src/components/LegacyCms/Actions/LoadUploadFile.tsx | Modified file validation handler to preserve existing file_details when validation fails (status !== 200) |
| ui/src/components/LegacyCms/Actions/LoadSelectCms.tsx | Updated CMS selection to merge config data with existing file_details, preserving non-empty values |
| upload-api/package.json | Moved helmet from devDependencies to dependencies, removed unused packages |
| upload-api/package-lock.json | Updated lock file to reflect package.json changes |
| upload-api/migration-contentful/package.json | Updated jsonpath from ^1.1.1 to ^1.2.0 |
| ui/package.json | Removed unused testing and UI dependencies |
| package.json | Removed unused root-level dependencies |
| api/package.json | Removed unused dependencies, added lodash to dependencies |
Files not reviewed (4)
- api/package-lock.json: Language not supported
- ui/package-lock.json: Language not supported
- upload-api/migration-contentful/package-lock.json: Language not supported
- upload-api/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ponent logic to prioritize non-empty config values over existing Redux state during file uploads. This enhances data integrity and consistency in the migration process.
…ge-lock.json across multiple modules for improved functionality and security. Additionally, add new qs dependency in upload-api for enhanced compatibility.
…ious dependencies, including @babel packages and axios, to their latest versions for improved functionality and security. Remove deprecated migration-related packages to streamline the project structure.
…Contentful, Sitecore, and WordPress. Each file specifies dependencies and versions to ensure consistent environments across migrations, enhancing functionality and maintainability.
…pment-only by adding "dev": true. Remove the ui package-lock.json file to streamline the project structure and eliminate unused dependencies.
…es. Update package.json and package-lock.json in upload-api to include new dependencies: fs-readdir-recursive, lodash, mkdirp, and moment for enhanced functionality. Clean up unused dependencies to streamline project structure.
…ge-lock.json files across multiple modules. Add new dependencies for improved functionality, including @types/uuid in the upload-api module. Introduce a new ui package-lock.json file to manage dependencies for the UI component of the migration project.
…ing 'qs' to version 6.14.2 and 'tmp' to version 0.2.5. Remove deprecated 'os-tmpdir' dependency and clean up package-lock.json files to streamline project structure and enhance maintainability.
…lob' dependency and add several new development dependencies, including 'brace-expansion', 'glob', 'minimatch', 'inflight', and 'path-is-absolute', enhancing project functionality and maintainability.
…endency management while retaining 'diff' version specification for compatibility.
…ency from overrides and add 'webpack-dev-server' to enhance development capabilities. Additionally, new dependencies for @jsonjoy.com modules are introduced in package-lock.json to improve functionality and maintainability.
…to streamline project dependencies. Refactor contentful.service.ts to eliminate reliance on 'jsonpath' by implementing direct item-level processing for arrays, enhancing code clarity and maintainability.
…ersion 6.14.2 across multiple modules, enhancing functionality. Clean up package structure by ensuring consistency in dependency management.
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.
…ing file details during validation failures. Merge config data with Redux state to maintain user input integrity. Update Migration page logic to ensure non-empty values are prioritized, improving overall data consistency.