mirror of
https://github.com/andwati/zitadel.git
synced 2026-10-28 10:02:15 +00:00
feat(org-selector): Remember the last selected org and order the list. (#2343)
This remembers the last selected org in localstorage instead of session storage to improve the UX. Furthermore, the list of organizations is ordered by name instead of just the returned result set.
This commit is contained in:
@@ -10,7 +10,6 @@ import { ActivatedRoute, Router, RouterOutlet } from '@angular/router';
|
||||
import { LangChangeEvent, TranslateService } from '@ngx-translate/core';
|
||||
import { BehaviorSubject, from, Observable, of, Subject } from 'rxjs';
|
||||
import { catchError, debounceTime, finalize, map, take, takeUntil } from 'rxjs/operators';
|
||||
|
||||
import { accountCard, adminLineAnimation, navAnimations, routeAnimations, toolbarAnimation } from './animations';
|
||||
import { TextQueryMethod } from './proto/generated/zitadel/object_pb';
|
||||
import { Org, OrgNameQuery, OrgQuery } from './proto/generated/zitadel/org_pb';
|
||||
@@ -22,6 +21,7 @@ import { ManagementService } from './services/mgmt.service';
|
||||
import { ThemeService } from './services/theme.service';
|
||||
import { UpdateService } from './services/update.service';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
templateUrl: './app.component.html',
|
||||
@@ -307,7 +307,7 @@ export class AppComponent implements OnDestroy {
|
||||
this.orgLoading$.next(true);
|
||||
this.orgs$ = from(this.authService.listMyProjectOrgs(10, 0, query ? [query] : undefined)).pipe(
|
||||
map(resp => {
|
||||
return resp.resultList;
|
||||
return resp.resultList.sort((left, right) => left.name.localeCompare(right.name));
|
||||
}),
|
||||
catchError(() => of([])),
|
||||
finalize(() => {
|
||||
|
||||
Reference in New Issue
Block a user