Skip to content

Commit

Permalink
STCOR-753: Accessibility Issues - core components - Include label tex…
Browse files Browse the repository at this point in the history
…t in element's accessible name
  • Loading branch information
UladzislauKutarkin committed Nov 1, 2023
1 parent dd71819 commit 44a641a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
16 changes: 3 additions & 13 deletions src/components/MainNav/ProfileDropdown/ProfileDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,23 +256,13 @@ class ProfileDropdown extends Component {
}

renderProfileTriggerLabel = ({ open }) => {
const { okapi } = this.props.stripes;
const userData = this.getUserData();
const servicePointName = userData?.curServicePoint?.name;
const tenantName = userData?.tenants?.find(({ id }) => id === okapi.tenant)?.name;

const hasLabel = Boolean(servicePointName || tenantName);

return (
hasLabel ? (
<>

Check failure on line 260 in src/components/MainNav/ProfileDropdown/ProfileDropdown.js

View workflow job for this annotation

GitHub Actions / build-npm

Expected indentation of 6 space characters but found 8

Check failure on line 260 in src/components/MainNav/ProfileDropdown/ProfileDropdown.js

View workflow job for this annotation

GitHub Actions / build-npm

Expected indentation of 6 space characters but found 8
<span className={css.button__label}>
{tenantName && <span>{tenantName}</span>}
{servicePointName && <span>{servicePointName}</span>}
</span>
<span className={css.button__label}>

Check failure on line 261 in src/components/MainNav/ProfileDropdown/ProfileDropdown.js

View workflow job for this annotation

GitHub Actions / build-npm

Expected indentation of 10 space characters but found 8

Check failure on line 261 in src/components/MainNav/ProfileDropdown/ProfileDropdown.js

View workflow job for this annotation

GitHub Actions / build-npm

Expected indentation of 10 space characters but found 8
<FormattedMessage id="stripes-core.mainnav.myProfileAriaLabel" />
</span>
<Icon icon={open ? 'caret-up' : 'caret-down'} />
</>
) : null
);
}

Expand Down
2 changes: 1 addition & 1 deletion translations/stripes-core/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"settingSystemInfo": "System information",
"settingChoose": "Choose settings",

"mainnav.showAllApplicationsButtonLabel": "Apps",
"mainnav.showAllApplicationsButtonLabel": "All applications",
"mainnav.showAllApplicationsButtonAriaLabel": "All applications",
"mainnav.currentAppAriaLabel": "Current open application: {appName} (Click to go home)",
"mainnav.topLevelLabel": "Primary",
Expand Down

0 comments on commit 44a641a

Please sign in to comment.