mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-10-01 14:41:14 +00:00
[ACA-2087] Overlay Viewer (#1175)
* viewer outlet over preview route * use ViewNodeAction over ViewFileAction * pass data to dynamic component * ViewNodeComponent for view file custom actions * update docs * pass primary url to show preview outlet * update tests * reset selection on navigation event * document list update selection action when not viewer * close viewer for move and delete from viewer * location as router commands to work with search query * make viewer to behave like former preview * viewer error route * call correct preview method * remove view/error route * navigate to show error * span element for action name * fix folder navigation * fix test * page title fix * update tests * locate better the viewer toolbar * fix viewer url link * update navigation rules * document-list directive tests * try workaround for chrome 76 * try another workaround for using chromedriver 75 instead of 76 * ViewerEffects tests * reset selection over reload * fix tests * add reset event test * remove actions * context menu action refresh on favourite * reset selection on navigation * add delete and upload events * takeUntil after operators * remove chrome workaround parameter * filter navigation event
This commit is contained in:
committed by
Suzana Dirla
parent
8643a8806d
commit
e31c0d6caf
@@ -29,13 +29,10 @@ import { AppConfigService, UserPreferencesService } from '@alfresco/adf-core';
|
||||
import { AppLayoutComponent } from './app-layout.component';
|
||||
import { AppTestingModule } from '../../../testing/app-testing.module';
|
||||
import { Store } from '@ngrx/store';
|
||||
import {
|
||||
AppStore,
|
||||
SetSelectedNodesAction,
|
||||
getAppSelection
|
||||
} from '@alfresco/aca-shared/store';
|
||||
import { AppStore, SetSelectedNodesAction } from '@alfresco/aca-shared/store';
|
||||
import { Router, NavigationStart } from '@angular/router';
|
||||
import { Subject } from 'rxjs';
|
||||
import { ResetSelectionAction } from '@alfresco/aca-shared/store';
|
||||
|
||||
class MockRouter {
|
||||
private url = 'some-url';
|
||||
@@ -139,30 +136,17 @@ describe('AppLayoutComponent', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('should reset selection before navigation', done => {
|
||||
fixture.detectChanges();
|
||||
it('should reset selection before navigation', () => {
|
||||
const selection = [<any>{ entry: { id: 'nodeId', name: 'name' } }];
|
||||
spyOn(store, 'dispatch').and.stub();
|
||||
fixture.detectChanges();
|
||||
store.dispatch(new SetSelectedNodesAction(selection));
|
||||
|
||||
router.navigateByUrl('somewhere/over/the/rainbow');
|
||||
fixture.detectChanges();
|
||||
store.select(getAppSelection).subscribe(state => {
|
||||
expect(state.isEmpty).toBe(true);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
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();
|
||||
});
|
||||
expect(store.dispatch['calls'].mostRecent().args).toEqual([
|
||||
new ResetSelectionAction()
|
||||
]);
|
||||
});
|
||||
|
||||
it('should close menu on mobile screen size', () => {
|
||||
|
Reference in New Issue
Block a user