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

Move SplitPanel to kibana_react #55529

Merged
merged 5 commits into from
Jan 24, 2020

Conversation

jloleysens
Copy link
Contributor

Summary

Moves the SplitPanel component to a shared location rather than housing it inside of the legacy Console plugin where it can be used and updated.

This component creates a divider between two panels that supports dragging the divider which resizes components - currently supports two panels. No reason we can't support n panels if there is a need.

This might be of interest to design to take over eventually.

@jloleysens jloleysens added chore v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.7.0 labels Jan 22, 2020
@jloleysens jloleysens requested a review from a team as a code owner January 22, 2020 09:47
Copy link
Contributor

@clintandrewhall clintandrewhall left a comment

Choose a reason for hiding this comment

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

Thanks for moving this upward, and so quickly! I may contribute some changes in the coming days... I noticed there's an opportunity to wrap children in Panels, rather than forcing the consumer to wrap each panel content, for example.

@flash1293
Copy link
Contributor

FYI there is already a draft PR for moving this to EUI - elastic/eui#2701

@jloleysens if you are moving forward with that, let @sulemanof know.

@jloleysens
Copy link
Contributor Author

@flash1293 Thanks for referencing that work here! I wasn't aware those changes were happening I just noticed that this component was already being used in another app after #49864 was merged (I wasn't aware of this either until recently). @clintandrewhall also asked whether he could use it so I moved this out of Console.

I guess it is not worth making changes to this component here in future but we can still go ahead with the move for now?

@jloleysens
Copy link
Contributor Author

jloleysens commented Jan 23, 2020

In other words, moving the component shouldn't affect their work other than it not being really necessary as it will probably be removed from Kibana at some future point anyway 😅.

@flash1293
Copy link
Contributor

@jloleysens We discussed moving it into kibana_react as part of the PR you linked, but decided against it because the EUI component should be close. With other consumers it definitely makes sense, so thanks for working on this!

Copy link
Contributor

@streamich streamich left a comment

Choose a reason for hiding this comment

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

AppArch changes LGTM.

@@ -91,6 +91,16 @@ export function PanelsContainer({
[onPanelWidthChange]
);

useEffect(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe wrap this in

if (process.env.NODE_ENV !== 'production') {

'[Split Panels Container] Detected more than two children; ignoring additional children.'
);
}
}, [thirdChild ? 1 : 0]);
Copy link
Contributor

Choose a reason for hiding this comment

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

thirdChild could be null or undefined or "" (empty string), maybe

Suggested change
}, [thirdChild ? 1 : 0]);
}, [children.length > 2]);

@lukeelmers
Copy link
Member

I guess it is not worth making changes to this component here in future

++ Yeah this is definitely the type of thing that belongs in EUI. If elastic/eui#2701 is going to be on the way soon, then ideally we would remove this component as soon as that replacement one becomes available, so that we aren't maintaining it any longer than necessary. Perhaps we could even add a TODO to remove this as soon as EUI is upgraded.

@clintandrewhall If you are looking to contribute changes, maybe you could instead coordinate with @sulemanof to make sure the EUI component has the features you need? That way we aren't deepening our integration with this component.

@jloleysens
Copy link
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

@jloleysens jloleysens merged commit 6984cf1 into elastic:master Jan 24, 2020
@jloleysens jloleysens deleted the move-split-panel-component branch January 24, 2020 12:11
jloleysens added a commit to jloleysens/kibana that referenced this pull request Jan 24, 2020
* split_panel component -> kibana_react

* Update useEffect for console warning

* `console` -> `kibana-react` i18n namespace

* Update when warning about children is emitted in split panel component

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
jloleysens added a commit that referenced this pull request Jan 24, 2020
* split_panel component -> kibana_react

* Update useEffect for console warning

* `console` -> `kibana-react` i18n namespace

* Update when warning about children is emitted in split panel component

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore release_note:skip Skip the PR/issue when compiling release notes v7.7.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants