Skip to content

Conversation

@zubairslamdien
Copy link
Contributor

@zubairslamdien zubairslamdien commented May 3, 2024

Fixes #191

To do ‼️

Will wait on general feedback before doing the following tasks:

  • Schemas
  • Migration scripts

New

Notes

  • Can be configured to show optional labels, required labels, both or none
  • Classes added so that the type of label can be styled differently (e.g. red labels for required and orange for optional)

Testing

Add to course.json:

"_boxMenu": {
  "_priorityLabels": {
    "_showPriorityWhenOptional": true,
    "_showPriorityWhenRequired": true
  }
}

Related

Styling: adaptlearning/adapt-contrib-vanilla#567

@zubairslamdien zubairslamdien self-assigned this May 3, 2024
@zubairslamdien zubairslamdien linked an issue May 3, 2024 that may be closed by this pull request
@oliverfoster oliverfoster changed the title Required and optional labels added (Fixes #191) New: Required and optional labels added (Fixes #191) May 3, 2024
@StuartNicholls

This comment was marked as outdated.

@StuartNicholls
Copy link
Contributor

StuartNicholls commented May 7, 2024

I'll leave the mock-up for the boxmenu item to @zubair but I've added a simple mock-up of a suggested use case for discussion

@swashbuck

This comment was marked as outdated.

@swashbuck swashbuck moved this from Assigned to Needs Reviewing in adapt_framework: The TODO Board Oct 23, 2025
@swashbuck
Copy link
Contributor

swashbuck commented Oct 23, 2025

Updated PR description above.

Would be good to get feedback/approvals on the new config options before I do the schemas and migration scripts.

@oliverfoster
Copy link
Member

Are priority labels needed in any other titles? Page, article, block, component?
If so, the code should live in the core heading module.

@swashbuck
Copy link
Contributor

Are priority labels needed in any other titles? Page, article, block, component? If so, the code should live in the core heading module.

Having the labels available in other areas might be useful. However, Box Menu items do not currently use the core heading templates as they are set up a little differently. For instance, box menu items have an aria-label for the item graphic and do not have instruction text. Changes to the heading templates would be required.

If we did add priority labels to other titles, we would want fine-grained control. For instance, either add the object to each specific content object, article, block, and component:

"_priorityLabels": {
    "_showPriorityWhenOptional": true,
    "_showPriorityWhenRequired": false  
},

Or set global config for each type of element:

"_priorityLabels": {
    "_contentObject": {
        "_showPriorityWhenOptional": false,
        "_showPriorityWhenRequired": false
    },
    "_article": {
        "_showPriorityWhenOptional": false,
        "_showPriorityWhenRequired": false
    },
    "_block": {
        "_showPriorityWhenOptional": false,
        "_showPriorityWhenRequired": false
    },
    "_component": {
        "_showPriorityWhenOptional": true,
        "_showPriorityWhenRequired": false
    },
},

This seems like it would be a separate issue from adding to box menu items as it would apply to core elements rather than Box Menu which is a plugin.

@oliverfoster
Copy link
Member

oliverfoster commented Oct 29, 2025

These are the places that ariaLabels are important:

https://github.com/adaptlearning/adapt-contrib-core/blob/df348fb89b5e5d58fd35db18b2cbb35471b05f51/js/enums/defaultAriaLevels.js#L2-L10

Often we have sub-contentobject settings, menu, page, menuitem, etc

It might be better to include the settings in core and have the boxMenu tie into it rather than having some settings in the plugin and some in the core.

@swashbuck swashbuck moved this from Needs Reviewing to Assigned in adapt_framework: The TODO Board Nov 11, 2025
@swashbuck
Copy link
Contributor

These are the places that ariaLabels are important

@oliverfoster Could you clarify this comment about ariaLabels? The new priority labels do not use aria-level values, nor does the graphic ariaLabel.

It might be better to include the settings in core and have the boxMenu tie into it rather than having some settings in the plugin and some in the core.

Are you suggesting to move the logic that sets the priorityClass and priorityLabel model properties into Core? What did you have in mind?

@oliverfoster
Copy link
Member

Sorry, no. I meant that contentobject is a group of multiple configurations that should probably be separated into its constituent parts. Use ariaLabels as the inspiration on which to granulate your settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

Add new required and optional labels

5 participants