1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-24 16:49:26 +01:00

[SM-1090] Fix org switcher alphabetization (#7831)

* Remove sorting of disabled orgs to the bottom

* Fix color contrast of disabled label and add a11y attributes
This commit is contained in:
Robyn MacCallum 2024-02-20 10:13:19 -05:00 committed by GitHub
parent cc37ccbea5
commit 660017a25f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 6 deletions

View File

@ -10,7 +10,9 @@
<i
slot="end"
*ngIf="!activeOrganization.enabled"
class="bwi bwi-exclamation-triangle tw-my-auto !tw-text-danger"
class="bwi bwi-exclamation-triangle tw-my-auto !text-alt-2"
[attr.aria-label]="'organizationIsDisabled' | i18n"
appA11yTitle="{{ 'organizationIsDisabled' | i18n }}"
></i>
<ng-container *ngIf="organizations$ | async as organizations">
<bit-nav-item
@ -24,7 +26,9 @@
<i
slot="end"
*ngIf="org.enabled == false"
class="bwi bwi-exclamation-triangle !tw-text-danger"
class="bwi bwi-exclamation-triangle !text-alt-2"
[attr.aria-label]="'organizationIsDisabled' | i18n"
appA11yTitle="{{ 'organizationIsDisabled' | i18n }}"
></i>
</bit-nav-item>
</ng-container>

View File

@ -13,10 +13,7 @@ export class OrgSwitcherComponent {
protected organizations$: Observable<Organization[]> =
this.organizationService.organizations$.pipe(
map((orgs) =>
orgs
.filter((org) => this.filter(org))
.sort((a, b) => a.name.localeCompare(b.name))
.sort((a, b) => (a.enabled ? -1 : 1)),
orgs.filter((org) => this.filter(org)).sort((a, b) => a.name.localeCompare(b.name)),
),
);