apucher closed pull request #3485: [TE] frontend harleyjj/manage remove WoW and
change buildMetricDataUr…
URL: https://github.com/apache/incubator-pinot/pull/3485
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/thirdeye/thirdeye-frontend/app/pods/components/anomaly-graph/component.js
b/thirdeye/thirdeye-frontend/app/pods/components/anomaly-graph/component.js
index f5f3c75f01..6218f6abcc 100644
--- a/thirdeye/thirdeye-frontend/app/pods/components/anomaly-graph/component.js
+++ b/thirdeye/thirdeye-frontend/app/pods/components/anomaly-graph/component.js
@@ -159,12 +159,11 @@ export default Component.extend({
const legendText = this.get('legendText');
const {
- dotted = { text: 'expected', color: 'blue'},
solid = { text: 'current', color: 'blue' }
} = legendText;
chart.insert('div', '.chart').attr('class',
'anomaly-graph__legend').selectAll('span')
- .data([dotted, solid])
+ .data([solid])
.enter().append('svg')
.attr('class', 'anomaly-graph__legend-item')
.attr('width', 80)
@@ -187,7 +186,7 @@ export default Component.extend({
.attr('x2', 30)
.attr('y2', 10)
.attr('stroke-dasharray', (d) => {
- const dasharrayNum = (d === dotted) ? '10%' : 'none';
+ const dasharrayNum = 'none';
return dasharrayNum;
});
});
@@ -254,7 +253,8 @@ export default Component.extend({
primaryMetric,
...relatedMetric,
...selectedMetrics,
- ...selectedDimensions];
+ ...selectedDimensions
+ ];
data.forEach((datum) => {
const name = datum.metricName || datum.name;
@@ -279,7 +279,7 @@ export default Component.extend({
dimensions: [],
selectedDimensions: [],
- showGraphLegend: true,
+ showGraphLegend: false,
colors: {},
showSubChart: false,
subchartStart: null,
@@ -388,7 +388,7 @@ export default Component.extend({
const showGraphLegend = this.get('showGraphLegend');
return {
position: 'inset',
- show: showGraphLegend
+ show: false
};
}),
@@ -541,8 +541,7 @@ export default Component.extend({
'showLegend',
'height',
function() {
- const height = this.get('height')
- || this.get('showLegend') ? 400 : 200;
+ const height = this.get('height') || 400;
return {
height
};
@@ -562,13 +561,11 @@ export default Component.extend({
if (primaryMetric.isSelected) {
const { baselineValues, currentValues } =
primaryMetric.subDimensionContributionMap['All'];
return [
- [`${primaryMetric.metricName}-current`, ...currentValues],
- [`${primaryMetric.metricName}-expected`, ...baselineValues]
+ [`${primaryMetric.metricName}-current`, ...currentValues]
];
}
return [
- [`${primaryMetric.metricName}-current`],
- [`${primaryMetric.metricName}-expected`]
+ [`${primaryMetric.metricName}-current`]
];
}
),
@@ -588,7 +585,6 @@ export default Component.extend({
const { baselineValues, currentValues } =
metric.subDimensionContributionMap['All'];
columns.push([`${metric.metricName}-current`, ...currentValues]);
- columns.push([`${metric.metricName}-expected`, ...baselineValues]);
});
return columns;
}
@@ -606,7 +602,6 @@ export default Component.extend({
selectedDimensions.forEach((dimension) => {
const { baselineValues, currentValues } = dimension;
columns.push([`${dimension.name}-current`, ...currentValues]);
- columns.push([`${dimension.name}-expected`, ...baselineValues]);
});
return columns;
}
diff --git
a/thirdeye/thirdeye-frontend/app/pods/components/self-serve-graph/template.hbs
b/thirdeye/thirdeye-frontend/app/pods/components/self-serve-graph/template.hbs
index 8ab3707361..05146d6c7f 100644
---
a/thirdeye/thirdeye-frontend/app/pods/components/self-serve-graph/template.hbs
+++
b/thirdeye/thirdeye-frontend/app/pods/components/self-serve-graph/template.hbs
@@ -21,7 +21,7 @@
showDimensions=false
isLoading=loading
showSubchart=true
- showLegend=true
+ showLegend=false
enableZoom=true
legendText=legendText
componentId=componentId
diff --git a/thirdeye/thirdeye-frontend/app/pods/manage/alert/explore/route.js
b/thirdeye/thirdeye-frontend/app/pods/manage/alert/explore/route.js
index ef3eb01037..2bfab38baf 100644
--- a/thirdeye/thirdeye-frontend/app/pods/manage/alert/explore/route.js
+++ b/thirdeye/thirdeye-frontend/app/pods/manage/alert/explore/route.js
@@ -274,6 +274,8 @@ export default Route.extend({
const maxTime = isReplayDone && metricId ? await
fetch(maxTimeUrl).then(checkStatus) : moment().valueOf();
Object.assign(model, { metricDataUrl: buildMetricDataUrl({
maxTime,
+ endStamp: config.endStamp,
+ startStamp: config.startStamp,
id: metricId,
filters: config.filters,
granularity: config.bucketUnit,
diff --git a/thirdeye/thirdeye-frontend/app/utils/manage-alert-utils.js
b/thirdeye/thirdeye-frontend/app/utils/manage-alert-utils.js
index 572e3b5c4e..3171387824 100644
--- a/thirdeye/thirdeye-frontend/app/utils/manage-alert-utils.js
+++ b/thirdeye/thirdeye-frontend/app/utils/manage-alert-utils.js
@@ -210,23 +210,21 @@ export function evalObj() {
* @returns {String} metric data call params/url
*/
export function buildMetricDataUrl(graphConfig) {
- const { id, maxTime, filters, dimension, granularity } = graphConfig;
+ const { id, maxTime, startStamp, endStamp, filters, dimension, granularity }
= graphConfig;
// Chosen dimension
const selectedDimension = dimension || 'All';
// Do not send a filters param if value not present
const filterQs = filters ? `&filters=${encodeURIComponent(filters)}` : '';
- // Load only a week of data if granularity is high
+ // Load only a week of data in default if granularity is high
const startTimeBucket = granularity &&
granularity.toLowerCase().includes('minute') ? 'week' : 'months';
- // For end date, choose either maxTime or end of yesterday
- const currentEnd = moment(maxTime).isValid() ? moment(maxTime).valueOf() :
buildDateEod(1, 'day').valueOf();
- // For graph start date, take either 1 week or 1 month, depending on
granularity
- const currentStart = moment(currentEnd).subtract(1,
startTimeBucket).valueOf();
- // Baseline starts 1 week before our start date
- const baselineStart = moment(currentStart).subtract(1, 'week').valueOf();
- // Baseline ends 1 week before our end date
- const baselineEnd = moment(currentEnd).subtract(1, 'week');
- // Now build the metric data url
- return
`/timeseries/compare/${id}/${currentStart}/${currentEnd}/${baselineStart}/${baselineEnd}?dimension=`
+
+ // set maxData as maxTime or default
+ const maxData = maxTime && moment(maxTime).isValid() ?
moment(maxTime).valueOf() : buildDateEod(1, 'day').valueOf();
+ // For end date, use end stamp if defined and valid, otherwise use maxData
+ const currentEnd = endStamp && moment(endStamp).isValid() ?
moment(endStamp).valueOf() : moment(maxData).valueOf();
+ // For graph start date, use start stamp if defined and valid, otherwise
pick it usimng startTimeBucket depending on granularity
+ const currentStart = startStamp && moment(startStamp).isValid() ?
moment(startStamp).valueOf() : moment(currentEnd).subtract(1,
startTimeBucket).valueOf();
+ // Now build the metric data url -> currentEnd and currentStart reused in
the call since baseline no longer displayed on graph
+ return
`/timeseries/compare/${id}/${currentStart}/${currentEnd}/${currentStart}/${currentEnd}?dimension=`
+
`${selectedDimension}&granularity=${granularity}${filterQs}`;
}
diff --git
a/thirdeye/thirdeye-frontend/tests/acceptance/self-serve-onboarding-test.js
b/thirdeye/thirdeye-frontend/tests/acceptance/self-serve-onboarding-test.js
index dfd691d50e..2beea9c72d 100644
--- a/thirdeye/thirdeye-frontend/tests/acceptance/self-serve-onboarding-test.js
+++ b/thirdeye/thirdeye-frontend/tests/acceptance/self-serve-onboarding-test.js
@@ -61,7 +61,7 @@ module('Acceptance | create alert', function(hooks) {
);
assert.equal(
$graphContainer.find('svg').length,
- 3,
+ 2,
'Graph and legend svg elements are rendered.'
);
assert.notOk(
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]