-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
Provide additional context for authorization and logout button #8999
Provide additional context for authorization and logout button #8999
Conversation
@char0n Conscious of your limited time reviewing all the PRs and reported issues, would be nice to get some feedback both about the reported issue/enhancement and if the PR content makes sense. |
@tim-lai Hello, could you review this PR or let me know how to expedite any review / comments? |
Hi @vmware-jaret, Thank you for the PR! Your changeset is on my radar, and I'll address it ASAP. |
I'm not sure I fully understand the underlying intention correctly, but as far as I understand you want additional context for screen readers. Wouldn't this be achieved by ad-hoc Original code: <div className="auth-btn-wrapper">
{
nonOauthDefinitions.size === authorizedAuth.size ? <Button className="btn modal-btn auth" onClick={ this.logoutClick }>Logout</Button>
: <Button type="submit" className="btn modal-btn auth authorize">Authorize</Button>
}
<Button className="btn modal-btn auth btn-done" onClick={ this.close }>Close</Button>
</div> More accessibility: <div className="auth-btn-wrapper">
{
nonOauthDefinitions.size === authorizedAuth.size ? <Button className="btn modal-btn auth" onClick={ this.logoutClick }>Logout</Button>
: <Button type="submit" className="btn modal-btn auth authorize" aria-label="Apply authorization credentials">Authorize</Button>
}
<Button className="btn modal-btn auth btn-done" onClick={ this.close }>Close</Button>
</div> |
- Introduced the AuthorizeButton component that entails the apply authorization and remove authorization functionality, as well as a close button. - Unit tests provided for different states. - AuthorizeButton is able to be used for both form submit and onClick function behavior.
8ab51c5
to
4b6d389
Compare
- Reverted the AuthorizationButton as <label /> is not needed and `aria-label` seems to be better fit for screen readers (see as well https://www.w3.org/WAI/WCAG21/Techniques/html/H44 that <label /> is not usable for <button /> or <input type="submit" /> HTML elements). - Validation test for that aria-label is available for OAuth2 authorization and non-oauth2 authorization buttons.
Thanks @char0n. After some analysis indeed the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Hi @vmware-jaret, I've changed |
Description
Motivation and Context
Fixes #8998, mainly to provide additional context in what the user can do by clicking 'Autorize' and 'Remove Authorization'.
How Has This Been Tested?
Used the swagger-react in another product and have seen that the hidden labels are added. Unittest added + Cypress test fixed.
Screenshots (if appropriate):
Checklist
My PR contains...
src/
is unmodified: changes to documentation, CI, metadata, etc.)package.json
)My changes...
Documentation
Automated tests