Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ACS-8999] rename confirmation button label for closing conversation dialog #10431

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
&-actions {
margin-top: 11px;
margin-bottom: 1px;
margin-left: 40px;
padding: 0;
align-items: flex-end;

Expand All @@ -51,7 +52,6 @@

&-cancel-button,
&-discard-changes-button {
padding: 4px 12px;
height: 32px;
display: flex;
align-items: center;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ export interface UnsavedChangesDialogData {
confirmButtonText?: string;
descriptionText?: string;
headerText?: string;
maxWidth?: number | string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,33 @@ describe('UnsavedChangesGuard', () => {
expectGuardToBe(true, done, true);
afterClosed$.next(false);
});

it('should call open on dialog with correct parameters when maxWidth is not set', () => {
guard.unsaved = true;
guard.data = {
headerText: 'header'
};

guard.canDeactivate();
expect(dialog.open).toHaveBeenCalledWith(UnsavedChangesDialogComponent, {
maxWidth: 346,
data: guard.data
});
});

it('should call open on dialog with correct parameters when maxWidth is set', () => {
guard.unsaved = true;
guard.data = {
headerText: 'header',
maxWidth: 'none'
};

guard.canDeactivate();
expect(dialog.open).toHaveBeenCalledWith(UnsavedChangesDialogComponent, {
maxWidth: 'none',
data: guard.data
});
});
});

describe('Without auth', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class UnsavedChangesGuard implements CanDeactivate<any> {
return this.unsaved
? this.dialog
.open<UnsavedChangesDialogComponent>(UnsavedChangesDialogComponent, {
maxWidth: 346,
maxWidth: this.data?.maxWidth ?? 346,
data: this.data
})
.afterClosed()
Expand Down
Loading