Skip to content

Commit

Permalink
NAS-129039: NAS-120039: PR update
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKarpov98 committed Jul 2, 2024
1 parent 4b1b3b6 commit 854092c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ <h1 matDialogTitle>{{ 'Send Feedback' | translate }}</h1>
mat-dialog-close
class="close-feedback-dialog"
ixTest="close-feedback-dialog"
[disabled]="isLoading"
>
<ix-icon name="clear"></ix-icon>
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,20 +147,6 @@ describe('FeedbackDialogComponent', () => {
expect(spectator.query(FileReviewComponent)).not.toExist();
expect(spectator.query(FileTicketComponent)).not.toExist();
});

it('disables dialog close when loading is set to true', async () => {
await typeButtonGroup.setValue('Report a bug');
spectator.detectChanges();

const visibleForm = spectator.query(FileTicketComponent);
expect(visibleForm.dialogRef).toBe(spectator.inject(MatDialogRef));

spectator.component.onIsLoadingChange(true);
expect(visibleForm.dialogRef.disableClose).toBe(true);

spectator.component.onIsLoadingChange(false);
expect(visibleForm.dialogRef.disableClose).toBe(false);
});
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { mapToOptions } from 'app/helpers/options.helper';
import { Option } from 'app/interfaces/option.interface';
import { FeedbackType, feedbackTypesLabels } from 'app/modules/feedback/interfaces/feedback.interface';
import { FeedbackService } from 'app/modules/feedback/services/feedback.service';
import { AppLoaderService } from 'app/modules/loader/app-loader.service';
import { SystemGeneralService } from 'app/services/system-general.service';

@UntilDestroy()
Expand Down Expand Up @@ -39,6 +40,7 @@ export class FeedbackDialogComponent implements OnInit {
private cdr: ChangeDetectorRef,
private systemGeneralService: SystemGeneralService,
protected dialogRef: MatDialogRef<FeedbackDialogComponent>,
private loader: AppLoaderService,
@Inject(MAT_DIALOG_DATA) private requestedType: FeedbackType,
) {}

Expand All @@ -50,11 +52,11 @@ export class FeedbackDialogComponent implements OnInit {
this.isLoading = newValue;

if (newValue) {
this.loader.open();
this.typeControl.disable();
this.dialogRef.disableClose = true;
} else {
this.loader.close();
this.typeControl.enable();
this.dialogRef.disableClose = false;
}

this.cdr.markForCheck();
Expand Down

0 comments on commit 854092c

Please sign in to comment.