Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable phase date fields when a phase is disabled #4082

Merged
merged 2 commits into from
Aug 15, 2020
Merged

Conversation

javierm
Copy link
Member

@javierm javierm commented Aug 13, 2020

References

  • The JavaScript involved wasn't working since we removed the disable-date attribute in commit 73ff688

Objectives

  • Fix the JavaScript disabling the date fields for a certain phase when the phase is disabled
  • Improve the usability of this form

Visual Changes

Before these changes:

Date fields are enabled when a phase is disabled

After these changes:

Date fields are disabled when a phase is disabled

@javierm javierm added this to Reviewing in Consul Democracy via automation Aug 13, 2020
@javierm javierm self-assigned this Aug 13, 2020
@javierm javierm added the 1.2 label Aug 13, 2020
@javierm javierm force-pushed the disable_phase branch 9 times, most recently from 69c957c to de76a95 Compare August 14, 2020 16:34
Consul Democracy automation moved this from Reviewing to Testing Aug 14, 2020
Copy link
Member

@Senen Senen left a comment

Choose a reason for hiding this comment

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

👏

@javierm javierm force-pushed the disable_phase branch 3 times, most recently from 1c7400c to 002088a Compare August 14, 2020 21:24
We were using a <label> tag with no associated field where a <legend>
tag was more appropriate. With a fieldset, we also make it obvious these
fields are related.
The JavaScript involved wasn't working since we removed the disable-date
attribute in commit 73ff688.

We're also improving the JavaScript in two ways:

First, we trigger the `change` event immediately, so when the page loads
date fields are disabled when phases are disabled.

And second, we don't remove the selected dates when disabling a phase,
so disabling it and enabling it again will keep the selected values.
@javierm javierm merged commit 1ab1e68 into master Aug 15, 2020
Consul Democracy automation moved this from Testing to Release 1.2.0 Aug 15, 2020
@javierm javierm deleted the disable_phase branch August 15, 2020 11:47
@javierm javierm removed the 1.2 label Aug 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants