Wizard: Navigation buttons have weird activation
Overview
A wizard, such as "New A/B Test", allows you proceed through multiple steps sequentially. Every step in a wizard should be completed in order, although it is also valid to return to a prior step and revise it.
The current behavior of the navigation-bar does not correctly implement this.
Reproduction steps
- Click on "Mailings -> New A/B Test."
- Within "1. Setup"
- Within "2. Target"
- Observe: In the navbar, you cannot jump to any other step. (Proceeding to step 3 would be premature, but you should be allowed to go back to step 1.)
- Fill in Recipients
- Observe: In the navbar, you are now allowed to jump to any other step. (Proceeding to step 3 is OK, but you should not be allowed to jump to step 4.)
Current behaviour
You may jump to any step if the current step is complete.
Expected behaviour
You may jump to any step if its predecessors have valid complete/data (ie if the prerequisites for the selected step are met).
Comments
The behavior of the "Previous" and "Next" buttons is OK. It's just the top navbar that has the quirk.
This gets to the basic difference between a "wizard" and "tab set". A "tab set" is free-form, so you may navigate to any tab at any time. A "wizard" is sequential, and the steps build upon each other. (In fact, steps may be added or removed as you go through.)
This appears to have regressed in 4.7.28 via https://github.com/civicrm/civicrm-core/commit/5919adff1dc7a531d426c211baf65d8c9b538eeb. I suspect that dev+review focused on "New Mailing", which is deceptively simple use-case (static 2-step wizard). The "New A/B Test" is a representative use-case (dynamic, 4/5-step wizard).