fix: update Card component's radio button logic and improve SaveChang…#1085
Conversation
…esModal props for better handling of async functions style: refine ContentMapper styles for improved layout and adjust LegacyCms styles for better UI consistency feat: enhance LoadSelectCms logic to preserve selected CMS and file format across sessions fix: disable editing of file path in LoadUploadFile when file is validated refactor: update HorizontalStepper to correctly manage completed steps during navigation fix: add iteration handling in Migration component to ensure proper state management
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
Consider reviewing these vulnerabilities when fixes become available. |
There was a problem hiding this comment.
Pull request overview
This PR fixes several state/UI inconsistencies in the migration restart flow, ensuring previously selected Legacy CMS version/file-format and iteration-dependent UI render correctly after revisiting/restarting a project, while also tightening up stepper reset behavior and minor UI styling.
Changes:
- Preserve selected Legacy CMS version + file format across restart/revisit; fix CMS card radio selection logic to compare by
cms_id. - Persist
iterationfrom project DB response into Redux to render the correct mapper (Entry Mapper foriteration > 1). - Reset horizontal stepper completion state on restart navigation; disable editing of validated file paths; apply UI/CSS alignment fixes.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| ui/src/pages/Migration/index.tsx | Adds iteration from project response into the Redux migration state. |
| ui/src/components/Stepper/HorizontalStepper/HorizontalStepper.tsx | Resets “completed steps” ahead of the current step when navigating backward (restart UX). |
| ui/src/components/LegacyCms/legacyCms.scss | Styles edit icon disabled state; spacing tweaks for file path row. |
| ui/src/components/LegacyCms/Actions/LoadUploadFile.tsx | Disables file-path edit once the uploaded file is validated. |
| ui/src/components/LegacyCms/Actions/LoadSelectCms.tsx | Preserves previously selected CMS version and file-format when still valid; otherwise falls back appropriately. |
| ui/src/components/ContentMapper/index.scss | Refactors layout styles; centers row-select checkbox in Entry Mapper and fixes some alignment issues. |
| ui/src/components/Common/SaveChangesModal/index.tsx | Refactors modal callbacks (but currently introduces async typing/ordering issues). |
| ui/src/components/Common/Card/card.tsx | Fixes radio checked logic to compare by configured idField (e.g. cms_id). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… to prevent stale formats
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
Consider reviewing these vulnerabilities when fixes become available. |
🔗 Jira Ticket
. CMG-985
· CMG-986
· CMG-987
· CMG-988
· CMG-989
📋 PR Type
📝 Description
What changed?
DEFAULT_CMS_TYPE.LoadSelectCmswas wipingselectedCms.cms_idto empty when multiple versions exist (e.g. Sitecore v8/v9/v10), which made the legacy-CMS step look incomplete and triggered a false "Please complete Imported File step" warning on Save & Continue.checkedto compare oncms_idinstead of the always-undefinedid, so the selected version card reflects actual state.iterationfrom the project DB response into Redux so the Content Mapper renders the Entry Mapper (iteration > 1) instead of the content-type mapper after switching projects.Why?
After restarting a migration, the selected version was being lost in Redux, blocking Save & Continue with a misleading error. Separately, the wrong mapper rendered on revisited projects, the progress bar didn't reset, and a few UI alignment/overlap issues needed cleanup.
🧩 Affected Areas
api— Node.js backendui— React frontendupload-api— Upload API serverdocker/docker-compose🧪 How to Test
Expected result: The previously selected version stays checked, no "Please complete Imported File step" warning appears, and the flow proceeds. Also verify: switching to a project with iteration > 1 renders the Entry Mapper; the progress bar resets after restart; the edit icon is disabled once a file is validated.
📸 Screenshots / Recordings
🔗 Related PRs / Dependencies
✅ Author Checklist
feature/,bugfix/, orhotfix/+ 5–30 lowercase chars.env/example.envupdated if new environment variables were added — N/Anpm test)README.md/ docs updated if behaviour changed — N/A👀 Reviewer Notes
Core fix is in
LoadSelectCms.filterCMSData— it now keeps an already-selected version if it's still valid among the filtered cards, only falling back to default when nothing is selected. All changes are frontend-only (ui).