ReloadDocumentListAction over SetSelectedNodesAction

This commit is contained in:
Cilibiu Bogdan
2019-07-08 16:22:52 +03:00
parent 79f3ad8840
commit 77fa5fa487
2 changed files with 4 additions and 21 deletions

View File

@@ -152,19 +152,6 @@ describe('AppLayoutComponent', () => {
}); });
}); });
it('should not reset selection if route is `/search`', done => {
fixture.detectChanges();
const selection = [<any>{ entry: { id: 'nodeId', name: 'name' } }];
store.dispatch(new SetSelectedNodesAction(selection));
router.navigateByUrl('/search;q=');
fixture.detectChanges();
store.select(getAppSelection).subscribe(state => {
expect(state.isEmpty).toBe(false);
done();
});
});
it('should close menu on mobile screen size', () => { it('should close menu on mobile screen size', () => {
component.minimizeSidenav = false; component.minimizeSidenav = false;
component.layout.container = { component.layout.container = {

View File

@@ -43,8 +43,8 @@ import { NodePermissionService } from '@alfresco/aca-shared';
import { BreakpointObserver } from '@angular/cdk/layout'; import { BreakpointObserver } from '@angular/cdk/layout';
import { import {
AppStore, AppStore,
SetSelectedNodesAction, getCurrentFolder,
getCurrentFolder ReloadDocumentListAction
} from '@alfresco/aca-shared/store'; } from '@alfresco/aca-shared/store';
import { Directionality } from '@angular/cdk/bidi'; import { Directionality } from '@angular/cdk/bidi';
@@ -140,15 +140,11 @@ export class AppLayoutComponent implements OnInit, OnDestroy {
this.router.events this.router.events
.pipe( .pipe(
filter(event => { filter(event => {
return ( return event instanceof NavigationStart;
event instanceof NavigationStart &&
// search employs reuse route strategy
!event.url.startsWith('/search;')
);
}), }),
takeUntil(this.onDestroy$) takeUntil(this.onDestroy$)
) )
.subscribe(() => this.store.dispatch(new SetSelectedNodesAction([]))); .subscribe(() => this.store.dispatch(new ReloadDocumentListAction()));
} }
ngOnDestroy() { ngOnDestroy() {