-
Notifications
You must be signed in to change notification settings - Fork 29
Update: provide alternative title text override for menu button ARIA label (fixes #214) #215
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
Open
kirsty-hames
wants to merge
16
commits into
master
Choose a base branch
from
issue/214
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
9f4e112
altTitle provided for menu button aria label
kirsty-hames 5787651
altTitle added to contentObjects example
kirsty-hames f865d6a
altTitle added to properties.schema
kirsty-hames b3ac644
altTitle added to contentobject.schema
kirsty-hames 63a3b22
altTitle added to README
kirsty-hames 331300f
replace menu item altTitle with titleAriaLabel
kirsty-hames 4b93fee
Update properties.schema
kirsty-hames f18fc2c
Update contentobject.schema.json
kirsty-hames d82c3f0
Update example
kirsty-hames 00e5366
Update README.md
kirsty-hames 30d1e97
Add missing comma in schema
swashbuck afc2810
Merge branch 'master' into issue/214
joe-allen-89 50433c9
migration script added, master merged in for package changes
joe-allen-89 a92213f
Strings must use singlequote
swashbuck a8ca577
Remove unused getCourse
swashbuck 107b39e
Add missing semicolon
swashbuck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| import { describe, whereContent, whereFromPlugin, mutateContent, checkContent, updatePlugin, testStopWhere, testSuccessWhere } from 'adapt-migrations'; | ||
| import _ from 'lodash'; | ||
|
|
||
| function getBoxMenus(content) { | ||
| return content.filter(({ _type, _component }) => | ||
| (_type === 'menu' || _type === 'course') && | ||
| (!_component || _component === 'boxMenu')); | ||
| } | ||
|
|
||
| describe('Box menu - v@@CURRENT_VERSION to v@@RELEASE_VERSION', async () => { | ||
| let boxMenus; | ||
|
|
||
| whereFromPlugin('Box menu - from v@@CURRENT_VERSION', { name: 'adapt-contrib-boxMenu', version: '<@@RELEASE_VERSION' }); | ||
|
|
||
| whereContent('Box menu - where boxMenus', async (content) => { | ||
| boxMenus = getBoxMenus(content).filter(({ _boxMenu }) => _boxMenu); | ||
| return boxMenus.length; | ||
| }); | ||
|
|
||
| mutateContent('Box menu - add titleAriaLabel to contentObjects', async (content) => { | ||
| boxMenus.titleAriaLabel = ''; | ||
| return true; | ||
| }); | ||
|
|
||
| checkContent('Box menu - check titleAriaLabel to contentObjects', async (content) => { | ||
| const isValid = boxMenus.every(menu => _.has(menu, 'titleAriaLabel')); | ||
| if (!isValid) throw new Error('Box menu - global attribute titleAriaLabel'); | ||
| return true; | ||
| }); | ||
|
|
||
| updatePlugin('Box menu - update to v@@RELEASE_VERSION', { name: 'adapt-contrib-boxMenu', version: '@@RELEASE_VERSION', framework: '">=5.48.4' }); | ||
|
|
||
| testSuccessWhere('Multiple boxMenu, both course and menu', { | ||
| fromPlugins: [{ name: 'adapt-contrib-boxMenu', version: '@@CURRENT_VERSION' }], | ||
| content: [ | ||
| { _type: 'course', _boxMenu: { _backgroundImage: {} } }, | ||
| { _type: 'menu', _boxMenu: { _backgroundImage: {} } }, | ||
| { _type: 'menu', _boxMenu: {} } | ||
| ] | ||
| }); | ||
|
|
||
| testSuccessWhere('boxMenu with course globals', { | ||
| fromPlugins: [{ name: 'adapt-contrib-boxMenu', version: '@@CURRENT_VERSION' }], | ||
| content: [ | ||
| { _type: 'course', _globals: { _menu: { _boxMenu: {} } } } | ||
| ] | ||
| }); | ||
|
|
||
| testStopWhere('incorrect version', { | ||
| fromPlugins: [{ name: 'adapt-contrib-boxMenu', version: '@@RELEASE_VERSION' }] | ||
| }); | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.