[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:
parent
cc37ccbea5
commit
660017a25f
|
@ -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>
|
||||
|
|
|
@ -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)),
|
||||
),
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue