ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jonathanhur...@apache.org
Subject [29/35] git commit: AMBARI-7028. Config History: need to set notes for the new SCV when reverting back via 'Make Current' action.(xiwang)
Date Wed, 27 Aug 2014 14:05:10 GMT
AMBARI-7028. Config History: need to set notes for the new SCV when reverting back via 'Make
Current' action.(xiwang)


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

Branch: refs/heads/branch-alerts-dev
Commit: 2dc55f08fe7b1660122145853ede4d7a04c014a8
Parents: a8e6736
Author: Xi Wang <xiwang@apache.org>
Authored: Tue Aug 26 17:35:45 2014 -0700
Committer: Xi Wang <xiwang@apache.org>
Committed: Tue Aug 26 17:48:46 2014 -0700

----------------------------------------------------------------------
 ambari-web/app/messages.js                      |  3 +-
 .../views/common/configs/config_history_flow.js | 32 ++++++++++++++++----
 2 files changed, 28 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2dc55f08/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 31d3e69..9579b04 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1410,7 +1410,7 @@ Em.I18n.translations = {
     'on the Ambari Server host to make the JDBC driver available and to enable testing the
database connection.',
 
   'services.service.config.configHistory.configGroup': 'Group',
-  'services.service.config.configHistory.makeCurrent.message': 'Are you sure you want to
make {0} the current version for {1}:{2} ?',
+  'services.service.config.configHistory.makeCurrent.message': 'Created from service config
version {0}',
 
   'services.add.header':'Add Service Wizard',
   'services.reassign.header':'Move Master Wizard',
@@ -2000,6 +2000,7 @@ Em.I18n.translations = {
   'dashboard.configHistory.info-bar.changesToHandle': 'Changes to handle',
   'dashboard.configHistory.info-bar.showMore': 'Show more',
   'dashboard.configHistory.info-bar.save.popup.title': 'Save Configuration',
+  'dashboard.configHistory.info-bar.makeCurrent.popup.title': 'Make Current Confirmation',
   'dashboard.configHistory.info-bar.save.popup.placeholder': 'What did you change?',
   'dashboard.configHistory.info-bar.revert.button': 'Make current',
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/2dc55f08/ambari-web/app/views/common/configs/config_history_flow.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/config_history_flow.js b/ambari-web/app/views/common/configs/config_history_flow.js
index a4c21af..0c0e686 100644
--- a/ambari-web/app/views/common/configs/config_history_flow.js
+++ b/ambari-web/app/views/common/configs/config_history_flow.js
@@ -245,14 +245,33 @@ App.ConfigHistoryFlowView = Em.View.extend({
     if (isDisabled) return;
     var serviceConfigVersion = event.context || Em.Object.create({
       version: this.get('displayedServiceVersion.version'),
-      serviceName: this.get('displayedServiceVersion.serviceName')
+      serviceName: this.get('displayedServiceVersion.serviceName'),
+      notes:''
     });
     var versionText = event.context ? event.context.get('versionText') : this.get('displayedServiceVersion.versionText');
-    App.showConfirmationPopup(function () {
+    var configGroupName = this.get('displayedServiceVersion.configGroupName');
+    return App.ModalPopup.show({
+      header: Em.I18n.t('dashboard.configHistory.info-bar.makeCurrent.popup.title'),
+      serviceConfigNote: Em.I18n.t('services.service.config.configHistory.makeCurrent.message').format(versionText),
+      bodyClass: Em.View.extend({
+        templateName: require('templates/common/configs/save_configuration'),
+        notesArea: Em.TextArea.extend({
+          classNames: ['full-width'],
+          value: Em.I18n.t('services.service.config.configHistory.makeCurrent.message').format(versionText),
+          onChangeValue: function() {
+            this.get('parentView.parentView').set('serviceConfigNote', this.get('value'));
+          }.observes('value')
+        })
+      }),
+      primary: Em.I18n.t('dashboard.configHistory.info-bar.revert.button'),
+      secondary: Em.I18n.t('common.discard'),
+      third: Em.I18n.t('common.cancel'),
+      onPrimary: function () {
+        serviceConfigVersion.set('serviceConfigNote', this.get('serviceConfigNote'));
         self.sendRevertCall(serviceConfigVersion);
-      },
-      Em.I18n.t('services.service.config.configHistory.makeCurrent.message').format(versionText,
this.get('displayedServiceVersion.serviceName'), this.get('displayedServiceVersion.configGroupName'))
-    );
+        this.hide();
+      }
+    });
   },
 
   /**
@@ -268,7 +287,8 @@ App.ConfigHistoryFlowView = Em.View.extend({
           "Clusters": {
             "desired_serviceconfigversions": {
               "serviceconfigversion": serviceConfigVersion.get('version'),
-              "service_name": serviceConfigVersion.get('serviceName')
+              "service_name": serviceConfigVersion.get('serviceName'),
+              "service_config_version_note": serviceConfigVersion.get('serviceConfigNote')
             }
           }
         }


Mime
View raw message