Selaa lähdekoodia

AMBARI-10925 Create/Clone widget: widget created has malformed value array. (atkach)

Andrii Tkach 10 vuotta sitten
vanhempi
commit
2378021510

+ 1 - 0
ambari-web/app/controllers/main/service/widgets/create/step2_controller.js

@@ -267,6 +267,7 @@ App.WidgetWizardStep2Controller = Em.Controller.extend({
           expressionData = this.parseExpression(this.get('expressions')[0]);
           expressionData = this.parseExpression(this.get('expressions')[0]);
           expressionData.values = [
           expressionData.values = [
             {
             {
+              name: "",
               value: expressionData.value
               value: expressionData.value
             }
             }
           ];
           ];

+ 4 - 1
ambari-web/app/controllers/main/service/widgets/create/step3_controller.js

@@ -129,7 +129,10 @@ App.WidgetWizardStep3Controller = Em.Controller.extend({
             "host_component_criteria": metric.hostComponentCriteria
             "host_component_criteria": metric.hostComponentCriteria
           }
           }
         }),
         }),
-        values: this.get('widgetValues'),
+        values: this.get('widgetValues').map(function (value) {
+          delete value.computedValue;
+          return value;
+        }),
         properties: this.get('widgetProperties')
         properties: this.get('widgetProperties')
       }
       }
     };
     };