You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jl...@apache.org on 2016/03/11 06:47:16 UTC
[08/21] ambari git commit: AMBARI-15351 Remove Service: Delete
confirmation tweaks. (atkach)
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/AMBARI-13364
Commit: f9d317bd29dd88e46038ebfab34682ea524f2d37
Parents: 0c44129
Author: Andrii Tkach <at...@hortonworks.com>
Authored: Thu Mar 10 12:34:48 2016 +0200
Committer: Andrii Tkach <at...@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}} {{view.confirmKey}}</b></label> ' +
+ '<label><b>{{view.typeMessage}}</b></label> ' +
'{{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;
});
});