mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACA-4503] Fix close all dialogs (#7142)
* [ACA-4503] Fix close all dialogs * [ci:force] clean unit test file
This commit is contained in:
committed by
GitHub
parent
cc8a9f3ca0
commit
dab75c51ee
@@ -195,7 +195,7 @@ describe('ContentNodeDialogService', () => {
|
||||
beforeEach(() => {
|
||||
spyOnDialogOpen.and.callFake((_: any, config: any) => {
|
||||
testContentNodeSelectorComponentData = config.data;
|
||||
return { componentInstance: {} };
|
||||
return { componentInstance: {}, afterClosed: () => of(null) };
|
||||
});
|
||||
service.openCopyMoveDialog(NodeAction.CHOOSE, fakeNode, '!update');
|
||||
});
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
|
||||
import { EventEmitter, Injectable, Output } from '@angular/core';
|
||||
import { ContentService, ThumbnailService, SitesService, TranslationService, AllowableOperationsEnum } from '@alfresco/adf-core';
|
||||
import { Subject, Observable, throwError } from 'rxjs';
|
||||
@@ -156,7 +156,8 @@ export class ContentNodeDialogService {
|
||||
select: select
|
||||
};
|
||||
|
||||
this.openContentNodeDialog(data, 'adf-content-node-selector-dialog', '630px');
|
||||
const dialogRef = this.openContentNodeDialog(data, 'adf-content-node-selector-dialog', '630px');
|
||||
dialogRef.afterClosed().subscribe({ next: () => select.complete() });
|
||||
|
||||
return select;
|
||||
} else {
|
||||
@@ -195,7 +196,9 @@ export class ContentNodeDialogService {
|
||||
select: select
|
||||
};
|
||||
|
||||
this.openContentNodeDialog(data, 'adf-content-node-selector-dialog', '630px');
|
||||
const dialogRef = this.openContentNodeDialog(data, 'adf-content-node-selector-dialog', '630px');
|
||||
dialogRef.afterClosed().subscribe({ next: () => select.complete() });
|
||||
|
||||
return select;
|
||||
}
|
||||
|
||||
@@ -220,12 +223,14 @@ export class ContentNodeDialogService {
|
||||
showFilesInResult
|
||||
};
|
||||
|
||||
this.openContentNodeDialog(data, 'adf-content-node-selector-dialog', '630px');
|
||||
const dialogRef = this.openContentNodeDialog(data, 'adf-content-node-selector-dialog', '630px');
|
||||
dialogRef.afterClosed().subscribe({ next: () => select.complete() });
|
||||
|
||||
return select;
|
||||
}
|
||||
|
||||
private openContentNodeDialog(data: ContentNodeSelectorComponentData, panelClass: string, width: string) {
|
||||
this.dialog.open(ContentNodeSelectorComponent, {
|
||||
private openContentNodeDialog(data: ContentNodeSelectorComponentData, panelClass: string, width: string): MatDialogRef<ContentNodeSelectorComponent> {
|
||||
return this.dialog.open(ContentNodeSelectorComponent, {
|
||||
data,
|
||||
panelClass,
|
||||
width,
|
||||
|
@@ -65,7 +65,8 @@ describe('ContentNodeSelectorComponent', () => {
|
||||
useValue: {
|
||||
keydownEvents: () => of(null),
|
||||
backdropClick: () => of(null),
|
||||
close: jasmine.createSpy('close')
|
||||
close: jasmine.createSpy('close'),
|
||||
afterClosed: () => of(null)
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@@ -76,7 +76,6 @@ export class ContentNodeSelectorComponent implements OnInit {
|
||||
}
|
||||
|
||||
close() {
|
||||
this.data.select.complete();
|
||||
this.dialog.close();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user