[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>
</button>
<button mat-icon-button
[disabled]="!shareRef.isFile"
[disabled]="documentList.selection.length && !shareRef.isFile"
[baseShareUrl]="baseShareUrl"
#shareRef="adfShare"
[adf-share]="documentList.selection[0]"

View File

@@ -47,7 +47,7 @@ import moment from 'moment-es6';
export class ShareDialogComponent implements OnInit, OnDestroy {
private subscriptions: Subscription[] = [];
minDate = moment().toDate();
minDate = moment().add(1, 'd');
sharedId: string;
fileName: string;
baseShareUrl: string;
@@ -159,7 +159,6 @@ export class ShareDialogComponent implements OnInit, OnDestroy {
this.isFileShared = true;
this.updateForm();
}
},
() => {
@@ -188,7 +187,7 @@ export class ShareDialogComponent implements OnInit, OnDestroy {
this.form.setValue({
'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,
{
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;
properties['qshare:expiryDate'] = updates.time
? updates.time.format()
? updates.time.local()
: null;
}
}