jihaozh commented on a change in pull request #3636: [TE] frontend - 
aaronucsd/Basic yaml editor with alert and subscripti…
URL: https://github.com/apache/incubator-pinot/pull/3636#discussion_r247677467
 
 

 ##########
 File path: 
thirdeye/thirdeye-frontend/app/pods/self-serve/create-alert/controller.js
 ##########
 @@ -880,89 +766,18 @@ export default Controller.extend({
    * Actions for create alert form view
    */
   actions: {
-    /**
-     * returns array of suggestions for Yaml editor autocompletion
-     */
-    yamlSuggestions(editor, session, position, prefix) {
-      const {
-        alertYamlContent,
-        noResultsArray
-      } = getProperties(this, 'alertYamlContent', 'noResultsArray');
-      let yamlAsObject = {}
-      try {
-        yamlAsObject = yamljs.parse(alertYamlContent);
-        set(this, 'isYamlParseable', true);
-      }
-      catch(err){
-        set(this, 'isYamlParseable', false);
-        return noResultsArray;
-      }
-      // if editor.metricId field contains a value, metric was just chosen.  
Populate caches for filters and dimensions
-      if(editor.metricId){
-        const currentMetric = set(this, 'currentMetric', editor.metricId);
-        editor.metricId = '';
-        return get(this, '_loadAutocompleteById')(currentMetric)
-          .then(resultObj => {
-            const { filters, dimensions } = resultObj;
-            this.setProperties({
-              dimensionsCache: dimensions,
-              filtersCache: filters
-            });
-          })
-          .then(() => {
-            return get(this, '_buildYamlSuggestions')(currentMetric, 
yamlAsObject, prefix, noResultsArray, get(this, 'filtersCache'), get(this, 
'dimensionsCache'))
-              .then(results => results);
-          })
-      }
-      const currentMetric = get(this, 'currentMetric');
-      // deals with no metricId, which could be autocomplete for metric or for 
filters and dimensions already cached
-      return get(this, '_buildYamlSuggestions')(currentMetric, yamlAsObject, 
prefix, noResultsArray, get(this, 'filtersCache'), get(this, 'dimensionsCache'))
-        .then(results => results);
-
-    },
 
     /**
      * Clears YAML content, disables 'save changes' button, and moves to form
      */
     cancelAlertYaml() {
-      set(this, 'disableYamlSave', true);
-      set(this, 'alertYamlContent', null);
+      //set(this, 'disableYamlSave', true);
 
 Review comment:
   clean these lines?

----------------------------------------------------------------
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]

Reply via email to