2021-09-21 02:48:36 +02:00
|
|
|
<ng-container>
|
|
|
|
<h3 class="mt-4">{{ "customFields" | i18n }}</h3>
|
|
|
|
<div cdkDropList (cdkDropListDropped)="drop($event)" *ngIf="cipher.hasFields">
|
|
|
|
<div
|
|
|
|
class="row"
|
|
|
|
cdkDrag
|
|
|
|
*ngFor="let f of cipher.fields; let i = index; trackBy: trackByFunction"
|
|
|
|
>
|
|
|
|
<div class="col-5 form-group">
|
|
|
|
<div class="d-flex">
|
|
|
|
<label for="fieldName{{ i }}">{{ "name" | i18n }}</label>
|
|
|
|
<a
|
|
|
|
class="ml-auto"
|
|
|
|
href="https://help.bitwarden.com/article/custom-fields/"
|
|
|
|
target="_blank"
|
|
|
|
rel="noopener"
|
|
|
|
appA11yTitle="{{ 'learnMore' | i18n }}"
|
|
|
|
>
|
|
|
|
<i class="fa fa-question-circle-o" aria-hidden="true"></i>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<input
|
|
|
|
id="fieldName{{ i }}"
|
|
|
|
type="text"
|
|
|
|
name="Field.Name{{ i }}"
|
|
|
|
[(ngModel)]="f.name"
|
|
|
|
class="form-control"
|
|
|
|
appInputVerbatim
|
|
|
|
[disabled]="cipher.isDeleted || viewOnly"
|
2021-12-17 15:57:11 +01:00
|
|
|
/>
|
|
|
|
</div>
|
2021-09-21 02:48:36 +02:00
|
|
|
<div class="col-7 form-group">
|
|
|
|
<label for="fieldValue{{ i }}">{{ "value" | i18n }}</label>
|
|
|
|
<div class="d-flex align-items-center">
|
2021-11-03 22:41:04 +01:00
|
|
|
<!-- Text -->
|
2021-09-21 02:48:36 +02:00
|
|
|
<div class="input-group" *ngIf="f.type === fieldType.Text">
|
2021-12-17 15:57:11 +01:00
|
|
|
<input
|
2021-09-21 02:48:36 +02:00
|
|
|
id="fieldValue{{ i }}"
|
|
|
|
class="form-control"
|
|
|
|
type="text"
|
2021-11-03 22:41:04 +01:00
|
|
|
name="Field.Value{{ i }}"
|
2021-09-21 02:48:36 +02:00
|
|
|
[(ngModel)]="f.value"
|
|
|
|
appInputVerbatim
|
|
|
|
[disabled]="cipher.isDeleted || viewOnly"
|
2021-12-17 15:57:11 +01:00
|
|
|
/>
|
2021-09-21 02:48:36 +02:00
|
|
|
<div class="input-group-append">
|
2021-12-17 15:57:11 +01:00
|
|
|
<button
|
2021-09-21 02:48:36 +02:00
|
|
|
type="button"
|
|
|
|
class="btn btn-outline-secondary"
|
|
|
|
appA11yTitle="{{ 'copyValue' | i18n }}"
|
|
|
|
(click)="copy(f.value, 'value', 'Field')"
|
2021-12-17 15:57:11 +01:00
|
|
|
>
|
2021-09-21 02:48:36 +02:00
|
|
|
<i class="fa fa-lg fa-clone" aria-hidden="true"></i>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-11-03 22:41:04 +01:00
|
|
|
<!-- Hidden -->
|
2021-09-21 02:48:36 +02:00
|
|
|
<div class="input-group" *ngIf="f.type === fieldType.Hidden">
|
|
|
|
<input
|
|
|
|
id="fieldValue{{ i }}"
|
|
|
|
type="{{ f.showValue ? 'text' : 'password' }}"
|
|
|
|
name="Field.Value{{ i }}"
|
|
|
|
[(ngModel)]="f.value"
|
|
|
|
class="form-control text-monospace"
|
|
|
|
appInputVerbatim
|
|
|
|
autocomplete="new-password"
|
|
|
|
[disabled]="cipher.isDeleted || viewOnly || (!cipher.viewPassword && !f.newField)"
|
|
|
|
/>
|
|
|
|
<div class="input-group-append">
|
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
class="btn btn-outline-secondary"
|
|
|
|
appA11yTitle="{{ 'toggleVisibility' | i18n }}"
|
|
|
|
(click)="toggleFieldValue(f)"
|
|
|
|
[disabled]="!cipher.viewPassword && !f.newField"
|
|
|
|
>
|
|
|
|
<i
|
|
|
|
class="fa fa-lg"
|
|
|
|
aria-hidden="true"
|
2021-11-03 22:41:04 +01:00
|
|
|
[ngClass]="{ 'fa-eye': !f.showValue, 'fa-eye-slash': f.showValue }"
|
2021-12-17 15:57:11 +01:00
|
|
|
>
|
2021-11-03 22:41:04 +01:00
|
|
|
</i>
|
2021-09-21 02:48:36 +02:00
|
|
|
</button>
|
2021-12-17 15:57:11 +01:00
|
|
|
<button
|
2021-11-03 22:41:04 +01:00
|
|
|
type="button"
|
|
|
|
class="btn btn-outline-secondary"
|
|
|
|
appA11yTitle="{{ 'copyValue' | i18n }}"
|
2021-09-21 02:48:36 +02:00
|
|
|
(click)="copy(f.value, 'value', f.type === fieldType.Hidden ? 'H_Field' : 'Field')"
|
|
|
|
[disabled]="!cipher.viewPassword && !f.newField"
|
|
|
|
>
|
|
|
|
<i class="fa fa-lg fa-clone" aria-hidden="true"></i>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-11-03 22:41:04 +01:00
|
|
|
<!-- Linked -->
|
2021-09-21 02:48:36 +02:00
|
|
|
<div class="input-group" *ngIf="f.type === fieldType.Linked">
|
|
|
|
<select
|
|
|
|
id="fieldValue{{ i }}"
|
|
|
|
name="Field.Value{{ i }}"
|
|
|
|
class="form-control"
|
|
|
|
[(ngModel)]="f.linkedId"
|
|
|
|
*ngIf="f.type === fieldType.Linked && cipher.linkedFieldOptions != null"
|
2021-11-03 22:41:04 +01:00
|
|
|
[disabled]="cipher.isDeleted || viewOnly"
|
2021-09-21 02:48:36 +02:00
|
|
|
>
|
|
|
|
<option *ngFor="let o of linkedFieldOptions" [ngValue]="o.value">{{ o.name }}</option>
|
|
|
|
</select>
|
2021-12-17 15:57:11 +01:00
|
|
|
</div>
|
2021-09-21 02:48:36 +02:00
|
|
|
<div class="flex-fill">
|
2021-11-03 22:41:04 +01:00
|
|
|
<!-- Boolean -->
|
2021-12-17 15:57:11 +01:00
|
|
|
<input
|
2021-09-21 02:48:36 +02:00
|
|
|
id="fieldValue{{ i }}"
|
|
|
|
name="Field.Value{{ i }}"
|
|
|
|
type="checkbox"
|
|
|
|
[(ngModel)]="f.value"
|
|
|
|
*ngIf="f.type === fieldType.Boolean"
|
|
|
|
appTrueFalseValue
|
|
|
|
trueValue="true"
|
|
|
|
falseValue="false"
|
2021-11-03 22:41:04 +01:00
|
|
|
[disabled]="cipher.isDeleted || viewOnly"
|
2021-12-17 15:57:11 +01:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<button
|
2021-09-21 02:48:36 +02:00
|
|
|
type="button"
|
|
|
|
class="btn btn-link text-danger ml-2"
|
|
|
|
(click)="removeField(f)"
|
|
|
|
appA11yTitle="{{ 'remove' | i18n }}"
|
|
|
|
*ngIf="!cipher.isDeleted && !viewOnly"
|
2021-12-17 15:57:11 +01:00
|
|
|
>
|
2021-09-21 02:48:36 +02:00
|
|
|
<i class="fa fa-minus-circle fa-lg" aria-hidden="true"></i>
|
|
|
|
</button>
|
2021-12-17 15:57:11 +01:00
|
|
|
<button
|
2021-09-21 02:48:36 +02:00
|
|
|
type="button"
|
|
|
|
class="btn btn-link text-muted cursor-move"
|
|
|
|
appA11yTitle="{{ 'dragToSort' | i18n }}"
|
|
|
|
*ngIf="!cipher.isDeleted && !viewOnly"
|
2021-12-17 15:57:11 +01:00
|
|
|
>
|
2021-09-21 02:48:36 +02:00
|
|
|
<i class="fa fa-bars fa-lg" aria-hidden="true"></i>
|
|
|
|
</button>
|
|
|
|
</div>
|
2021-12-17 15:57:11 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-11-03 22:41:04 +01:00
|
|
|
<!-- Add new custom field -->
|
2021-12-17 15:57:11 +01:00
|
|
|
<a
|
|
|
|
href="#"
|
2021-09-21 02:48:36 +02:00
|
|
|
appStopClick
|
|
|
|
(click)="addField()"
|
|
|
|
class="d-inline-block mb-2"
|
|
|
|
*ngIf="!cipher.isDeleted && !viewOnly"
|
2021-12-17 15:57:11 +01:00
|
|
|
>
|
2021-09-21 02:48:36 +02:00
|
|
|
<i class="fa fa-plus-circle fa-fw" aria-hidden="true"></i> {{ "newCustomField" | i18n }}
|
2021-12-17 15:57:11 +01:00
|
|
|
</a>
|
2021-09-21 02:48:36 +02:00
|
|
|
<div class="row" *ngIf="!cipher.isDeleted && !viewOnly">
|
|
|
|
<div class="col-5">
|
|
|
|
<label for="addFieldType" class="sr-only">{{ "type" | i18n }}</label>
|
2021-11-03 22:41:04 +01:00
|
|
|
<select id="addFieldType" class="form-control" name="AddFieldType" [(ngModel)]="addFieldType">
|
|
|
|
<option *ngFor="let o of addFieldTypeOptions" [ngValue]="o.value">{{ o.name }}</option>
|
2021-12-17 15:57:11 +01:00
|
|
|
<option
|
2021-11-03 22:41:04 +01:00
|
|
|
*ngIf="cipher.linkedFieldOptions != null"
|
|
|
|
[ngValue]="addFieldLinkedTypeOption.value"
|
2021-12-17 15:57:11 +01:00
|
|
|
>
|
2021-11-03 22:41:04 +01:00
|
|
|
{{ addFieldLinkedTypeOption.name }}
|
|
|
|
</option>
|
2021-09-21 02:48:36 +02:00
|
|
|
</select>
|
|
|
|
</div>
|
2021-12-17 15:57:11 +01:00
|
|
|
</div>
|
2021-09-21 02:48:36 +02:00
|
|
|
</ng-container>
|