mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-10-01 14:41:14 +00:00
[ACS-9702] Restore focus after closing dialog (#4590)
* [ACS-9702] restore focus after closing dialog * [ACS-9702] link ticket to excluded test
This commit is contained in:
committed by
GitHub
parent
377cfae13a
commit
8c3bf4738f
@@ -210,7 +210,7 @@ describe('ManageRulesSmartComponent', () => {
|
|||||||
expect(ruleDetails).toBeFalsy();
|
expect(ruleDetails).toBeFalsy();
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO: flaky test that needs review
|
// TODO: [ACS-9719] flaky test that needs review
|
||||||
// eslint-disable-next-line ban/ban
|
// eslint-disable-next-line ban/ban
|
||||||
xit('should call deleteRule() if confirmation dialog returns true', () => {
|
xit('should call deleteRule() if confirmation dialog returns true', () => {
|
||||||
const dialog = TestBed.inject(MatDialog);
|
const dialog = TestBed.inject(MatDialog);
|
||||||
|
@@ -223,7 +223,8 @@ export class ManageRulesSmartComponent implements OnInit {
|
|||||||
title: 'ACA_FOLDER_RULES.CONFIRMATION_DIALOG.DELETE_RULE.TITLE',
|
title: 'ACA_FOLDER_RULES.CONFIRMATION_DIALOG.DELETE_RULE.TITLE',
|
||||||
message: 'ACA_FOLDER_RULES.CONFIRMATION_DIALOG.DELETE_RULE.MESSAGE'
|
message: 'ACA_FOLDER_RULES.CONFIRMATION_DIALOG.DELETE_RULE.MESSAGE'
|
||||||
},
|
},
|
||||||
minWidth: '346px'
|
minWidth: '346px',
|
||||||
|
restoreFocus: true
|
||||||
})
|
})
|
||||||
.afterClosed()
|
.afterClosed()
|
||||||
.subscribe((result) => {
|
.subscribe((result) => {
|
||||||
|
@@ -53,7 +53,7 @@ import { AppHookService, AppSettingsService, ContentApiService } from '@alfresco
|
|||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { ContentManagementService } from './content-management.service';
|
import { ContentManagementService } from './content-management.service';
|
||||||
import { NodeActionsService } from './node-actions.service';
|
import { NodeActionsService } from './node-actions.service';
|
||||||
import { DialogComponent, DialogSize, NotificationService, TranslationService } from '@alfresco/adf-core';
|
import { ConfirmDialogComponent, DialogComponent, DialogSize, NotificationService, TranslationService } from '@alfresco/adf-core';
|
||||||
import { MatDialog, MatDialogModule, MatDialogRef } from '@angular/material/dialog';
|
import { MatDialog, MatDialogModule, MatDialogRef } from '@angular/material/dialog';
|
||||||
import { MatSnackBarModule, MatSnackBarRef, SimpleSnackBar } from '@angular/material/snack-bar';
|
import { MatSnackBarModule, MatSnackBarRef, SimpleSnackBar } from '@angular/material/snack-bar';
|
||||||
import { Node, NodeEntry, UserInfo, VersionPaging } from '@alfresco/js-api';
|
import { Node, NodeEntry, UserInfo, VersionPaging } from '@alfresco/js-api';
|
||||||
@@ -1819,6 +1819,16 @@ describe('ContentManagementService', () => {
|
|||||||
spyOn(elementToFocus, 'focus');
|
spyOn(elementToFocus, 'focus');
|
||||||
spyOn(document, 'querySelector').withArgs(elementToFocusSelector).and.returnValue(elementToFocus);
|
spyOn(document, 'querySelector').withArgs(elementToFocusSelector).and.returnValue(elementToFocus);
|
||||||
contentManagementService.leaveLibrary('', elementToFocusSelector);
|
contentManagementService.leaveLibrary('', elementToFocusSelector);
|
||||||
|
expect(dialog.open).toHaveBeenCalledWith(ConfirmDialogComponent, {
|
||||||
|
data: {
|
||||||
|
title: 'APP.DIALOGS.CONFIRM_LEAVE.TITLE',
|
||||||
|
message: 'APP.DIALOGS.CONFIRM_LEAVE.MESSAGE',
|
||||||
|
yesLabel: 'APP.DIALOGS.CONFIRM_LEAVE.YES_LABEL',
|
||||||
|
noLabel: 'APP.DIALOGS.CONFIRM_LEAVE.NO_LABEL'
|
||||||
|
},
|
||||||
|
minWidth: '250px',
|
||||||
|
restoreFocus: true
|
||||||
|
});
|
||||||
afterClosed$.next();
|
afterClosed$.next();
|
||||||
expect(elementToFocus.focus).toHaveBeenCalled();
|
expect(elementToFocus.focus).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
@@ -326,7 +326,8 @@ export class ContentManagementService {
|
|||||||
yesLabel: 'APP.DIALOGS.CONFIRM_LEAVE.YES_LABEL',
|
yesLabel: 'APP.DIALOGS.CONFIRM_LEAVE.YES_LABEL',
|
||||||
noLabel: 'APP.DIALOGS.CONFIRM_LEAVE.NO_LABEL'
|
noLabel: 'APP.DIALOGS.CONFIRM_LEAVE.NO_LABEL'
|
||||||
},
|
},
|
||||||
minWidth: '250px'
|
minWidth: '250px',
|
||||||
|
restoreFocus: true
|
||||||
});
|
});
|
||||||
|
|
||||||
dialogRef.afterClosed().subscribe((result) => {
|
dialogRef.afterClosed().subscribe((result) => {
|
||||||
|
Reference in New Issue
Block a user