ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From atk...@apache.org
Subject ambari git commit: AMBARI-15351 Remove Service: Delete confirmation tweaks. (atkach)
Date Thu, 10 Mar 2016 10:35:16 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 0c44129ad -> f9d317bd2


AMBARI-15351 Remove Service: Delete confirmation tweaks. (atkach)


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

Branch: refs/heads/trunk
Commit: f9d317bd29dd88e46038ebfab34682ea524f2d37
Parents: 0c44129
Author: Andrii Tkach <atkach@hortonworks.com>
Authored: Thu Mar 10 12:34:48 2016 +0200
Committer: Andrii Tkach <atkach@hortonworks.com>
Committed: Thu Mar 10 12:34:48 2016 +0200

----------------------------------------------------------------------
 ambari-web/app/controllers/main/service/item.js     | 16 ++++++++++------
 ambari-web/app/messages.js                          |  5 +++--
 .../test/controllers/main/service/item_test.js      |  2 +-
 3 files changed, 14 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f9d317bd/ambari-web/app/controllers/main/service/item.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/item.js b/ambari-web/app/controllers/main/service/item.js
index eda0485..f37891d 100644
--- a/ambari-web/app/controllers/main/service/item.js
+++ b/ambari-web/app/controllers/main/service/item.js
@@ -1167,11 +1167,14 @@ App.MainServiceItemController = Em.Controller.extend(App.SupportClientConfigsDow
    * @param {string} [servicesToDeleteFmt]
    */
   confirmDeleteService: function (serviceName, dependentServiceNames, servicesToDeleteFmt)
{
-    var message = dependentServiceNames && dependentServiceNames.length
-        ? Em.I18n.t('services.service.confirmDelete.popup.body.dependent').format(App.format.role(serviceName),
servicesToDeleteFmt)
-        : Em.I18n.t('services.service.confirmDelete.popup.body').format(App.format.role(serviceName)),
-        confirmKey = 'yes',
-        self = this;
+    var confirmKey = 'delete',
+        self = this,
+        message = Em.I18n.t('services.service.confirmDelete.popup.body').format(App.format.role(serviceName),
confirmKey);
+
+    if (dependentServiceNames.length > 0) {
+      message = Em.I18n.t('services.service.confirmDelete.popup.body.dependent')
+                .format(App.format.role(serviceName), servicesToDeleteFmt, confirmKey);
+    }
 
     App.ModalPopup.show({
 
@@ -1213,9 +1216,10 @@ App.MainServiceItemController = Em.Controller.extend(App.SupportClientConfigsDow
        */
       bodyClass: Em.View.extend({
         confirmKey: confirmKey,
+        typeMessage: Em.I18n.t('services.service.confirmDelete.popup.body.type').format(confirmKey),
         template: Em.Handlebars.compile(message +
         '<div class="form-inline align-center"></br>' +
-        '<label><b>{{t common.enter}}&nbsp;{{view.confirmKey}}</b></label>&nbsp;'
+
+        '<label><b>{{view.typeMessage}}</b></label>&nbsp;' +
         '{{view Ember.TextField valueBinding="view.parentView.confirmInput" class="input-small"}}</br>'
+
         '</div>')
       }),

http://git-wip-us.apache.org/repos/asf/ambari/blob/f9d317bd/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 8e69dd0..6b8317b 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1724,10 +1724,11 @@ Em.I18n.translations = {
   ' and configuration history will be lost.</b>',
   'services.service.delete.popup.warning.dependent': '<b>Note! {0} will be deleted
too.</b>',
   'services.service.confirmDelete.popup.header': 'Confirm Delete',
-  'services.service.confirmDelete.popup.body': 'You must confirm delete of <b>{0}</b>
by typing "yes"' +
+  'services.service.confirmDelete.popup.body': 'You must confirm delete of <b>{0}</b>
by typing "{1}"' +
   ' in the confirmation box. <b>This operation is not reversible and all configuration
history will be lost.</b>',
+  'services.service.confirmDelete.popup.body.type': 'Type "{0}" to confirm',
 
-  'services.service.confirmDelete.popup.body.dependent': 'You must confirm delete of <b>{0}</b>
and <b>{1}</b> by typing "yes"' +
+  'services.service.confirmDelete.popup.body.dependent': 'You must confirm delete of <b>{0}</b>
and <b>{1}</b> by typing "{2}"' +
   ' in the confirmation box. <b>This operation is not reversible and all configuration
history will be lost.</b>',
   'services.service.summary.unknown':'unknown',
   'services.service.summary.notRunning':'Not Running',

http://git-wip-us.apache.org/repos/asf/ambari/blob/f9d317bd/ambari-web/test/controllers/main/service/item_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/service/item_test.js b/ambari-web/test/controllers/main/service/item_test.js
index f2fcd2d..dbb4463 100644
--- a/ambari-web/test/controllers/main/service/item_test.js
+++ b/ambari-web/test/controllers/main/service/item_test.js
@@ -1362,7 +1362,7 @@ describe('App.MainServiceItemController', function () {
     });
 
     it("App.ModalPopup.show should be called", function() {
-      mainServiceItemController.confirmDeleteService();
+      mainServiceItemController.confirmDeleteService('S1', [], '');
       expect(App.ModalPopup.show.calledOnce).to.be.true;
     });
   });


Mime
View raw message