Skip to content

Commit

Permalink
Fix: don't initialize workpad from WorkpadApp (elastic#32163)
Browse files Browse the repository at this point in the history
Closes elastic#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*
  • Loading branch information
w33ble authored and clintandrewhall committed Feb 28, 2019
1 parent f807708 commit 42707a1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -24,9 +23,6 @@ const mapStateToProps = state => {
};

const mapDispatchToProps = dispatch => ({
initializeWorkpad() {
dispatch(initializeWorkpad());
},
deselectElement(ev) {
ev && ev.stopPropagation();
dispatch(selectElement(null));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 42707a1

Please sign in to comment.