Skip to content

fix: update Card component's radio button logic and improve SaveChang…#1085

Merged
umesh-more-cstk merged 2 commits into
devfrom
bugfix/delta
Jun 9, 2026
Merged

fix: update Card component's radio button logic and improve SaveChang…#1085
umesh-more-cstk merged 2 commits into
devfrom
bugfix/delta

Conversation

@yashin4112

@yashin4112 yashin4112 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

🔗 Jira Ticket

. CMG-985
· CMG-986
· CMG-987
· CMG-988
· CMG-989


📋 PR Type

  • ✨ Feature
  • 🐛 Bug Fix
  • 🔥 Hotfix
  • ♻️ Refactor
  • 🧹 Chore / Dependency Update
  • 📝 Documentation

📝 Description

What changed?

  • Restart flow: Preserve the selected CMS version and file format on restart instead of resetting to DEFAULT_CMS_TYPE. LoadSelectCms was wiping selectedCms.cms_id to 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.
  • CMS card: Fixed the radio checked to compare on cms_id instead of the always-undefined id, so the selected version card reflects actual state.
  • Entry Mapper: Read iteration from 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.
  • Progress bar: Reset completed steps at/beyond the current step on restart so the horizontal stepper un-fills instead of staying filled to the end.
  • Edit icon: Disable the file-path edit icon once the file is validated (greyed out, not-allowed cursor, pointer-events none).
  • CSS: Added padding to the error container so the red border no longer overlaps content; vertically centered the row-select checkbox in the entry-mapper table.

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 backend
  • ui — React frontend
  • upload-api — Upload API server
  • docker / docker-compose
  • CI / GitHub Actions workflows
  • Environment variables / config
  • Other:

🧪 How to Test

  1. Open a project with a Sitecore version selected (e.g. v9), complete and run the migration.
  2. Restart the migration, then go to step 1 (Select Legacy CMS).
  3. Without changing the version, click Save and Continue.

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

Before After

🔗 Related PRs / Dependencies

  • N/A

✅ Author Checklist

  • Branch follows naming convention: feature/, bugfix/, or hotfix/ + 5–30 lowercase chars
  • Jira ticket linked above
  • Self-reviewed the diff — no debug logs, commented-out code, or TODOs left in
  • .env / example.env updated if new environment variables were added — N/A
  • No sensitive credentials or secrets committed
  • Existing tests pass locally (npm test)
  • New tests written (or not applicable — explain why) — N/A, UI/state bug fixes verified manually
  • README.md / docs updated if behaviour changed — N/A
  • Talisman pre-push scan passes (no secrets flagged)

👀 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).

…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
@yashin4112 yashin4112 requested a review from a team as a code owner June 8, 2026 14:39
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 15 334 25 ✅ Passed
🟡 Medium Severity 20 3 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

⚠️ Warning: The following vulnerabilities have exceeded their SLA thresholds (days since publication).

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 2 90 / 365 days ⚠️ Warning
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ 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:

  • Critical without fixes: 0
  • High without fixes: 334
  • Medium without fixes: 3
  • Low without fixes: 0

⚠️ BUILD PASSED WITH WARNINGS - SLA breaches detected for issues without available fixes

Consider reviewing these vulnerabilities when fixes become available.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 iteration from project DB response into Redux to render the correct mapper (Entry Mapper for iteration > 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.

Comment thread ui/src/components/Common/SaveChangesModal/index.tsx
Comment thread ui/src/components/Common/SaveChangesModal/index.tsx
Comment thread ui/src/components/Common/SaveChangesModal/index.tsx
Comment thread ui/src/components/LegacyCms/Actions/LoadSelectCms.tsx Outdated
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 15 334 25 ✅ Passed
🟡 Medium Severity 20 3 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

⚠️ Warning: The following vulnerabilities have exceeded their SLA thresholds (days since publication).

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 2 90 / 365 days ⚠️ Warning
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ 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:

  • Critical without fixes: 0
  • High without fixes: 334
  • Medium without fixes: 3
  • Low without fixes: 0

⚠️ BUILD PASSED WITH WARNINGS - SLA breaches detected for issues without available fixes

Consider reviewing these vulnerabilities when fixes become available.

@umesh-more-cstk umesh-more-cstk merged commit 981e5be into dev Jun 9, 2026
9 checks passed
@umesh-more-cstk umesh-more-cstk deleted the bugfix/delta branch June 9, 2026 05:14
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