diff --git a/apps/web/src/app/admin-console/organizations/policies/base-policy-edit.component.ts b/apps/web/src/app/admin-console/organizations/policies/base-policy-edit.component.ts index 2e5faea4702..9293c686b7f 100644 --- a/apps/web/src/app/admin-console/organizations/policies/base-policy-edit.component.ts +++ b/apps/web/src/app/admin-console/organizations/policies/base-policy-edit.component.ts @@ -9,6 +9,8 @@ import { PolicyRequest } from "@bitwarden/common/admin-console/models/request/po import { PolicyResponse } from "@bitwarden/common/admin-console/models/response/policy.response"; import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service"; +import type { PolicyEditDialogComponent } from "./policy-edit-dialog.component"; + /** * A metadata class that defines how a policy is displayed in the Admin Console Policies page for editing. * Add this to the `ossPolicyRegister` or `bitPolicyRegister` file to register it in the application. @@ -32,6 +34,13 @@ export abstract class BasePolicyEditDefinition { */ abstract component: Constructor; + /** + * The dialog component that will be opened when editing this policy. + * This allows customizing the look and feel of each policy's dialog contents. + * If not specified, defaults to {@link PolicyEditDialogComponent}. + */ + editDialogComponent?: typeof PolicyEditDialogComponent; + /** * If true, the {@link description} will be reused in the policy edit modal. Set this to false if you * have more complex requirements that you will implement in your template instead. diff --git a/apps/web/src/app/admin-console/organizations/policies/policies.component.ts b/apps/web/src/app/admin-console/organizations/policies/policies.component.ts index e2c51b77d45..95c00f74f1c 100644 --- a/apps/web/src/app/admin-console/organizations/policies/policies.component.ts +++ b/apps/web/src/app/admin-console/organizations/policies/policies.component.ts @@ -127,7 +127,8 @@ export class PoliciesComponent implements OnInit { } async edit(policy: BasePolicyEditDefinition) { - const dialogRef = PolicyEditDialogComponent.open(this.dialogService, { + const dialogComponent = policy.editDialogComponent ?? PolicyEditDialogComponent; + const dialogRef = dialogComponent.open(this.dialogService, { data: { policy: policy, organizationId: this.organizationId,