Skip to content

Conversation

@sulemanof
Copy link
Contributor

@sulemanof sulemanof commented Aug 14, 2019

Summary

A part of #38273.
EUIfication of the Options tab in the Gauge and Goal visualizations.

GAUGE

This includes:

  • get rid of all params, which were related to Metric type of gauge, since this type was removed -> removes left over code from the gauge-metric #15142 ;
  • all params, which were drawn using ng-hide, ng-show and ng-if becomes enabled/disabled for edit;
  • disable Alignment field when there is a single Metric aggregation and absence of Buckets:

gauge_disable_alignment

  • added color ranges validation with an error hint:

gauge_ranges_validation

Changes are done according to:

---- panel
​
## Style
​
Gauge Type --> Type
Alignment

--- panel
​
## Ranges
​
{List of ranges}
Auto extend range​
Percentage mode
Color schema
  -- `Reset colors` as hidden/visible xs empty button in labelAppend
Reverse schema
Show legend
Show scale

--- panel

### Labels

Show labels
Sub label [disabled not hidden if show labels is false]
Display warnings [disabled if show labels is false]

Checklist

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

For maintainers

@sulemanof sulemanof added the WIP Work in progress label Aug 14, 2019
@sulemanof sulemanof requested a review from cchaos August 14, 2019 13:11
@elasticmachine
Copy link
Contributor

💔 Build Failed

…ns/gauge

# Conflicts:
#	src/legacy/core_plugins/kbn_vislib_vis_types/public/controls/select.tsx
#	src/legacy/ui/public/vis/editors/default/vis_options.js
@elasticmachine
Copy link
Contributor

💔 Build Failed

@sulemanof sulemanof removed the WIP Work in progress label Aug 19, 2019
@sulemanof sulemanof changed the title [WIP][Vis: Default editor] EUIficate gauge options tab [Vis: Default editor] EUIficate gauge options tab Aug 19, 2019
@sulemanof sulemanof marked this pull request as ready for review August 19, 2019 14:54
@sulemanof sulemanof added release_note:skip Skip the PR/issue when compiling release notes Feature:Vis Editor Visualization editor issues Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v7.4.0 v8.0.0 labels Aug 19, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app

@elasticmachine
Copy link
Contributor

💔 Build Failed

@sulemanof sulemanof requested a review from cchaos August 19, 2019 18:18
@sulemanof sulemanof changed the title [Vis: Default editor] EUIficate gauge options tab [Vis: Default editor] EUIficate gauge/goal options tab Aug 19, 2019
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.

I think maybe it makes sense to split each panel into a separate component. It'll allow to keep components smaller and a bit simpler. Also probably we will be able reuse Range panel in Heat map vis

@elasticmachine
Copy link
Contributor

💔 Build Failed

@sulemanof
Copy link
Contributor Author

@maryia-lapata each panel was split. please, take a look

@elasticmachine
Copy link
Contributor

💔 Build Failed

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.

LGTM, testes locally on Chrome, Mac

@elasticmachine
Copy link
Contributor

💔 Build Failed

@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.

👍

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 LGTM. Passed locally on both Chrome/Firefox 👍

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 LGTM. Passed locally on both Chrome/Firefox 👍

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.

Code LGTM

addLegend: boolean;
isDisplayWarning: boolean;
gauge: {
readonly backStyle: 'Full';
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure why some of those are set to readonly - could you elaborate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The readonly params are only need for initial config and won't be changed anywhere.
We decided to mark them as readonly..

Copy link
Contributor

Choose a reason for hiding this comment

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

As they only have a single allowed value, it shouldn't change anything. Even if you don't have it readonly, you wouldn't be able to do params.type = 'xy';, right?


const setGaugeType = useCallback(
(paramName: 'gaugeType', value: GaugeVisParams['gauge']['gaugeType']) => {
const minAngle = value === 'Arc' ? undefined : 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably out of scope for this PR, but it seems like the angle params don't do anything useful for gauge - could we have this min and max angle as default params in the actual visualization? Then we don't have to handle this here in the form and just pass undefined for all cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

minAngel and maxAngel play role in building the gauge vis :
image

Not sure what do you mean by skipping them..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I suppose you mean something like that ? :

image

Copy link
Contributor

Choose a reason for hiding this comment

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

Exactly, that's what I meant - moving the default values into the actual rendering code so we don't have to care about it in the form.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This would make sense!
I'll create a PR, maybe someone could verify that this changes would not break a possible configuration issues! (I mean the possibility of creating custom minAngel and maxAngel in the default config or even in a custom plugin )

@sulemanof
Copy link
Contributor Author

retest

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@sulemanof sulemanof merged commit e568c3d into elastic:master Aug 22, 2019
@sulemanof sulemanof deleted the EUIfication/options/gauge branch August 22, 2019 13:02
sulemanof added a commit to sulemanof/kibana that referenced this pull request Aug 22, 2019
* Euificate gauge options

* Changes params places

* Add ranges validation

* Get rid of legacy translates

* Fix functional tests

* Split gauge to panel components

* Disable alignment option
sulemanof added a commit that referenced this pull request Aug 23, 2019
* Euificate gauge options

* Changes params places

* Add ranges validation

* Get rid of legacy translates

* Fix functional tests

* Split gauge to panel components

* Disable alignment option
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 Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v7.4.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants