ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akovale...@apache.org
Subject ambari git commit: AMBARI-15918. No link to config group for custom properties (akovalenko)
Date Fri, 15 Apr 2016 14:16:55 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk fdf6eb8a6 -> 073eed0d9


AMBARI-15918. No link to config group for custom properties (akovalenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/073eed0d
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/073eed0d
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/073eed0d

Branch: refs/heads/trunk
Commit: 073eed0d9b653f98b7188797773e6ad1d5b0f69f
Parents: fdf6eb8
Author: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Authored: Fri Apr 15 17:08:04 2016 +0300
Committer: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Committed: Fri Apr 15 17:08:31 2016 +0300

----------------------------------------------------------------------
 .../common/configs/overriddenProperty.hbs       | 68 ++++++++---------
 .../common/configs/overriddenPropertyRow.hbs    | 24 ++++++
 .../common/configs/service_config_category.hbs  | 50 ++++++------
 ambari-web/app/views.js                         |  1 +
 .../configs/overriddenPropertyRow_view.js       | 80 ++++++++++++++++++++
 .../common/configs/overriddenProperty_view.js   | 61 +--------------
 6 files changed, 166 insertions(+), 118 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/073eed0d/ambari-web/app/templates/common/configs/overriddenProperty.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/overriddenProperty.hbs b/ambari-web/app/templates/common/configs/overriddenProperty.hbs
index 954da75..48bc171 100644
--- a/ambari-web/app/templates/common/configs/overriddenProperty.hbs
+++ b/ambari-web/app/templates/common/configs/overriddenProperty.hbs
@@ -15,42 +15,40 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 }}
-{{#each overriddenSCP in view.serviceConfigProperty.overrides}}
-  {{! Here serviceConfigBinding should ideally be serviceConfigPropertyBinding }}
-  <div {{bindAttr class="overriddenSCP.errorMessage:error: :control-group :overrideField"}}>
-    {{view overriddenSCP.viewClass serviceConfigBinding="overriddenSCP" categoryConfigsBinding="view.categoryConfigs"}}
-    {{#if overriddenSCP.supportsFinal}}
-      <a href="#" data-toggle="tooltip"
-        {{bindAttr class=":btn-small :btn-final overriddenSCP.isFinal:active overriddenSCP.hideFinalIcon:hidden"
disabled="overriddenSCP.isNotEditable"}}
-        {{action "toggleFinalFlag" overriddenSCP target="view"}}
-        {{translateAttr data-original-title="services.service.config.final"}}>
-        <i class="icon-lock"></i>
-      </a>
+{{! Here serviceConfigBinding should ideally be serviceConfigPropertyBinding }}
+<div {{bindAttr class="view.overriddenSCP.errorMessage:error: :control-group :overrideField"}}>
+  {{view view.overriddenSCP.viewClass serviceConfigBinding="view.overriddenSCP" categoryConfigsBinding="view.parentView.categoryConfigs"}}
+  {{#if view.overriddenSCP.supportsFinal}}
+    <a href="#" data-toggle="tooltip"
+      {{bindAttr class=":btn-small :btn-final view.overriddenSCP.isFinal:active view.overriddenSCP.hideFinalIcon:hidden"
disabled="view.overriddenSCP.isNotEditable"}}
+      {{action "toggleFinalFlag" view.overriddenSCP target="view.parentView"}}
+      {{translateAttr data-original-title="services.service.config.final"}}>
+      <i class="icon-lock"></i>
+    </a>
+  {{/if}}
+  {{#if view.parentView.isDefaultGroupSelected}}
+    {{#if view.overriddenSCP.group}}
+      {{view App.SwitchToGroupView controllerBinding="controller" groupBinding="view.overriddenSCP.group"}}
     {{/if}}
-    {{#if view.isDefaultGroupSelected}}
-      {{#if overriddenSCP.group}}
-        {{view App.SwitchToGroupView controllerBinding="controller" groupBinding="overriddenSCP.group"}}
+  {{else}}
+    {{#if view.overriddenSCP.isEditable}}
+      {{#if isNotDefaultValue}}
+        <a class="btn-small" href="#" data-toggle="tooltip"
+          {{action "doRestoreDefaultValue" view.overriddenSCP target="view.parentView"}}
+          {{translateAttr data-original-title="common.undo"}}>
+          <i class="icon-undo"></i>
+        </a>
       {{/if}}
+      {{#isAuthorized "SERVICE.MODIFY_CONFIGS"}}
+        <a class="btn-small" href="#" data-toggle="tooltip"
+          {{action "removeOverride" view.overriddenSCP target="view.parentView"}}
+          {{translateAttr data-original-title="common.remove"}}>
+          <i class="icon-minus-sign"></i>
+        </a>
+      {{/isAuthorized}}
+      <span class="help-inline">{{view.overriddenSCP.errorMessage}}</span>
     {{else}}
-      {{#if overriddenSCP.isEditable}}
-        {{#if isNotDefaultValue}}
-          <a class="btn-small" href="#" data-toggle="tooltip"
-            {{action "doRestoreDefaultValue" overriddenSCP target="view"}}
-            {{translateAttr data-original-title="common.undo"}}>
-            <i class="icon-undo"></i>
-          </a>
-        {{/if}}
-        {{#isAuthorized "SERVICE.MODIFY_CONFIGS"}}
-          <a class="btn-small" href="#" data-toggle="tooltip"
-            {{action "removeOverride" overriddenSCP target="view"}}
-            {{translateAttr data-original-title="common.remove"}}>
-            <i class="icon-minus-sign"></i>
-          </a>
-        {{/isAuthorized}}
-          <span class="help-inline">{{overriddenSCP.errorMessage}}</span>
-      {{else}}
-        <a class="action">{{overriddenSCP.group.switchGroupTextShort}}</a> <i
class="icon-spinner"></i>
-      {{/if}}
+      <a class="action">{{view.overriddenSCP.group.switchGroupTextShort}}</a>
<i class="icon-spinner"></i>
     {{/if}}
-  </div>
-{{/each}}
+  {{/if}}
+</div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/073eed0d/ambari-web/app/templates/common/configs/overriddenPropertyRow.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/overriddenPropertyRow.hbs b/ambari-web/app/templates/common/configs/overriddenPropertyRow.hbs
new file mode 100644
index 0000000..e13a980
--- /dev/null
+++ b/ambari-web/app/templates/common/configs/overriddenPropertyRow.hbs
@@ -0,0 +1,24 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+{{#if view.serviceConfigProperty.isOriginalSCP}}
+  {{#each overriddenSCP in view.serviceConfigProperty.overrides}}
+    {{view App.ServiceConfigView.SCPOverriddenPropertyView overriddenSCPBinding="overriddenSCP"}}
+  {{/each}}
+{{else}}
+  {{view App.ServiceConfigView.SCPOverriddenPropertyView overriddenSCPBinding="view.serviceConfigProperty"}}
+{{/if}}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/073eed0d/ambari-web/app/templates/common/configs/service_config_category.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/service_config_category.hbs b/ambari-web/app/templates/common/configs/service_config_category.hbs
index 5ec4db9..38b4f83 100644
--- a/ambari-web/app/templates/common/configs/service_config_category.hbs
+++ b/ambari-web/app/templates/common/configs/service_config_category.hbs
@@ -49,32 +49,34 @@
             {{/if}}
             <div {{bindAttr class="showLabel:controls"}}>
               {{! Here serviceConfigBinding should ideally be serviceConfigPropertyBinding
}}
-              <div {{bindAttr class="errorMessage:error: warnMessage:warning: :control-group"}}>
-                {{view viewClass serviceConfigBinding="this" categoryConfigsAllBinding="view.categoryConfigsAll"
}}
-                {{#if rightSideLabel}}
-                  <span {{bindAttr class="isEditable::muted"}}>{{formatWordBreak displayName}}</span>
-                {{/if}}
-                {{#if hintMessage}}
-                  <a class="icon-question-sign icon-blue" href="#" data-toggle="tooltip"
{{bindAttr data-original-title="hintMessage"}}></a>
-                {{/if}}
-                {{#if this.isComparison}}
-                  {{#if controller.selectedConfigGroup.isDefault}}
-                    <span
-                        class="label label-info">{{t dashboard.configHistory.table.version.prefix}}{{controller.selectedVersion}}</span>
-                    {{#if controller.isCurrentSelected}}
-                      <span class="label label-success">{{t common.current}}</span>
+              {{#if this.isOriginalSCP}}
+                <div {{bindAttr class="errorMessage:error: warnMessage:warning: :control-group"}}>
+                  {{view viewClass serviceConfigBinding="this" categoryConfigsAllBinding="view.categoryConfigsAll"
}}
+                  {{#if rightSideLabel}}
+                    <span {{bindAttr class="isEditable::muted"}}>{{formatWordBreak
displayName}}</span>
+                  {{/if}}
+                  {{#if hintMessage}}
+                    <a class="icon-question-sign icon-blue" href="#" data-toggle="tooltip"
{{bindAttr data-original-title="hintMessage"}}></a>
+                  {{/if}}
+                  {{#if this.isComparison}}
+                    {{#if controller.selectedConfigGroup.isDefault}}
+                      <span
+                          class="label label-info">{{t dashboard.configHistory.table.version.prefix}}{{controller.selectedVersion}}</span>
+                      {{#if controller.isCurrentSelected}}
+                        <span class="label label-success">{{t common.current}}</span>
+                      {{/if}}
+                    {{else}}
+                      <span class="label label-info">{{t common.default}}
+                        &nbsp;{{t services.service.config.configHistory.configGroup}}</span>
                     {{/if}}
-                  {{else}}
-                    <span class="label label-info">{{t common.default}}
-                      &nbsp;{{t services.service.config.configHistory.configGroup}}</span>
                   {{/if}}
-                {{/if}}
-                {{#if controller.canEdit}}
-                  {{view App.ControlsView serviceConfigPropertyBinding="this"}}
-                {{/if}}
-                <span class="help-inline">{{errorMessage}}</span>
-                <span class="help-inline">{{warnMessage}}</span>
-              </div>
+                  {{#if controller.canEdit}}
+                    {{view App.ControlsView serviceConfigPropertyBinding="this"}}
+                  {{/if}}
+                  <span class="help-inline">{{errorMessage}}</span>
+                  <span class="help-inline">{{warnMessage}}</span>
+                </div>
+              {{/if}}
               {{#if this.isComparison}}
                 {{view App.ServiceConfigView.SCPComparisonRowsView serviceConfigPropertyBinding="this"}}
               {{else}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/073eed0d/ambari-web/app/views.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views.js b/ambari-web/app/views.js
index 5410680..16d9650 100644
--- a/ambari-web/app/views.js
+++ b/ambari-web/app/views.js
@@ -56,6 +56,7 @@ require('views/common/configs/service_config_container_view');
 require('views/common/configs/service_configs_by_category_view');
 require('views/common/configs/service_config_view');
 require('views/common/configs/service_config_tab_view');
+require('views/common/configs/overriddenPropertyRow_view');
 require('views/common/configs/overriddenProperty_view');
 require('views/common/configs/compare_property_view');
 require('views/common/configs/config_history_flow');

http://git-wip-us.apache.org/repos/asf/ambari/blob/073eed0d/ambari-web/app/views/common/configs/overriddenPropertyRow_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/overriddenPropertyRow_view.js b/ambari-web/app/views/common/configs/overriddenPropertyRow_view.js
new file mode 100644
index 0000000..86e9c60
--- /dev/null
+++ b/ambari-web/app/views/common/configs/overriddenPropertyRow_view.js
@@ -0,0 +1,80 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+// SCP means ServiceConfigProperty
+
+var App = require('app');
+
+App.ServiceConfigView.SCPOverriddenRowsView = Ember.View.extend({
+  templateName: require('templates/common/configs/overriddenPropertyRow'),
+  classNames: ['overriden-value'],
+  serviceConfigProperty: null, // is passed dynamically at runtime where ever
+  // we are declaring this from configs.hbs ( we are initializing this from UI )
+  categoryConfigs: null, // just declared as viewClass need it
+
+  init: function () {
+    this._super();
+    if (this.get('controller.name') != 'mainServiceInfoConfigsController') {
+      this.addObserver('isDefaultGroupSelected', this, 'setSwitchText');
+    }
+  },
+
+  didInsertElement: function () {
+    this.setSwitchText();
+  },
+
+  willDestroyElement: function () {
+    if (this.get('controller.name') != 'mainServiceInfoConfigsController') {
+      this.removeObserver('isDefaultGroupSelected', this, 'setSwitchText');
+    }
+  },
+
+  setSwitchText: function () {
+    if (this.get('isDefaultGroupSelected')) {
+      var overrides = this.get('serviceConfigProperty.overrides');
+      if (!overrides) return;
+      overrides.forEach(function(overriddenSCP) {
+        overriddenSCP.get('group').set('switchGroupTextShort',
+            Em.I18n.t('services.service.config_groups.switchGroupTextShort').format(overriddenSCP.get('group.displayName')));
+        overriddenSCP.get('group').set('switchGroupTextFull',
+            Em.I18n.t('services.service.config_groups.switchGroupTextFull').format(overriddenSCP.get('group.displayName')));
+      });
+      this.set('serviceConfigProperty.overrides', overrides);
+    }
+  },
+
+  toggleFinalFlag: function (event) {
+    var override = event.contexts[0];
+    if (override.get('isNotEditable')) {
+      return;
+    }
+    override.set('isFinal', !override.get('isFinal'));
+  },
+
+  removeOverride: function (event) {
+    // arg 1 SCP means ServiceConfigProperty
+    var scpToBeRemoved = event.contexts[0];
+    var overrides = this.get('serviceConfigProperty.overrides');
+    // remove override property from selectedService on installer 7-th step
+    if (this.get('controller.name') == 'wizardStep7Controller') {
+      var controller = this.get('controller');
+      var group = controller.get('selectedService.configGroups').findProperty('name', controller.get('selectedConfigGroup.name'));
+      group.get('properties').removeObject(scpToBeRemoved);
+    }
+    overrides = overrides.without(scpToBeRemoved);
+    this.set('serviceConfigProperty.overrides', overrides);
+  }
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/073eed0d/ambari-web/app/views/common/configs/overriddenProperty_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/overriddenProperty_view.js b/ambari-web/app/views/common/configs/overriddenProperty_view.js
index 8623d71..97b2fdc 100644
--- a/ambari-web/app/views/common/configs/overriddenProperty_view.js
+++ b/ambari-web/app/views/common/configs/overriddenProperty_view.js
@@ -18,63 +18,6 @@
 
 var App = require('app');
 
-App.ServiceConfigView.SCPOverriddenRowsView = Ember.View.extend({
-  classNames: ['overriden-value'],
-  templateName: require('templates/common/configs/overriddenProperty'),
-  serviceConfigProperty: null, // is passed dynamically at runtime where ever
-  // we are declaring this from configs.hbs ( we are initializing this from UI )
-  categoryConfigs: null, // just declared as viewClass need it
-
-  init: function () {
-    this._super();
-    if (this.get('controller.name') != 'mainServiceInfoConfigsController') {
-      this.addObserver('isDefaultGroupSelected', this, 'setSwitchText');
-    }
-  },
-
-  didInsertElement: function () {
-    this.setSwitchText();
-  },
-
-  willDestroyElement: function () {
-    if (this.get('controller.name') != 'mainServiceInfoConfigsController') {
-      this.removeObserver('isDefaultGroupSelected', this, 'setSwitchText');
-    }
-  },
-
-  setSwitchText: function () {
-    if (this.get('isDefaultGroupSelected')) {
-      var overrides = this.get('serviceConfigProperty.overrides');
-      if (!overrides) return;
-      overrides.forEach(function(overriddenSCP) {
-        overriddenSCP.get('group').set('switchGroupTextShort',
-          Em.I18n.t('services.service.config_groups.switchGroupTextShort').format(overriddenSCP.get('group.displayName')));
-        overriddenSCP.get('group').set('switchGroupTextFull',
-          Em.I18n.t('services.service.config_groups.switchGroupTextFull').format(overriddenSCP.get('group.displayName')));
-      });
-      this.set('serviceConfigProperty.overrides', overrides);
-    }
-  },
-
-  toggleFinalFlag: function (event) {
-    var override = event.contexts[0];
-    if (override.get('isNotEditable')) {
-      return;
-    }
-    override.set('isFinal', !override.get('isFinal'));
-  },
-
-  removeOverride: function (event) {
-    // arg 1 SCP means ServiceConfigProperty
-    var scpToBeRemoved = event.contexts[0];
-    var overrides = this.get('serviceConfigProperty.overrides');
-    // remove override property from selectedService on installer 7-th step
-    if (this.get('controller.name') == 'wizardStep7Controller') {
-      var controller = this.get('controller');
-      var group = controller.get('selectedService.configGroups').findProperty('name', controller.get('selectedConfigGroup.name'));
-      group.get('properties').removeObject(scpToBeRemoved);
-    }
-    overrides = overrides.without(scpToBeRemoved);
-    this.set('serviceConfigProperty.overrides', overrides);
-  }
+App.ServiceConfigView.SCPOverriddenPropertyView = Ember.View.extend({
+  templateName: require('templates/common/configs/overriddenProperty')
 });


Mime
View raw message