boolean name changed as per naming convention

This commit is contained in:
Jatin_Chugh 2023-05-08 18:27:08 +05:30
parent 705a52a567
commit d6a8379f42
2 changed files with 17 additions and 21 deletions

View File

@ -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>

View File

@ -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