Skip to content

Fixes loading component#25819

Merged
cqliu1 merged 2 commits intoelastic:masterfrom
cqliu1:fix/loading-component
Nov 19, 2018
Merged

Fixes loading component#25819
cqliu1 merged 2 commits intoelastic:masterfrom
cqliu1:fix/loading-component

Conversation

@cqliu1
Copy link
Copy Markdown
Contributor

@cqliu1 cqliu1 commented Nov 16, 2018

Re #25342.

This is a permanent fix to the bug that was crashing kibana when you upload images.

The cause was the Loading component was trying to access redux from inside one of the arg forms, which don't have access to the redux store.

This removes the redux selector from the Loading component and moves it higher up to a component that has access to redux and passes that page background color into the loading component as a prop.

@cqliu1 cqliu1 added review v7.0.0 Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// v6.6.0 v6.5.2 labels Nov 16, 2018
@cqliu1 cqliu1 requested a review from w33ble November 16, 2018 17:51
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-canvas

@cqliu1 cqliu1 self-assigned this Nov 16, 2018
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Copy link
Copy Markdown
Contributor

@w33ble w33ble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionally LGTM, couple small change requests though.

return !state || !renderable;
}, renderComponent(Loading)),

}, renderComponent(({ backgroundColor }) => <Loading backgroundColor={backgroundColor} />)),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add backgroundColor to the propTypes too.

});

export const Loading = connect(mapStateToProps)(Component);
export const Loading = pure(Component);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need a defaultValue in loading.js for the backgroundColor prop. It's not a required prop, and it'll be null otherwise. You could also make it a required prop...

@cqliu1
Copy link
Copy Markdown
Contributor Author

cqliu1 commented Nov 16, 2018

@w33ble I added a backgroundColor prop to element_content and added a defaultProp for backgroundColor in loading.

Copy link
Copy Markdown
Contributor

@w33ble w33ble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ship it ヾ(´▽`;)ゝ

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@cqliu1 cqliu1 merged commit 1d7d603 into elastic:master Nov 19, 2018
cqliu1 added a commit to cqliu1/kibana that referenced this pull request Nov 19, 2018
* Removes redux selectors from loading component. Fixes how loading accesses page background color

* Fixed props
cqliu1 added a commit that referenced this pull request Nov 19, 2018
* Removes redux selectors from loading component. Fixes how loading accesses page background color

* Fixed props
cqliu1 added a commit that referenced this pull request Nov 19, 2018
* Removes redux selectors from loading component. Fixes how loading accesses page background color

* Fixed props
@cqliu1 cqliu1 deleted the fix/loading-component branch January 3, 2019 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// v6.5.2 v6.6.0 v7.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants