[ADF-3530] Share file dialog - expiration date update (#3860)

* disable button when no selection

* fix date
This commit is contained in:
Cilibiu Bogdan
2018-10-04 17:38:42 +03:00
committed by Eugenio Romano
parent 5467e92966
commit 95587de864
2 changed files with 5 additions and 6 deletions

View File

@@ -119,7 +119,7 @@
</mat-icon> </mat-icon>
</button> </button>
<button mat-icon-button <button mat-icon-button
[disabled]="!shareRef.isFile" [disabled]="documentList.selection.length && !shareRef.isFile"
[baseShareUrl]="baseShareUrl" [baseShareUrl]="baseShareUrl"
#shareRef="adfShare" #shareRef="adfShare"
[adf-share]="documentList.selection[0]" [adf-share]="documentList.selection[0]"

View File

@@ -47,7 +47,7 @@ import moment from 'moment-es6';
export class ShareDialogComponent implements OnInit, OnDestroy { export class ShareDialogComponent implements OnInit, OnDestroy {
private subscriptions: Subscription[] = []; private subscriptions: Subscription[] = [];
minDate = moment().toDate(); minDate = moment().add(1, 'd');
sharedId: string; sharedId: string;
fileName: string; fileName: string;
baseShareUrl: string; baseShareUrl: string;
@@ -159,7 +159,6 @@ export class ShareDialogComponent implements OnInit, OnDestroy {
this.isFileShared = true; this.isFileShared = true;
this.updateForm(); this.updateForm();
} }
}, },
() => { () => {
@@ -188,7 +187,7 @@ export class ShareDialogComponent implements OnInit, OnDestroy {
this.form.setValue({ this.form.setValue({
'sharedUrl': `${this.baseShareUrl}${this.sharedId}`, 'sharedUrl': `${this.baseShareUrl}${this.sharedId}`,
'time': expiryDate ? moment(expiryDate) : null 'time': expiryDate ? expiryDate : null
}); });
} }
@@ -197,7 +196,7 @@ export class ShareDialogComponent implements OnInit, OnDestroy {
this.data.node.entry.id, this.data.node.entry.id,
{ {
properties: { properties: {
'qshare:expiryDate': updates.time ? updates.time.format() : null 'qshare:expiryDate': updates.time ? updates.time.utc().format() : null
} }
} }
); );
@@ -207,7 +206,7 @@ export class ShareDialogComponent implements OnInit, OnDestroy {
const { properties } = this.data.node.entry; const { properties } = this.data.node.entry;
properties['qshare:expiryDate'] = updates.time properties['qshare:expiryDate'] = updates.time
? updates.time.format() ? updates.time.local()
: null; : null;
} }
} }