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 Sub agg control #37979

Merged
merged 20 commits into from
Jun 13, 2019

Conversation

maryia-lapata
Copy link
Contributor

@maryia-lapata maryia-lapata commented Jun 4, 2019

Summary

EUIfication of Sub agg control for aggregation parameter in Default Editor, Data tab.
Part of #30922.

image

Steps to reproduce: create a visualization, choose an aggregation from Parent Pipeline Aggregations group (e.g. Derivative).

Details

  • validate-agg directive was removed
  • agg_select.js was updated. Now it has the same validation flow as agg_param.js has
  • functions isCompatibleAgg and safeMakeLabel were moved to a separate utils file (agg_utils.ts)

Screenshot:

Please pay your attention that validation a bit changed:

before: when a user chooses incompatible bucket aggregation, metrics aggregation input was in red
after: when a user chooses incompatible bucket aggregation, bucket aggregation input is in red

I changed this validation because it's a bit difficult to implement before case until agg_params.js will be migrated. Also I find it logical to make bucket aggregation input in red as that agg is incompatible. Reviewers, please, let me know if it's applicable.

Also now the error message is displayed underneath the agg form control:

Jun-05-2019 14-32-18

Checklist

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

For maintainers

@maryia-lapata maryia-lapata changed the title EUIficate metric agg control [Vis: Default editor] EUIficate Metric agg control Jun 4, 2019
@maryia-lapata maryia-lapata changed the title [Vis: Default editor] EUIficate Metric agg control [Vis: Default editor] EUIficate Sub agg control Jun 4, 2019
@elasticmachine

This comment has been minimized.

@maryia-lapata maryia-lapata requested a review from cchaos June 4, 2019 14:49
@cchaos
Copy link
Contributor

cchaos commented Jun 4, 2019

It doesn't seem to automatically put the sub-agg in an error state until you interact with it. Is there any way to force that state before you interact with it?

Also is there any way to change this message so that it is just help text underneath the sub-agg form control?

@elasticmachine

This comment has been minimized.

@maryia-lapata
Copy link
Contributor Author

It doesn't seem to automatically put the sub-agg in an error state until you interact with it. Is there any way to force that state before you interact with it?

Oh yes, I updated the PR. Thank you for noticing.

Also is there any way to change this message so that it is just help text underneath the sub-agg form control?

I moved this message into agg selector's error section.
I updated a screenshot in the description, please take a look.

@maryia-lapata maryia-lapata requested a review from sulemanof June 5, 2019 11:56
@elasticmachine

This comment has been minimized.

@maryia-lapata maryia-lapata marked this pull request as ready for review June 5, 2019 12:06
@maryia-lapata maryia-lapata 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.3.0 v8.0.0 labels Jun 5, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app

@timroes timroes mentioned this pull request Jun 5, 2019
29 tasks
@@ -79,9 +70,6 @@ const parentPipelineAggController = function ($scope) {

// we aren't creating a custom aggConfig
if (metricAgg !== 'custom') {
if (!$scope.state.aggs.find(agg => agg.id === metricAgg)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -13,12 +13,6 @@
style="display: none;">
</div>

<div ng-if="agg.error" class="form-group">
<p class="visEditorAggParam__error ng-binding">
{{agg.error}}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you also change the exclamation point of the error message to just a period:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@elasticmachine

This comment has been minimized.

@elasticmachine

This comment has been minimized.

@elasticmachine

This comment has been minimized.

@wylieconlon
Copy link
Contributor

I'm a bit confused about the warnings here. In both this branch and on master, I see the blue arrow indicating that a Derivative is valid without any X axis: Screenshot 2019-06-07 13 20 21

I see that this is not a regression, but it was confusing and seems related. What do you think?

@elasticmachine

This comment has been minimized.

Copy link
Contributor

@sulemanof sulemanof left a comment

Choose a reason for hiding this comment

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

Code and functionality LGTM! Tested locally.

@maryia-lapata
Copy link
Contributor Author

I'm a bit confused about the warnings here. In both this branch and on master, I see the blue arrow indicating that a Derivative is valid without any X axis: Screenshot 2019-06-07 13 20 21

I see that this is not a regression, but it was confusing and seems related. What do you think?

@wylieconlon I tested on 6.7, the issue is reproduced. So for me it seems like a bug. I create an issue:
#38537

@maryia-lapata
Copy link
Contributor Author

I believe that #38537 doesn't block migration. @wylieconlon could please continue with review?

@elasticmachine

This comment has been minimized.

@maryia-lapata maryia-lapata requested a review from dmlemeshko June 12, 2019 08:57
@elasticmachine

This comment has been minimized.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

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.

LGTM, thx!

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.

LGTM

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.

Changes to functional tests LGTM. Tested in both Chrome and Firefox

@maryia-lapata maryia-lapata merged commit 386619e into elastic:master Jun 13, 2019
@maryia-lapata maryia-lapata deleted the vis-editor-sub-agg branch June 13, 2019 08:18
maryia-lapata added a commit to maryia-lapata/kibana that referenced this pull request Jun 13, 2019
* EUIficate metric agg control

* Fix translation errors

* Display agg error underneath the last bucket agg form control

* Update functional test

* Update error message

* Update parent_pipeline_agg_controller.js

* Fix validation when metricAgg is invalid

* Show error message when a filed is selected

* Delete _terms_helper.tsx

* Remove extra empty line

* Update parent_pipeline_agg_helper.js

* Update selector for test
maryia-lapata added a commit that referenced this pull request Jun 13, 2019
* [Vis: Default editor] EUIficate Sub agg control (#37979)

* EUIficate metric agg control

* Fix translation errors

* Display agg error underneath the last bucket agg form control

* Update functional test

* Update error message

* Update parent_pipeline_agg_controller.js

* Fix validation when metricAgg is invalid

* Show error message when a filed is selected

* Delete _terms_helper.tsx

* Remove extra empty line

* Update parent_pipeline_agg_helper.js

* Update selector for test

* Remove unused translation
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.3.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants