mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-06-02 17:35:08 +00:00
boolean name changed as per naming convention
This commit is contained in:
parent
705a52a567
commit
d6a8379f42
@ -97,7 +97,7 @@
|
|||||||
</mat-icon>
|
</mat-icon>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<p class="adf-share-link__warn adf-share-link__para" *ngIf="linkWithExpirySettings">
|
<p class="adf-share-link__warn adf-share-link__para" *ngIf="isLinkWithExpiryDate">
|
||||||
{{ 'SHARE.LINK-WITH-EXPIRY-SETTINGS' | translate }}
|
{{ 'SHARE.LINK-WITH-EXPIRY-SETTINGS' | translate }}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ export class ShareDialogComponent implements OnInit, OnDestroy {
|
|||||||
baseShareUrl: string;
|
baseShareUrl: string;
|
||||||
isFileShared: boolean = false;
|
isFileShared: boolean = false;
|
||||||
isDisabled: boolean = false;
|
isDisabled: boolean = false;
|
||||||
linkWithExpirySettings: boolean = false;
|
isLinkWithExpiryDate: boolean = false;
|
||||||
form: UntypedFormGroup = new UntypedFormGroup({
|
form: UntypedFormGroup = new UntypedFormGroup({
|
||||||
sharedUrl: new UntypedFormControl(''),
|
sharedUrl: new UntypedFormControl(''),
|
||||||
time: new UntypedFormControl({value: '', disabled: true})
|
time: new UntypedFormControl({value: '', disabled: true})
|
||||||
@ -109,12 +109,12 @@ export class ShareDialogComponent implements OnInit, OnDestroy {
|
|||||||
const expiryDate = this.updateForm();
|
const expiryDate = this.updateForm();
|
||||||
if (expiryDate !== null && expiryDate !== undefined) {
|
if (expiryDate !== null && expiryDate !== undefined) {
|
||||||
this.time.enable();
|
this.time.enable();
|
||||||
this.linkWithExpirySettings = true;
|
this.isLinkWithExpiryDate = true;
|
||||||
this.isExpiryDateToggleChecked = true;
|
this.isExpiryDateToggleChecked = true;
|
||||||
} else {
|
} else {
|
||||||
this.time.disable();
|
this.time.disable();
|
||||||
this.isExpiryDateToggleChecked = false;
|
this.isExpiryDateToggleChecked = false;
|
||||||
this.linkWithExpirySettings = false;
|
this.isLinkWithExpiryDate = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -232,7 +232,7 @@ export class ShareDialogComponent implements OnInit, OnDestroy {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteSharedLink(sharedId: string, dialogOpenFlag?: boolean) {
|
deleteSharedLink(sharedId: string, dialogOpenFlag?: boolean) {
|
||||||
this.isDisabled = true;
|
this.isDisabled = true;
|
||||||
|
|
||||||
this.sharedLinksApiService
|
this.sharedLinksApiService
|
||||||
@ -250,7 +250,7 @@ export class ShareDialogComponent implements OnInit, OnDestroy {
|
|||||||
if (dialogOpenFlag) {
|
if (dialogOpenFlag) {
|
||||||
this.createSharedLinks(this.data.node.entry.id);
|
this.createSharedLinks(this.data.node.entry.id);
|
||||||
this.isExpiryDateToggleChecked = false;
|
this.isExpiryDateToggleChecked = false;
|
||||||
this.linkWithExpirySettings = false;
|
this.isLinkWithExpiryDate = false;
|
||||||
} else {
|
} else {
|
||||||
this.dialogRef.close(false);
|
this.dialogRef.close(false);
|
||||||
}
|
}
|
||||||
@ -302,29 +302,25 @@ export class ShareDialogComponent implements OnInit, OnDestroy {
|
|||||||
: null;
|
: null;
|
||||||
|
|
||||||
if (this.sharedId && expiryDate) {
|
if (this.sharedId && expiryDate) {
|
||||||
this.isDisabled = true;
|
this.isDisabled = true;
|
||||||
|
|
||||||
this.sharedLinksApiService
|
this.sharedLinksApiService.deleteSharedLink(this.sharedId).subscribe((response: any) => {
|
||||||
.deleteSharedLink(this.sharedId)
|
if (response instanceof Error) {
|
||||||
.subscribe((response: any) => {
|
this.isDisabled = false;
|
||||||
if (response instanceof Error) {
|
this.isFileShared = true;
|
||||||
this.isDisabled = false;
|
this.handleError(response);
|
||||||
this.isFileShared = true;
|
} else {
|
||||||
this.handleError(response);
|
this.sharedLinkWithExpirySettings(expiryDate);
|
||||||
} else {
|
this.isLinkWithExpiryDate = true;
|
||||||
this.sharedLinkWithExpirySettings(expiryDate);
|
this.updateEntryExpiryDate(date);
|
||||||
this.linkWithExpirySettings = true;
|
}
|
||||||
this.updateEntryExpiryDate(date);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private sharedLinkWithExpirySettings(expiryDate: string) {
|
private sharedLinkWithExpirySettings(expiryDate: string) {
|
||||||
|
|
||||||
const lastIndex = expiryDate?.lastIndexOf(':');
|
const lastIndex = expiryDate?.lastIndexOf(':');
|
||||||
expiryDate = expiryDate?.substring(0, lastIndex) + expiryDate?.substring(lastIndex + 1, expiryDate?.length);
|
expiryDate = expiryDate?.substring(0, lastIndex) + expiryDate?.substring(lastIndex + 1, expiryDate?.length);
|
||||||
|
|
||||||
const nodeObject = {
|
const nodeObject = {
|
||||||
nodeId: this.data.node.entry.id,
|
nodeId: this.data.node.entry.id,
|
||||||
expiresAt: expiryDate
|
expiresAt: expiryDate
|
||||||
|
Loading…
x
Reference in New Issue
Block a user