mirror of
https://github.com/bitwarden/browser
synced 2026-02-10 21:50:15 +00:00
remove navigation/router logic and use new policy link
This commit is contained in:
@@ -30,18 +30,18 @@
|
||||
</div>
|
||||
<div class="tw-flex-1">
|
||||
<h3 class="tw-font-semibold tw-text-main tw-mb-2">
|
||||
Remove individual vaults
|
||||
Enforce organization data ownership
|
||||
<span class="tw-text-muted tw-font-normal">(recommended)</span>
|
||||
</h3>
|
||||
<p class="tw-text-muted tw-leading-relaxed">
|
||||
Turn on the
|
||||
<a
|
||||
href="#"
|
||||
href="https://bitwarden.com/help/policies/#enforce-organization-data-ownership"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="tw-text-primary-600 tw-underline hover:tw-text-primary-700 tw-cursor-pointer"
|
||||
(click)="navigateToPolicy()"
|
||||
>enforce organization data ownership policy</a
|
||||
>
|
||||
Remove individual vault policy
|
||||
</a>
|
||||
to get complete visibility of all organization vault data. This setting can be
|
||||
enabled at any time.
|
||||
</p>
|
||||
@@ -76,6 +76,8 @@
|
||||
<footer
|
||||
class="tw-flex tw-flex-row tw-items-center tw-justify-center tw-gap-2 tw-bg-background tw-p-4"
|
||||
>
|
||||
<button bitButton buttonType="primary" type="button" (click)="runReport()">Run Report</button>
|
||||
<button bitButton buttonType="primary" type="button" (click)="runReport()" cdkFocusInitial>
|
||||
Run Report
|
||||
</button>
|
||||
</footer>
|
||||
</section>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { DialogRef, DIALOG_DATA } from "@angular/cdk/dialog";
|
||||
import { Component, Inject } from "@angular/core";
|
||||
import { Router } from "@angular/router";
|
||||
|
||||
import { ButtonModule } from "@bitwarden/components";
|
||||
|
||||
@@ -14,40 +13,8 @@ export class NoDataModalComponent {
|
||||
constructor(
|
||||
public dialogRef: DialogRef<boolean>,
|
||||
@Inject(DIALOG_DATA) public data: any,
|
||||
private router: Router,
|
||||
) {}
|
||||
|
||||
async navigateToPolicy(): Promise<void> {
|
||||
// Check if we have the organizationId
|
||||
if (!this.data.organizationId) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Close the modal first
|
||||
this.dialogRef.close(true);
|
||||
|
||||
// Add a small delay to ensure modal closes before navigation
|
||||
await new Promise((resolve) => setTimeout(resolve, 100));
|
||||
|
||||
// Try to navigate using router first
|
||||
try {
|
||||
const result = await this.router.navigate([
|
||||
"/organizations",
|
||||
this.data.organizationId,
|
||||
"settings",
|
||||
"policies",
|
||||
]);
|
||||
|
||||
// If router navigation fails, use window.location as fallback
|
||||
if (!result) {
|
||||
window.location.href = `/#/organizations/${this.data.organizationId}/settings/policies`;
|
||||
}
|
||||
} catch {
|
||||
// Fallback to window.location if router navigation throws an error
|
||||
window.location.href = `/#/organizations/${this.data.organizationId}/settings/policies`;
|
||||
}
|
||||
}
|
||||
|
||||
async runReport(): Promise<void> {
|
||||
// Close the modal first
|
||||
this.dialogRef.close(true);
|
||||
|
||||
Reference in New Issue
Block a user