mirror of
https://github.com/bitwarden/browser
synced 2025-12-22 03:03:43 +00:00
PM-26676 change the org should update the access intelligence report (#17053)
This commit is contained in:
@@ -165,6 +165,7 @@ export class RiskInsightsOrchestratorService {
|
|||||||
initializeForOrganization(organizationId: OrganizationId) {
|
initializeForOrganization(organizationId: OrganizationId) {
|
||||||
this.logService.debug("[RiskInsightsOrchestratorService] Initializing for org", organizationId);
|
this.logService.debug("[RiskInsightsOrchestratorService] Initializing for org", organizationId);
|
||||||
this._initializeOrganizationTriggerSubject.next(organizationId);
|
this._initializeOrganizationTriggerSubject.next(organizationId);
|
||||||
|
this.fetchReport();
|
||||||
}
|
}
|
||||||
|
|
||||||
removeCriticalApplication$(criticalApplication: string): Observable<ReportState> {
|
removeCriticalApplication$(criticalApplication: string): Observable<ReportState> {
|
||||||
@@ -587,7 +588,7 @@ export class RiskInsightsOrchestratorService {
|
|||||||
private _setupEnrichedReportData() {
|
private _setupEnrichedReportData() {
|
||||||
// Setup the enriched report data pipeline
|
// Setup the enriched report data pipeline
|
||||||
const enrichmentSubscription = combineLatest([
|
const enrichmentSubscription = combineLatest([
|
||||||
this.rawReportData$.pipe(filter((data) => !!data && !!data?.data)),
|
this.rawReportData$,
|
||||||
this._ciphers$.pipe(filter((data) => !!data)),
|
this._ciphers$.pipe(filter((data) => !!data)),
|
||||||
]).pipe(
|
]).pipe(
|
||||||
switchMap(([rawReportData, ciphers]) => {
|
switchMap(([rawReportData, ciphers]) => {
|
||||||
@@ -627,7 +628,7 @@ export class RiskInsightsOrchestratorService {
|
|||||||
.pipe(
|
.pipe(
|
||||||
withLatestFrom(this._userId$),
|
withLatestFrom(this._userId$),
|
||||||
filter(([orgId, userId]) => !!orgId && !!userId),
|
filter(([orgId, userId]) => !!orgId && !!userId),
|
||||||
exhaustMap(([orgId, userId]) =>
|
switchMap(([orgId, userId]) =>
|
||||||
this.organizationService.organizations$(userId!).pipe(
|
this.organizationService.organizations$(userId!).pipe(
|
||||||
getOrganizationById(orgId),
|
getOrganizationById(orgId),
|
||||||
map((org) => ({ organizationId: orgId!, organizationName: org?.name ?? "" })),
|
map((org) => ({ organizationId: orgId!, organizationName: org?.name ?? "" })),
|
||||||
@@ -725,7 +726,7 @@ export class RiskInsightsOrchestratorService {
|
|||||||
scan((prevState: ReportState, currState: ReportState) => ({
|
scan((prevState: ReportState, currState: ReportState) => ({
|
||||||
...prevState,
|
...prevState,
|
||||||
...currState,
|
...currState,
|
||||||
data: currState.data !== null ? currState.data : prevState.data,
|
data: currState.data,
|
||||||
})),
|
})),
|
||||||
startWith({ loading: false, error: null, data: null }),
|
startWith({ loading: false, error: null, data: null }),
|
||||||
shareReplay({ bufferSize: 1, refCount: true }),
|
shareReplay({ bufferSize: 1, refCount: true }),
|
||||||
|
|||||||
Reference in New Issue
Block a user