Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Lens] fix chart switching when on VisualizationDimensionEditor #70689

Merged
merged 9 commits into from
Aug 5, 2020

Conversation

mbondyra
Copy link
Contributor

@mbondyra mbondyra commented Jul 3, 2020

Summary

Fixes #70626

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@mbondyra mbondyra added Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Feature:Lens v7.9.0 labels Jul 3, 2020
@mbondyra mbondyra requested a review from a team July 3, 2020 07:10
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@flash1293
Copy link
Contributor

If I get this fix correctly it's hiding the popover content when the currently selected tab can't be shown because the popover will be hidden anyway in a split second because the user clicked something outside of the popover.

But that's not necessarily the case, if the user uses keyboard navigation (we probably have other bugs related to that). If I manage to click a suggestion without using the mouse, the popover won't close and render empty:
Screenshot 2020-07-03 at 10 54 26

I would suggest we simply reset the popover state in the layer panel when props.activeVisualizationId changes - seems like we should do that anyway.

@mbondyra
Copy link
Contributor Author

mbondyra commented Jul 3, 2020

Good one, Joe, didn't think about it, thanks 👌

@mbondyra
Copy link
Contributor Author

mbondyra commented Jul 6, 2020

@elasticmachine merge upstream

@mbondyra mbondyra requested review from flash1293 and wylieconlon July 6, 2020 12:26
@mbondyra mbondyra force-pushed the lens/visDimensionEditorfix branch from 7666465 to c42437e Compare July 6, 2020 12:30
@mbondyra
Copy link
Contributor Author

mbondyra commented Jul 6, 2020

@elasticmachine merge upstream

@wylieconlon
Copy link
Contributor

I tested this in Safari and observed the bug 100% of the time when following the reproduction steps.

Screenshot 2020-07-06 11 45 08

@mbondyra mbondyra force-pushed the lens/visDimensionEditorfix branch from 32ee830 to 4dba563 Compare July 7, 2020 13:55
@mbondyra
Copy link
Contributor Author

@elasticmachine merge upstream

@mbondyra mbondyra force-pushed the lens/visDimensionEditorfix branch from a51d47c to ab805d3 Compare July 29, 2020 11:52
@mbondyra
Copy link
Contributor Author

@elasticmachine merge upstream

@mbondyra
Copy link
Contributor Author

mbondyra commented Aug 3, 2020

@elasticmachine merge upstream

@mbondyra
Copy link
Contributor Author

mbondyra commented Aug 5, 2020

@elasticmachine merge upstream

Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

Tested in Firefox, no crashes. LGTM


const { framePublicAPI, layerId, isOnlyLayer, onRemoveLayer } = props;
const datasourcePublicAPI = framePublicAPI.datasourceLayers[layerId];

React.useEffect(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Super nit: Normally we import useEffect explicitly


React.useEffect(() => {
setPopoverState(initialPopoverState);
}, [props.activeVisualizationId]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this dependency list complete as far as the linter is concerned?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep, it's all good here :)

@mbondyra
Copy link
Contributor Author

mbondyra commented Aug 5, 2020

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

page load bundle size

id value diff baseline
lens 843.0KB +101.0B 842.9KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Lens release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.9.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Lens] Switching to different visualization while opened VisualizationDimensionEditor blows up the editor
5 participants