mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
parent
14f693e0f3
commit
e6391ceba6
4 changed files with 4 additions and 15 deletions
|
@ -9,7 +9,7 @@ import { notify } from '../../lib/notify';
|
|||
import { getDefaultWorkpad } from '../../state/defaults';
|
||||
import { setWorkpad } from '../../state/actions/workpad';
|
||||
import { setAssets, resetAssets } from '../../state/actions/assets';
|
||||
import { gotoPage } from '../../state/actions/pages';
|
||||
import { setPage } from '../../state/actions/pages';
|
||||
import { getWorkpad } from '../../state/selectors/workpad';
|
||||
import { isFirstLoad } from '../../state/selectors/app';
|
||||
import { setCanUserWrite, setFirstLoad } from '../../state/actions/transient';
|
||||
|
@ -88,7 +88,7 @@ export const routes = [
|
|||
// set the active page using the number provided in the url
|
||||
const pageIndex = pageNumber - 1;
|
||||
if (pageIndex !== workpad.page) {
|
||||
dispatch(gotoPage(pageIndex));
|
||||
dispatch(setPage(pageIndex));
|
||||
}
|
||||
},
|
||||
meta: {
|
||||
|
|
|
@ -8,7 +8,6 @@ import { createAction } from 'redux-actions';
|
|||
|
||||
export const addPage = createAction('addPage');
|
||||
export const duplicatePage = createAction('duplicatePage');
|
||||
export const gotoPage = createAction('gotoPage');
|
||||
export const movePage = createAction('movePage', (id, position) => ({ id, position }));
|
||||
export const removePage = createAction('removePage');
|
||||
export const stylePage = createAction('stylePage', (pageId, style) => ({ pageId, style }));
|
||||
|
|
|
@ -18,7 +18,7 @@ import {
|
|||
} from '../actions/elements';
|
||||
import { restoreHistory } from '../actions/history';
|
||||
import { selectElement } from '../actions/transient';
|
||||
import { addPage, removePage, duplicatePage, gotoPage } from '../actions/pages';
|
||||
import { addPage, removePage, duplicatePage, setPage } from '../actions/pages';
|
||||
import { appReady } from '../actions/app';
|
||||
import { setWorkpad } from '../actions/workpad';
|
||||
import { getNodes, getPages, getSelectedPage, getSelectedElement } from '../selectors/workpad';
|
||||
|
@ -59,7 +59,7 @@ const aeroelasticConfiguration = {
|
|||
|
||||
const isGroupId = id => id.startsWith(aeroelasticConfiguration.groupName);
|
||||
|
||||
const pageChangerActions = [gotoPage.toString(), duplicatePage.toString(), addPage.toString()];
|
||||
const pageChangerActions = [duplicatePage.toString(), addPage.toString(), setPage.toString()];
|
||||
|
||||
/**
|
||||
* elementToShape
|
||||
|
|
|
@ -80,16 +80,6 @@ export const pagesReducer = handleActions(
|
|||
return setPageIndex(workpadState, payload);
|
||||
},
|
||||
|
||||
[actions.gotoPage]: (workpadState, { payload }) => {
|
||||
const newState = setPageIndex(workpadState, payload);
|
||||
|
||||
// changes to the page require navigation
|
||||
const router = routerProvider();
|
||||
router.navigateTo('loadWorkpad', { id: newState.id, page: newState.page + 1 });
|
||||
|
||||
return newState;
|
||||
},
|
||||
|
||||
[actions.movePage]: (workpadState, { payload }) => {
|
||||
const { id, position } = payload;
|
||||
const pageIndex = getPageIndexById(workpadState, id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue