1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-24 12:06:15 +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 <i
slot="end" slot="end"
*ngIf="!activeOrganization.enabled" *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> ></i>
<ng-container *ngIf="organizations$ | async as organizations"> <ng-container *ngIf="organizations$ | async as organizations">
<bit-nav-item <bit-nav-item
@ -24,7 +26,9 @@
<i <i
slot="end" slot="end"
*ngIf="org.enabled == false" *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> ></i>
</bit-nav-item> </bit-nav-item>
</ng-container> </ng-container>

View File

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