mirror of
https://github.com/bitwarden/browser
synced 2026-02-14 23:45:37 +00:00
PM-29621 changed error message to indicate lack of permissions
This commit is contained in:
@@ -10435,6 +10435,9 @@
|
||||
"failedToSaveIntegration": {
|
||||
"message": "Failed to save integration. Please try again later."
|
||||
},
|
||||
"mustBeOrganizationOwnerAdmin": {
|
||||
"message": "You must be an Organization Owner or Admin to perform this action."
|
||||
},
|
||||
"mustBeOrgOwnerToPerformAction": {
|
||||
"message": "You must be the organization owner to perform this action."
|
||||
},
|
||||
|
||||
@@ -165,7 +165,7 @@ export class PasswordChangeMetricComponent implements OnInit {
|
||||
});
|
||||
} catch {
|
||||
this.toastService.showToast({
|
||||
message: this.i18nService.t("unexpectedError"),
|
||||
message: this.i18nService.t("mustBeOrganizationOwnerAdmin"),
|
||||
variant: "error",
|
||||
title: this.i18nService.t("error"),
|
||||
});
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Component, DestroyRef, inject, OnInit, ChangeDetectionStrategy } from "
|
||||
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
||||
import { FormControl } from "@angular/forms";
|
||||
import { ActivatedRoute, Router } from "@angular/router";
|
||||
import { debounceTime, EMPTY, from, map, switchMap, take } from "rxjs";
|
||||
import { debounceTime, EMPTY, firstValueFrom, map, switchMap } from "rxjs";
|
||||
|
||||
import { Security } from "@bitwarden/assets/svg";
|
||||
import {
|
||||
@@ -152,35 +152,25 @@ export class CriticalApplicationsComponent implements OnInit {
|
||||
};
|
||||
|
||||
async requestPasswordChange() {
|
||||
this.dataService.criticalApplicationAtRiskCipherIds$
|
||||
.pipe(
|
||||
takeUntilDestroyed(this.destroyRef), // Satisfy eslint rule
|
||||
take(1), // Handle unsubscribe for one off operation
|
||||
switchMap((cipherIds) => {
|
||||
return from(
|
||||
this.securityTasksService.requestPasswordChangeForCriticalApplications(
|
||||
this.organizationId,
|
||||
cipherIds,
|
||||
),
|
||||
);
|
||||
}),
|
||||
)
|
||||
.subscribe({
|
||||
next: () => {
|
||||
this.toastService.showToast({
|
||||
message: this.i18nService.t("notifiedMembers"),
|
||||
variant: "success",
|
||||
title: this.i18nService.t("success"),
|
||||
});
|
||||
},
|
||||
error: () => {
|
||||
this.toastService.showToast({
|
||||
message: this.i18nService.t("unexpectedError"),
|
||||
variant: "error",
|
||||
title: this.i18nService.t("error"),
|
||||
});
|
||||
},
|
||||
try {
|
||||
const cipherIds = await firstValueFrom(this.dataService.criticalApplicationAtRiskCipherIds$);
|
||||
|
||||
await this.securityTasksService.requestPasswordChangeForCriticalApplications(
|
||||
this.organizationId,
|
||||
cipherIds,
|
||||
);
|
||||
this.toastService.showToast({
|
||||
message: this.i18nService.t("notifiedMembers"),
|
||||
variant: "success",
|
||||
title: this.i18nService.t("success"),
|
||||
});
|
||||
} catch {
|
||||
this.toastService.showToast({
|
||||
message: this.i18nService.t("mustBeOrganizationOwnerAdmin"),
|
||||
variant: "error",
|
||||
title: this.i18nService.t("error"),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
showAppAtRiskMembers = async (applicationName: string) => {
|
||||
|
||||
Reference in New Issue
Block a user