You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by on...@apache.org on 2015/05/16 11:59:49 UTC

ambari git commit: AMBARI-11188. Widgets: Warning should be explicit exiting of create widget wizard (onechiporenko)

Repository: ambari
Updated Branches:
  refs/heads/trunk e5e1c3d79 -> 8cd295c10


AMBARI-11188. Widgets: Warning should be explicit exiting of create widget wizard (onechiporenko)


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

Branch: refs/heads/trunk
Commit: 8cd295c10e935b49e7669a23d4ccdfeeab84188d
Parents: e5e1c3d
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Sat May 16 12:49:11 2015 +0300
Committer: Oleg Nechiporenko <on...@apache.org>
Committed: Sat May 16 12:49:11 2015 +0300

----------------------------------------------------------------------
 .../main/service/widgets/create/wizard_controller.js   | 13 ++++++-------
 ambari-web/app/messages.js                             |  2 ++
 2 files changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8cd295c1/ambari-web/app/controllers/main/service/widgets/create/wizard_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/widgets/create/wizard_controller.js b/ambari-web/app/controllers/main/service/widgets/create/wizard_controller.js
index 10c49db..08a5582 100644
--- a/ambari-web/app/controllers/main/service/widgets/create/wizard_controller.js
+++ b/ambari-web/app/controllers/main/service/widgets/create/wizard_controller.js
@@ -322,17 +322,16 @@ App.WidgetWizardController = App.WizardController.extend({
   cancel: function () {
     var self = this;
     var step3Controller = App.router.get('widgetWizardStep3Controller');
+    var isLastStep = parseInt(self.get('currentStep')) === self.get('totalSteps');
     return App.ModalPopup.show({
       header: Em.I18n.t('common.warning'),
-      bodyClass: Em.View.extend({
-        template: Ember.Handlebars.compile('{{t alerts.saveChanges}}')
-      }),
-      primary: Em.I18n.t('common.save'),
-      secondary: Em.I18n.t('common.discard'),
+      body: Em.I18n.t('dashboard.widgets.wizard.onClose.popup.body'),
+      primary: isLastStep ? Em.I18n.t('common.save') : null,
+      secondary: Em.I18n.t('dashboard.widgets.wizard.onClose.popup.discardAndExit'),
       third: Em.I18n.t('common.cancel'),
       disablePrimary: function () {
-        return !(parseInt(self.get('currentStep')) === self.get('totalSteps') && !step3Controller.get('isSubmitDisabled'));
-      }.property(''),
+        return !(isLastStep && !step3Controller.get('isSubmitDisabled'));
+      }.property(),
       onPrimary: function () {
         App.router.send('complete', step3Controller.collectWidgetData());
         this.onSecondary();

http://git-wip-us.apache.org/repos/asf/ambari/blob/8cd295c1/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 67ad9fd..a93ab1f 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -2590,6 +2590,8 @@ Em.I18n.translations = {
   'dashboard.widgets.wizard.step2.aggregateTooltip': 'This mathematical function will be applied to compute single value for selected metric across all host components',
   'dashboard.widgets.wizard.step2.threshold.ok.tooltip': 'This is the threshold value at which the widget color changes from green (OK) to orange (Warning)',
   'dashboard.widgets.wizard.step2.threshold.warning.tooltip': 'This is the threshold value at which the widget color changes from orange (Warning) to red (Critical)',
+  'dashboard.widgets.wizard.onClose.popup.body': 'You have unsaved changes. Your changes will not be saved if you exit the wizard at this step.',
+  'dashboard.widgets.wizard.onClose.popup.discardAndExit': 'Discard and Exit',
 
   'restart.service.all': 'Restart All',
   'restart.service.all.affected': 'Restart All Affected',