From a63c40db4d6de7adb7dff38ea337908293b291c0 Mon Sep 17 00:00:00 2001 From: monfera Date: Thu, 14 Feb 2019 20:00:32 +0100 Subject: [PATCH] Refactor: `configuration` is normal part of the scene --- .../plugins/canvas/public/lib/aeroelastic/layout_functions.js | 2 +- x-pack/plugins/canvas/public/lib/aeroelastic_kibana.js | 1 - x-pack/plugins/canvas/public/state/middleware/aeroelastic.js | 3 +-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/canvas/public/lib/aeroelastic/layout_functions.js b/x-pack/plugins/canvas/public/lib/aeroelastic/layout_functions.js index d7c873d74c96d..8445c1f88ec51 100644 --- a/x-pack/plugins/canvas/public/lib/aeroelastic/layout_functions.js +++ b/x-pack/plugins/canvas/public/lib/aeroelastic/layout_functions.js @@ -1018,7 +1018,7 @@ const preserveCurrentGroups = (shapes, selectedShapes) => ({ shapes, selectedSha export const getScene = state => state.currentScene; export const configuration = state => { - return state.configuration; + return state.currentScene.configuration; }; export const getShapes = scene => scene.shapes; diff --git a/x-pack/plugins/canvas/public/lib/aeroelastic_kibana.js b/x-pack/plugins/canvas/public/lib/aeroelastic_kibana.js index 20bb45df5187a..3167294e4fb08 100644 --- a/x-pack/plugins/canvas/public/lib/aeroelastic_kibana.js +++ b/x-pack/plugins/canvas/public/lib/aeroelastic_kibana.js @@ -24,7 +24,6 @@ export const aeroelastic = { const updateScene = state.select((nextScene, primaryUpdate) => ({ primaryUpdate, currentScene: nextScene, - configuration: nextScene.configuration, }))(layout.nextScene, layout.primaryUpdate); stores.get(page).setUpdater(updateScene); diff --git a/x-pack/plugins/canvas/public/state/middleware/aeroelastic.js b/x-pack/plugins/canvas/public/state/middleware/aeroelastic.js index 5159f78be0839..37747b6d0f787 100644 --- a/x-pack/plugins/canvas/public/state/middleware/aeroelastic.js +++ b/x-pack/plugins/canvas/public/state/middleware/aeroelastic.js @@ -262,8 +262,7 @@ export const aeroelastic = ({ dispatch, getState }) => { aero.createStore( { primaryUpdate: null, - currentScene: { shapes: [] }, - configuration: aeroelasticConfiguration, + currentScene: { shapes: [], configuration: aeroelasticConfiguration }, }, onChangeCallback, page