[AAE-4585] Resolved - Disable actions that can not happen when naviga… (#2223)

* [AAE-4585] Resolved - Disable actions that can not happen when navigating to an extension (upload, create folder etc)

* [AAE-4585] Resolved failing unit test
This commit is contained in:
Sushmitha V
2021-07-19 18:20:38 +05:30
committed by GitHub
parent 994e1cfeea
commit ce35c4d875
3 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -118,8 +118,8 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
}
ngOnDestroy() {
super.ngOnDestroy();
this.store.dispatch(new SetCurrentFolderAction(null));
super.ngOnDestroy();
}
navigate(nodeId: string = null) {
@@ -42,6 +42,7 @@ import { Store } from '@ngrx/store';
import { AppTestingModule } from '../testing/app-testing.module';
import { Component } from '@angular/core';
import { DocumentListComponent } from '@alfresco/adf-content-services';
import { of } from 'rxjs';
@Component({
selector: 'aca-test',
@@ -72,6 +73,10 @@ describe('PageComponent', () => {
component = fixture.componentInstance;
});
afterEach(() => {
fixture.destroy();
});
describe('getParentNodeId()', () => {
it('returns parent node id when node is set', () => {
component.node = { id: 'node-id' };
@@ -94,6 +99,7 @@ describe('PageComponent', () => {
});
it('should open info drawer on action event', (done) => {
spyOn(store, 'select').and.returnValue(of(true));
window.history.pushState({}, null, `${locationHref}#test`);
fixture.detectChanges();
@@ -108,6 +114,7 @@ describe('PageComponent', () => {
});
it('should not open info drawer if viewer outlet is active', (done) => {
spyOn(store, 'select').and.returnValue(of(false));
window.history.pushState({}, null, `${locationHref}#test(viewer:view)`);
fixture.detectChanges();
+1
View File
@@ -112,6 +112,7 @@ export abstract class PageComponent implements OnInit, OnDestroy, OnChanges {
this.onDestroy$.next(true);
this.onDestroy$.complete();
this.store.dispatch(new SetSelectedNodesAction([]));
}
showPreview(node: MinimalNodeEntity, extras?: ViewNodeExtras) {