You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ji...@apache.org on 2019/03/20 00:35:57 UTC

[incubator-pinot] branch master updated: [TE] frontend - harleyjj/edit-alert - update endpoint for preview when editing alert (#3987)

This is an automated email from the ASF dual-hosted git repository.

jihao 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 31f4fd0  [TE] frontend - harleyjj/edit-alert - update endpoint for preview when editing alert (#3987)
31f4fd0 is described below

commit 31f4fd0f1f544baa4bc5af582fab0a053242c8bc
Author: Harley Jackson <ha...@gmail.com>
AuthorDate: Tue Mar 19 17:35:52 2019 -0700

    [TE] frontend - harleyjj/edit-alert - update endpoint for preview when editing alert (#3987)
---
 .../thirdeye-frontend/app/pods/components/alert-details/component.js  | 2 +-
 .../thirdeye-frontend/app/pods/components/yaml-editor/template.hbs    | 1 +
 thirdeye/thirdeye-frontend/app/utils/anomaly.js                       | 4 ++--
 thirdeye/thirdeye-frontend/app/utils/api/anomaly.js                   | 4 ++--
 4 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/thirdeye/thirdeye-frontend/app/pods/components/alert-details/component.js b/thirdeye/thirdeye-frontend/app/pods/components/alert-details/component.js
index f93e432..37433f4 100644
--- a/thirdeye/thirdeye-frontend/app/pods/components/alert-details/component.js
+++ b/thirdeye/thirdeye-frontend/app/pods/components/alert-details/component.js
@@ -505,7 +505,7 @@ export default Component.extend({
     let metricUrnList;
     try {
       if(isPreviewMode){
-        applicationAnomalies = yield getYamlPreviewAnomalies(alertYaml, start, end);
+        applicationAnomalies = yield getYamlPreviewAnomalies(alertYaml, start, end, alertId);
         if (applicationAnomalies && applicationAnomalies.diagnostics && applicationAnomalies.diagnostics['0']) {
           metricUrnList = Object.keys(applicationAnomalies.diagnostics['0']);
           set(this, 'metricUrnList', metricUrnList);
diff --git a/thirdeye/thirdeye-frontend/app/pods/components/yaml-editor/template.hbs b/thirdeye/thirdeye-frontend/app/pods/components/yaml-editor/template.hbs
index 9aaae46..b2f01b0 100644
--- a/thirdeye/thirdeye-frontend/app/pods/components/yaml-editor/template.hbs
+++ b/thirdeye/thirdeye-frontend/app/pods/components/yaml-editor/template.hbs
@@ -57,6 +57,7 @@
           {{#alert-details
             isPreviewMode=true
             alertYaml=alertYaml
+            alertId=alertId
             dataIsCurrent=alertDataIsCurrent
           }}
             {{yield}}
diff --git a/thirdeye/thirdeye-frontend/app/utils/anomaly.js b/thirdeye/thirdeye-frontend/app/utils/anomaly.js
index ed74925..3611aad 100644
--- a/thirdeye/thirdeye-frontend/app/utils/anomaly.js
+++ b/thirdeye/thirdeye-frontend/app/utils/anomaly.js
@@ -102,8 +102,8 @@ export function updateAnomalyFeedback(anomalyId, feedbackType) {
  * @param {Number} endTime - end time of analysis range
  * @return {Ember.RSVP.Promise}
  */
-export function getYamlPreviewAnomalies(yamlString, startTime, endTime) {
-  const url = getAnomaliesForYamlPreviewUrl(startTime, endTime);
+export function getYamlPreviewAnomalies(yamlString, startTime, endTime, alertId) {
+  const url = getAnomaliesForYamlPreviewUrl(startTime, endTime, alertId);
   return fetch(url, postYamlProps(yamlString)).then((res) => checkStatus(res, 'post', false, true));
 }
 
diff --git a/thirdeye/thirdeye-frontend/app/utils/api/anomaly.js b/thirdeye/thirdeye-frontend/app/utils/api/anomaly.js
index de4aa5a..9d5017e 100644
--- a/thirdeye/thirdeye-frontend/app/utils/api/anomaly.js
+++ b/thirdeye/thirdeye-frontend/app/utils/api/anomaly.js
@@ -16,8 +16,8 @@ export function getAnomalyDataUrl(anomalyId) {
  * @returns {String} the complete yaml/preview url
  * @example getAnomaliesForYamlPreview(1508472700000, 1508472800000) // yields => /yaml/preview?start=1508472700000&end=1508472800000&tuningStart=0&tuningEnd=0
  */
-export function getAnomaliesForYamlPreviewUrl(startTime, endTime) {
-  return `/yaml/preview?start=${startTime}&end=${endTime}&tuningStart=0&tuningEnd=0`;
+export function getAnomaliesForYamlPreviewUrl(startTime, endTime, alertId) {
+  return `/yaml/preview${alertId ? `/${alertId}` : ''}?start=${startTime}&end=${endTime}&tuningStart=0&tuningEnd=0`;
 }
 
 /**


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org