Skip to content

PM-4823: lock completed challenge schedule rows#1711

Merged
jmgasper merged 1 commit intodevfrom
PM-4823
Apr 10, 2026
Merged

PM-4823: lock completed challenge schedule rows#1711
jmgasper merged 1 commit intodevfrom
PM-4823

Conversation

@jmgasper
Copy link
Copy Markdown
Collaborator

@jmgasper jmgasper commented Apr 10, 2026

What was broken
Completed challenge phases in the work app schedule editor still exposed editable end date and duration controls, unlike legacy work-manager.

Root cause
Challenge phase normalization dropped actualEndDate, so the form lost the completion signal used by the legacy canChangeDuration rule and the schedule rows never disabled completed phases.

What was changed
Preserved phase completion timestamps when hydrating challenge editor form data.
Applied the legacy completed-phase editability rule to schedule row end date and duration controls while keeping the existing start-date rules intact.
Updated the challenge editor README to note the restored legacy behavior.

Any added/updated tests
Added a challenge-editor utils test that keeps actualEndDate in form state.
Added a schedule section test that verifies completed phases lock end date and duration controls.
Validated with yarn test:no-watch --runInBand src/apps/work/src/lib/utils/challenge-editor.utils.spec.ts src/apps/work/src/pages/challenges/ChallengeEditorPage/components/ChallengeScheduleSection/ChallengeScheduleSection.component.spec.tsx, yarn lint, and yarn run build.
Full yarn test:no-watch --runInBand still reports six unrelated failures in src/apps/wallet-admin/src/home/tabs/payments/PaymentsListView.spec.tsx.


Open with Devin

What was broken
Completed challenge phases in the work app schedule editor still exposed editable end date and duration controls, unlike legacy work-manager.

Root cause
Challenge phase normalization dropped `actualEndDate`, so the form lost the completion signal used by the legacy `canChangeDuration` rule and the schedule rows never disabled completed phases.

What was changed
Preserved phase completion timestamps when hydrating challenge editor form data.
Applied the legacy completed-phase editability rule to schedule row end date and duration controls while keeping the existing start-date rules intact.
Updated the challenge editor README to note the restored legacy behavior.

Any added/updated tests
Added a challenge-editor utils test that keeps `actualEndDate` in form state.
Added a schedule section test that verifies completed phases lock end date and duration controls.
@jmgasper jmgasper requested a review from kkartunov as a code owner April 10, 2026 03:17
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@jmgasper jmgasper merged commit ede24b8 into dev Apr 10, 2026
9 checks passed
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.

1 participant