-
Notifications
You must be signed in to change notification settings - Fork 16
New: Add priority labels to templates and schemas (fix #816) #817
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
base: master
Are you sure you want to change the base?
Conversation
|
Ready for review. |
|
Should the icons be defined in the json? I'm not sure what the standard is there. CSS only or json define class name? |
I like the idea of setting this in the JSON config. This could be two new props that would apply to all types (box menu item, article, etc). I don't feel that we would need a different icon for each type. So, we would have: Thoughts about this approach? We would need to remove it from the Vanilla theme PR as the icon is currently hard-coded in the Less. |
|
@kirsty-hames Any thoughts on the icon config proposed solution? |
I'm happy with the above suggestion thanks @swashbuck. When I've seen optional/progress labels used in projects, I've only seen icons used as suggested (no icon for optional, exclamation mark for required). Whilst I can't see much scope for changing the icons at least it's future proofing for customisation. |
|
Hey @swashbuck, just thinking on this from an a11y perspective, whilst the optional/required labels are accessible, they don't have context of the content they refer to. As per my suggestion in the PLP optional content visual indicator PR, is it worth adding the optional / required labels to the model headings like we already do for complete/incomplete? Alternatively, we could add the model title to the optional/required labels as hidden labels. However, I think it makes sense to update the model headings for the following reasons:
If we did do this then we should set the priority labels to |
Co-authored-by: Joseph Replin <joe.replin@kineo.com>
|
Icon classes have been implemented.
@kirsty-hames I think this makes sense. Would we only show optional / required when the relevant priority labels are configured to be shown? In other words, only show optional when Also, this is how the titles could be read. Is this what you had in mind?
|
Thanks @swashbuck. Yep this is what I had in mind. If an on screen label doesn't exist then there's no reason to provide the alt text equivalent. |
|
Thanks, @kirsty-hames . When a displayTitle isn't present:
Screenshots showing 3 optional components: Text, MCQ and Graphic. Note that the label is not shown for the optional Graphic.
|
Good points @swashbuck. I'm open to either but my preference would be to only display the priority label when displayTitle is present. A couple of reasons why:
|
|
Thanks, @kirsty-hames. I agree on both points. That said, I can think of one use case that might be a problem: when we use a block header to replace the component header. For example:
But we probably wouldn't want the priority label to be positioned above the title-less MCQ component either. Maybe we shouldn't worry about this edge case, although we do often use this layout. Could also use block priority labels instead of component labels in this case. |
||||
Hey @swashbuck, I also find this is a common layout use case and agree in this instance it would make sense to enable the priority label at block level. My only concern with this is the current config is limited to model only (all blocks etc) - there's no option to override per block instance. So would this mean the priority labels would need to be enabled for all blocks to support the scenario you've screenshotted above? |
Yep, this would definitely be an issue. Is it worth allowing individual elements the ability to override global settings? So, if we had block priority labels disabled globally, the specific block in the above screenshot could override with: |
Thanks @swashbuck. In most instances, priority labels will only require global settings but at least when we do set an override it's super clear. |
|
Overrides at the element level have been added. I believe all that's left is the migration scripts, and I'm waiting on #824 to be approved. |



Fix #816
📋 To-do
New
Notes
Dependencies
Configuration
In course.json, add the following to
_globalsand enable/disable labels as desired.The following example configuration will show optional labels only for menu item and page headings. In contentObjects.json, set
"_isOptional": trueto make content objects optional.You can also override global priority label settings for individual elements. Add to the specific instance (ex. a block):