-
Notifications
You must be signed in to change notification settings - Fork 4
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
YALB-1233: Improved term picker with ChosenJS #334
YALB-1233: Improved term picker with ChosenJS #334
Conversation
c20a972
to
b7da273
Compare
Created multidev environment pr-334 for yalesites-platform. |
1 similar comment
Created multidev environment pr-334 for yalesites-platform. |
bc358c6
to
5d7e3ea
Compare
Created multidev environment pr-334 for yalesites-platform. |
80ac6a5
to
fc058e7
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.
@dblanken-yale CSS additions looks great to me!
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.
I will defer to @kara-franco on this, but I approve use of this control for now with the CSS fixes Dave was able to make. This control is better than the Autocomplete Deluxe that was being considered. Longer term, we might consider building our own component for this or wait to see what Drupal core comes up with as a replacement for autocomplete. Since we don't want new terms to be added with this control, the Drupal core option may never be what we want, however.
80e5486
to
9d9b32e
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.
The CSS tweaks for the selected menu items looks great! The colors pass the color contrast triangle: https://contrast-triangle.com/?linkColor=%23058260&textColor=%23082538
For future updates/fixes we can:
- Replace the negative tabindex on the remove/close buttons with tabindex=0
- Enhance the focus indicator color for the remove/close buttons
- Add an aria-label="Remove" to the x buttons
- When a SR user selects the term, feedback needs to be given (Combobo example)
Combobo example: https://dequelabs.github.io/combobo/demo/
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.
Tested this on the multidev and all looked good to me! I'm approving, but a few notes:
- You can add links into the description box for the tags/categories that can open a new tab to add new terms. Not sure if we want to do that or not. I seem to recall that Franz liked that you can't easily add terms - that it has to be a deliberate action so your solution is probably just fine.
- I see you've added a few methods to the ViewsBasicManager that will get the terms and the labels - with vocab. Nice! So, is the code here (https://github.com/yalesites-org/yalesites-project/pull/334/files#diff-f1390886a6a1a2acfda94028c41660896cd1781aba805deb4a13e6e6671a710dL221-L227) needed anymore? (Same goes for
terms_exclude
field) I didn't test, but I assume you can get rid of the#selection_handler
and the#selection_settings
and even delete the view I created called "Taxonomy Lookup" (located here: /admin/structure/views/view/taxonomy_lookup)? It all works as coded now, but perhaps test trying to remove that code and delete the view since your code replicates that and we don't want orphaned things in there. Thanks!
@codechefmarc You are absolutely right. I was unsure if those settings were only related to the previous autocomplete or not, so didn't touch them. I removed them and all looks to work well. Thanks for that feedback. Yes, I was hesitant to provide the link as well. I figure if it's decided it's too verbose, we can update that quickly. :D |
This reverts commit afc430c. Moving this logic into the profile did not work.
This allows a method to retrieve all tags from the taxonomy for use in our filters. It appends the vocabulary that the term is a part of so that users can know where it came from.
Use the existing manager set by the constructor instead of calling another method to get it each time.
The previous way of getting the IDs was to use the target_id of a term, but since chosen only cares about key/value pairs, we just get the term itself. This change allows the displaying of the view.
When modifying a view, chosen needs the ids that were selected before so that it can show them as pre-selected. It no longer uses the target_id as chosen only cares about key/value pairs. This fix allows pre-selected saved items to show when editing.
I didn't like the look of this, so I removed it. I can re-add it if others wish it to be here, but to me it does not follow our style.
CI seems to be erroring, and looking at the script, it changes into the profile directoy and attempts to use composer. Because all of our allowed plugins are defined in the main repo, I could see why this would error on us. I'm attmempting to add it in the hopes it'll be happy, even if it's redundant.
While the linting and testing were successful by placing the info that was in the main composer.json into the profile's, the build to pantheon seems to be failing. Looking at the error, it's pointing to a file path that really shouldn't exist. This made me think I was a bit too heavy handed on my change, so I'm rolling it back and only keeping the allow-plugins for composer/installers since that was the original complaint in the hopes that the build succeeds.
The build complained that this was not in the allow list, so we will be adding it so that it can build.
The build is now complaining about oomphinc/composer-installers-extender not being allowed, so we will allow it as well.
This is in the hopes I can define where web/core exists so that the publish using the profile can properly find bartik.info.yml. My hope is that I can use relative url locations using "..".
The accessibility team stated that the color contrast did not pass WCAG guidelines, so this change allows WCAG A/AA passing while keeping the Gin colors used.
The linter complained about using ::load, so this was my attempt to try not using it.
Change the instructions for event category chosen selection so that it conveys that they cannot create new entries.
Update tag help text for a page to convey that they cannot create new tags while creating new pages.
Update post help tag text to convey that they cannot create new tags while creating a post.
Update post tag help text to convey that they cannot create tags while creating a post.
Update event tag help text to convey that they cannot create new tags while creating an event.
When looking for a color that worked for Gin, I had access to the --colorGin<X> variables. When attempting to use this across the site, I noticed that they are not always available. So this change allows what looks like the alternate way of defining them, which is available at other locations throughout the site.
It was discussed how to style chosen fields in the ys_views_basic module since it does not currently include the Gin overrides in the ys_admin_theme theme. For now, the decision was to copy the CSS to fix later.
Now that we are using chosen, we do not need these extra options.
f710d11
to
147247f
Compare
YALB-1233: Improved term picker with ChosenJS
Description of work
Functional testing steps:
Locally
npm run setup
chosen
directory exists afterward in./web/libraries
Locally or Remotely
Accessibility testing steps: