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', () => {
component.minimizeSidenav = false;
component.layout.container = {

View File

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