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

[Vis: Default editor] EUIficate order and size controls #35134

Merged
merged 14 commits into from
May 3, 2019

Conversation

sulemanof
Copy link
Contributor

@sulemanof sulemanof commented Apr 16, 2019

Summary

Part of #30922.
EUIfication of other order and size controls for aggregation parameter.
These controls are used under Terms and Significant Terms aggregations.

image

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

@sulemanof sulemanof added Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Vis Editor Visualization editor issues release_note:skip Skip the PR/issue when compiling release notes v7.2.0 v8.0.0 labels Apr 16, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app

@elasticmachine
Copy link
Contributor

💔 Build Failed

@sulemanof sulemanof requested a review from maryia-lapata April 17, 2019 08:07
Copy link
Contributor

@maryia-lapata maryia-lapata left a comment

Choose a reason for hiding this comment

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

Please take a look at the comments

@sulemanof sulemanof requested a review from maryia-lapata April 17, 2019 13:59
@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@sulemanof sulemanof requested review from timroes and cchaos April 17, 2019 14:50
@cchaos
Copy link
Contributor

cchaos commented Apr 17, 2019

Can we put them on the same line as before?:

Screen Shot 2019-04-17 at 10 57 26 AM

@sulemanof
Copy link
Contributor Author

sulemanof commented Apr 18, 2019

Can we put them on the same line as before?:

Hi @cchaos !
Since these are two separate components without common parent (the parent only the whole block of parameters), the only way I found is to set both of them next rules:
display

Does it an appropriate way or you could propose another one? Thanks 😊

P.S. :
I could also provide an another solution and make it nested, then I need to use an additional parameter in angular onChange func in src\legacy\ui\public\vis\editors\default\agg_param.js:

$scope.onChange = (value, aggParamName = $scope.aggParam.name) => {

            $scope.$parent.onParamChange($scope.agg, aggParamName, value);

            ngModelCtrl.$setDirty();
          };

if @timroes and @maryia-lapata are OK with this ?

# Conflicts:
#	src/legacy/ui/public/agg_types/buckets/significant_terms.js
@cchaos
Copy link
Contributor

cchaos commented Apr 18, 2019

My worry with your inline style solution is if they are ever actually not used together then you're always applying that 50% width. I would suggest creating some way of allowing grouping multiple inputs on one line as it's the most extensible. Then you can just use EuiFlexGroups to contain them.

@sulemanof sulemanof requested a review from a team as a code owner April 19, 2019 10:30
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@sulemanof
Copy link
Contributor Author

sulemanof commented Apr 19, 2019

My worry with your inline style solution is if they are ever actually not used together then you're always applying that 50% width.

@cchaos , during the investigation of the problem I found that another solutions would break an existing interface of building aggregation params container.
I proposed a solution with wrapping both in additional blocks with inline styling, and it will not break cases where we need to use bare SizeParamEditor or OrderParamEditor separately and without this styling, e.x. in Significant Terms agg:

image

Copy link
Contributor

@maryia-lapata maryia-lapata left a comment

Choose a reason for hiding this comment

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

Tested on Chrome Mac, with custom locale, LGTM, just minor comments

src/legacy/ui/public/agg_types/agg_params.js Outdated Show resolved Hide resolved
src/legacy/ui/public/agg_types/__tests__/agg_params.js Outdated Show resolved Hide resolved
src/legacy/ui/public/vis/editors/default/_agg_params.scss Outdated Show resolved Hide resolved
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@timroes timroes mentioned this pull request Apr 23, 2019
29 tasks
Copy link
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

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

I think this can work as a solution. Though, I'd like to make it more specific to being "half" the size.

src/legacy/ui/public/vis/editors/default/_agg_params.scss Outdated Show resolved Hide resolved
src/legacy/ui/public/vis/editors/default/_agg_params.scss Outdated Show resolved Hide resolved
src/legacy/ui/public/vis/editors/default/_agg_params.scss Outdated Show resolved Hide resolved
import React from 'react';

const wrapWithInlineComp = Component => props => (
<div className={`visEditorAggParam--inline visEditorAggParam--inline-${props.aggParam.name}`}>
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that if you go the route of renaming this to explicitly state half then you won't need to depend on the props.aggParam.name and the margin can be added to a sibling CSS selector like: .visEditorAggParam--half + .visEditorAggParam--half

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately the solution wouldn't work because of our current structure (both them are built through the existing interface and are wrapped into additional elements). They are not siblings and that was the main pain of positioning them both since the start.

order-and-size-siblings

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cchaos are you OK with current implementation ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I just have a concern around using the aggParam name.

Will props.aggParam.name eve have a space in it like "name here"? If so you'll end up with a className list like: visEditorAggParam--inline visEditorAggParam--inline-name here which causes .here to be a valid class which is not good.

I also still think you can change the class from --inline to --half so it's easily understood that the CSS will make that field 50% wide.

Copy link
Contributor Author

@sulemanof sulemanof Apr 30, 2019

Choose a reason for hiding this comment

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

Will props.aggParam.name eve have a space in it like "name here"? If so you'll end up with a className list like: visEditorAggParam--inline visEditorAggParam--inline-name here which causes .here to be a valid class which is not good.

It never can have a space in a name because we are using these names in a url string. These names should always have or camelCase style or _ between words, like intervalBase, ip_range, min_doc_count, extended_bounds and so on.

I also still think you can change the class from --inline to --half so it's easily understood that the CSS will make that field 50% wide.

This work has been already done in this commit

src/legacy/ui/public/vis/editors/default/_agg_params.scss Outdated Show resolved Hide resolved
width: 50%;
}

.visEditorAggParam--inline-size {
Copy link
Contributor

Choose a reason for hiding this comment

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

As stated above about the class names this can be changed to:

Suggested change
.visEditorAggParam--inline-size {
.visEditorAggParam--half + .visEditorAggParam--half {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

😢

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@sulemanof sulemanof requested a review from cchaos April 24, 2019 08:46
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Member

@dmlemeshko dmlemeshko left a comment

Choose a reason for hiding this comment

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

Functional tests update reviewed and tested on MacOS 10.14.4

LGTM

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@wylieconlon wylieconlon left a comment

Choose a reason for hiding this comment

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

This is working for me locally, I scanned the code and it is mostly good, so LGTM

…_and_size

# Conflicts:
#	src/legacy/ui/public/agg_types/buckets/terms.js
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@maryia-lapata maryia-lapata left a comment

Choose a reason for hiding this comment

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

Tested locally, it works as expected. Also checked with custom locale and checked accessibility with VoiceOver.
LGTM

@sulemanof sulemanof merged commit b96e316 into elastic:master May 3, 2019
@sulemanof sulemanof deleted the EUIfication/order_and_size branch May 3, 2019 07:39
sulemanof added a commit to sulemanof/kibana that referenced this pull request May 3, 2019
sulemanof added a commit that referenced this pull request May 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported Feature:Vis Editor Visualization editor issues release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.2.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants