Skip to content

Disable start date field for started cadences

euko requested to merge 354977-update-cadence-form into master

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 to Upcoming 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

UI text changes
Before After
Screen_Shot_2022-05-05_at_9.22.56_PM Screen_Shot_2022-05-06_at_9.46.21_AM

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 👇.

demo

Screen_Recording_2022-05-05_at_9.54.27_PM

Test with a manual cadence

  1. 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)
  1. Create an iteration in the manual cadence. Check that the edit form shows this iteration's start date.
Demo: when manual cadence is empty, a new start date can be selected Screen_Recording_2022-05-05_at_10.37.05_PM
Demo: when manual cadence is not empty, the first iteration's start date is filled in

Screen_Recording_2022-05-05_at_10.39.26_PM

Edited by euko

Merge request reports

Loading