[ACS-3888] Correct role for new version dialog (#7965)

* [ACS-3888] Correct role for new version dialog

* [ACS-3888] Correct role for move/copy dialog

* [ACS-3888] Unit test fix
This commit is contained in:
MichalKinas
2022-11-15 10:03:23 +01:00
committed by GitHub
parent a83e837a96
commit 39e458abb0
3 changed files with 16 additions and 2 deletions

View File

@@ -66,7 +66,8 @@ describe('ContentNodeSelectorComponent', () => {
keydownEvents: () => of(null),
backdropClick: () => of(null),
close: jasmine.createSpy('close'),
afterClosed: () => of(null)
afterClosed: () => of(null),
afterOpened: () => of(null)
}
}
],

View File

@@ -23,6 +23,7 @@ import { Node } from '@alfresco/js-api';
import { ContentNodeSelectorComponentData } from './content-node-selector.component-data.interface';
import { NodeEntryEvent } from '../document-list/components/node.event';
import { NodeAction } from '../document-list/models/node-action.enum';
import { OverlayContainer } from '@angular/cdk/overlay';
@Component({
selector: 'adf-content-node-selector',
@@ -50,6 +51,7 @@ export class ContentNodeSelectorComponent implements OnInit {
private notificationService: NotificationService,
private uploadService: UploadService,
private dialog: MatDialogRef<ContentNodeSelectorComponent>,
private overlayContainer: OverlayContainer,
@Inject(MAT_DIALOG_DATA) public data: ContentNodeSelectorComponentData) {
this.action = data.actionName ?? NodeAction.CHOOSE;
this.buttonActionName = `NODE_SELECTOR.${this.action}`;
@@ -71,6 +73,10 @@ export class ContentNodeSelectorComponent implements OnInit {
this.close();
});
this.dialog.afterOpened().subscribe(() => {
this.overlayContainer.getContainerElement().setAttribute('role', 'main');
});
this.uploadService.fileUploadStarting.subscribe(() => {
this.uploadStarted = true;
});
@@ -78,6 +84,7 @@ export class ContentNodeSelectorComponent implements OnInit {
close() {
this.dialog.close();
this.overlayContainer.getContainerElement().setAttribute('role', 'region');
}
onSelect(nodeList: Node[]) {