bitwarden-desktop/src/app/send/add-edit.component.html

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

293 lines
9.9 KiB
HTML
Raw Normal View History

<form #form (ngSubmit)="submit()" [appApiAction]="formPromise">
2021-02-16 17:52:23 +01:00
<div class="content">
<div class="inner-content" *ngIf="send">
2021-02-18 19:03:20 +01:00
<div class="box">
<app-callout *ngIf="disableSend">
<span>{{ "sendDisabledWarning" | i18n }}</span>
</app-callout>
2021-03-25 06:29:49 +01:00
<app-callout type="info" *ngIf="disableHideEmail && !disableSend">
{{ "sendOptionsPolicyInEffect" | i18n }}
</app-callout>
2021-12-20 15:47:17 +01:00
</div>
2021-02-16 17:52:23 +01:00
<div class="box">
<div class="box-header">
2021-12-20 15:47:17 +01:00
{{ title }}
</div>
2021-02-16 17:52:23 +01:00
<div class="box-content">
<div class="box-content-row" appBoxRow>
<label for="name">{{ "name" | i18n }}</label>
2021-12-20 15:47:17 +01:00
<input
2021-02-18 19:03:20 +01:00
id="name"
type="text"
name="Name"
[(ngModel)]="send.name"
appAutofocus
[readOnly]="disableSend"
2021-12-20 15:47:17 +01:00
/>
</div>
<div class="box-content-row box-content-row-radio" *ngIf="!editMode">
<label class="radio-header">{{ "whatTypeOfSend" | i18n }}</label>
<div class="item" *ngFor="let o of typeOptions">
2021-12-20 15:47:17 +01:00
<input
type="radio"
class="radio"
[(ngModel)]="send.type"
name="Type_{{ o.value }}"
id="type_{{ o.value }}"
[value]="o.value"
(change)="typeChanged(o)"
[checked]="send.type === o.value"
[disabled]="disableSend"
2021-12-20 15:47:17 +01:00
/>
<label class="unstyled" for="type_{{ o.value }}">
2021-12-20 15:47:17 +01:00
{{ o.name }}
</label>
2021-02-18 19:03:20 +01:00
</div>
2021-02-16 17:52:23 +01:00
</div>
<div class="box-content-row" appBowRow *ngIf="!editMode && send.type === sendType.File">
<label for="file">{{ "file" | i18n }}</label>
<input
type="file"
2021-12-20 15:47:17 +01:00
id="file"
class="form-control-file"
name="file"
required
[disabled]="disableSend"
2021-12-20 15:47:17 +01:00
/>
</div>
<div class="box-content-row" appBowRow *ngIf="editMode && send.type === sendType.File">
<label for="file">{{ "file" | i18n }}</label>
<div class="row-main">{{ send.file.fileName }} ({{ send.file.sizeName }})</div>
2021-12-20 15:47:17 +01:00
</div>
<div class="box-content-row" appBoxRow *ngIf="send.type === sendType.Text">
<label for="text">{{ "text" | i18n }}</label>
2021-02-18 19:03:20 +01:00
<textarea
id="text"
name="text"
[(ngModel)]="send.text.text"
2021-12-20 15:47:17 +01:00
rows="6"
2021-02-18 19:03:20 +01:00
[readOnly]="disableSend"
></textarea>
</div>
</div>
<div class="box-footer" *ngIf="!editMode && send.type === sendType.File">
{{ "sendFileDesc" | i18n }} {{ "maxFileSize" | i18n }}
</div>
<div class="box-footer" *ngIf="send.type === sendType.Text">
{{ "sendTextDesc" | i18n }}
</div>
</div>
<div class="box" *ngIf="send.type === sendType.Text">
2021-02-18 19:03:20 +01:00
<div class="box-content">
<div class="box-content-row box-content-row-checkbox" appBoxRow>
<label for="hideText">{{ "textHiddenByDefault" | i18n }}</label>
2021-12-20 15:47:17 +01:00
<input
id="hideText"
name="hideText"
type="checkbox"
[(ngModel)]="send.text.hidden"
[disabled]="disableSend"
2021-12-20 15:47:17 +01:00
/>
</div>
</div>
</div>
2021-02-18 19:03:20 +01:00
<div class="box">
<div class="box-header">
Change links to buttons, expose `aria-pressed` for toggles, add `aria-expanded` to send view's "Options" (#1437) * Change links to buttons, expose `aria-pressed` for toggles - also make existing `<a routerLink...>` type controls keyboard focusable with the addition of `tabindex="0"` * Correctly set aria-pressed now that I have a working build environment, could verify correct way to set this with my limited Angular knowledge * Change more links to buttons, initial style changes * Fix layout of <button> elements with .box-content-row * Update jslib submodule * Add `aria-expanded` to the send view's "Show options" expand/collapse control * Fix position of "Edit" pencil when hovering over folders * Update jslib * Change sends list links to buttons * Add `aria-pressed` to vault and send list buttons Programmatically denote which of the buttons is currently active/shown in the right-most panel * Fix incorrect "Options" expand/collapse button in add-edit view Currently, that buttons lacks an accName because the "Options" text is outside of it. * Add `aria-pressed` to the send left-hand column filters * Simplify base, list, and vault styles Since links are now buttons, no need to double up selectors for both types of elements. No need to double-up theming in base, as this also causes incorrect "x" in toasts. * Remove unnecessary `position:relative` Fixes issue with cut-off focus outlines, has no other adverse effect * Fix styling for last child of action buttons Old approach of making right padding smaller results in unsightly, off-center icon (noticeable when focus outline is visible). This visually remains the same, but reduces right-hand margin instead.
2022-04-30 16:09:41 +02:00
<button
type="button"
2021-02-18 19:03:20 +01:00
class="toggle"
appStopClick
(click)="toggleOptions()"
Change links to buttons, expose `aria-pressed` for toggles, add `aria-expanded` to send view's "Options" (#1437) * Change links to buttons, expose `aria-pressed` for toggles - also make existing `<a routerLink...>` type controls keyboard focusable with the addition of `tabindex="0"` * Correctly set aria-pressed now that I have a working build environment, could verify correct way to set this with my limited Angular knowledge * Change more links to buttons, initial style changes * Fix layout of <button> elements with .box-content-row * Update jslib submodule * Add `aria-expanded` to the send view's "Show options" expand/collapse control * Fix position of "Edit" pencil when hovering over folders * Update jslib * Change sends list links to buttons * Add `aria-pressed` to vault and send list buttons Programmatically denote which of the buttons is currently active/shown in the right-most panel * Fix incorrect "Options" expand/collapse button in add-edit view Currently, that buttons lacks an accName because the "Options" text is outside of it. * Add `aria-pressed` to the send left-hand column filters * Simplify base, list, and vault styles Since links are now buttons, no need to double up selectors for both types of elements. No need to double-up theming in base, as this also causes incorrect "x" in toasts. * Remove unnecessary `position:relative` Fixes issue with cut-off focus outlines, has no other adverse effect * Fix styling for last child of action buttons Old approach of making right padding smaller results in unsightly, off-center icon (noticeable when focus outline is visible). This visually remains the same, but reduces right-hand margin instead.
2022-04-30 16:09:41 +02:00
[attr.aria-expanded]="showOptions"
2021-12-20 15:47:17 +01:00
>
Change links to buttons, expose `aria-pressed` for toggles, add `aria-expanded` to send view's "Options" (#1437) * Change links to buttons, expose `aria-pressed` for toggles - also make existing `<a routerLink...>` type controls keyboard focusable with the addition of `tabindex="0"` * Correctly set aria-pressed now that I have a working build environment, could verify correct way to set this with my limited Angular knowledge * Change more links to buttons, initial style changes * Fix layout of <button> elements with .box-content-row * Update jslib submodule * Add `aria-expanded` to the send view's "Show options" expand/collapse control * Fix position of "Edit" pencil when hovering over folders * Update jslib * Change sends list links to buttons * Add `aria-pressed` to vault and send list buttons Programmatically denote which of the buttons is currently active/shown in the right-most panel * Fix incorrect "Options" expand/collapse button in add-edit view Currently, that buttons lacks an accName because the "Options" text is outside of it. * Add `aria-pressed` to the send left-hand column filters * Simplify base, list, and vault styles Since links are now buttons, no need to double up selectors for both types of elements. No need to double-up theming in base, as this also causes incorrect "x" in toasts. * Remove unnecessary `position:relative` Fixes issue with cut-off focus outlines, has no other adverse effect * Fix styling for last child of action buttons Old approach of making right padding smaller results in unsightly, off-center icon (noticeable when focus outline is visible). This visually remains the same, but reduces right-hand margin instead.
2022-04-30 16:09:41 +02:00
{{ "options" | i18n }}
2021-12-20 15:47:17 +01:00
<i
class="bwi bwi-lg"
2021-02-18 19:03:20 +01:00
aria-hidden="true"
[ngClass]="{ 'bwi-angle-down': !showOptions, 'bwi-chevron-up': showOptions }"
2021-12-20 15:47:17 +01:00
></i>
Change links to buttons, expose `aria-pressed` for toggles, add `aria-expanded` to send view's "Options" (#1437) * Change links to buttons, expose `aria-pressed` for toggles - also make existing `<a routerLink...>` type controls keyboard focusable with the addition of `tabindex="0"` * Correctly set aria-pressed now that I have a working build environment, could verify correct way to set this with my limited Angular knowledge * Change more links to buttons, initial style changes * Fix layout of <button> elements with .box-content-row * Update jslib submodule * Add `aria-expanded` to the send view's "Show options" expand/collapse control * Fix position of "Edit" pencil when hovering over folders * Update jslib * Change sends list links to buttons * Add `aria-pressed` to vault and send list buttons Programmatically denote which of the buttons is currently active/shown in the right-most panel * Fix incorrect "Options" expand/collapse button in add-edit view Currently, that buttons lacks an accName because the "Options" text is outside of it. * Add `aria-pressed` to the send left-hand column filters * Simplify base, list, and vault styles Since links are now buttons, no need to double up selectors for both types of elements. No need to double-up theming in base, as this also causes incorrect "x" in toasts. * Remove unnecessary `position:relative` Fixes issue with cut-off focus outlines, has no other adverse effect * Fix styling for last child of action buttons Old approach of making right padding smaller results in unsightly, off-center icon (noticeable when focus outline is visible). This visually remains the same, but reduces right-hand margin instead.
2022-04-30 16:09:41 +02:00
</button>
</div>
2021-12-20 15:47:17 +01:00
</div>
2021-02-18 19:03:20 +01:00
<div [hidden]="!showOptions">
<app-send-efflux-dates
[initialDeletionDate]="send.deletionDate"
[initialExpirationDate]="send.expirationDate"
[editMode]="editMode"
2021-02-18 19:03:20 +01:00
[disabled]="disableSend"
(datesChanged)="setDates($event)"
2021-12-20 15:47:17 +01:00
>
</app-send-efflux-dates>
2021-03-25 06:29:49 +01:00
<div class="box">
<div class="box-content">
<div class="box-content-row" appBoxRow>
<label for="maxAccessCount">{{ "maxAccessCount" | i18n }}</label>
<input
id="maxAccessCount"
type="number"
name="maxAccessCount"
[(ngModel)]="send.maxAccessCount"
[readOnly]="disableSend"
2021-02-16 17:52:23 +01:00
/>
</div>
2021-12-20 15:47:17 +01:00
</div>
<div class="box-footer" *ngIf="!editMode">
{{ "maxAccessCountDesc" | i18n }}
2021-12-20 15:47:17 +01:00
</div>
<div class="box-footer" *ngIf="editMode">
<p>{{ "maxAccessCountDesc" | i18n }}</p>
{{ "currentAccessCount" | i18n }}: <strong>{{ send.accessCount }}</strong>
2021-12-20 15:47:17 +01:00
</div>
</div>
<div class="box">
2021-02-16 17:52:23 +01:00
<div class="box-content">
<div class="box-content-row box-content-row-flex" appBoxRow>
<div class="row-main">
<label for="password">{{
(hasPassword ? "newPassword" : "password") | i18n
}}</label>
<input
id="password"
name="password"
type="{{ showPassword ? 'text' : 'password' }}"
[(ngModel)]="password"
[readOnly]="disableSend"
appInputVerbatim
2021-12-20 15:47:17 +01:00
/>
</div>
<div class="action-buttons">
Change links to buttons, expose `aria-pressed` for toggles, add `aria-expanded` to send view's "Options" (#1437) * Change links to buttons, expose `aria-pressed` for toggles - also make existing `<a routerLink...>` type controls keyboard focusable with the addition of `tabindex="0"` * Correctly set aria-pressed now that I have a working build environment, could verify correct way to set this with my limited Angular knowledge * Change more links to buttons, initial style changes * Fix layout of <button> elements with .box-content-row * Update jslib submodule * Add `aria-expanded` to the send view's "Show options" expand/collapse control * Fix position of "Edit" pencil when hovering over folders * Update jslib * Change sends list links to buttons * Add `aria-pressed` to vault and send list buttons Programmatically denote which of the buttons is currently active/shown in the right-most panel * Fix incorrect "Options" expand/collapse button in add-edit view Currently, that buttons lacks an accName because the "Options" text is outside of it. * Add `aria-pressed` to the send left-hand column filters * Simplify base, list, and vault styles Since links are now buttons, no need to double up selectors for both types of elements. No need to double-up theming in base, as this also causes incorrect "x" in toasts. * Remove unnecessary `position:relative` Fixes issue with cut-off focus outlines, has no other adverse effect * Fix styling for last child of action buttons Old approach of making right padding smaller results in unsightly, off-center icon (noticeable when focus outline is visible). This visually remains the same, but reduces right-hand margin instead.
2022-04-30 16:09:41 +02:00
<button
type="button"
class="row-btn"
appStopClick
2021-02-18 19:03:20 +01:00
appA11yTitle="{{ 'toggleVisibility' | i18n }}"
[attr.aria-pressed]="showPassword"
2021-02-18 19:03:20 +01:00
(click)="togglePasswordVisible()"
[disabled]="disableSend"
2021-12-20 15:47:17 +01:00
>
<i
class="bwi bwi-lg"
aria-hidden="true"
[ngClass]="{ 'bwi-eye': !showPassword, 'bwi-eye-slash': showPassword }"
2021-12-20 15:47:17 +01:00
></i>
Change links to buttons, expose `aria-pressed` for toggles, add `aria-expanded` to send view's "Options" (#1437) * Change links to buttons, expose `aria-pressed` for toggles - also make existing `<a routerLink...>` type controls keyboard focusable with the addition of `tabindex="0"` * Correctly set aria-pressed now that I have a working build environment, could verify correct way to set this with my limited Angular knowledge * Change more links to buttons, initial style changes * Fix layout of <button> elements with .box-content-row * Update jslib submodule * Add `aria-expanded` to the send view's "Show options" expand/collapse control * Fix position of "Edit" pencil when hovering over folders * Update jslib * Change sends list links to buttons * Add `aria-pressed` to vault and send list buttons Programmatically denote which of the buttons is currently active/shown in the right-most panel * Fix incorrect "Options" expand/collapse button in add-edit view Currently, that buttons lacks an accName because the "Options" text is outside of it. * Add `aria-pressed` to the send left-hand column filters * Simplify base, list, and vault styles Since links are now buttons, no need to double up selectors for both types of elements. No need to double-up theming in base, as this also causes incorrect "x" in toasts. * Remove unnecessary `position:relative` Fixes issue with cut-off focus outlines, has no other adverse effect * Fix styling for last child of action buttons Old approach of making right padding smaller results in unsightly, off-center icon (noticeable when focus outline is visible). This visually remains the same, but reduces right-hand margin instead.
2022-04-30 16:09:41 +02:00
</button>
2021-02-16 17:52:23 +01:00
</div>
</div>
2021-12-20 15:47:17 +01:00
</div>
<div class="box-footer">
{{ "sendPasswordDesc" | i18n }}
2021-12-20 15:47:17 +01:00
</div>
</div>
2021-02-16 17:52:23 +01:00
<div class="box">
<div class="box-header">
{{ "notes" | i18n }}
2021-12-20 15:47:17 +01:00
</div>
2021-02-18 19:03:20 +01:00
<div class="box-content">
<div class="box-content-row" appBoxRow>
<textarea
id="notes"
name="notes"
[(ngModel)]="send.notes"
rows="6"
[readOnly]="disableSend"
></textarea>
</div>
</div>
<div class="box-footer">
{{ "sendNotesDesc" | i18n }}
</div>
2021-02-18 19:03:20 +01:00
</div>
<div class="box">
<div class="box-content">
<div class="box-content-row box-content-row-checkbox" appBoxRow>
<label for="hideEmail">{{ "hideEmail" | i18n }}</label>
<input
id="hideEmail"
2021-03-25 06:29:49 +01:00
type="checkbox"
name="HideEmail"
[(ngModel)]="send.hideEmail"
[disabled]="(disableHideEmail && !send.hideEmail) || disableSend"
2021-02-18 19:03:20 +01:00
/>
2021-02-16 17:52:23 +01:00
</div>
2021-12-20 15:47:17 +01:00
</div>
</div>
2021-02-16 17:52:23 +01:00
<div class="box">
<div class="box-content">
<div class="box-content-row box-content-row-checkbox" appBoxRow>
2021-02-18 19:03:20 +01:00
<label for="disabled">{{ "disableSend" | i18n }}</label>
2021-02-23 16:40:44 +01:00
<input
id="disabled"
type="checkbox"
name="disabled"
[(ngModel)]="send.disabled"
[disabled]="disableSend"
2021-02-09 21:57:10 +01:00
/>
</div>
2021-12-20 15:47:17 +01:00
</div>
2021-02-09 21:57:10 +01:00
</div>
2021-02-16 17:52:23 +01:00
</div>
2021-02-18 19:03:20 +01:00
<div class="box">
2021-02-16 17:52:23 +01:00
<div class="box-header">
{{ "share" | i18n }}
2021-12-20 15:47:17 +01:00
</div>
<div class="box-content">
<div class="box-content-row" appBoxRow *ngIf="editMode">
<label for="link">{{ "sendLinkLabel" | i18n }}</label>
<input id="link" name="link" [ngModel]="link" readonly />
2021-02-16 17:52:23 +01:00
</div>
<div class="box-content-row box-content-row-checkbox" appBoxRow>
2021-02-18 19:03:20 +01:00
<label for="copyLink">{{ "copySendLinkOnSave" | i18n }}</label>
<input
id="copyLink"
name="copyLink"
[(ngModel)]="copyLink"
2021-02-16 17:52:23 +01:00
type="checkbox"
[disabled]="disableSend"
/>
</div>
2021-02-03 22:24:49 +01:00
</div>
2021-12-20 15:47:17 +01:00
</div>
</div>
</div>
<div class="footer">
2021-12-20 15:47:17 +01:00
<button
type="submit"
class="primary btn-submit"
2021-03-08 21:19:08 +01:00
appA11yTitle="{{ 'save' | i18n }}"
[disabled]="form.loading"
2021-02-18 19:03:20 +01:00
*ngIf="!disableSend"
2021-12-20 15:47:17 +01:00
>
<i class="bwi bwi-spinner bwi-spin" title="{{ 'loading' | i18n }}" aria-hidden="true"></i>
<span><i class="bwi bwi-save-changes bwi-lg bwi-fw" aria-hidden="true"></i></span>
2021-02-10 20:15:10 +01:00
</button>
<button type="button" (click)="cancel()" [disabled]="form.loading">
2021-02-16 17:52:23 +01:00
{{ "cancel" | i18n }}
2021-02-10 20:15:10 +01:00
</button>
2021-02-18 19:03:20 +01:00
<div class="right">
2021-12-20 15:47:17 +01:00
<button
2021-02-18 19:03:20 +01:00
type="button"
(click)="copyLinkToClipboard(link)"
appA11yTitle="{{ 'copySendLinkToClipboard' | i18n }}"
2021-03-08 21:19:08 +01:00
*ngIf="editMode"
2021-12-20 15:47:17 +01:00
>
<i class="bwi bwi-clone bwi-lg bwi-fw" aria-hidden="true"></i>
2021-02-10 20:15:10 +01:00
</button>
2021-12-20 15:47:17 +01:00
<button
2021-02-16 17:52:23 +01:00
#deleteBtn
2021-02-18 19:03:20 +01:00
type="button"
2021-02-16 17:52:23 +01:00
(click)="delete()"
class="danger"
2021-03-08 21:19:08 +01:00
appA11yTitle="{{ 'delete' | i18n }}"
*ngIf="editMode"
2021-12-20 15:47:17 +01:00
>
<i class="bwi bwi-trash bwi-lg bwi-fw" [hidden]="deleteBtn.loading" aria-hidden="true"></i>
2021-12-20 15:47:17 +01:00
<i
class="bwi bwi-spinner bwi-spin bwi-lg bwi-fw"
2021-02-16 17:52:23 +01:00
[hidden]="!deleteBtn.loading"
aria-hidden="true"
2021-12-20 15:47:17 +01:00
></i>
2021-02-10 20:15:10 +01:00
</button>
2021-02-16 17:52:23 +01:00
</div>
2021-12-20 15:47:17 +01:00
</div>
2021-02-16 17:52:23 +01:00
</form>