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

Checkboxes/radios - Add select all and allow under 'other' reveal #1732

Merged
merged 30 commits into from
Nov 3, 2021

Conversation

boxadesign
Copy link
Contributor

@boxadesign boxadesign commented Oct 12, 2021

What is the context of this PR?

  • Added "Select/Unselect all" to checkboxes
  • Allow checkboxes and radios to "other" option
  • Updated "other" reveal styling
  • Added documetation

To do - Add unit tests for new scripts

How to review

Check examples, documentation

@codecov
Copy link

codecov bot commented Oct 14, 2021

Codecov Report

Merging #1732 (8cf2fe6) into master (780336d) will increase coverage by 2.27%.
The diff coverage is 94.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1732      +/-   ##
==========================================
+ Coverage   94.11%   96.39%   +2.27%     
==========================================
  Files          66       65       -1     
  Lines        2668     2746      +78     
==========================================
+ Hits         2511     2647     +136     
+ Misses        157       99      -58     
Impacted Files Coverage Δ
lib/rendering/create-nunjucks-environment.js 100.00% <ø> (+10.00%) ⬆️
...rc/components/checkboxes/checkboxes-with-reveal.js 100.00% <ø> (ø)
src/tests/spec/radios/radios.spec.js 92.30% <ø> (ø)
...rc/components/checkboxes/checkbox-with-fieldset.js 76.92% <76.92%> (ø)
...omponents/mutually-exclusive/mutually-exclusive.js 97.36% <83.33%> (+0.03%) ⬆️
...s/spec/table-of-contents/table-of-contents.spec.js 89.28% <89.28%> (ø)
src/components/table-of-contents/toc.js 92.85% <92.85%> (ø)
.../components/checkboxes/checkbox-with-autoselect.js 95.00% <95.00%> (ø)
...spec/checkboxes/checkboxes-with-autoselect.spec.js 100.00% <100.00%> (ø)
...kboxes/checkboxes-with-reveal-and-fieldset.spec.js 100.00% <100.00%> (ø)
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fa2bf13...8cf2fe6. Read the comment docs.

Copy link
Contributor

@jrbarnes9 jrbarnes9 left a comment

Choose a reason for hiding this comment

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

  • I think we should show realistic examples using the borderless variant (search filters etc), because we'd unlikely recommend this is used in questionnaires.

  • When used in bordered, button should be ghost style...
    Screenshot 2021-10-18 at 14 06 54

  • Alignment is a couple of pixels off
    Screenshot 2021-10-18 at 10 53 54

@jrbarnes9
Copy link
Contributor

I think we should align the styling of legends/labels so they're always 18px bold, then align all nested legends and labels to 18px regular. So all nested input types (text, select, radio, checkboxes) will have the same style label/legend.
Screenshot 2021-10-19 at 10 19 51

Copy link
Contributor

@jrbarnes9 jrbarnes9 left a comment

Choose a reason for hiding this comment

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

Apply these same content changes also to the radio component (where applicable)

JNATION85
JNATION85 previously approved these changes Oct 19, 2021
@jrbarnes9
Copy link
Contributor

New params need adding to macro options tables

Co-authored-by: Jon Barnes <43346934+jrbarnes9@users.noreply.github.com>
boxadesign and others added 6 commits October 20, 2021 09:54
Co-authored-by: Jon Barnes <43346934+jrbarnes9@users.noreply.github.com>
Co-authored-by: Jon Barnes <43346934+jrbarnes9@users.noreply.github.com>
Co-authored-by: Jon Barnes <43346934+jrbarnes9@users.noreply.github.com>
Co-authored-by: Jon Barnes <43346934+jrbarnes9@users.noreply.github.com>
Co-authored-by: Jon Barnes <43346934+jrbarnes9@users.noreply.github.com>
Co-authored-by: Jon Barnes <43346934+jrbarnes9@users.noreply.github.com>
boxadesign and others added 5 commits October 20, 2021 09:55
Co-authored-by: Jon Barnes <43346934+jrbarnes9@users.noreply.github.com>
Co-authored-by: Jon Barnes <43346934+jrbarnes9@users.noreply.github.com>
Copy link
Contributor

@jrbarnes9 jrbarnes9 left a comment

Choose a reason for hiding this comment

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

  • Selecting the nested radio labels in "Checkbox with revealed radios" doesn't check the input

boxadesign and others added 6 commits October 26, 2021 13:13
…ex.njk

Co-authored-by: Jon Barnes <43346934+jrbarnes9@users.noreply.github.com>
Co-authored-by: Jon Barnes <43346934+jrbarnes9@users.noreply.github.com>
….njk

Co-authored-by: Jon Barnes <43346934+jrbarnes9@users.noreply.github.com>
@jrbarnes9 jrbarnes9 self-requested a review October 27, 2021 07:43
@jrbarnes9 jrbarnes9 self-requested a review October 29, 2021 09:42
Copy link
Contributor

@jrbarnes9 jrbarnes9 left a comment

Choose a reason for hiding this comment

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

I think we need to keep the legend "Choose preferred time of day" on this example.

Screenshot 2021-10-29 at 10 41 55

@jrbarnes9 jrbarnes9 added the Enhancement Change of existing feature label Nov 1, 2021
@boxadesign boxadesign merged commit e031f41 into master Nov 3, 2021
@boxadesign boxadesign deleted the add-more-to-other branch November 3, 2021 14:22
boxadesign added a commit that referenced this pull request Feb 17, 2023
)

* WIP initial work

* JS work for select all

* Tweak selector

* Add radios and examples

* Fix existing tests

* Tidy up examples

* Add tests for autoselect

* Fix test

* Added tests for checkbox other with child fieldset

* Update src/components/checkboxes/index.njk

Co-authored-by: Jon Barnes <43346934+jrbarnes9@users.noreply.github.com>

* Update src/components/checkboxes/index.njk

Co-authored-by: Jon Barnes <43346934+jrbarnes9@users.noreply.github.com>

* Update src/components/checkboxes/index.njk

Co-authored-by: Jon Barnes <43346934+jrbarnes9@users.noreply.github.com>

* Update src/components/checkboxes/index.njk

Co-authored-by: Jon Barnes <43346934+jrbarnes9@users.noreply.github.com>

* Update src/components/checkboxes/index.njk

Co-authored-by: Jon Barnes <43346934+jrbarnes9@users.noreply.github.com>

* Update src/components/checkboxes/index.njk

Co-authored-by: Jon Barnes <43346934+jrbarnes9@users.noreply.github.com>

* Update src/components/checkboxes/index.njk

Co-authored-by: Jon Barnes <43346934+jrbarnes9@users.noreply.github.com>

* Update src/components/checkboxes/index.njk

Co-authored-by: Jon Barnes <43346934+jrbarnes9@users.noreply.github.com>

* Update src/components/checkboxes/index.njk

Co-authored-by: Jon Barnes <43346934+jrbarnes9@users.noreply.github.com>

* Updates from review

* Updated macro options

* Fix label issue

* Update src/components/checkboxes/examples/checkboxes-other-radios/index.njk

Co-authored-by: Jon Barnes <43346934+jrbarnes9@users.noreply.github.com>

* Update src/tests/spec/checkboxes/checkboxes-with-autoselect.spec.js

Co-authored-by: Jon Barnes <43346934+jrbarnes9@users.noreply.github.com>

* Update src/components/checkboxes/examples/checkboxes-autoselect/index.njk

Co-authored-by: Jon Barnes <43346934+jrbarnes9@users.noreply.github.com>

* Updated to allow child checkboxes to be checked by default

* Added visually hidden to revealed elements legend

* Fixed legend issue

Co-authored-by: Jon Barnes <43346934+jrbarnes9@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Change of existing feature
Projects
None yet
4 participants