From 42707a12dd7f6867a09a07669d06838cd6a50c7b Mon Sep 17 00:00:00 2001 From: Joe Fleming Date: Wed, 27 Feb 2019 21:00:11 -0700 Subject: [PATCH] Fix: don't initialize workpad from WorkpadApp (#32163) Closes https://github.com/elastic/kibana/issues/32161 All the elements are loaded in the router, so loading the from the component just duplicates the work. This is actually left-over code from before we had a router. Apparently I missed this lifecycle when adding the router, so it's been an issue in Canvas for quite some time now. ### Stats Workpad | Previous load time | PR load time -- | -- | -- Elastic{ON} Tour Dallas: Canvas v3 | 10 seconds | 7 seconds Kibana Canvas - Your data, your way. | 32 seconds | 18 seconds *Time from when the Canvas loading indicator goes away and the workpad app renders to when the loading indicator stops spinning* --- .../plugins/canvas/public/apps/workpad/workpad_app/index.js | 4 ---- .../canvas/public/apps/workpad/workpad_app/workpad_app.js | 5 ----- 2 files changed, 9 deletions(-) diff --git a/x-pack/plugins/canvas/public/apps/workpad/workpad_app/index.js b/x-pack/plugins/canvas/public/apps/workpad/workpad_app/index.js index 119c071e3866d..cbfa41f8d1675 100644 --- a/x-pack/plugins/canvas/public/apps/workpad/workpad_app/index.js +++ b/x-pack/plugins/canvas/public/apps/workpad/workpad_app/index.js @@ -6,7 +6,6 @@ import { connect } from 'react-redux'; import { compose, branch, renderComponent } from 'recompose'; -import { initializeWorkpad } from '../../../state/actions/workpad'; import { selectElement } from '../../../state/actions/transient'; import { canUserWrite, getAppReady } from '../../../state/selectors/app'; import { getWorkpad, isWriteable } from '../../../state/selectors/workpad'; @@ -24,9 +23,6 @@ const mapStateToProps = state => { }; const mapDispatchToProps = dispatch => ({ - initializeWorkpad() { - dispatch(initializeWorkpad()); - }, deselectElement(ev) { ev && ev.stopPropagation(); dispatch(selectElement(null)); diff --git a/x-pack/plugins/canvas/public/apps/workpad/workpad_app/workpad_app.js b/x-pack/plugins/canvas/public/apps/workpad/workpad_app/workpad_app.js index 49ef7ed97e07f..664c071cd0cd2 100644 --- a/x-pack/plugins/canvas/public/apps/workpad/workpad_app/workpad_app.js +++ b/x-pack/plugins/canvas/public/apps/workpad/workpad_app/workpad_app.js @@ -15,13 +15,8 @@ export class WorkpadApp extends React.PureComponent { static propTypes = { isWriteable: PropTypes.bool.isRequired, deselectElement: PropTypes.func, - initializeWorkpad: PropTypes.func.isRequired, }; - componentDidMount() { - this.props.initializeWorkpad(); - } - render() { const { isWriteable, deselectElement } = this.props;