mirror of
https://github.com/bitwarden/browser
synced 2026-02-19 19:04:01 +00:00
Separates policy response model for individual policy data (#18377)
This commit is contained in:
committed by
jaasen-livefront
parent
08a98d2c5e
commit
0abc685cda
@@ -6,7 +6,7 @@ import { Constructor } from "type-fest";
|
||||
import { PolicyType } from "@bitwarden/common/admin-console/enums";
|
||||
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
|
||||
import { PolicyRequest } from "@bitwarden/common/admin-console/models/request/policy.request";
|
||||
import { PolicyResponse } from "@bitwarden/common/admin-console/models/response/policy.response";
|
||||
import { PolicyStatusResponse } from "@bitwarden/common/admin-console/models/response/policy-status.response";
|
||||
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
|
||||
import { DialogConfig, DialogRef, DialogService } from "@bitwarden/components";
|
||||
|
||||
@@ -80,7 +80,7 @@ export abstract class BasePolicyEditDefinition {
|
||||
export abstract class BasePolicyEditComponent implements OnInit {
|
||||
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
|
||||
// eslint-disable-next-line @angular-eslint/prefer-signals
|
||||
@Input() policyResponse: PolicyResponse | undefined;
|
||||
@Input() policyResponse: PolicyStatusResponse | undefined;
|
||||
// FIXME(https://bitwarden.atlassian.net/browse/CL-903): Migrate to Signals
|
||||
// eslint-disable-next-line @angular-eslint/prefer-signals
|
||||
@Input() policy: BasePolicyEditDefinition | undefined;
|
||||
|
||||
@@ -4,7 +4,7 @@ import { By } from "@angular/platform-browser";
|
||||
import { mock } from "jest-mock-extended";
|
||||
|
||||
import { PolicyType } from "@bitwarden/common/admin-console/enums";
|
||||
import { PolicyResponse } from "@bitwarden/common/admin-console/models/response/policy.response";
|
||||
import { PolicyStatusResponse } from "@bitwarden/common/admin-console/models/response/policy-status.response";
|
||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
|
||||
import {
|
||||
@@ -42,8 +42,7 @@ describe("RemoveUnlockWithPinPolicyComponent", () => {
|
||||
});
|
||||
|
||||
it("input selected on load when policy enabled", async () => {
|
||||
component.policyResponse = new PolicyResponse({
|
||||
id: "policy1",
|
||||
component.policyResponse = new PolicyStatusResponse({
|
||||
organizationId: "org1",
|
||||
type: PolicyType.RemoveUnlockWithPin,
|
||||
enabled: true,
|
||||
@@ -63,8 +62,7 @@ describe("RemoveUnlockWithPinPolicyComponent", () => {
|
||||
});
|
||||
|
||||
it("input not selected on load when policy disabled", async () => {
|
||||
component.policyResponse = new PolicyResponse({
|
||||
id: "policy1",
|
||||
component.policyResponse = new PolicyStatusResponse({
|
||||
organizationId: "org1",
|
||||
type: PolicyType.RemoveUnlockWithPin,
|
||||
enabled: false,
|
||||
@@ -84,8 +82,7 @@ describe("RemoveUnlockWithPinPolicyComponent", () => {
|
||||
});
|
||||
|
||||
it("turn on message label", async () => {
|
||||
component.policyResponse = new PolicyResponse({
|
||||
id: "policy1",
|
||||
component.policyResponse = new PolicyStatusResponse({
|
||||
organizationId: "org1",
|
||||
type: PolicyType.RemoveUnlockWithPin,
|
||||
enabled: false,
|
||||
|
||||
Reference in New Issue
Block a user