mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +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
@@ -27,10 +27,10 @@ import * as app from './navigation.rules';
|
||||
|
||||
describe('navigation.evaluators', () => {
|
||||
describe('isPreview', () => {
|
||||
it('should return [true] if url contains `/preview/`', () => {
|
||||
it('should return [true] if url contains `viewer:view`', () => {
|
||||
const context: any = {
|
||||
navigation: {
|
||||
url: 'path/preview/id'
|
||||
url: 'path/(viewer:view/id)'
|
||||
}
|
||||
};
|
||||
|
||||
@@ -271,20 +271,30 @@ describe('navigation.evaluators', () => {
|
||||
});
|
||||
|
||||
describe('isSharedPreview', () => {
|
||||
it('should return [true] if url starts with `/shared/preview/`', () => {
|
||||
it('should return [true] if url starts with `/shared` and contains `viewer:view', () => {
|
||||
const context: any = {
|
||||
navigation: {
|
||||
url: '/shared/preview/path'
|
||||
url: '/shared/(viewer:view)'
|
||||
}
|
||||
};
|
||||
|
||||
expect(app.isSharedPreview(context)).toBe(true);
|
||||
});
|
||||
|
||||
it('should return [false] if url does not start with `/shared/preview/`', () => {
|
||||
it('should return [false] if url does not start with `/shared`', () => {
|
||||
const context: any = {
|
||||
navigation: {
|
||||
url: '/path/shared/preview/'
|
||||
url: '/path/shared/(viewer:view)'
|
||||
}
|
||||
};
|
||||
|
||||
expect(app.isSharedPreview(context)).toBe(false);
|
||||
});
|
||||
|
||||
it('should return [false] if url starts with `/shared` and does not includes `viewer:view`', () => {
|
||||
const context: any = {
|
||||
navigation: {
|
||||
url: '/shared/something'
|
||||
}
|
||||
};
|
||||
|
||||
@@ -293,20 +303,30 @@ describe('navigation.evaluators', () => {
|
||||
});
|
||||
|
||||
describe('isFavoritesPreview', () => {
|
||||
it('should return [true] if url starts with `/favorites/preview/`', () => {
|
||||
it('should return [true] if url starts with `/favorites` and includes `viewer:view`', () => {
|
||||
const context: any = {
|
||||
navigation: {
|
||||
url: '/favorites/preview/path'
|
||||
url: '/favorites/(viewer:view)'
|
||||
}
|
||||
};
|
||||
|
||||
expect(app.isFavoritesPreview(context)).toBe(true);
|
||||
});
|
||||
|
||||
it('should return [false] if url does not start with `/favorites/preview/`', () => {
|
||||
it('should return [false] if url does not start with `/favorites`', () => {
|
||||
const context: any = {
|
||||
navigation: {
|
||||
url: '/path/favorites/preview/'
|
||||
url: '/path/favorites/(viewer:view)'
|
||||
}
|
||||
};
|
||||
|
||||
expect(app.isFavoritesPreview(context)).toBe(false);
|
||||
});
|
||||
|
||||
it('should return [false] if url starts with `/favorites` and does not include `viewer:view`', () => {
|
||||
const context: any = {
|
||||
navigation: {
|
||||
url: '/favorites/other'
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -31,7 +31,7 @@ import { RuleContext } from '@alfresco/adf-extensions';
|
||||
*/
|
||||
export function isPreview(context: RuleContext): boolean {
|
||||
const { url } = context.navigation;
|
||||
return url && (url.includes('/preview/') || url.includes('/view/'));
|
||||
return url && (url.includes('viewer:view') || url.includes('/view/'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -165,7 +165,7 @@ export function isNotSearchResults(context: RuleContext): boolean {
|
||||
*/
|
||||
export function isSharedPreview(context: RuleContext): boolean {
|
||||
const { url } = context.navigation;
|
||||
return url && url.startsWith('/shared/preview/');
|
||||
return url && url.startsWith('/shared') && url.includes('viewer:view');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -174,7 +174,7 @@ export function isSharedPreview(context: RuleContext): boolean {
|
||||
*/
|
||||
export function isFavoritesPreview(context: RuleContext): boolean {
|
||||
const { url } = context.navigation;
|
||||
return url && url.startsWith('/favorites/preview/');
|
||||
return url && url.startsWith('/favorites') && url.includes('viewer:view');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -38,6 +38,7 @@ export enum AppActionTypes {
|
||||
ToggleDocumentDisplayMode = 'TOGGLE_DOCUMENT_DISPLAY_MODE',
|
||||
Logout = 'LOGOUT',
|
||||
ReloadDocumentList = 'RELOAD_DOCUMENT_LIST',
|
||||
ResetSelection = 'RESET_SELECTION',
|
||||
SetInfoDrawerState = 'SET_INFO_DRAWER_STATE',
|
||||
SetInfoDrawerMetadataAspect = 'SET_INFO_DRAWER_METADATA_ASPECT',
|
||||
CloseModalDialogs = 'CLOSE_MODAL_DIALOGS'
|
||||
@@ -91,6 +92,12 @@ export class ReloadDocumentListAction implements Action {
|
||||
constructor(public payload?: any) {}
|
||||
}
|
||||
|
||||
export class ResetSelectionAction implements Action {
|
||||
readonly type = AppActionTypes.ResetSelection;
|
||||
|
||||
constructor(public payload?: any) {}
|
||||
}
|
||||
|
||||
export class SetInfoDrawerStateAction implements Action {
|
||||
readonly type = AppActionTypes.SetInfoDrawerState;
|
||||
|
||||
|
@@ -36,7 +36,7 @@ export enum ViewerActionTypes {
|
||||
export class ViewFileAction implements Action {
|
||||
readonly type = ViewerActionTypes.ViewFile;
|
||||
|
||||
constructor(public payload: MinimalNodeEntity, public parentId?: string) {}
|
||||
constructor(public payload?: MinimalNodeEntity, public parentId?: string) {}
|
||||
}
|
||||
|
||||
export class ViewNodeAction implements Action {
|
||||
|
Reference in New Issue
Block a user