Skip to content
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

[JW-11320]<Teaching Channel 9: No confirmation message is provided it on selecting captions styles 'Reset' button> #3964

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

jdunningjwp
Copy link
Contributor

This PR will...

Add confirmation message "Reset Captions Successful" when the reset button in the captions menu is pressed

Why is this Pull Request needed?

If the screen reader does not notify anything after selecting "Reset" button non-sighted users will not be able to confirm or notice that the information has been reset

Are there any points in the code the reviewer needs to double check?

Nope

Are there any Pull Requests open in other repos which need to be merged with this?

Nope

Addresses Issue(s):

https://jwplayer.atlassian.net/browse/JW8-11320

Checklist

  • Jenkins builds and unit tests are passing
  • I have reviewed the automated results

@jwplayer-robot
Copy link

MULTI Build for commit c12a2b8 did not complete (FAILURE).
🏗️▪️ jwplayer build SUCCESS
📋▪️ jwplayer unit tests FAILURE
🏗️▪️ jwplayer-commercial build NOT_STARTED
📋▪️ jwplayer-commercial unit tests NOT_STARTED
🥒 Cucumber Integration Tests NOT_STARTED
🎃 Manual Tests
📺 Views

constructor(_content, _action, _template = itemButtonTemplate) {
super(_content, _action, _template);
this.statusEl = document.createElement('span');
this.statusEl.id = 'reset-status-message';
Copy link
Contributor

@zetagame zetagame Jan 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jw prefix, use classes rather than ids in case of multiple players per page (id is unique in semantically correct HTML).

super(_content, _action, _template);
this.statusEl = document.createElement('span');
this.statusEl.id = 'reset-status-message';
this.statusEl.style = 'font-size: 0;';
Copy link
Contributor

@zetagame zetagame Jan 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using CSS in JS whenever possible, as it can't be overwritten by CSS without !important suffixing, which would prevent user customization.

this.statusEl.style = 'font-size: 0;';
this.statusEl.setAttribute('role', 'status');
this.el.appendChild(this.statusEl);
this.el.setAttribute('aria-controls', 'reset-status-message');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't what aria-controls is for, see examples section here: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-controls

@zetagame
Copy link
Contributor

zetagame commented Jan 19, 2022

Might want to re-write as an aria-live region that gets updated by anything that needs this sort of alert. See here: https://cccaccessibility.org/web-1/web-developer-tutorials/using-aria-live

Copy link
Contributor

@zetagame zetagame left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments above.

@jwplayer-robot
Copy link

MULTI Build for commit 9a3da8d did not complete (FAILURE).
🏗️▪️ jwplayer build FAILURE
📋▪️ jwplayer unit tests NOT_STARTED
🏗️▪️ jwplayer-commercial build NOT_STARTED
📋▪️ jwplayer-commercial unit tests NOT_STARTED
🥒 Cucumber Integration Tests NOT_STARTED
🎃 Manual Tests
📺 Views

@jwplayer-robot
Copy link

MULTI Build for commit 8ea017f did not complete (FAILURE).
🏗️▪️ jwplayer build FAILURE
📋▪️ jwplayer unit tests SUCCESS
🏗️▪️ jwplayer-commercial build NOT_STARTED
📋▪️ jwplayer-commercial unit tests NOT_STARTED
🥒 Cucumber Integration Tests NOT_STARTED
🎃 Manual Tests
📺 Views

@Dawolee Dawolee force-pushed the captions-reset-settings-confirmation branch from 8ea017f to 9a3da8d Compare January 19, 2022 20:16
@jwplayer-robot
Copy link

MULTI Build for commit 9a3da8d did not complete (FAILURE).
🏗️▪️ jwplayer build FAILURE
📋▪️ jwplayer unit tests SUCCESS
🏗️▪️ jwplayer-commercial build NOT_STARTED
📋▪️ jwplayer-commercial unit tests NOT_STARTED
🥒 Cucumber Integration Tests NOT_STARTED
🎃 Manual Tests
📺 Views

@jwplayer-robot
Copy link

MULTI Build for commit 1a3eeb4 did not complete (FAILURE).
🏗️▪️ jwplayer build FAILURE
📋▪️ jwplayer unit tests SUCCESS
🏗️▪️ jwplayer-commercial build NOT_STARTED
📋▪️ jwplayer-commercial unit tests NOT_STARTED
🥒 Cucumber Integration Tests NOT_STARTED
🎃 Manual Tests
📺 Views

@jwbrandon
Copy link
Contributor

test this please

@jwplayer-robot
Copy link

MULTI Build for commit 1a3eeb4 did not complete (FAILURE).
🏗️▪️ jwplayer build SUCCESS
📋▪️ jwplayer unit tests FAILURE
🏗️▪️ jwplayer-commercial build NOT_STARTED
📋▪️ jwplayer-commercial unit tests NOT_STARTED
🥒 Cucumber Integration Tests NOT_STARTED
🎃 Manual Tests
📺 Views

@@ -35,3 +35,13 @@ export class ButtonMenuItem extends MenuItem {
this.active = false;
}
}

export class ResetMenuItem extends MenuItem {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be in its own file? Something like reset-menu-item?

@@ -188,9 +188,15 @@ class SettingsMenu extends Menu {
});
captionsSettingsItems.push(resetItem);
captionsSettingsMenu.setMenuItems(captionsSettingsItems);
if (isReset) {
resetItem.statusEl.innerHTML = 'Reset Captions Successful';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be better to use textContent here and below rather than innerHTML

Copy link
Contributor

@jwbrandon jwbrandon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could use a unit test, at least for the ResetMenuItem class. It does seem like it might be very difficult to unit test the actual fix here, but it might still be worth doing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants