1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-21 16:18:28 +01:00

[AC-1689] Add hidePasswords property to collection data and response models (#6451)

This commit is contained in:
Thomas Rittson 2023-10-03 13:30:24 +10:00 committed by GitHub
parent 32121dabe4
commit 512af1e923
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View File

@ -6,6 +6,7 @@ export class CollectionData {
name: string; name: string;
externalId: string; externalId: string;
readOnly: boolean; readOnly: boolean;
hidePasswords: boolean;
constructor(response: CollectionDetailsResponse) { constructor(response: CollectionDetailsResponse) {
this.id = response.id; this.id = response.id;
@ -13,5 +14,6 @@ export class CollectionData {
this.name = response.name; this.name = response.name;
this.externalId = response.externalId; this.externalId = response.externalId;
this.readOnly = response.readOnly; this.readOnly = response.readOnly;
this.hidePasswords = response.hidePasswords;
} }
} }

View File

@ -13,6 +13,7 @@ describe("Collection", () => {
name: "encName", name: "encName",
externalId: "extId", externalId: "extId",
readOnly: true, readOnly: true,
hidePasswords: true,
}; };
}); });
@ -39,7 +40,7 @@ describe("Collection", () => {
name: { encryptedString: "encName", encryptionType: 0 }, name: { encryptedString: "encName", encryptionType: 0 },
externalId: "extId", externalId: "extId",
readOnly: true, readOnly: true,
hidePasswords: null, hidePasswords: true,
}); });
}); });

View File

@ -18,10 +18,12 @@ export class CollectionResponse extends BaseResponse {
export class CollectionDetailsResponse extends CollectionResponse { export class CollectionDetailsResponse extends CollectionResponse {
readOnly: boolean; readOnly: boolean;
hidePasswords: boolean;
constructor(response: any) { constructor(response: any) {
super(response); super(response);
this.readOnly = this.getResponseProperty("ReadOnly") || false; this.readOnly = this.getResponseProperty("ReadOnly") || false;
this.hidePasswords = this.getResponseProperty("HidePasswords") || false;
} }
} }