Disable start date field for started cadences
What does this MR do and why?
Issue #354977 (closed)
After an iterations cadence starts, its start date should not be editable.
- frontend Update the cadence form to disable the start date field if the cadence has already started.
- backend Remove an unnecessary validation for manual cadence !86517 (comment 936590518).
- (UI text change) Change
Future iterations
toUpcoming iterations
. - (UI text change) Update the start date field description.
- (UI text change) Punctuate the field descriptions.
All changes in this MR are behind a feature flag.
Screenshots
How to set up and validate locally
Enable the feature in the rails console
Feature.enable(:iteration_cadences)
-
When create a new iterations cadence, the start date field should not be disabled. -
When editing an iterations cadence that has started, the start date field should be disabled. Test this by creating a new cadence with a future start date. -
When editing an iterations cadence that has not started, the start date field should not be disabled. Test this by creating a new cadence with a past start date.
NOTE: Even after updating the start date of a cadence, existing iterations do not adjust their dates. It's being taken care of in !86643 (merged). Please validate the changes by creating new cadences with different start dates as shown in the demo
Test with a manual cadence
- In the Rails console, enter the following line - just substitute the group - to create a manual cadence (this is faster and less onerous than turning off the feature flag and on again.)
group = Group.find(126)
Iterations::Cadence.new(group: group, start_date: Date.new(2022, 4, 4), last_run_date: nil, duration_in_weeks: 2, iterations_in_advance: 2, active: true, automatic: false, title: "manual cadence", roll_over: false).save!(validate: false)
- Create an iteration in the manual cadence. Check that the edit form shows this iteration's start date.