Denys Vuika 99f4b07878 [ADF-4496] Share dialog enhancements (#4705)
* raise snackbars on unshare errors

* remove time from datepicker

* update tests

* Update en.json

* code updates as per review

* update docs

* bind datetimepicker type attribute

* set datetimepicker type by configuration or default

* tests

* e2e test

* update docs

* e2e set sharedLinkDateTimePickerType config
2019-06-06 16:32:36 +01:00

55 lines
2.6 KiB
HTML

<div class="adf-share-link__dialog-content">
<h1 data-automation-id="adf-share-dialog-title" class="adf-share-link__title">
{{ 'SHARE.DIALOG-TITLE' | translate }} {{ fileName }}
</h1>
<mat-dialog-content>
<p class="adf-share-link__info">{{ 'SHARE.DESCRIPTION' | translate }}</p>
<div class="adf-share-link--row">
<h1 class="adf-share-link__label">{{ 'SHARE.TITLE' | translate }}</h1>
<mat-slide-toggle color="primary" data-automation-id="adf-share-toggle" [checked]="isFileShared"
[disabled]="!canUpdate || isDisabled" (change)="onSlideShareChange($event)">
</mat-slide-toggle>
</div>
<form [formGroup]="form">
<mat-form-field class="adf-full-width">
<input #sharedLinkInput data-automation-id="adf-share-link" class="adf-share-link__input" matInput
cdkFocusInitial placeholder="{{ 'SHARE.PUBLIC-LINK' | translate }}" formControlName="sharedUrl"
readonly="readonly">
<mat-icon class="adf-input-action" matSuffix
[clipboard-notification]="'SHARE.CLIPBOARD-MESSAGE' | translate" [adf-clipboard]
[target]="sharedLinkInput">
link
</mat-icon>
</mat-form-field>
<div class="adf-share-link--row">
<h1 class="adf-share-link__label">{{ 'SHARE.EXPIRES' | translate }}</h1>
<mat-slide-toggle [disabled]="!canUpdate" #slideToggleExpirationDate color="primary"
data-automation-id="adf-expire-toggle" [checked]="form.controls['time'].value"
(change)="onToggleExpirationDate($event)">
</mat-slide-toggle>
</div>
<mat-form-field class="adf-full-width">
<mat-datetimepicker-toggle #matDatetimepickerToggle="matDatetimepickerToggle" [for]="datetimePicker" matSuffix></mat-datetimepicker-toggle>
<mat-datetimepicker #datetimePicker (closed)="onDatetimepickerClosed()" [type]="type" openOnFocus="true" timeInterval="1"></mat-datetimepicker>
<input class="adf-share-link__input"
#dateTimePickerInput
matInput
[min]="minDate"
formControlName="time"
[matDatetimepicker]="datetimePicker" />
</mat-form-field>
</form>
</mat-dialog-content>
<div mat-dialog-actions>
<button data-automation-id="adf-share-dialog-close" mat-button color="primary" mat-dialog-close>
{{ 'SHARE.CLOSE' | translate }}
</button>
</div>
</div>