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
lib/content-services/src/lib
content-node-selector
new-version-uploader
@ -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)
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -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[]) {
|
||||
|
@ -23,6 +23,7 @@ import { NewVersionUploaderDialogComponent } from './new-version-uploader.dialog
|
||||
import { VersionPaging, VersionsApi } from '@alfresco/js-api';
|
||||
import { NewVersionUploaderData, NewVersionUploaderDialogData } from './models';
|
||||
import { Observable } from 'rxjs';
|
||||
import { OverlayContainer } from '@angular/cdk/overlay';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@ -38,7 +39,8 @@ export class NewVersionUploaderService {
|
||||
constructor(
|
||||
private contentService: ContentService,
|
||||
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 => {
|
||||
observer.error(error);
|
||||
});
|
||||
dialogRef.afterClosed().subscribe(() => {
|
||||
this.overlayContainer.getContainerElement().setAttribute('role', 'region');
|
||||
});
|
||||
this.overlayContainer.getContainerElement().setAttribute('role', 'main');
|
||||
});
|
||||
} else {
|
||||
observer.error({ value: 'OPERATION.ERROR.PERMISSION' });
|
||||
|
Loading…
x
Reference in New Issue
Block a user