mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
[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:
parent
a83e837a96
commit
39e458abb0
@ -66,7 +66,8 @@ describe('ContentNodeSelectorComponent', () => {
|
|||||||
keydownEvents: () => of(null),
|
keydownEvents: () => of(null),
|
||||||
backdropClick: () => of(null),
|
backdropClick: () => of(null),
|
||||||
close: jasmine.createSpy('close'),
|
close: jasmine.createSpy('close'),
|
||||||
afterClosed: () => of(null)
|
afterClosed: () => of(null),
|
||||||
|
afterOpened: () => of(null)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -23,6 +23,7 @@ import { Node } from '@alfresco/js-api';
|
|||||||
import { ContentNodeSelectorComponentData } from './content-node-selector.component-data.interface';
|
import { ContentNodeSelectorComponentData } from './content-node-selector.component-data.interface';
|
||||||
import { NodeEntryEvent } from '../document-list/components/node.event';
|
import { NodeEntryEvent } from '../document-list/components/node.event';
|
||||||
import { NodeAction } from '../document-list/models/node-action.enum';
|
import { NodeAction } from '../document-list/models/node-action.enum';
|
||||||
|
import { OverlayContainer } from '@angular/cdk/overlay';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'adf-content-node-selector',
|
selector: 'adf-content-node-selector',
|
||||||
@ -50,6 +51,7 @@ export class ContentNodeSelectorComponent implements OnInit {
|
|||||||
private notificationService: NotificationService,
|
private notificationService: NotificationService,
|
||||||
private uploadService: UploadService,
|
private uploadService: UploadService,
|
||||||
private dialog: MatDialogRef<ContentNodeSelectorComponent>,
|
private dialog: MatDialogRef<ContentNodeSelectorComponent>,
|
||||||
|
private overlayContainer: OverlayContainer,
|
||||||
@Inject(MAT_DIALOG_DATA) public data: ContentNodeSelectorComponentData) {
|
@Inject(MAT_DIALOG_DATA) public data: ContentNodeSelectorComponentData) {
|
||||||
this.action = data.actionName ?? NodeAction.CHOOSE;
|
this.action = data.actionName ?? NodeAction.CHOOSE;
|
||||||
this.buttonActionName = `NODE_SELECTOR.${this.action}`;
|
this.buttonActionName = `NODE_SELECTOR.${this.action}`;
|
||||||
@ -71,6 +73,10 @@ export class ContentNodeSelectorComponent implements OnInit {
|
|||||||
this.close();
|
this.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.dialog.afterOpened().subscribe(() => {
|
||||||
|
this.overlayContainer.getContainerElement().setAttribute('role', 'main');
|
||||||
|
});
|
||||||
|
|
||||||
this.uploadService.fileUploadStarting.subscribe(() => {
|
this.uploadService.fileUploadStarting.subscribe(() => {
|
||||||
this.uploadStarted = true;
|
this.uploadStarted = true;
|
||||||
});
|
});
|
||||||
@ -78,6 +84,7 @@ export class ContentNodeSelectorComponent implements OnInit {
|
|||||||
|
|
||||||
close() {
|
close() {
|
||||||
this.dialog.close();
|
this.dialog.close();
|
||||||
|
this.overlayContainer.getContainerElement().setAttribute('role', 'region');
|
||||||
}
|
}
|
||||||
|
|
||||||
onSelect(nodeList: Node[]) {
|
onSelect(nodeList: Node[]) {
|
||||||
|
@ -23,6 +23,7 @@ import { NewVersionUploaderDialogComponent } from './new-version-uploader.dialog
|
|||||||
import { VersionPaging, VersionsApi } from '@alfresco/js-api';
|
import { VersionPaging, VersionsApi } from '@alfresco/js-api';
|
||||||
import { NewVersionUploaderData, NewVersionUploaderDialogData } from './models';
|
import { NewVersionUploaderData, NewVersionUploaderDialogData } from './models';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
import { OverlayContainer } from '@angular/cdk/overlay';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@ -38,7 +39,8 @@ export class NewVersionUploaderService {
|
|||||||
constructor(
|
constructor(
|
||||||
private contentService: ContentService,
|
private contentService: ContentService,
|
||||||
private apiService: AlfrescoApiService,
|
private apiService: AlfrescoApiService,
|
||||||
private dialog: MatDialog
|
private dialog: MatDialog,
|
||||||
|
private overlayContainer: OverlayContainer
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -72,6 +74,10 @@ export class NewVersionUploaderService {
|
|||||||
dialogRef.componentInstance.uploadError.asObservable().subscribe(error => {
|
dialogRef.componentInstance.uploadError.asObservable().subscribe(error => {
|
||||||
observer.error(error);
|
observer.error(error);
|
||||||
});
|
});
|
||||||
|
dialogRef.afterClosed().subscribe(() => {
|
||||||
|
this.overlayContainer.getContainerElement().setAttribute('role', 'region');
|
||||||
|
});
|
||||||
|
this.overlayContainer.getContainerElement().setAttribute('role', 'main');
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
observer.error({ value: 'OPERATION.ERROR.PERMISSION' });
|
observer.error({ value: 'OPERATION.ERROR.PERMISSION' });
|
||||||
|
Loading…
x
Reference in New Issue
Block a user