-
-
Notifications
You must be signed in to change notification settings - Fork 242
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
GOVUK input for filters in around page #4728
Conversation
ac3d15a
to
3c7b2f7
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4728 +/- ##
==========================================
- Coverage 82.61% 82.61% -0.01%
==========================================
Files 395 395
Lines 30845 30869 +24
Branches 4891 4891
==========================================
+ Hits 25483 25502 +19
- Misses 3915 3920 +5
Partials 1447 1447 ☔ View full report in Codecov by Sentry. |
3bbfbc6
to
e70243c
Compare
0559aa6
to
b16df27
Compare
d4d47d0
to
1eb6346
Compare
640ea55
to
97e5a35
Compare
cf699a7
to
c403c3a
Compare
@dracos in order to fix https://github.com/mysociety/societyworks/issues/4214 Option 1
Option 2
|
If we're changing the structure to look more like normal fields, it doesn't have to be "About" any more, that's not needed, it's no longer displayed like a readable sentence so doesn't need to be one. It could be "Category". Does that help? Then there's no need for things to be different anywhere. Or have I misunderstood? |
To clarify, In this case we would have |
The (hidden) label needs to be kept with its Stepping back, the TfL issue https://github.com/mysociety/societyworks/issues/4214 as I understood it was the aria-label not matching the label. If the aria-label and the label are both changed to "Category" / "Report status", then they will match? But you're asking could we replace the span with a new label pointing at the button? According to 7bf65b2 and 9ba42de you used a span so that it wouldn't get read out (twice I assume?). So if you want a label now, we can do, but from previous it doesn't sound like that's necessary, as long as the aria-label is updated to match the span. |
@dracos I see good to know, I brought the |
@dracos |
@dracos Here is a preview of the current state. I have updated the screenshot above as well. When ready I'll rebase and test it on Camden(I'll probably end up getting rid of code that won't be necessary anymore) and all the other cobrands. |
I was vrery confused, because the |
I added this commit that should help us with this issue. I added it here because I though the layout of the current site will change with this PR, therefore it made more sense to include it here, but let me know if you think it shouldn't be here. |
@lucascumsille I don't think that's what that issue is about - that issue is saying that if you /change/ the filter, it changes automatically without you having to click a Submit, rather than what is happening on page load. The solution is we either add a submit button (meh, guess is easier not to have one, but could do), or add a message saying filters apply automatically (not what /was/ applied). |
d8bf7f4
to
1c999ab
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, have added fixup for prevAll and to actually have the aria-label on the select match the visible text (which I think was the issue being complained about in 4214). A number of hopefully small issues to deal with
@dracos Thanks for the feedback I have added a fixup for all the issues above with a thumbs up, I think that should be everything. When we are ready I'll tidy up Camden, which most likely will need some amendments with this PR. |
} | ||
|
||
input.on('change', function() { | ||
if (this.checked) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine, but you can also have this as one line with:
label.toggleClass('govuk-multi-select__label--checked', this.checked);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good :-) Will need a bit of checking that the changes to report lists/ multi selects etc haven't affected anything else, I guess.
@dracos I found some issues with three cobrands. I couldn't figure out what was causing it, not sure if we are doing something different with them, I couldn't find a template override. The problem is with "Category" filter, in the markup the I tried commenting out this line: The Status was is fine
|
@dracos I checked all the other cobrands and they are working fine on desktop and mobile. |
@dracos ohh perfect
Then we should be ready. There is one thing that might be odd, I didn't see it till I went to admin, with this deployment we only have styled the multi-select classes as GOVUK ones, which was fine in the user side of things because I couldn't see an scenario where NON multi-select We currently have this ticket to tackled the admin side which most likely will be next. However I wouldn't mind to add a commit here that changes the style of |
me neither happy to deploy and then tackle all those cases with the rest of tickets. @dracos, let me know if you are happy with this and I'll rebase and merge. But let me know if you'd rather have less commits for this PR. |
@lucascumsille Doing something about the dashboard as I mentioned in my previous message would be the only thing I'd like to be looked at - it looks a bit odd now: |
@dracos Sorry I had misread your comment. I added a commit here that reduces the height of the GOVUK ones only for the dashboard. I did't match it exactly, because I would have to reduce the font-size as well, but this approach should get rid of the oddness. Let me know if you are happy with it and how you'd like me to handle the rebase. I proposed this a few days ago:
|
8dca6c0
to
89f3dc3
Compare
Have squashed it all into one commit - let me know what you think! |
89f3dc3
to
9c9105d
Compare
Thanks @dracos looks good to me, thanks for adding it to the changelog as well =) |
9c9105d
to
dcc4841
Compare
This makes them more form-like, and using GOV.UK styling. The group of filters are now wrapped with a fieldset element. The label and aria-label now match, to comply with WCAG 2.5.3. The upgraded multi select library allows optgroup elements to be turned into fieldsets and adds a proper legend to the fieldset group. The change made directly to the vendored library in 235931e to add the for attribute to hidden labels, is now done in a better way. As the markup order does not match the usual GOV.UK ordering - input is nested inside label here, rathern than label and input as siblings - we use the has() selector, with a fallback in JavaScript. We lastly tweak the display on /dashboard due to the difference between the heights of default and .js-multiple selects. This can be removed in time once all selfct elements have the same appearance.
dcc4841
to
9c90530
Compare
settings.menuItemsHTML = '<div class="govuk-multi-select govuk-multi-select--checkboxes">'; | ||
settings.menuItemHTML = '<label class="govuk-multi-select__label">'; | ||
settings.menuFieldsetHTML = '<fieldset class="multi-select-fieldset govuk-fieldset">'; | ||
settings.menuFieldsetLegendHTML = '<fieldset class="multi-select-fieldset govuk-fieldset__legend govuk-fieldset__legend--s">'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how I didn't notice this before, sorry, but this should presumably be a legend
not a fieldset
.
Fixes: https://github.com/mysociety/societyworks/issues/3821
Fixes: https://github.com/mysociety/societyworks/issues/4214
Fixes: https://github.com/mysociety/societyworks/issues/4215
IMPORTANT: This update breaks Camden, therefore I think we should tackle this issue before merging this PR. The Alternative I could add a commit here fixing the issue that Camden currently has, which is the
line-height
property, and leave the tidy up ticket in his original order.Mobile
Desktop
For this commit I replaced
multi-select.min.js
with the one created on this PR on the jQuery-multi-select repo._report_list.scss