review comments addressed

This commit is contained in:
Jatin_Chugh
2023-06-07 10:45:59 +05:30
parent 29981c575a
commit 55f6f26bd2
3 changed files with 8 additions and 23 deletions
@@ -10,14 +10,10 @@
<mat-dialog-content> <mat-dialog-content>
<hr class="adf-share-link__separation-line" /> <hr class="adf-share-link__separation-line" />
<form [formGroup]="form" class="adf-share-link__form"> <form [formGroup]="form" class="adf-share-link__form">
<div class="adf-share-link--row"> <div class="adf-share-link--row">
<mat-icon class="adf-share-link__icon">timer</mat-icon> <mat-icon class="adf-share-link__icon">timer</mat-icon>
<div class="adf-share-link__label adf-sharable-link">{{ 'SHARE.LINK-EXPIRY-DATE' | translate }}</div> <div class="adf-share-link__label adf-sharable-link">{{ 'SHARE.LINK-EXPIRY-DATE' | translate }}</div>
<mat-slide-toggle <mat-slide-toggle
#slideToggleExpirationDate #slideToggleExpirationDate
[disabled]="!canUpdate" [disabled]="!canUpdate"
@@ -56,9 +52,7 @@
</mat-form-field> </mat-form-field>
</div> </div>
<p class="adf-share-link__info adf-share-link__para">{{ 'SHARE.SHARE-LINK' | translate }}</p> <p class="adf-share-link__info adf-share-link__para">{{ 'SHARE.SHARE-LINK' | translate }}</p>
<div class="adf-share-link--row"> <div class="adf-share-link--row">
<mat-slide-toggle <mat-slide-toggle
color="primary" color="primary"
@@ -68,9 +62,7 @@
[disabled]="!canUpdate || isDisabled" [disabled]="!canUpdate || isDisabled"
(change)="onSlideShareChange($event)"> (change)="onSlideShareChange($event)">
</mat-slide-toggle> </mat-slide-toggle>
<div class="adf-share-link__label adf-sharable-link">{{ 'SHARE.SHARABLE-LINK-CREATED' | translate }}</div> <div class="adf-share-link__label adf-sharable-link">{{ 'SHARE.SHARABLE-LINK-CREATED' | translate }}</div>
</div> </div>
<mat-form-field class="adf-full-width adf-float-label" floatLabel='always'> <mat-form-field class="adf-full-width adf-float-label" floatLabel='always'>
@@ -99,16 +91,13 @@
<p class="adf-share-link__warn adf-share-link__para" *ngIf="isLinkWithExpiryDate"> <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>
<div class="adf-share-link--row"> <div class="adf-share-link--row">
<mat-icon class="adf-share-link__icon">public</mat-icon> <mat-icon class="adf-share-link__icon">public</mat-icon>
<p class="adf-share-link__info adf-sharable-link adf-share-link__public-content adf-share-link__para"> <p class="adf-share-link__info adf-sharable-link adf-share-link__public-content adf-share-link__para">
{{ 'SHARE.PUBLIC-CONTENT' | translate }}</p> {{ 'SHARE.PUBLIC-CONTENT' | translate }}
</p>
</div> </div>
</form> </form>
<hr class="adf-share-link__separation-line" /> <hr class="adf-share-link__separation-line" />
</mat-dialog-content> </mat-dialog-content>
@@ -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 () => { 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, 'createSharedLinks').and.returnValue(of());
spyOn(sharedLinksApiService, 'deleteSharedLink').and.returnValue(of({})); spyOn(sharedLinksApiService, 'deleteSharedLink').and.returnValue(of({}));
spyOn(renditionService, 'getNodeRendition');
node.entry.properties['qshare:sharedId'] = 'sharedId'; node.entry.properties['qshare:sharedId'] = 'sharedId';
node.entry.properties['qshare:sharedId'] = '2017-04-15T18:31:37+00:00'; node.entry.properties['qshare:sharedId'] = '2017-04-15T18:31:37+00:00';
@@ -271,7 +270,6 @@ describe('ShareDialogComponent', () => {
expect(sharedLinksApiService.deleteSharedLink).toHaveBeenCalled(); expect(sharedLinksApiService.deleteSharedLink).toHaveBeenCalled();
expect(sharedLinksApiService.createSharedLinks).toHaveBeenCalledWith('nodeId'); expect(sharedLinksApiService.createSharedLinks).toHaveBeenCalledWith('nodeId');
}); });
it('should not allow expiration date action when node has no update permission', async () => { it('should not allow expiration date action when node has no update permission', async () => {
@@ -296,7 +294,6 @@ describe('ShareDialogComponent', () => {
beforeEach(() => { beforeEach(() => {
spyOn(sharedLinksApiService, 'createSharedLinks').and.returnValue(of()); spyOn(sharedLinksApiService, 'createSharedLinks').and.returnValue(of());
spyOn(sharedLinksApiService, 'deleteSharedLink').and.returnValue(of({})); spyOn(sharedLinksApiService, 'deleteSharedLink').and.returnValue(of({}));
spyOn(renditionService, 'getNodeRendition');
node.entry.properties['qshare:sharedId'] = 'sharedId'; node.entry.properties['qshare:sharedId'] = 'sharedId';
node.entry.allowableOperations = ['update']; node.entry.allowableOperations = ['update'];
@@ -101,7 +101,7 @@ export class ShareDialogComponent implements OnInit, OnDestroy {
this.isFileShared = true; this.isFileShared = true;
const expiryDate = this.updateForm(); 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(); this.isLinkWithExpiryDate ? this.time.enable() : this.time.disable();
} }
} }
@@ -280,7 +280,6 @@ export class ShareDialogComponent implements OnInit, OnDestroy {
} }
private updateNode(date: moment.Moment) { private updateNode(date: moment.Moment) {
let expiryDate: Date | string; let expiryDate: Date | string;
if (date) { if (date) {
if (this.type === 'date') { if (this.type === 'date') {