Repository: ambari
Updated Branches:
  refs/heads/trunk 79fddb7da -> 3ed90ad24


AMBARI-6348. Switching to host config group should spin since it takes a 
while.(xiwang)


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

Branch: refs/heads/trunk
Commit: 3ed90ad248281a3eadcabbfef857d1692a42151a
Parents: d1769ff
Author: Xi Wang <[email protected]>
Authored: Tue Jul 1 16:47:47 2014 -0700
Committer: Xi Wang <[email protected]>
Committed: Tue Jul 1 17:12:59 2014 -0700

----------------------------------------------------------------------
 ambari-web/app/messages.js                      |  2 ++
 .../common/configs/overriddenProperty.hbs       | 33 +++++++++++---------
 .../common/configs/overriddenProperty_view.js   | 16 +++++++++-
 3 files changed, 36 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/3ed90ad2/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index e81ba7a..bc14fc1 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1336,6 +1336,8 @@ Em.I18n.translations = {
   'services.service.config_groups.add_config_group_popup.header':'Create New 
Configuration Group',
   
'services.service.config_groups.duplicate_config_group_popup.header':'Duplicate 
Configuration Group',
   'services.service.config_groups.rename_config_group_popup.header':'Rename 
Configuration Group',
+  'services.service.config_groups.switchGroupTextFull':'Switch to \'{0}\' host 
config group',
+  'services.service.config_groups.switchGroupTextShort':'Switch to \'{0}\'',
   'services.reassign.closePopup':'Move {0} wizard is in progress. You must 
allow the wizard to complete for Ambari to be in usable state. If you choose to 
quit, you must follow manual instructions to complete or revert move {0} wizard 
as documented in the Ambari User Guide. Are you sure you want to exit the 
wizard?',
 
   'services.reassign.step1.header':'Get Started',

http://git-wip-us.apache.org/repos/asf/ambari/blob/3ed90ad2/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 053015b..8fe54d9 100644
--- a/ambari-web/app/templates/common/configs/overriddenProperty.hbs
+++ b/ambari-web/app/templates/common/configs/overriddenProperty.hbs
@@ -16,22 +16,27 @@
 * 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 view.isDefaultGroupSelected}}
-        {{#if overriddenSCP.group}}
-            <a class="action" {{action selectConfigGroup overriddenSCP.group 
target="controller"}}>{{overriddenSCP.group.displayName}}</a>
-        {{/if}}
+  {{! Here serviceConfigBinding should ideally be serviceConfigPropertyBinding 
}}
+  <div {{bindAttr class="overriddenSCP.errorMessage:error: :control-group 
:overrideField"}}>
+    {{view overriddenSCP.viewClass serviceConfigBinding="overriddenSCP" 
categoryConfigsBinding="view.categoryConfigs"}}
+    {{#if view.isDefaultGroupSelected}}
+      {{#if overriddenSCP.group}}
+        <a rel='SwitchGroupTooltip' {{bindAttr 
data-original-title="overriddenSCP.group.switchGroupTextFull" }} class="action" 
{{action selectConfigGroup overriddenSCP.group target="controller"}}>
+          {{overriddenSCP.group.switchGroupTextShort}}
+        </a>
       {{/if}}
+    {{else}}
       {{#if overriddenSCP.isEditable}}
-             {{#if isNotDefaultValue}}
-               <a class="action" {{action "doRestoreDefaultValue" this 
target="view" }} ><i class="icon-undo"></i>{{t common.undo}}</a>
-             {{/if}}
+        {{#if isNotDefaultValue}}
+          <a class="action" {{action "doRestoreDefaultValue" this 
target="view" }} ><i class="icon-undo"></i>{{t common.undo}}</a>
+        {{/if}}
         {{#if App.isAdmin}}
-               <a class="action" {{action "removeOverride" overriddenSCP 
target="view" }} ><i class="icon-minus-sign"></i>{{t common.remove}}</a>
+          <a class="action" {{action "removeOverride" overriddenSCP 
target="view" }} ><i class="icon-minus-sign"></i>{{t common.remove}}</a>
         {{/if}}
-             <span class="help-inline">{{overriddenSCP.errorMessage}}</span>
-           {{/if}}
-    </div>
+          <span class="help-inline">{{overriddenSCP.errorMessage}}</span>
+      {{else}}
+        <a class="action">{{overriddenSCP.group.switchGroupTextShort}}</a> <i 
class="icon-spinner"></i>
+      {{/if}}
+    {{/if}}
+  </div>
 {{/each}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/3ed90ad2/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 5c77371..811846e 100644
--- a/ambari-web/app/views/common/configs/overriddenProperty_view.js
+++ b/ambari-web/app/views/common/configs/overriddenProperty_view.js
@@ -23,7 +23,21 @@ App.ServiceConfigView.SCPOverriddenRowsView = 
Ember.View.extend({
   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
-  
+
+  didInsertElement: function (){
+    if (this.get('isDefaultGroupSelected')) {
+      var overrides = this.get('serviceConfigProperty.overrides');
+      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);
+      App.tooltip(this.$("[rel='SwitchGroupTooltip']"));
+    }
+  },
+
   removeOverride: function (event) {
     // arg 1 SCP means ServiceConfigProperty
     var scpToBeRemoved = event.contexts[0];

Reply via email to