1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 09:13:33 +00:00

Add support for collections with hide passwords

This commit is contained in:
hinton
2020-05-21 15:49:56 +02:00
parent 2858724f44
commit 1fa3eb49ad
8 changed files with 24 additions and 3 deletions

View File

@@ -22,6 +22,7 @@ export class CipherResponse extends BaseResponse {
secureNote: SecureNoteApi;
favorite: boolean;
edit: boolean;
viewPassword: boolean;
organizationUseTotp: boolean;
revisionDate: string;
attachments: AttachmentResponse[];
@@ -38,7 +39,12 @@ export class CipherResponse extends BaseResponse {
this.name = this.getResponseProperty('Name');
this.notes = this.getResponseProperty('Notes');
this.favorite = this.getResponseProperty('Favorite') || false;
this.edit = this.getResponseProperty('Edit') || true;
this.edit = !!this.getResponseProperty('Edit');
if (this.getResponseProperty('ViewPassword') == null) {
this.viewPassword = true;
} else {
this.viewPassword = this.getResponseProperty('ViewPassword');
}
this.organizationUseTotp = this.getResponseProperty('OrganizationUseTotp');
this.revisionDate = this.getResponseProperty('RevisionDate');
this.collectionIds = this.getResponseProperty('CollectionIds');

View File

@@ -3,10 +3,12 @@ import { BaseResponse } from './baseResponse';
export class SelectionReadOnlyResponse extends BaseResponse {
id: string;
readOnly: boolean;
hidePasswords: boolean;
constructor(response: any) {
super(response);
this.id = this.getResponseProperty('Id');
this.readOnly = this.getResponseProperty('ReadOnly');
this.hidePasswords = this.getResponseProperty('HidePasswords');
}
}