mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2026-09-09 18:02:54 +00:00
[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:
@@ -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();
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user