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>
<hr class="adf-share-link__separation-line" />
<form [formGroup]="form" class="adf-share-link__form">
<div class="adf-share-link--row">
<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>
<mat-slide-toggle
#slideToggleExpirationDate
[disabled]="!canUpdate"
@@ -56,9 +52,7 @@
</mat-form-field>
</div>
<p class="adf-share-link__info adf-share-link__para">{{ 'SHARE.SHARE-LINK' | translate }}</p>
<div class="adf-share-link--row">
<mat-slide-toggle
color="primary"
@@ -68,9 +62,7 @@
[disabled]="!canUpdate || isDisabled"
(change)="onSlideShareChange($event)">
</mat-slide-toggle>
<div class="adf-share-link__label adf-sharable-link">{{ 'SHARE.SHARABLE-LINK-CREATED' | translate }}</div>
</div>
<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">
{{ 'SHARE.LINK-WITH-EXPIRY-SETTINGS' | translate }}
</p>
<div class="adf-share-link--row">
<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">
{{ 'SHARE.PUBLIC-CONTENT' | translate }}</p>
{{ 'SHARE.PUBLIC-CONTENT' | translate }}
</p>
</div>
</form>
<hr class="adf-share-link__separation-line" />
</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 () => {
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'];
@@ -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') {