Skip to content
Snippets Groups Projects
Commit 92c6cb66 authored by Jessie Keck's avatar Jessie Keck
Browse files

Remove unused companion window actions and reducers

parent f6ad3228
Branches
Tags
No related merge requests found
......@@ -86,21 +86,6 @@ describe('window actions', () => {
});
});
describe('setWindowCompanionWindow', () => {
it('returns the appropriate action type', () => {
const windowId = 'abc123';
const panelType = 'info';
const position = 'right';
const expectedAction = {
type: ActionTypes.SET_WINDOW_COMPANION_WINDOW,
windowId,
panelType,
position,
};
expect(actions.setWindowCompanionWindow(windowId, 'info', 'right')).toEqual(expectedAction);
});
});
describe('popOutCompanionWindow', () => {
it('returns a thunk which dispatches the appropriate actions', () => {
const mockDispatch = jest.fn();
......
......@@ -121,42 +121,6 @@ describe('windows reducer', () => {
});
});
describe('SET_WINDOW_COMPANION_WINDOW', () => {
it('sets the given type under the given position when no companion window exists', () => {
const action = {
type: ActionTypes.SET_WINDOW_COMPANION_WINDOW,
windowId: 'abc123',
position: 'right',
panelType: 'info',
};
const before = {
abc123: {},
};
const after = {
abc123: { companionWindows: { right: 'info' } },
};
expect(windowsReducer(before, action)).toEqual(after);
});
it('overwrites the given position and sets the new type when a companion window in the same position exists', () => {
const action = {
type: ActionTypes.SET_WINDOW_COMPANION_WINDOW,
windowId: 'abc123',
position: 'right',
panelType: 'info',
};
const before = {
abc123: { companionWindows: { right: 'canvas_navigation' } },
};
const after = {
abc123: { companionWindows: { right: 'info' } },
};
expect(windowsReducer(before, action)).toEqual(after);
});
});
describe('SET_COMPANION_WINDOW', () => {
it('adds the id to the companin array', () => {
const action = {
......
......@@ -17,7 +17,6 @@ const ActionTypes = {
SET_WINDOW_THUMBNAIL_POSITION: 'SET_WINDOW_THUMBNAIL_POSITION',
SET_WINDOW_VIEW_TYPE: 'SET_WINDOW_VIEW_TYPE',
SET_WORKSPACE_ADD_VISIBILITY: 'SET_WORKSPACE_ADD_VISIBILITY',
SET_WINDOW_COMPANION_WINDOW: 'SET_WINDOW_COMPANION_WINDOW',
TOGGLE_WINDOW_SIDE_BAR: 'TOGGLE_WINDOW_SIDE_BAR',
TOGGLE_WINDOW_SIDE_BAR_PANEL: 'TOGGLE_WINDOW_SIDE_BAR_PANEL',
TOGGLE_ZOOM_CONTROLS: 'TOGGLE_ZOOM_CONTROLS',
......
......@@ -54,25 +54,6 @@ export function toggleWindowSideBar(windowId) {
return { type: ActionTypes.TOGGLE_WINDOW_SIDE_BAR, windowId };
}
/**
* setWindowCompanionWindow - action creator
*
* @param {String} windowId
* @param {String} panelType The type of panel content to be rendered
* in the companion window (e.g. info, canvas_navigation)
* @param {String} position The position of the companion window to
* set content for (e.g. right, bottom)
* @memberof ActionCreators
*/
export function setWindowCompanionWindow(windowId, panelType, position) {
return {
type: ActionTypes.SET_WINDOW_COMPANION_WINDOW,
windowId,
panelType,
position,
};
}
/**
* toggleWindowSideBarPanel - action creator
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment