mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-06-30 18:14:45 +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:
parent
377cfae13a
commit
8c3bf4738f
@ -210,7 +210,7 @@ describe('ManageRulesSmartComponent', () => {
|
||||
expect(ruleDetails).toBeFalsy();
|
||||
});
|
||||
|
||||
// TODO: flaky test that needs review
|
||||
// TODO: [ACS-9719] flaky test that needs review
|
||||
// eslint-disable-next-line ban/ban
|
||||
xit('should call deleteRule() if confirmation dialog returns true', () => {
|
||||
const dialog = TestBed.inject(MatDialog);
|
||||
|
@ -223,7 +223,8 @@ export class ManageRulesSmartComponent implements OnInit {
|
||||
title: 'ACA_FOLDER_RULES.CONFIRMATION_DIALOG.DELETE_RULE.TITLE',
|
||||
message: 'ACA_FOLDER_RULES.CONFIRMATION_DIALOG.DELETE_RULE.MESSAGE'
|
||||
},
|
||||
minWidth: '346px'
|
||||
minWidth: '346px',
|
||||
restoreFocus: true
|
||||
})
|
||||
.afterClosed()
|
||||
.subscribe((result) => {
|
||||
|
@ -53,7 +53,7 @@ import { AppHookService, AppSettingsService, ContentApiService } from '@alfresco
|
||||
import { Store } from '@ngrx/store';
|
||||
import { ContentManagementService } from './content-management.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 { MatSnackBarModule, MatSnackBarRef, SimpleSnackBar } from '@angular/material/snack-bar';
|
||||
import { Node, NodeEntry, UserInfo, VersionPaging } from '@alfresco/js-api';
|
||||
@ -1819,6 +1819,16 @@ describe('ContentManagementService', () => {
|
||||
spyOn(elementToFocus, 'focus');
|
||||
spyOn(document, 'querySelector').withArgs(elementToFocusSelector).and.returnValue(elementToFocus);
|
||||
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();
|
||||
expect(elementToFocus.focus).toHaveBeenCalled();
|
||||
});
|
||||
|
@ -326,7 +326,8 @@ export class ContentManagementService {
|
||||
yesLabel: 'APP.DIALOGS.CONFIRM_LEAVE.YES_LABEL',
|
||||
noLabel: 'APP.DIALOGS.CONFIRM_LEAVE.NO_LABEL'
|
||||
},
|
||||
minWidth: '250px'
|
||||
minWidth: '250px',
|
||||
restoreFocus: true
|
||||
});
|
||||
|
||||
dialogRef.afterClosed().subscribe((result) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user