1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-11 05:43:41 +00:00

Ps 976 moving of read only organization collection items to different folder not possible (#3474)

* PS-976 - when user has cipher readonly permissions, prevent user from editing cipher fields and make separate api call that only updates Favorite and Folder values

* PS-976 - in the readonly edit cipher view, hide non-operable buttons and display select values as readonly input text

* PS-976 - update failing test

* PS-976 - split cipher saveWithServer call into Create and Update calls

* PS-976 - replace property with function call to get the card expiration month for the readonly view

* MM-976 - when user has readonly permissions hide "delete" button on View Item view, hide generate username/password buttons on Edit Item view

* PS-976 - rename cipherPartialRequest file to align with new naming convention
This commit is contained in:
dgoodman-bw
2022-10-25 12:24:21 -07:00
committed by GitHub
parent d9542c45d9
commit 41d6b6bd21
19 changed files with 382 additions and 96 deletions

View File

@@ -394,7 +394,7 @@ export default class NotificationBackground {
} }
const cipher = await this.cipherService.encrypt(model); const cipher = await this.cipherService.encrypt(model);
await this.cipherService.saveWithServer(cipher); await this.cipherService.createWithServer(cipher);
} }
private async getDecryptedCipherById(cipherId: string) { private async getDecryptedCipherById(cipherId: string) {
@@ -409,7 +409,7 @@ export default class NotificationBackground {
if (cipher != null && cipher.type === CipherType.Login) { if (cipher != null && cipher.type === CipherType.Login) {
cipher.login.password = newPassword; cipher.login.password = newPassword;
const newCipher = await this.cipherService.encrypt(cipher); const newCipher = await this.cipherService.encrypt(cipher);
await this.cipherService.saveWithServer(newCipher); await this.cipherService.updateWithServer(newCipher);
} }
} }

View File

@@ -19,6 +19,7 @@
appStopClick appStopClick
(click)="removeField(f)" (click)="removeField(f)"
appA11yTitle="{{ 'remove' | i18n }}" appA11yTitle="{{ 'remove' | i18n }}"
*ngIf="!(!cipher.edit && editMode)"
> >
<i class="bwi bwi-minus-circle bwi-lg" aria-hidden="true"></i> <i class="bwi bwi-minus-circle bwi-lg" aria-hidden="true"></i>
</button> </button>
@@ -33,6 +34,7 @@
class="row-label" class="row-label"
placeholder="{{ 'name' | i18n }}" placeholder="{{ 'name' | i18n }}"
appInputVerbatim appInputVerbatim
[readonly]="!cipher.edit && editMode"
/> />
<!-- Text --> <!-- Text -->
<input <input
@@ -44,6 +46,7 @@
placeholder="{{ 'value' | i18n }}" placeholder="{{ 'value' | i18n }}"
appInputVerbatim appInputVerbatim
attr.aria-describedby="fieldName{{ i }}" attr.aria-describedby="fieldName{{ i }}"
[readonly]="!cipher.edit && editMode"
/> />
<!-- Hidden --> <!-- Hidden -->
<input <input
@@ -57,6 +60,7 @@
placeholder="{{ 'value' | i18n }}" placeholder="{{ 'value' | i18n }}"
[disabled]="!cipher.viewPassword && !f.newField" [disabled]="!cipher.viewPassword && !f.newField"
attr.aria-describedby="fieldName{{ i }}" attr.aria-describedby="fieldName{{ i }}"
[readonly]="!cipher.edit && editMode"
/> />
<!-- Linked --> <!-- Linked -->
<select <select
@@ -80,6 +84,7 @@
trueValue="true" trueValue="true"
falseValue="false" falseValue="false"
attr.aria-describedby="fieldName{{ i }}" attr.aria-describedby="fieldName{{ i }}"
[readonly]="!cipher.edit && editMode"
/> />
<div <div
class="action-buttons" class="action-buttons"
@@ -100,13 +105,22 @@
></i> ></i>
</button> </button>
</div> </div>
<div class="drag-handle" appA11yTitle="{{ 'dragToSort' | i18n }}" cdkDragHandle> <div
class="drag-handle"
appA11yTitle="{{ 'dragToSort' | i18n }}"
*ngIf="!(!cipher.edit && editMode)"
cdkDragHandle
>
<i class="bwi bwi-hamburger" aria-hidden="true"></i> <i class="bwi bwi-hamburger" aria-hidden="true"></i>
</div> </div>
</div> </div>
</div> </div>
<!-- Add new custom field --> <!-- Add new custom field -->
<div class="box-content-row box-content-row-newmulti" appBoxRow> <div
class="box-content-row box-content-row-newmulti"
*ngIf="!(!cipher.edit && editMode)"
appBoxRow
>
<button type="button" appStopClick (click)="addField()"> <button type="button" appStopClick (click)="addField()">
<i class="bwi bwi-plus-circle bwi-fw bwi-lg" aria-hidden="true"></i> <i class="bwi bwi-plus-circle bwi-fw bwi-lg" aria-hidden="true"></i>
{{ "newCustomField" | i18n }} {{ "newCustomField" | i18n }}

View File

@@ -30,7 +30,13 @@
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
<label for="name">{{ "name" | i18n }}</label> <label for="name">{{ "name" | i18n }}</label>
<input id="name" type="text" name="Name" [(ngModel)]="cipher.name" /> <input
id="name"
type="text"
name="Name"
[(ngModel)]="cipher.name"
[readonly]="!cipher.edit && editMode"
/>
</div> </div>
<!-- Login --> <!-- Login -->
<div *ngIf="cipher.type === cipherType.Login"> <div *ngIf="cipher.type === cipherType.Login">
@@ -44,6 +50,7 @@
[(ngModel)]="cipher.login.username" [(ngModel)]="cipher.login.username"
inputmode="email" inputmode="email"
appInputVerbatim appInputVerbatim
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="action-buttons"> <div class="action-buttons">
@@ -53,6 +60,7 @@
appStopClick appStopClick
appA11yTitle="{{ 'generateUsername' | i18n }}" appA11yTitle="{{ 'generateUsername' | i18n }}"
(click)="generateUsername()" (click)="generateUsername()"
*ngIf="!(!cipher.edit && editMode)"
> >
<i class="bwi bwi-lg bwi-generate" aria-hidden="true"></i> <i class="bwi bwi-lg bwi-generate" aria-hidden="true"></i>
</button> </button>
@@ -69,6 +77,7 @@
[(ngModel)]="cipher.login.password" [(ngModel)]="cipher.login.password"
appInputVerbatim appInputVerbatim
[disabled]="!cipher.viewPassword" [disabled]="!cipher.viewPassword"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="action-buttons"> <div class="action-buttons">
@@ -114,7 +123,7 @@
appStopClick appStopClick
appA11yTitle="{{ 'generatePassword' | i18n }}" appA11yTitle="{{ 'generatePassword' | i18n }}"
(click)="generatePassword()" (click)="generatePassword()"
*ngIf="cipher.viewPassword" *ngIf="cipher.viewPassword && !(!cipher.edit && editMode)"
> >
<i class="bwi bwi-lg bwi-generate" aria-hidden="true"></i> <i class="bwi bwi-lg bwi-generate" aria-hidden="true"></i>
</button> </button>
@@ -130,6 +139,7 @@
[(ngModel)]="cipher.login.totp" [(ngModel)]="cipher.login.totp"
appInputVerbatim appInputVerbatim
[disabled]="!cipher.viewPassword" [disabled]="!cipher.viewPassword"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
</div> </div>
@@ -142,6 +152,7 @@
type="text" type="text"
name="Card.CardCardholderName" name="Card.CardCardholderName"
[(ngModel)]="cipher.card.cardholderName" [(ngModel)]="cipher.card.cardholderName"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row box-content-row-flex" appBoxRow> <div class="box-content-row box-content-row-flex" appBoxRow>
@@ -154,6 +165,7 @@
name="Card.Number" name="Card.Number"
[(ngModel)]="cipher.card.number" [(ngModel)]="cipher.card.number"
appInputVerbatim appInputVerbatim
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="action-buttons"> <div class="action-buttons">
@@ -175,17 +187,39 @@
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
<label for="cardBrand">{{ "brand" | i18n }}</label> <label for="cardBrand">{{ "brand" | i18n }}</label>
<select id="cardBrand" name="Card.Brand" [(ngModel)]="cipher.card.brand"> <span *ngIf="!(!cipher.edit && editMode); else readonlyCardBrand">
<option *ngFor="let o of cardBrandOptions" [ngValue]="o.value">{{ o.name }}</option> <select id="cardBrand" name="Card.Brand" [(ngModel)]="cipher.card.brand">
</select> <option *ngFor="let o of cardBrandOptions" [ngValue]="o.value">{{ o.name }}</option>
</select>
</span>
<ng-template #readonlyCardBrand>
<input
id="cardBrand"
name="Card.Brand"
type="text"
[readonly]="true"
[value]="cipher.card.brand"
/>
</ng-template>
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
<label for="cardExpMonth">{{ "expirationMonth" | i18n }}</label> <label for="cardExpMonth">{{ "expirationMonth" | i18n }}</label>
<select id="cardExpMonth" name="Card.ExpMonth" [(ngModel)]="cipher.card.expMonth"> <span *ngIf="!(!cipher.edit && editMode); else readonlyCardExpMonth">
<option *ngFor="let o of cardExpMonthOptions" [ngValue]="o.value"> <select id="cardExpMonth" name="Card.ExpMonth" [(ngModel)]="cipher.card.expMonth">
{{ o.name }} <option *ngFor="let o of cardExpMonthOptions" [ngValue]="o.value">
</option> {{ o.name }}
</select> </option>
</select>
</span>
<ng-template #readonlyCardExpMonth>
<input
id="cardExpMonth"
name="Card.ExpMonth"
type="text"
[readonly]="true"
[value]="getCardExpMonthDisplay()"
/>
</ng-template>
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
<label for="cardExpYear">{{ "expirationYear" | i18n }}</label> <label for="cardExpYear">{{ "expirationYear" | i18n }}</label>
@@ -195,6 +229,7 @@
name="Card.ExpYear" name="Card.ExpYear"
[(ngModel)]="cipher.card.expYear" [(ngModel)]="cipher.card.expYear"
placeholder="{{ 'ex' | i18n }} {{ currentDate | date: 'yyyy' }}" placeholder="{{ 'ex' | i18n }} {{ currentDate | date: 'yyyy' }}"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row box-content-row-flex" appBoxRow> <div class="box-content-row box-content-row-flex" appBoxRow>
@@ -207,6 +242,7 @@
name="Card.Code" name="Card.Code"
[(ngModel)]="cipher.card.code" [(ngModel)]="cipher.card.code"
appInputVerbatim appInputVerbatim
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="action-buttons"> <div class="action-buttons">
@@ -231,11 +267,22 @@
<div *ngIf="cipher.type === cipherType.Identity"> <div *ngIf="cipher.type === cipherType.Identity">
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
<label for="idTitle">{{ "title" | i18n }}</label> <label for="idTitle">{{ "title" | i18n }}</label>
<select id="idTitle" name="Identity.Title" [(ngModel)]="cipher.identity.title"> <span *ngIf="!(!cipher.edit && editMode); else readonlyIdTitle">
<option *ngFor="let o of identityTitleOptions" [ngValue]="o.value"> <select id="idTitle" name="Identity.Title" [(ngModel)]="cipher.identity.title">
{{ o.name }} <option *ngFor="let o of identityTitleOptions" [ngValue]="o.value">
</option> {{ o.name }}
</select> </option>
</select>
</span>
<ng-template #readonlyIdTitle>
<input
id="idTitle"
name="Identity.Title"
type="text"
[readonly]="true"
[value]="cipher.identity.title"
/>
</ng-template>
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
<label for="idFirstName">{{ "firstName" | i18n }}</label> <label for="idFirstName">{{ "firstName" | i18n }}</label>
@@ -244,6 +291,7 @@
type="text" type="text"
name="Identity.FirstName" name="Identity.FirstName"
[(ngModel)]="cipher.identity.firstName" [(ngModel)]="cipher.identity.firstName"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
@@ -253,6 +301,7 @@
type="text" type="text"
name="Identity.MiddleName" name="Identity.MiddleName"
[(ngModel)]="cipher.identity.middleName" [(ngModel)]="cipher.identity.middleName"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
@@ -262,6 +311,7 @@
type="text" type="text"
name="Identity.LastName" name="Identity.LastName"
[(ngModel)]="cipher.identity.lastName" [(ngModel)]="cipher.identity.lastName"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
@@ -272,6 +322,7 @@
name="Identity.Username" name="Identity.Username"
[(ngModel)]="cipher.identity.username" [(ngModel)]="cipher.identity.username"
appInputVerbatim appInputVerbatim
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
@@ -281,6 +332,7 @@
type="text" type="text"
name="Identity.Company" name="Identity.Company"
[(ngModel)]="cipher.identity.company" [(ngModel)]="cipher.identity.company"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
@@ -291,6 +343,7 @@
name="Identity.SSN" name="Identity.SSN"
[(ngModel)]="cipher.identity.ssn" [(ngModel)]="cipher.identity.ssn"
appInputVerbatim appInputVerbatim
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
@@ -301,6 +354,7 @@
name="Identity.PassportNumber" name="Identity.PassportNumber"
[(ngModel)]="cipher.identity.passportNumber" [(ngModel)]="cipher.identity.passportNumber"
appInputVerbatim appInputVerbatim
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
@@ -311,6 +365,7 @@
name="Identity.LicenseNumber" name="Identity.LicenseNumber"
[(ngModel)]="cipher.identity.licenseNumber" [(ngModel)]="cipher.identity.licenseNumber"
appInputVerbatim appInputVerbatim
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
@@ -321,6 +376,7 @@
name="Identity.Email" name="Identity.Email"
[(ngModel)]="cipher.identity.email" [(ngModel)]="cipher.identity.email"
appInputVerbatim appInputVerbatim
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
@@ -330,6 +386,7 @@
type="text" type="text"
name="Identity.Phone" name="Identity.Phone"
[(ngModel)]="cipher.identity.phone" [(ngModel)]="cipher.identity.phone"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
@@ -339,6 +396,7 @@
type="text" type="text"
name="Identity.Address1" name="Identity.Address1"
[(ngModel)]="cipher.identity.address1" [(ngModel)]="cipher.identity.address1"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
@@ -348,6 +406,7 @@
type="text" type="text"
name="Identity.Address2" name="Identity.Address2"
[(ngModel)]="cipher.identity.address2" [(ngModel)]="cipher.identity.address2"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
@@ -357,6 +416,7 @@
type="text" type="text"
name="Identity.Address3" name="Identity.Address3"
[(ngModel)]="cipher.identity.address3" [(ngModel)]="cipher.identity.address3"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
@@ -366,6 +426,7 @@
type="text" type="text"
name="Identity.City" name="Identity.City"
[(ngModel)]="cipher.identity.city" [(ngModel)]="cipher.identity.city"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
@@ -375,6 +436,7 @@
type="text" type="text"
name="Identity.State" name="Identity.State"
[(ngModel)]="cipher.identity.state" [(ngModel)]="cipher.identity.state"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
@@ -384,6 +446,7 @@
type="text" type="text"
name="Identity.PostalCode" name="Identity.PostalCode"
[(ngModel)]="cipher.identity.postalCode" [(ngModel)]="cipher.identity.postalCode"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
@@ -393,6 +456,7 @@
type="text" type="text"
name="Identity.Country" name="Identity.Country"
[(ngModel)]="cipher.identity.country" [(ngModel)]="cipher.identity.country"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
</div> </div>
@@ -484,6 +548,7 @@
appStopClick appStopClick
(click)="addUri()" (click)="addUri()"
class="box-content-row box-content-row-newmulti" class="box-content-row box-content-row-newmulti"
*ngIf="!(!cipher.edit && editMode)"
> >
<i class="bwi bwi-plus-circle bwi-fw bwi-lg" aria-hidden="true"></i> {{ "newUri" | i18n }} <i class="bwi bwi-plus-circle bwi-fw bwi-lg" aria-hidden="true"></i> {{ "newUri" | i18n }}
</button> </button>
@@ -535,6 +600,7 @@
name="PasswordPrompt" name="PasswordPrompt"
[ngModel]="reprompt" [ngModel]="reprompt"
(change)="repromptChanged()" (change)="repromptChanged()"
[disabled]="!cipher.edit && editMode"
/> />
</div> </div>
<button <button
@@ -574,11 +640,18 @@
</h2> </h2>
<div class="box-content"> <div class="box-content">
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
<textarea id="notes" name="Notes" rows="6" [(ngModel)]="cipher.notes"></textarea> <textarea
id="notes"
name="Notes"
rows="6"
[(ngModel)]="cipher.notes"
[readonly]="!cipher.edit && editMode"
></textarea>
</div> </div>
</div> </div>
</div> </div>
<app-vault-add-edit-custom-fields <app-vault-add-edit-custom-fields
*ngIf="!(!cipher.hasFields && !cipher.edit && editMode)"
[cipher]="cipher" [cipher]="cipher"
[thisCipherType]="cipher.type" [thisCipherType]="cipher.type"
[editMode]="editMode" [editMode]="editMode"
@@ -628,7 +701,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="box list" *ngIf="editMode && !cloneMode"> <div class="box list" *ngIf="editMode && !cloneMode && !(!cipher.edit && editMode)">
<div class="box-content single-line"> <div class="box-content single-line">
<button <button
type="button" type="button"

View File

@@ -620,7 +620,13 @@
<span>{{ "restoreItem" | i18n }}</span> <span>{{ "restoreItem" | i18n }}</span>
</div> </div>
</button> </button>
<button type="button" class="box-content-row" appStopClick (click)="delete()"> <button
type="button"
class="box-content-row"
appStopClick
(click)="delete()"
*ngIf="cipher.edit"
>
<div class="row-main text-danger"> <div class="row-main text-danger">
<div class="icon text-danger" aria-hidden="true"> <div class="icon text-danger" aria-hidden="true">
<i class="bwi bwi-trash bwi-lg bwi-fw"></i> <i class="bwi bwi-trash bwi-lg bwi-fw"></i>

View File

@@ -218,7 +218,7 @@ export class ViewComponent extends BaseViewComponent {
try { try {
const cipher: Cipher = await this.cipherService.encrypt(this.cipher); const cipher: Cipher = await this.cipherService.encrypt(this.cipher);
await this.cipherService.saveWithServer(cipher); await this.cipherService.updateWithServer(cipher);
this.platformUtilsService.showToast( this.platformUtilsService.showToast(
"success", "success",
null, null,

View File

@@ -77,7 +77,7 @@ export class CreateCommand {
private async createCipher(req: CipherExport) { private async createCipher(req: CipherExport) {
const cipher = await this.cipherService.encrypt(CipherExport.toView(req)); const cipher = await this.cipherService.encrypt(CipherExport.toView(req));
try { try {
await this.cipherService.saveWithServer(cipher); await this.cipherService.createWithServer(cipher);
const newCipher = await this.cipherService.get(cipher.id); const newCipher = await this.cipherService.get(cipher.id);
const decCipher = await newCipher.decrypt(); const decCipher = await newCipher.decrypt();
const res = new CipherResponse(decCipher); const res = new CipherResponse(decCipher);

View File

@@ -84,7 +84,7 @@ export class EditCommand {
cipherView = CipherExport.toView(req, cipherView); cipherView = CipherExport.toView(req, cipherView);
const encCipher = await this.cipherService.encrypt(cipherView); const encCipher = await this.cipherService.encrypt(cipherView);
try { try {
await this.cipherService.saveWithServer(encCipher); await this.cipherService.updateWithServer(encCipher);
const updatedCipher = await this.cipherService.get(cipher.id); const updatedCipher = await this.cipherService.get(cipher.id);
const decCipher = await updatedCipher.decrypt(); const decCipher = await updatedCipher.decrypt();
const res = new CipherResponse(decCipher); const res = new CipherResponse(decCipher);

View File

@@ -17,6 +17,7 @@
appStopClick appStopClick
(click)="removeField(f)" (click)="removeField(f)"
appA11yTitle="{{ 'remove' | i18n }}" appA11yTitle="{{ 'remove' | i18n }}"
*ngIf="!(!cipher.edit && editMode)"
> >
<i class="bwi bwi-minus-circle bwi-lg" aria-hidden="true"></i> <i class="bwi bwi-minus-circle bwi-lg" aria-hidden="true"></i>
</button> </button>
@@ -31,6 +32,7 @@
class="row-label" class="row-label"
placeholder="{{ 'name' | i18n }}" placeholder="{{ 'name' | i18n }}"
appInputVerbatim appInputVerbatim
[readonly]="!cipher.edit && editMode"
/> />
<!-- Text --> <!-- Text -->
<input <input
@@ -42,6 +44,7 @@
placeholder="{{ 'value' | i18n }}" placeholder="{{ 'value' | i18n }}"
appInputVerbatim appInputVerbatim
attr.aria-describedby="fieldName{{ i }}" attr.aria-describedby="fieldName{{ i }}"
[readonly]="!cipher.edit && editMode"
/> />
<!-- Password --> <!-- Password -->
<input <input
@@ -55,6 +58,7 @@
[disabled]="!cipher.viewPassword && !f.newField" [disabled]="!cipher.viewPassword && !f.newField"
appInputVerbatim appInputVerbatim
attr.aria-describedby="fieldName{{ i }}" attr.aria-describedby="fieldName{{ i }}"
[readonly]="!cipher.edit && editMode"
/> />
<!-- Linked --> <!-- Linked -->
<select <select
@@ -78,6 +82,7 @@
trueValue="true" trueValue="true"
falseValue="false" falseValue="false"
attr.aria-describedby="fieldName{{ i }}" attr.aria-describedby="fieldName{{ i }}"
[readonly]="!cipher.edit && editMode"
/> />
<div <div
class="action-buttons" class="action-buttons"
@@ -99,13 +104,18 @@
></i> ></i>
</button> </button>
</div> </div>
<div class="drag-handle" appA11yTitle="{{ 'dragToSort' | i18n }}" cdkDragHandle> <div
class="drag-handle"
appA11yTitle="{{ 'dragToSort' | i18n }}"
*ngIf="!(!cipher.edit && editMode)"
cdkDragHandle
>
<i class="bwi bwi-hamburger" aria-hidden="true"></i> <i class="bwi bwi-hamburger" aria-hidden="true"></i>
</div> </div>
</div> </div>
</div> </div>
<!-- Add new custom field --> <!-- Add new custom field -->
<div class="box-content-row" appBoxRow> <div class="box-content-row" *ngIf="!(!cipher.edit && editMode)" appBoxRow>
<button type="button" appStopClick (click)="addField()"> <button type="button" appStopClick (click)="addField()">
<i class="bwi bwi-plus-circle bwi-fw bwi-lg" aria-hidden="true"></i> <i class="bwi bwi-plus-circle bwi-fw bwi-lg" aria-hidden="true"></i>
{{ "newCustomField" | i18n }} {{ "newCustomField" | i18n }}

View File

@@ -23,6 +23,7 @@
name="Name" name="Name"
[(ngModel)]="cipher.name" [(ngModel)]="cipher.name"
[appAutofocus]="!editMode" [appAutofocus]="!editMode"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<!-- Login --> <!-- Login -->
@@ -36,6 +37,7 @@
name="Login.Username" name="Login.Username"
[(ngModel)]="cipher.login.username" [(ngModel)]="cipher.login.username"
appInputVerbatim appInputVerbatim
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="action-buttons"> <div class="action-buttons">
@@ -45,6 +47,7 @@
appStopClick appStopClick
appA11yTitle="{{ 'generateUsername' | i18n }}" appA11yTitle="{{ 'generateUsername' | i18n }}"
(click)="generateUsername()" (click)="generateUsername()"
*ngIf="!(!cipher.edit && editMode)"
> >
<i class="bwi bwi-lg bwi-generate" aria-hidden="true"></i> <i class="bwi bwi-lg bwi-generate" aria-hidden="true"></i>
</button> </button>
@@ -60,6 +63,7 @@
name="Login.Password" name="Login.Password"
[(ngModel)]="cipher.login.password" [(ngModel)]="cipher.login.password"
[disabled]="!cipher.viewPassword" [disabled]="!cipher.viewPassword"
[readonly]="!cipher.edit && editMode"
appInputVerbatim appInputVerbatim
/> />
</div> </div>
@@ -104,6 +108,7 @@
appStopClick appStopClick
appA11yTitle="{{ 'generatePassword' | i18n }}" appA11yTitle="{{ 'generatePassword' | i18n }}"
(click)="generatePassword()" (click)="generatePassword()"
*ngIf="!(!cipher.edit && editMode)"
> >
<i class="bwi bwi-lg bwi-generate" aria-hidden="true"></i> <i class="bwi bwi-lg bwi-generate" aria-hidden="true"></i>
</button> </button>
@@ -118,6 +123,7 @@
class="monospaced" class="monospaced"
[(ngModel)]="cipher.login.totp" [(ngModel)]="cipher.login.totp"
[disabled]="!cipher.viewPassword" [disabled]="!cipher.viewPassword"
[readonly]="!cipher.edit && editMode"
appInputVerbatim appInputVerbatim
/> />
</div> </div>
@@ -131,6 +137,7 @@
type="text" type="text"
name="Card.CardCardholderName" name="Card.CardCardholderName"
[(ngModel)]="cipher.card.cardholderName" [(ngModel)]="cipher.card.cardholderName"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row box-content-row-flex" appBoxRow> <div class="box-content-row box-content-row-flex" appBoxRow>
@@ -143,6 +150,7 @@
name="Card.Number" name="Card.Number"
[(ngModel)]="cipher.card.number" [(ngModel)]="cipher.card.number"
appInputVerbatim appInputVerbatim
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="action-buttons"> <div class="action-buttons">
@@ -164,17 +172,41 @@
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
<label for="cardBrand">{{ "brand" | i18n }}</label> <label for="cardBrand">{{ "brand" | i18n }}</label>
<select id="cardBrand" name="Card.Brand" [(ngModel)]="cipher.card.brand"> <span *ngIf="!(!cipher.edit && editMode); else readonlyCardBrand">
<option *ngFor="let o of cardBrandOptions" [ngValue]="o.value">{{ o.name }}</option> <select id="cardBrand" name="Card.Brand" [(ngModel)]="cipher.card.brand">
</select> <option *ngFor="let o of cardBrandOptions" [ngValue]="o.value">
{{ o.name }}
</option>
</select>
</span>
<ng-template #readonlyCardBrand>
<input
id="cardBrand"
name="Card.Brand"
type="text"
[readonly]="true"
[value]="cipher.card.brand"
/>
</ng-template>
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
<label for="cardExpMonth">{{ "expirationMonth" | i18n }}</label> <label for="cardExpMonth">{{ "expirationMonth" | i18n }}</label>
<select id="cardExpMonth" name="Card.ExpMonth" [(ngModel)]="cipher.card.expMonth"> <span *ngIf="!(!cipher.edit && editMode); else readonlyCardExpMonth">
<option *ngFor="let o of cardExpMonthOptions" [ngValue]="o.value"> <select id="cardExpMonth" name="Card.ExpMonth" [(ngModel)]="cipher.card.expMonth">
{{ o.name }} <option *ngFor="let o of cardExpMonthOptions" [ngValue]="o.value">
</option> {{ o.name }}
</select> </option>
</select>
</span>
<ng-template #readonlyCardExpMonth>
<input
id="cardExpMonth"
type="text"
name="Card.ExpMonth"
[readonly]="true"
[value]="getCardExpMonthDisplay()"
/>
</ng-template>
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
<label for="cardExpYear">{{ "expirationYear" | i18n }}</label> <label for="cardExpYear">{{ "expirationYear" | i18n }}</label>
@@ -184,6 +216,7 @@
name="Card.ExpYear" name="Card.ExpYear"
[(ngModel)]="cipher.card.expYear" [(ngModel)]="cipher.card.expYear"
placeholder="{{ 'ex' | i18n }} {{ currentDate | date: 'yyyy' }}" placeholder="{{ 'ex' | i18n }} {{ currentDate | date: 'yyyy' }}"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row box-content-row-flex" appBoxRow> <div class="box-content-row box-content-row-flex" appBoxRow>
@@ -196,6 +229,7 @@
name="Card.Code" name="Card.Code"
[(ngModel)]="cipher.card.code" [(ngModel)]="cipher.card.code"
appInputVerbatim appInputVerbatim
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="action-buttons"> <div class="action-buttons">
@@ -220,11 +254,22 @@
<div *ngIf="cipher.type === cipherType.Identity"> <div *ngIf="cipher.type === cipherType.Identity">
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
<label for="idTitle">{{ "title" | i18n }}</label> <label for="idTitle">{{ "title" | i18n }}</label>
<select id="idTitle" name="Identity.Title" [(ngModel)]="cipher.identity.title"> <span *ngIf="!(!cipher.edit && editMode); else readonlyIdTitle">
<option *ngFor="let o of identityTitleOptions" [ngValue]="o.value"> <select id="idTitle" name="Identity.Title" [(ngModel)]="cipher.identity.title">
{{ o.name }} <option *ngFor="let o of identityTitleOptions" [ngValue]="o.value">
</option> {{ o.name }}
</select> </option>
</select>
</span>
<ng-template #readonlyIdTitle>
<input
id="idTitle"
name="Identity.Title"
type="text"
[readonly]="true"
[value]="cipher.identity.title"
/>
</ng-template>
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
<label for="idFirstName">{{ "firstName" | i18n }}</label> <label for="idFirstName">{{ "firstName" | i18n }}</label>
@@ -233,6 +278,7 @@
type="text" type="text"
name="Identity.FirstName" name="Identity.FirstName"
[(ngModel)]="cipher.identity.firstName" [(ngModel)]="cipher.identity.firstName"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
@@ -242,6 +288,7 @@
type="text" type="text"
name="Identity.MiddleName" name="Identity.MiddleName"
[(ngModel)]="cipher.identity.middleName" [(ngModel)]="cipher.identity.middleName"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
@@ -251,6 +298,7 @@
type="text" type="text"
name="Identity.LastName" name="Identity.LastName"
[(ngModel)]="cipher.identity.lastName" [(ngModel)]="cipher.identity.lastName"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
@@ -261,6 +309,7 @@
name="Identity.Username" name="Identity.Username"
[(ngModel)]="cipher.identity.username" [(ngModel)]="cipher.identity.username"
appInputVerbatim appInputVerbatim
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
@@ -270,6 +319,7 @@
type="text" type="text"
name="Identity.Company" name="Identity.Company"
[(ngModel)]="cipher.identity.company" [(ngModel)]="cipher.identity.company"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
@@ -280,6 +330,7 @@
name="Identity.SSN" name="Identity.SSN"
[(ngModel)]="cipher.identity.ssn" [(ngModel)]="cipher.identity.ssn"
appInputVerbatim appInputVerbatim
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
@@ -290,6 +341,7 @@
name="Identity.PassportNumber" name="Identity.PassportNumber"
[(ngModel)]="cipher.identity.passportNumber" [(ngModel)]="cipher.identity.passportNumber"
appInputVerbatim appInputVerbatim
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
@@ -300,6 +352,7 @@
name="Identity.LicenseNumber" name="Identity.LicenseNumber"
[(ngModel)]="cipher.identity.licenseNumber" [(ngModel)]="cipher.identity.licenseNumber"
appInputVerbatim appInputVerbatim
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
@@ -310,6 +363,7 @@
name="Identity.Email" name="Identity.Email"
[(ngModel)]="cipher.identity.email" [(ngModel)]="cipher.identity.email"
appInputVerbatim appInputVerbatim
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
@@ -319,6 +373,7 @@
type="text" type="text"
name="Identity.Phone" name="Identity.Phone"
[(ngModel)]="cipher.identity.phone" [(ngModel)]="cipher.identity.phone"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
@@ -328,6 +383,7 @@
type="text" type="text"
name="Identity.Address1" name="Identity.Address1"
[(ngModel)]="cipher.identity.address1" [(ngModel)]="cipher.identity.address1"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
@@ -337,6 +393,7 @@
type="text" type="text"
name="Identity.Address2" name="Identity.Address2"
[(ngModel)]="cipher.identity.address2" [(ngModel)]="cipher.identity.address2"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
@@ -346,6 +403,7 @@
type="text" type="text"
name="Identity.Address3" name="Identity.Address3"
[(ngModel)]="cipher.identity.address3" [(ngModel)]="cipher.identity.address3"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
@@ -355,6 +413,7 @@
type="text" type="text"
name="Identity.City" name="Identity.City"
[(ngModel)]="cipher.identity.city" [(ngModel)]="cipher.identity.city"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
@@ -364,6 +423,7 @@
type="text" type="text"
name="Identity.State" name="Identity.State"
[(ngModel)]="cipher.identity.state" [(ngModel)]="cipher.identity.state"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
@@ -373,6 +433,7 @@
type="text" type="text"
name="Identity.PostalCode" name="Identity.PostalCode"
[(ngModel)]="cipher.identity.postalCode" [(ngModel)]="cipher.identity.postalCode"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
@@ -382,6 +443,7 @@
type="text" type="text"
name="Identity.Country" name="Identity.Country"
[(ngModel)]="cipher.identity.country" [(ngModel)]="cipher.identity.country"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
</div> </div>
@@ -402,6 +464,7 @@
appStopClick appStopClick
(click)="removeUri(u)" (click)="removeUri(u)"
appA11yTitle="{{ 'remove' | i18n }}" appA11yTitle="{{ 'remove' | i18n }}"
[disabled]="!cipher.edit && editMode"
> >
<i class="bwi bwi-minus-circle bwi-lg" aria-hidden="true"></i> <i class="bwi bwi-minus-circle bwi-lg" aria-hidden="true"></i>
</button> </button>
@@ -446,7 +509,13 @@
</div> </div>
</div> </div>
</ng-container> </ng-container>
<button type="button" appStopClick (click)="addUri()" class="box-content-row"> <button
type="button"
appStopClick
(click)="addUri()"
class="box-content-row"
*ngIf="!(!cipher.edit && editMode)"
>
<i class="bwi bwi-plus-circle bwi-fw bwi-lg" aria-hidden="true"></i> <i class="bwi bwi-plus-circle bwi-fw bwi-lg" aria-hidden="true"></i>
{{ "newUri" | i18n }} {{ "newUri" | i18n }}
</button> </button>
@@ -481,6 +550,7 @@
name="PasswordPrompt" name="PasswordPrompt"
[ngModel]="reprompt" [ngModel]="reprompt"
(change)="repromptChanged()" (change)="repromptChanged()"
[disabled]="!cipher.edit && editMode"
/> />
</div> </div>
<button <button
@@ -511,11 +581,18 @@
</h2> </h2>
<div class="box-content"> <div class="box-content">
<div class="box-content-row" appBoxRow> <div class="box-content-row" appBoxRow>
<textarea id="notes" name="Notes" rows="6" [(ngModel)]="cipher.notes"></textarea> <textarea
id="notes"
name="Notes"
rows="6"
[(ngModel)]="cipher.notes"
[readonly]="!cipher.edit && editMode"
></textarea>
</div> </div>
</div> </div>
</div> </div>
<app-vault-add-edit-custom-fields <app-vault-add-edit-custom-fields
*ngIf="!(!cipher.hasFields && !cipher.edit && editMode)"
[cipher]="cipher" [cipher]="cipher"
[thisCipherType]="cipher.type" [thisCipherType]="cipher.type"
[editMode]="editMode" [editMode]="editMode"

View File

@@ -537,7 +537,7 @@
> >
<i class="bwi bwi-files bwi-fw bwi-lg" aria-hidden="true"></i> <i class="bwi bwi-files bwi-fw bwi-lg" aria-hidden="true"></i>
</button> </button>
<div class="right"> <div class="right" *ngIf="cipher.edit">
<button <button
type="button" type="button"
(click)="delete()" (click)="delete()"

View File

@@ -159,7 +159,7 @@ export class EncryptedMessageHandlerService {
try { try {
const encrypted = await this.cipherService.encrypt(cipherView); const encrypted = await this.cipherService.encrypt(cipherView);
await this.cipherService.saveWithServer(encrypted); await this.cipherService.createWithServer(encrypted);
// Notify other clients of new login // Notify other clients of new login
await this.messagingService.send("addedCipher"); await this.messagingService.send("addedCipher");
@@ -198,7 +198,7 @@ export class EncryptedMessageHandlerService {
cipherView.login.uris[0].uri = credentialUpdatePayload.uri; cipherView.login.uris[0].uri = credentialUpdatePayload.uri;
const encrypted = await this.cipherService.encrypt(cipherView); const encrypted = await this.cipherService.encrypt(cipherView);
await this.cipherService.saveWithServer(encrypted); await this.cipherService.updateWithServer(encrypted);
// Notify other clients of update // Notify other clients of update
await this.messagingService.send("editedCipher"); await this.messagingService.send("editedCipher");

View File

@@ -29,6 +29,7 @@
class="form-control" class="form-control"
appInputVerbatim appInputVerbatim
[disabled]="cipher.isDeleted || viewOnly" [disabled]="cipher.isDeleted || viewOnly"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="col-7 form-group"> <div class="col-7 form-group">
@@ -44,6 +45,7 @@
[(ngModel)]="f.value" [(ngModel)]="f.value"
appInputVerbatim appInputVerbatim
[disabled]="cipher.isDeleted || viewOnly" [disabled]="cipher.isDeleted || viewOnly"
[readonly]="!cipher.edit && editMode"
attr.aria-describedby="fieldName{{ i }}" attr.aria-describedby="fieldName{{ i }}"
/> />
<div class="input-group-append"> <div class="input-group-append">
@@ -68,6 +70,7 @@
appInputVerbatim appInputVerbatim
autocomplete="new-password" autocomplete="new-password"
[disabled]="cipher.isDeleted || viewOnly || (!cipher.viewPassword && !f.newField)" [disabled]="cipher.isDeleted || viewOnly || (!cipher.viewPassword && !f.newField)"
[readonly]="!cipher.edit && editMode"
attr.aria-describedby="fieldName{{ i }}" attr.aria-describedby="fieldName{{ i }}"
/> />
<div class="input-group-append"> <div class="input-group-append">
@@ -130,7 +133,7 @@
class="btn btn-link text-danger ml-2" class="btn btn-link text-danger ml-2"
(click)="removeField(f)" (click)="removeField(f)"
appA11yTitle="{{ 'remove' | i18n }}" appA11yTitle="{{ 'remove' | i18n }}"
*ngIf="!cipher.isDeleted && !viewOnly" *ngIf="!cipher.isDeleted && !viewOnly && !(!cipher.edit && editMode)"
> >
<i class="bwi bwi-minus-circle bwi-lg" aria-hidden="true"></i> <i class="bwi bwi-minus-circle bwi-lg" aria-hidden="true"></i>
</button> </button>
@@ -138,7 +141,7 @@
type="button" type="button"
class="btn btn-link text-muted cursor-move" class="btn btn-link text-muted cursor-move"
appA11yTitle="{{ 'dragToSort' | i18n }}" appA11yTitle="{{ 'dragToSort' | i18n }}"
*ngIf="!cipher.isDeleted && !viewOnly" *ngIf="!cipher.isDeleted && !viewOnly && !(!cipher.edit && editMode)"
> >
<i class="bwi bwi-hamburger bwi-lg" aria-hidden="true"></i> <i class="bwi bwi-hamburger bwi-lg" aria-hidden="true"></i>
</button> </button>
@@ -152,11 +155,11 @@
appStopClick appStopClick
(click)="addField()" (click)="addField()"
class="d-inline-block mb-2" class="d-inline-block mb-2"
*ngIf="!cipher.isDeleted && !viewOnly" *ngIf="!cipher.isDeleted && !viewOnly && !(!cipher.edit && editMode)"
> >
<i class="bwi bwi-plus-circle bwi-fw" aria-hidden="true"></i> {{ "newCustomField" | i18n }} <i class="bwi bwi-plus-circle bwi-fw" aria-hidden="true"></i> {{ "newCustomField" | i18n }}
</a> </a>
<div class="row" *ngIf="!cipher.isDeleted && !viewOnly"> <div class="row" *ngIf="!cipher.isDeleted && !viewOnly && !(!cipher.edit && editMode)">
<div class="col-5"> <div class="col-5">
<label for="addFieldType" class="sr-only">{{ "type" | i18n }}</label> <label for="addFieldType" class="sr-only">{{ "type" | i18n }}</label>
<select id="addFieldType" class="form-control" name="AddFieldType" [(ngModel)]="addFieldType"> <select id="addFieldType" class="form-control" name="AddFieldType" [(ngModel)]="addFieldType">

View File

@@ -49,6 +49,7 @@
[(ngModel)]="cipher.name" [(ngModel)]="cipher.name"
required required
[disabled]="cipher.isDeleted || viewOnly" [disabled]="cipher.isDeleted || viewOnly"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="col-6 form-group" *ngIf="!organization"> <div class="col-6 form-group" *ngIf="!organization">
@@ -78,6 +79,7 @@
[(ngModel)]="cipher.login.username" [(ngModel)]="cipher.login.username"
appInputVerbatim appInputVerbatim
[disabled]="cipher.isDeleted || viewOnly" [disabled]="cipher.isDeleted || viewOnly"
[readonly]="!cipher.edit && editMode"
/> />
<div class="input-group-append" *ngIf="!cipher.isDeleted"> <div class="input-group-append" *ngIf="!cipher.isDeleted">
<button <button
@@ -101,7 +103,7 @@
appStopClick appStopClick
appA11yTitle="{{ 'generatePassword' | i18n }}" appA11yTitle="{{ 'generatePassword' | i18n }}"
(click)="generatePassword()" (click)="generatePassword()"
*ngIf="cipher.viewPassword" *ngIf="cipher.viewPassword && !(!cipher.edit && editMode)"
> >
<i class="bwi bwi-lg bwi-fw bwi-generate" aria-hidden="true"></i> <i class="bwi bwi-lg bwi-fw bwi-generate" aria-hidden="true"></i>
</a> </a>
@@ -138,6 +140,7 @@
appInputVerbatim appInputVerbatim
autocomplete="new-password" autocomplete="new-password"
[disabled]="cipher.isDeleted || !cipher.viewPassword || viewOnly" [disabled]="cipher.isDeleted || !cipher.viewPassword || viewOnly"
[readonly]="!cipher.edit && editMode"
/> />
<div class="input-group-append"> <div class="input-group-append">
<button <button
@@ -177,6 +180,7 @@
[(ngModel)]="cipher.login.totp" [(ngModel)]="cipher.login.totp"
appInputVerbatim appInputVerbatim
[disabled]="cipher.isDeleted || !cipher.viewPassword || viewOnly" [disabled]="cipher.isDeleted || !cipher.viewPassword || viewOnly"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="tw-mb-4 tw-ml-4 tw-flex tw-w-1/2 tw-items-end" [ngClass]="{ low: totpLow }"> <div class="tw-mb-4 tw-ml-4 tw-flex tw-w-1/2 tw-items-end" [ngClass]="{ low: totpLow }">
@@ -358,7 +362,7 @@
appStopClick appStopClick
(click)="addUri()" (click)="addUri()"
class="d-inline-block mb-3" class="d-inline-block mb-3"
*ngIf="!cipher.isDeleted && !viewOnly" *ngIf="!cipher.isDeleted && !viewOnly && !(!cipher.edit && editMode)"
> >
<i class="bwi bwi-plus-circle bwi-fw" aria-hidden="true"></i> {{ "newUri" | i18n }} <i class="bwi bwi-plus-circle bwi-fw" aria-hidden="true"></i> {{ "newUri" | i18n }}
</a> </a>
@@ -375,19 +379,34 @@
name="Card.CardCardholderName" name="Card.CardCardholderName"
[(ngModel)]="cipher.card.cardholderName" [(ngModel)]="cipher.card.cardholderName"
[disabled]="cipher.isDeleted || viewOnly" [disabled]="cipher.isDeleted || viewOnly"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="col-6 form-group"> <div class="col-6 form-group">
<label for="cardBrand">{{ "brand" | i18n }}</label> <label for="cardBrand">{{ "brand" | i18n }}</label>
<select <span *ngIf="!(!cipher.edit && editMode); else readonlyCardBrand">
id="cardBrand" <select
class="form-control" id="cardBrand"
name="Card.Brand" class="form-control"
[(ngModel)]="cipher.card.brand" name="Card.Brand"
[disabled]="cipher.isDeleted || viewOnly" [(ngModel)]="cipher.card.brand"
> [disabled]="cipher.isDeleted || viewOnly"
<option *ngFor="let o of cardBrandOptions" [ngValue]="o.value">{{ o.name }}</option> >
</select> <option *ngFor="let o of cardBrandOptions" [ngValue]="o.value">
{{ o.name }}
</option>
</select>
</span>
<ng-template #readonlyCardBrand>
<input
id="cardBrand"
class="form-control"
name="Card.Brand"
type="text"
[readonly]="true"
[value]="cipher.card.brand"
/>
</ng-template>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@@ -403,6 +422,7 @@
appInputVerbatim appInputVerbatim
autocomplete="new-password" autocomplete="new-password"
[disabled]="cipher.isDeleted || viewOnly" [disabled]="cipher.isDeleted || viewOnly"
[readonly]="!cipher.edit && editMode"
/> />
<div class="input-group-append"> <div class="input-group-append">
<button <button
@@ -433,17 +453,29 @@
</div> </div>
<div class="col form-group"> <div class="col form-group">
<label for="cardExpMonth">{{ "expirationMonth" | i18n }}</label> <label for="cardExpMonth">{{ "expirationMonth" | i18n }}</label>
<select <span *ngIf="!(!cipher.edit && editMode); else readonlyCardExpMonth">
id="cardExpMonth" <select
class="form-control" id="cardExpMonth"
name="Card.ExpMonth" class="form-control"
[(ngModel)]="cipher.card.expMonth" name="Card.ExpMonth"
[disabled]="cipher.isDeleted || viewOnly" [(ngModel)]="cipher.card.expMonth"
> [disabled]="cipher.isDeleted || viewOnly"
<option *ngFor="let o of cardExpMonthOptions" [ngValue]="o.value"> >
{{ o.name }} <option *ngFor="let o of cardExpMonthOptions" [ngValue]="o.value">
</option> {{ o.name }}
</select> </option>
</select>
</span>
<ng-template #readonlyCardExpMonth>
<input
id="cardExpMonth"
class="form-control"
type="text"
name="Card.ExpMonth"
[readonly]="true"
[value]="getCardExpMonthDisplay()"
/>
</ng-template>
</div> </div>
<div class="col form-group"> <div class="col form-group">
<label for="cardExpYear">{{ "expirationYear" | i18n }}</label> <label for="cardExpYear">{{ "expirationYear" | i18n }}</label>
@@ -455,6 +487,7 @@
[(ngModel)]="cipher.card.expYear" [(ngModel)]="cipher.card.expYear"
placeholder="{{ 'ex' | i18n }} 2019" placeholder="{{ 'ex' | i18n }} 2019"
[disabled]="cipher.isDeleted || viewOnly" [disabled]="cipher.isDeleted || viewOnly"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
</div> </div>
@@ -471,6 +504,7 @@
appInputVerbatim appInputVerbatim
autocomplete="new-password" autocomplete="new-password"
[disabled]="cipher.isDeleted || viewOnly" [disabled]="cipher.isDeleted || viewOnly"
[readonly]="!cipher.edit && editMode"
/> />
<div class="input-group-append"> <div class="input-group-append">
<button <button
@@ -503,17 +537,29 @@
<div class="row"> <div class="row">
<div class="col-4 form-group"> <div class="col-4 form-group">
<label for="idTitle">{{ "title" | i18n }}</label> <label for="idTitle">{{ "title" | i18n }}</label>
<select <span *ngIf="!(!cipher.edit && editMode); else readonlyIdTitle">
id="idTitle" <select
class="form-control" id="idTitle"
name="Identity.Title" class="form-control"
[(ngModel)]="cipher.identity.title" name="Identity.Title"
[disabled]="cipher.isDeleted || viewOnly" [(ngModel)]="cipher.identity.title"
> [disabled]="cipher.isDeleted || viewOnly"
<option *ngFor="let o of identityTitleOptions" [ngValue]="o.value"> >
{{ o.name }} <option *ngFor="let o of identityTitleOptions" [ngValue]="o.value">
</option> {{ o.name }}
</select> </option>
</select>
</span>
<ng-template #readonlyIdTitle>
<input
id="idTitle"
class="form-control"
name="Identity.Title"
type="text"
[readonly]="true"
[value]="cipher.identity.title"
/>
</ng-template>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@@ -526,6 +572,7 @@
name="Identity.FirstName" name="Identity.FirstName"
[(ngModel)]="cipher.identity.firstName" [(ngModel)]="cipher.identity.firstName"
[disabled]="cipher.isDeleted || viewOnly" [disabled]="cipher.isDeleted || viewOnly"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="col-4 form-group"> <div class="col-4 form-group">
@@ -537,6 +584,7 @@
name="Identity.MiddleName" name="Identity.MiddleName"
[(ngModel)]="cipher.identity.middleName" [(ngModel)]="cipher.identity.middleName"
[disabled]="cipher.isDeleted || viewOnly" [disabled]="cipher.isDeleted || viewOnly"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="col-4 form-group"> <div class="col-4 form-group">
@@ -548,6 +596,7 @@
name="Identity.LastName" name="Identity.LastName"
[(ngModel)]="cipher.identity.lastName" [(ngModel)]="cipher.identity.lastName"
[disabled]="cipher.isDeleted || viewOnly" [disabled]="cipher.isDeleted || viewOnly"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
</div> </div>
@@ -562,6 +611,7 @@
[(ngModel)]="cipher.identity.username" [(ngModel)]="cipher.identity.username"
appInputVerbatim appInputVerbatim
[disabled]="cipher.isDeleted || viewOnly" [disabled]="cipher.isDeleted || viewOnly"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="col-4 form-group"> <div class="col-4 form-group">
@@ -573,6 +623,7 @@
name="Identity.Company" name="Identity.Company"
[(ngModel)]="cipher.identity.company" [(ngModel)]="cipher.identity.company"
[disabled]="cipher.isDeleted || viewOnly" [disabled]="cipher.isDeleted || viewOnly"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
</div> </div>
@@ -587,6 +638,7 @@
[(ngModel)]="cipher.identity.ssn" [(ngModel)]="cipher.identity.ssn"
appInputVerbatim appInputVerbatim
[disabled]="cipher.isDeleted || viewOnly" [disabled]="cipher.isDeleted || viewOnly"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="col-4 form-group"> <div class="col-4 form-group">
@@ -599,6 +651,7 @@
[(ngModel)]="cipher.identity.passportNumber" [(ngModel)]="cipher.identity.passportNumber"
appInputVerbatim appInputVerbatim
[disabled]="cipher.isDeleted || viewOnly" [disabled]="cipher.isDeleted || viewOnly"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="col-4 form-group"> <div class="col-4 form-group">
@@ -611,6 +664,7 @@
[(ngModel)]="cipher.identity.licenseNumber" [(ngModel)]="cipher.identity.licenseNumber"
appInputVerbatim appInputVerbatim
[disabled]="cipher.isDeleted || viewOnly" [disabled]="cipher.isDeleted || viewOnly"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
</div> </div>
@@ -626,6 +680,7 @@
[(ngModel)]="cipher.identity.email" [(ngModel)]="cipher.identity.email"
appInputVerbatim appInputVerbatim
[disabled]="cipher.isDeleted || viewOnly" [disabled]="cipher.isDeleted || viewOnly"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="col-6 form-group"> <div class="col-6 form-group">
@@ -638,6 +693,7 @@
name="Identity.Phone" name="Identity.Phone"
[(ngModel)]="cipher.identity.phone" [(ngModel)]="cipher.identity.phone"
[disabled]="cipher.isDeleted || viewOnly" [disabled]="cipher.isDeleted || viewOnly"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
</div> </div>
@@ -651,6 +707,7 @@
name="Identity.Address1" name="Identity.Address1"
[(ngModel)]="cipher.identity.address1" [(ngModel)]="cipher.identity.address1"
[disabled]="cipher.isDeleted || viewOnly" [disabled]="cipher.isDeleted || viewOnly"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="col-6 form-group"> <div class="col-6 form-group">
@@ -662,6 +719,7 @@
name="Identity.Address2" name="Identity.Address2"
[(ngModel)]="cipher.identity.address2" [(ngModel)]="cipher.identity.address2"
[disabled]="cipher.isDeleted || viewOnly" [disabled]="cipher.isDeleted || viewOnly"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
</div> </div>
@@ -675,6 +733,7 @@
name="Identity.Address3" name="Identity.Address3"
[(ngModel)]="cipher.identity.address3" [(ngModel)]="cipher.identity.address3"
[disabled]="cipher.isDeleted || viewOnly" [disabled]="cipher.isDeleted || viewOnly"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="col-6 form-group"> <div class="col-6 form-group">
@@ -686,6 +745,7 @@
name="Identity.City" name="Identity.City"
[(ngModel)]="cipher.identity.city" [(ngModel)]="cipher.identity.city"
[disabled]="cipher.isDeleted || viewOnly" [disabled]="cipher.isDeleted || viewOnly"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
</div> </div>
@@ -699,6 +759,7 @@
name="Identity.State" name="Identity.State"
[(ngModel)]="cipher.identity.state" [(ngModel)]="cipher.identity.state"
[disabled]="cipher.isDeleted || viewOnly" [disabled]="cipher.isDeleted || viewOnly"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
<div class="col-6 form-group"> <div class="col-6 form-group">
@@ -710,6 +771,7 @@
name="Identity.PostalCode" name="Identity.PostalCode"
[(ngModel)]="cipher.identity.postalCode" [(ngModel)]="cipher.identity.postalCode"
[disabled]="cipher.isDeleted || viewOnly" [disabled]="cipher.isDeleted || viewOnly"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
</div> </div>
@@ -723,6 +785,7 @@
name="Identity.Country" name="Identity.Country"
[(ngModel)]="cipher.identity.country" [(ngModel)]="cipher.identity.country"
[disabled]="cipher.isDeleted || viewOnly" [disabled]="cipher.isDeleted || viewOnly"
[readonly]="!cipher.edit && editMode"
/> />
</div> </div>
</div> </div>
@@ -735,14 +798,17 @@
rows="6" rows="6"
[(ngModel)]="cipher.notes" [(ngModel)]="cipher.notes"
[disabled]="cipher.isDeleted || viewOnly" [disabled]="cipher.isDeleted || viewOnly"
[readonly]="!cipher.edit && editMode"
class="form-control" class="form-control"
></textarea> ></textarea>
</div> </div>
<app-vault-add-edit-custom-fields <app-vault-add-edit-custom-fields
*ngIf="!(!cipher.hasFields && !cipher.edit && editMode)"
[cipher]="cipher" [cipher]="cipher"
[thisCipherType]="cipher.type" [thisCipherType]="cipher.type"
[viewOnly]="viewOnly" [viewOnly]="viewOnly"
[copy]="copy.bind(this)" [copy]="copy.bind(this)"
[editMode]="editMode"
></app-vault-add-edit-custom-fields> ></app-vault-add-edit-custom-fields>
<ng-container *ngIf="allowOwnershipAssignment()"> <ng-container *ngIf="allowOwnershipAssignment()">
<h3 class="mt-4">{{ "ownership" | i18n }}</h3> <h3 class="mt-4">{{ "ownership" | i18n }}</h3>
@@ -819,7 +885,7 @@
(change)="repromptChanged()" (change)="repromptChanged()"
id="passwordPrompt" id="passwordPrompt"
name="passwordPrompt" name="passwordPrompt"
[disabled]="cipher.isDeleted || viewOnly" [disabled]="cipher.isDeleted || viewOnly || (!cipher.edit && editMode)"
/> />
<label class="form-check-label" for="passwordPrompt">{{ <label class="form-check-label" for="passwordPrompt">{{
"passwordPrompt" | i18n "passwordPrompt" | i18n
@@ -868,7 +934,7 @@
(click)="delete()" (click)="delete()"
class="btn btn-outline-danger" class="btn btn-outline-danger"
appA11yTitle="{{ (cipher.isDeleted ? 'permanentlyDelete' : 'delete') | i18n }}" appA11yTitle="{{ (cipher.isDeleted ? 'permanentlyDelete' : 'delete') | i18n }}"
*ngIf="editMode && !cloneMode" *ngIf="editMode && !cloneMode && !(!cipher.edit && editMode)"
[disabled]="deleteBtn.loading" [disabled]="deleteBtn.loading"
[appApiAction]="deletePromise" [appApiAction]="deletePromise"
> >

View File

@@ -363,6 +363,10 @@ export class AddEditComponent implements OnInit, OnDestroy {
} }
} }
getCardExpMonthDisplay() {
return this.cardExpMonthOptions.find((x) => x.value == this.cipher.card.expMonth)?.name;
}
trackByFunction(index: number, item: any) { trackByFunction(index: number, item: any) {
return index; return index;
} }
@@ -580,7 +584,9 @@ export class AddEditComponent implements OnInit, OnDestroy {
} }
protected saveCipher(cipher: Cipher) { protected saveCipher(cipher: Cipher) {
return this.cipherService.saveWithServer(cipher); return this.cipher.id == null
? this.cipherService.createWithServer(cipher)
: this.cipherService.updateWithServer(cipher);
} }
protected deleteCipher() { protected deleteCipher() {

View File

@@ -8,6 +8,7 @@ import { CipherBulkRestoreRequest } from "../models/request/cipher-bulk-restore.
import { CipherBulkShareRequest } from "../models/request/cipher-bulk-share.request"; import { CipherBulkShareRequest } from "../models/request/cipher-bulk-share.request";
import { CipherCollectionsRequest } from "../models/request/cipher-collections.request"; import { CipherCollectionsRequest } from "../models/request/cipher-collections.request";
import { CipherCreateRequest } from "../models/request/cipher-create.request"; import { CipherCreateRequest } from "../models/request/cipher-create.request";
import { CipherPartialRequest } from "../models/request/cipher-partial.request";
import { CipherShareRequest } from "../models/request/cipher-share.request"; import { CipherShareRequest } from "../models/request/cipher-share.request";
import { CipherRequest } from "../models/request/cipher.request"; import { CipherRequest } from "../models/request/cipher.request";
import { CollectionRequest } from "../models/request/collection.request"; import { CollectionRequest } from "../models/request/collection.request";
@@ -257,6 +258,7 @@ export abstract class ApiService {
postCipherCreate: (request: CipherCreateRequest) => Promise<CipherResponse>; postCipherCreate: (request: CipherCreateRequest) => Promise<CipherResponse>;
postCipherAdmin: (request: CipherCreateRequest) => Promise<CipherResponse>; postCipherAdmin: (request: CipherCreateRequest) => Promise<CipherResponse>;
putCipher: (id: string, request: CipherRequest) => Promise<CipherResponse>; putCipher: (id: string, request: CipherRequest) => Promise<CipherResponse>;
putPartialCipher: (id: string, request: CipherPartialRequest) => Promise<CipherResponse>;
putCipherAdmin: (id: string, request: CipherRequest) => Promise<CipherResponse>; putCipherAdmin: (id: string, request: CipherRequest) => Promise<CipherResponse>;
deleteCipher: (id: string) => Promise<any>; deleteCipher: (id: string) => Promise<any>;
deleteCipherAdmin: (id: string) => Promise<any>; deleteCipherAdmin: (id: string) => Promise<any>;

View File

@@ -33,7 +33,8 @@ export abstract class CipherService {
updateLastUsedDate: (id: string) => Promise<void>; updateLastUsedDate: (id: string) => Promise<void>;
updateLastLaunchedDate: (id: string) => Promise<void>; updateLastLaunchedDate: (id: string) => Promise<void>;
saveNeverDomain: (domain: string) => Promise<void>; saveNeverDomain: (domain: string) => Promise<void>;
saveWithServer: (cipher: Cipher) => Promise<any>; createWithServer: (cipher: Cipher) => Promise<any>;
updateWithServer: (cipher: Cipher) => Promise<any>;
shareWithServer: ( shareWithServer: (
cipher: CipherView, cipher: CipherView,
organizationId: string, organizationId: string,

View File

@@ -0,0 +1,11 @@
import { Cipher } from "../domain/cipher";
export class CipherPartialRequest {
folderId: string;
favorite: boolean;
constructor(cipher: Cipher) {
this.folderId = cipher.folderId;
this.favorite = cipher.favorite;
}
}

View File

@@ -14,6 +14,7 @@ import { CipherBulkMoveRequest } from "../models/request/cipher-bulk-move.reques
import { CipherBulkShareRequest } from "../models/request/cipher-bulk-share.request"; import { CipherBulkShareRequest } from "../models/request/cipher-bulk-share.request";
import { CipherCollectionsRequest } from "../models/request/cipher-collections.request"; import { CipherCollectionsRequest } from "../models/request/cipher-collections.request";
import { CipherCreateRequest } from "../models/request/cipher-create.request"; import { CipherCreateRequest } from "../models/request/cipher-create.request";
import { CipherPartialRequest } from "../models/request/cipher-partial.request";
import { CipherShareRequest } from "../models/request/cipher-share.request"; import { CipherShareRequest } from "../models/request/cipher-share.request";
import { CipherRequest } from "../models/request/cipher.request"; import { CipherRequest } from "../models/request/cipher.request";
import { CollectionRequest } from "../models/request/collection.request"; import { CollectionRequest } from "../models/request/collection.request";
@@ -609,6 +610,11 @@ export class ApiService implements ApiServiceAbstraction {
return new CipherResponse(r); return new CipherResponse(r);
} }
async putPartialCipher(id: string, request: CipherPartialRequest): Promise<CipherResponse> {
const r = await this.send("PUT", "/ciphers/" + id + "/partial", request, true, true);
return new CipherResponse(r);
}
async putCipherAdmin(id: string, request: CipherRequest): Promise<CipherResponse> { async putCipherAdmin(id: string, request: CipherRequest): Promise<CipherResponse> {
const r = await this.send("PUT", "/ciphers/" + id + "/admin", request, true, true); const r = await this.send("PUT", "/ciphers/" + id + "/admin", request, true, true);
return new CipherResponse(r); return new CipherResponse(r);

View File

@@ -37,6 +37,7 @@ import { CipherBulkRestoreRequest } from "../models/request/cipher-bulk-restore.
import { CipherBulkShareRequest } from "../models/request/cipher-bulk-share.request"; import { CipherBulkShareRequest } from "../models/request/cipher-bulk-share.request";
import { CipherCollectionsRequest } from "../models/request/cipher-collections.request"; import { CipherCollectionsRequest } from "../models/request/cipher-collections.request";
import { CipherCreateRequest } from "../models/request/cipher-create.request"; import { CipherCreateRequest } from "../models/request/cipher-create.request";
import { CipherPartialRequest } from "../models/request/cipher-partial.request";
import { CipherShareRequest } from "../models/request/cipher-share.request"; import { CipherShareRequest } from "../models/request/cipher-share.request";
import { CipherRequest } from "../models/request/cipher.request"; import { CipherRequest } from "../models/request/cipher.request";
import { CipherResponse } from "../models/response/cipher.response"; import { CipherResponse } from "../models/response/cipher.response";
@@ -157,6 +158,7 @@ export class CipherService implements CipherServiceAbstraction {
cipher.collectionIds = model.collectionIds; cipher.collectionIds = model.collectionIds;
cipher.revisionDate = model.revisionDate; cipher.revisionDate = model.revisionDate;
cipher.reprompt = model.reprompt; cipher.reprompt = model.reprompt;
cipher.edit = model.edit;
if (key == null && cipher.organizationId != null) { if (key == null && cipher.organizationId != null) {
key = await this.cryptoService.getOrgKey(cipher.organizationId); key = await this.cryptoService.getOrgKey(cipher.organizationId);
@@ -594,20 +596,29 @@ export class CipherService implements CipherServiceAbstraction {
await this.stateService.setNeverDomains(domains); await this.stateService.setNeverDomains(domains);
} }
async saveWithServer(cipher: Cipher): Promise<any> { async createWithServer(cipher: Cipher): Promise<any> {
let response: CipherResponse; let response: CipherResponse;
if (cipher.id == null) { if (cipher.collectionIds != null) {
if (cipher.collectionIds != null) { const request = new CipherCreateRequest(cipher);
const request = new CipherCreateRequest(cipher); response = await this.apiService.postCipherCreate(request);
response = await this.apiService.postCipherCreate(request);
} else {
const request = new CipherRequest(cipher);
response = await this.apiService.postCipher(request);
}
cipher.id = response.id;
} else { } else {
const request = new CipherRequest(cipher);
response = await this.apiService.postCipher(request);
}
cipher.id = response.id;
const data = new CipherData(response, cipher.collectionIds);
await this.upsert(data);
}
async updateWithServer(cipher: Cipher): Promise<any> {
let response: CipherResponse;
if (cipher.edit) {
const request = new CipherRequest(cipher); const request = new CipherRequest(cipher);
response = await this.apiService.putCipher(cipher.id, request); response = await this.apiService.putCipher(cipher.id, request);
} else {
const request = new CipherPartialRequest(cipher);
response = await this.apiService.putPartialCipher(cipher.id, request);
} }
const data = new CipherData(response, cipher.collectionIds); const data = new CipherData(response, cipher.collectionIds);