-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[input controls] Horizontal layout #14918
Conversation
I suspect a flaky test:
cc @elastic/kibana-visualizations, does this look like a flaky test to you at all? I'm pretty sure I've seen this one before. jenkins, test this |
} | ||
const panelWidth = panelNode.clientWidth; | ||
const panelHeight = panelNode.clientHeight; | ||
// todo - how do we make this less fragile to css changes? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we need something exposed to the embeddable from dashboard - width/height that is only the inner values, and an onResize function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I filed #14921 so I can keep track of these kinds of things. Plus then maybe we can remember to go back and clean this up, since I agree, it's going to be very fragile.
What about adding a selenium test to try to ensure we don't break it accidentally? I'm dubious whether the react test would catch any issues. I've had problems testing dimension values in the jest tests because jsdom returns all 0 for getClientBoundingRect (or whatever that function is called).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor feedback, but lgtm.
.pressMouseButton() | ||
.moveMouseTo(null, 300, 0) | ||
.releaseMouseButton(); | ||
await PageObjects.common.sleep(500); //give time for vis to redraw |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I try to avoid sleeps as much as possible - what about wrapping the below in a retry, so if it fails the first time, I'll try again, and by then enough time should have passed so it finished redrawing? (here and below function)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
retry
does not work in this situation since the elements already exist and will be returned the first attempt. A sleep is needed before the expect
to allow the elements to be re-drawn with the new state. I updated the commits around the sleep to reflect this.
before(async () => { | ||
await PageObjects.common.navigateToApp('dashboard'); | ||
await PageObjects.dashboard.clickNewDashboard(); | ||
await PageObjects.dashboard.addVisualizations(['Visualization InputControl']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sweeeet, now you're going to have to show me how to add more visualization types to the archive. :)
@@ -44,5 +44,9 @@ visualization.input_control_vis { | |||
} | |||
} | |||
|
|||
visualize.input_control_vis { | |||
padding: 0 !important; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should add a comment here explaining why this is important (I'm guessing bc of the width calculations?)
const panelMargin = 1; | ||
const embeddedPanelPadding = 8; | ||
const inputControlVisMargin = 5; | ||
const flexGridSmallMargin = 4; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tiny nit but I think as static const variables, these are supposed to be named like EMBEDDED_PANEL_PADDING. Also, is there a file you grabbed these from? Might be worthwhile to point to it so if anything looks off someone can double check the values match and know where to look. (though who knows how long that will stay in sync for... just a suggestion, take it or leave it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
06c466b
to
6458a5e
Compare
6458a5e
to
115cc59
Compare
@stacey-gammon @kobelb I have refactor this PR to use the ui framework's |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The CI failure looks unrelated, but I'd much prefer a green CI run before merging as it could be caused by this PR.
|
jenkins, test this |
1 similar comment
jenkins, test this |
ec42357
to
6338a3d
Compare
6338a3d
to
198ab11
Compare
* input controls horizontal layout * fix controlWidth calculation * add functional test to ensure panel resizing changes layout * use all caps for consts, add more comments about where values came from * replace sleeps in functional tests with retry * use KuiFlexGroup with wrap option instead of manually calculating widths * remove no longer used min width constants
* input controls horizontal layout * fix controlWidth calculation * add functional test to ensure panel resizing changes layout * use all caps for consts, add more comments about where values came from * replace sleeps in functional tests with retry * use KuiFlexGroup with wrap option instead of manually calculating widths * remove no longer used min width constants
* [input controls] Horizontal layout (#14918) * input controls horizontal layout * fix controlWidth calculation * add functional test to ensure panel resizing changes layout * use all caps for consts, add more comments about where values came from * replace sleeps in functional tests with retry * use KuiFlexGroup with wrap option instead of manually calculating widths * remove no longer used min width constants * fix dashboard grid function test.
* input controls horizontal layout * fix controlWidth calculation * add functional test to ensure panel resizing changes layout * use all caps for consts, add more comments about where values came from * replace sleeps in functional tests with retry * use KuiFlexGroup with wrap option instead of manually calculating widths * remove no longer used min width constants
Dynamically configure the input control panel layout based on the panel dimensions. When the panel is short and long - lay the controls out in a horizontal fashion. When the panel is tall and skinny - lay the controls out in a vertical fashion