mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACS-8999] rename confirmation button label for closing conversation dialog (#10431)
* [ACS-8999] Correct styles for buttons in unsaved changes dialog for different size of buttons, allowed to set maxWidth of unsaved changes dialog * [ACS-8999] Unit tests
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
&-actions {
|
||||
margin-top: 11px;
|
||||
margin-bottom: 1px;
|
||||
margin-left: 40px;
|
||||
padding: 0;
|
||||
align-items: flex-end;
|
||||
|
||||
@@ -51,7 +52,6 @@
|
||||
|
||||
&-cancel-button,
|
||||
&-discard-changes-button {
|
||||
padding: 4px 12px;
|
||||
height: 32px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
@@ -20,4 +20,5 @@ export interface UnsavedChangesDialogData {
|
||||
confirmButtonText?: string;
|
||||
descriptionText?: string;
|
||||
headerText?: string;
|
||||
maxWidth?: number | string;
|
||||
}
|
||||
|
@@ -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', () => {
|
||||
|
@@ -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()
|
||||
|
Reference in New Issue
Block a user