From 55f6f26bd20d086390ecb9eb92e1e92f1c306529 Mon Sep 17 00:00:00 2001 From: Jatin_Chugh Date: Thu, 11 May 2023 16:49:54 +0530 Subject: [PATCH] review comments addressed --- .../content-node-share.dialog.html | 15 ++------------- .../content-node-share.dialog.spec.ts | 3 --- .../content-node-share.dialog.ts | 13 ++++++------- 3 files changed, 8 insertions(+), 23 deletions(-) diff --git a/lib/content-services/src/lib/content-node-share/content-node-share.dialog.html b/lib/content-services/src/lib/content-node-share/content-node-share.dialog.html index cf7a533946..cc40504500 100644 --- a/lib/content-services/src/lib/content-node-share/content-node-share.dialog.html +++ b/lib/content-services/src/lib/content-node-share/content-node-share.dialog.html @@ -10,14 +10,10 @@ - diff --git a/lib/content-services/src/lib/content-node-share/content-node-share.dialog.spec.ts b/lib/content-services/src/lib/content-node-share/content-node-share.dialog.spec.ts index 2eceb61194..b1e3764437 100644 --- a/lib/content-services/src/lib/content-node-share/content-node-share.dialog.spec.ts +++ b/lib/content-services/src/lib/content-node-share/content-node-share.dialog.spec.ts @@ -245,7 +245,6 @@ describe('ShareDialogComponent', () => { it('should delete the current link generated with expiry date and generate a new link without expiry date when toggle is unchecked', async () => { spyOn(sharedLinksApiService, 'createSharedLinks').and.returnValue(of()); spyOn(sharedLinksApiService, 'deleteSharedLink').and.returnValue(of({})); - spyOn(renditionService, 'getNodeRendition'); node.entry.properties['qshare:sharedId'] = 'sharedId'; node.entry.properties['qshare:sharedId'] = '2017-04-15T18:31:37+00:00'; @@ -271,7 +270,6 @@ describe('ShareDialogComponent', () => { expect(sharedLinksApiService.deleteSharedLink).toHaveBeenCalled(); expect(sharedLinksApiService.createSharedLinks).toHaveBeenCalledWith('nodeId'); - }); it('should not allow expiration date action when node has no update permission', async () => { @@ -296,7 +294,6 @@ describe('ShareDialogComponent', () => { beforeEach(() => { spyOn(sharedLinksApiService, 'createSharedLinks').and.returnValue(of()); spyOn(sharedLinksApiService, 'deleteSharedLink').and.returnValue(of({})); - spyOn(renditionService, 'getNodeRendition'); node.entry.properties['qshare:sharedId'] = 'sharedId'; node.entry.allowableOperations = ['update']; diff --git a/lib/content-services/src/lib/content-node-share/content-node-share.dialog.ts b/lib/content-services/src/lib/content-node-share/content-node-share.dialog.ts index ad085d04ab..09cbb18140 100644 --- a/lib/content-services/src/lib/content-node-share/content-node-share.dialog.ts +++ b/lib/content-services/src/lib/content-node-share/content-node-share.dialog.ts @@ -101,7 +101,7 @@ export class ShareDialogComponent implements OnInit, OnDestroy { this.isFileShared = true; const expiryDate = this.updateForm(); - this.isExpiryDateToggleChecked = this.isLinkWithExpiryDate = expiryDate !== null && expiryDate !== undefined; + this.isExpiryDateToggleChecked = this.isLinkWithExpiryDate = !!expiryDate; this.isLinkWithExpiryDate ? this.time.enable() : this.time.disable(); } } @@ -148,12 +148,12 @@ export class ShareDialogComponent implements OnInit, OnDestroy { onToggleExpirationDate(slideToggle: MatSlideToggleChange) { if (slideToggle.checked) { - this.time.enable(); - this.isExpiryDateToggleChecked = true; + this.time.enable(); + this.isExpiryDateToggleChecked = true; } else { - this.time.disable(); - this.time.setValue(null); - this.deleteSharedLink(this.sharedId, true); + this.time.disable(); + this.time.setValue(null); + this.deleteSharedLink(this.sharedId, true); } } @@ -280,7 +280,6 @@ export class ShareDialogComponent implements OnInit, OnDestroy { } private updateNode(date: moment.Moment) { - let expiryDate: Date | string; if (date) { if (this.type === 'date') {