mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 13:53:34 +00:00
[PM-27688] fix events page not loading (#17166)
* remove unneeded rxjs filter * add check for canManage * add null check * fix provider ID, clean up
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
// @ts-strict-ignore
|
// @ts-strict-ignore
|
||||||
import { Component, OnDestroy, OnInit } from "@angular/core";
|
import { Component, OnDestroy, OnInit } from "@angular/core";
|
||||||
import { ActivatedRoute } from "@angular/router";
|
import { ActivatedRoute } from "@angular/router";
|
||||||
import { concatMap, firstValueFrom, lastValueFrom, map, switchMap, takeUntil } from "rxjs";
|
import { concatMap, firstValueFrom, lastValueFrom, map, of, switchMap, takeUntil, tap } from "rxjs";
|
||||||
|
|
||||||
import { OrganizationUserApiService } from "@bitwarden/admin-console/common";
|
import { OrganizationUserApiService } from "@bitwarden/admin-console/common";
|
||||||
import { UserNamePipe } from "@bitwarden/angular/pipes/user-name.pipe";
|
import { UserNamePipe } from "@bitwarden/angular/pipes/user-name.pipe";
|
||||||
@@ -143,16 +143,23 @@ export class EventsComponent extends BaseEventsComponent implements OnInit, OnDe
|
|||||||
getUserId,
|
getUserId,
|
||||||
switchMap((userId) => this.providerService.get$(this.organization.providerId, userId)),
|
switchMap((userId) => this.providerService.get$(this.organization.providerId, userId)),
|
||||||
map((provider) => provider != null && provider.canManageUsers),
|
map((provider) => provider != null && provider.canManageUsers),
|
||||||
switchMap(() => this.apiService.getProviderUsers(this.organization.id)),
|
switchMap((canManage) => {
|
||||||
map((providerUsersResponse) =>
|
if (canManage) {
|
||||||
providerUsersResponse.data.forEach((u) => {
|
return this.apiService.getProviderUsers(this.organization.providerId);
|
||||||
const name = this.userNamePipe.transform(u);
|
}
|
||||||
this.orgUsersUserIdMap.set(u.userId, {
|
return of(null);
|
||||||
name: `${name} (${this.organization.providerName})`,
|
}),
|
||||||
email: u.email,
|
tap((providerUsersResponse) => {
|
||||||
|
if (providerUsersResponse) {
|
||||||
|
providerUsersResponse.data.forEach((u) => {
|
||||||
|
const name = this.userNamePipe.transform(u);
|
||||||
|
this.orgUsersUserIdMap.set(u.userId, {
|
||||||
|
name: `${name} (${this.organization.providerName})`,
|
||||||
|
email: u.email,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}),
|
}
|
||||||
),
|
}),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user