This is an automated email from the ASF dual-hosted git repository.
apucher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git
The following commit(s) were added to refs/heads/master by this push:
new ebe5060 [TE] rootcause - support remove metric from chart label
(#3531)
ebe5060 is described below
commit ebe50604623eadab482fb5b87c180ac4ef4fcf32
Author: Alexander Pucher <[email protected]>
AuthorDate: Tue Nov 20 14:35:02 2018 -0800
[TE] rootcause - support remove metric from chart label (#3531)
Add support from removing metrics from the current selection directly from
the chart label.
---
.../pods/components/rootcause-chart/component.js | 12 +++++++++--
.../pods/components/rootcause-chart/template.hbs | 13 +++++++++---
.../app/pods/rootcause/template.hbs | 3 ++-
.../app/styles/components/rootcause-chart.scss | 24 ++++++++++++++++++++++
4 files changed, 46 insertions(+), 6 deletions(-)
diff --git
a/thirdeye/thirdeye-frontend/app/pods/components/rootcause-chart/component.js
b/thirdeye/thirdeye-frontend/app/pods/components/rootcause-chart/component.js
index 23e3787..697b5cf 100644
---
a/thirdeye/thirdeye-frontend/app/pods/components/rootcause-chart/component.js
+++
b/thirdeye/thirdeye-frontend/app/pods/components/rootcause-chart/component.js
@@ -35,6 +35,8 @@ export default Component.extend({
onSelection: null, // function (updates)
+ onPrimaryChange: null, // function (updates)
+
timeseriesMode: null, // 'absolute', 'relative', 'log', 'split'
classNames: ['rootcause-chart'],
@@ -524,10 +526,16 @@ export default Component.extend({
actions: {
onSelect(urn) {
- const { onSelection } = getProperties(this, 'onSelection');
+ const { onPrimaryChange } = getProperties(this, 'onPrimaryChange');
+ if (onPrimaryChange) {
+ onPrimaryChange({ [toMetricUrn(urn)]: true, [toBaselineUrn(urn)]:
true, [toCurrentUrn(urn)]: true });
+ }
+ },
+ onRemove(urn) {
+ const { onSelection } = getProperties(this, 'onSelection');
if (onSelection) {
- onSelection({ [toMetricUrn(urn)]: true, [toBaselineUrn(urn)]: true,
[toCurrentUrn(urn)]: true });
+ onSelection({ [toMetricUrn(urn)]: false, [toBaselineUrn(urn)]: false,
[toCurrentUrn(urn)]: false });
}
}
}
diff --git
a/thirdeye/thirdeye-frontend/app/pods/components/rootcause-chart/template.hbs
b/thirdeye/thirdeye-frontend/app/pods/components/rootcause-chart/template.hbs
index eb399a4..bd4cae4 100644
---
a/thirdeye/thirdeye-frontend/app/pods/components/rootcause-chart/template.hbs
+++
b/thirdeye/thirdeye-frontend/app/pods/components/rootcause-chart/template.hbs
@@ -1,9 +1,16 @@
{{#if isSplit}}
{{#each splitUrns as |urn|}}
<div>
- <a {{action "onSelect" urn}}>
- <h4 class="rootcause-chart__title">{{get-safe splitLabels urn}}</h4>
- </a>
+ <span>
+ <h4 class="rootcause-chart__title">
+ <a {{action "onSelect" urn}}>{{get-safe splitLabels urn}}</a>
+ <a class="rootcause-chart__remove-icon" {{action "onRemove" urn}}>
+ <i class="glyphicon glyphicon-remove">
+ {{tooltip-on-element text='Remove metric'}}
+ </i>
+ </a>
+ </h4>
+ </span>
{{timeseries-chart
series=(get-safe splitSeries urn)
tooltip=tooltip
diff --git a/thirdeye/thirdeye-frontend/app/pods/rootcause/template.hbs
b/thirdeye/thirdeye-frontend/app/pods/rootcause/template.hbs
index ba42d4e..a161caf 100644
--- a/thirdeye/thirdeye-frontend/app/pods/rootcause/template.hbs
+++ b/thirdeye/thirdeye-frontend/app/pods/rootcause/template.hbs
@@ -73,7 +73,8 @@
focusedUrns=focusedUrns
context=context
onHover=(action "chartOnHover")
- onSelection=(action "onPrimaryChange")
+ onSelection=(action "onSelection")
+ onPrimaryChange=(action "onPrimaryChange")
}}
</div>
</div>
diff --git
a/thirdeye/thirdeye-frontend/app/styles/components/rootcause-chart.scss
b/thirdeye/thirdeye-frontend/app/styles/components/rootcause-chart.scss
index 111446a..cd3c566 100644
--- a/thirdeye/thirdeye-frontend/app/styles/components/rootcause-chart.scss
+++ b/thirdeye/thirdeye-frontend/app/styles/components/rootcause-chart.scss
@@ -4,11 +4,35 @@
&__title {
padding-left: 16px;
cursor: pointer;
+
+ &:hover {
+ .rootcause-chart__remove-icon {
+ visibility: visible;
+ }
+ }
}
g[class*='c3-target-frontend-metric-baseline'] > .c3-lines {
stroke-dasharray: 1%;
}
+
+ &__remove-icon {
+ background-color: white;
+ border-color: app-shade(black, 0.55);
+ color: app-shade(black, 0.55);
+ visibility: hidden;
+ text-decoration: none;
+ cursor: pointer;
+
+ &:hover,
+ &:focus,
+ &:active,
+ a:hover, {
+ border-color: app-shade(black, 0.75);
+ color: app-shade(black, 0.75);
+ text-decoration: none;
+ }
+ }
}
.c3-line {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]