Skip to content
This repository was archived by the owner on Nov 18, 2025. It is now read-only.

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

Open
jdunningjwp wants to merge 7 commits into
masterfrom
captions-reset-settings-confirmation
Open

[JW-11320]<Teaching Channel 9: No confirmation message is provided it on selecting captions styles 'Reset' button>#3964
jdunningjwp wants to merge 7 commits into
masterfrom
captions-reset-settings-confirmation

Conversation

@jdunningjwp

Copy link
Copy Markdown
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
Copy Markdown

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';

@zetagame zetagame Jan 19, 2022

Copy link
Copy Markdown
Contributor

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;';

@zetagame zetagame Jan 19, 2022

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

zetagame commented Jan 19, 2022

Copy link
Copy Markdown
Contributor

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

@zetagame zetagame left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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
Copy Markdown
Contributor

test this please

@jwplayer-robot

Copy link
Copy Markdown

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

}
}

export class ResetMenuItem extends MenuItem {

Copy link
Copy Markdown
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?

captionsSettingsItems.push(resetItem);
captionsSettingsMenu.setMenuItems(captionsSettingsItems);
if (isReset) {
resetItem.statusEl.innerHTML = 'Reset Captions Successful';

Copy link
Copy Markdown
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

@jwbrandon jwbrandon left a comment

Copy link
Copy Markdown
Contributor

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants