Prechádzať zdrojové kódy

AMBARI-15562 Result of service deletion action is not known until user does browser refresh. (ababiichuk)

ababiichuk 9 rokov pred
rodič
commit
15e58e419c

+ 8 - 3
ambari-web/app/controllers/main/service/item.js

@@ -1311,12 +1311,17 @@ App.MainServiceItemController = Em.Controller.extend(App.SupportClientConfigsDow
     if (Em.isArray(data) && data.length) {
       this.putChangedConfigurations(data, 'onSaveConfigs');
     } else {
-      this.onSaveConfigs();
+      this.confirmServiceDeletion();
     }
   },
 
-  onSaveConfigs: function() {
-    window.location.reload();
+  confirmServiceDeletion: function() {
+    var msg = this.get('interDependentServices.length')
+      ? Em.I18n.t('services.service.delete.service.success.confirmation.plural').format(this.get('serviceNamesToDelete').join(','))
+      : Em.I18n.t('services.service.delete.service.success.confirmation').format(this.get('content.serviceName'));
+    return App.showAlertPopup(Em.I18n.t('popup.confirmation.commonHeader'), msg, function() {
+      window.location.reload();
+    })
   },
 
   /**

+ 3 - 1
ambari-web/app/messages.js

@@ -1753,9 +1753,11 @@ Em.I18n.translations = {
   '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 "{2}"' +
   ' in the confirmation box. <b>This operation is not reversible and all configuration history will be lost.</b>',
+  'services.service.delete.service.success.confirmation': 'Service {0} was successfully deleted',
+  'services.service.delete.service.success.confirmation.plural': 'Services {0} were successfully deleted',
+
   'services.service.summary.unknown':'unknown',
   'services.service.summary.notRunning':'Not Running',
   'services.service.summary.notAvailable':'n/a',