Repository: ambari Updated Branches: refs/heads/branch-2.5 88d93b924 -> 621f38019
AMBARI-21437 Allow user to execute force_remove_packages custom action from UI, second patch. (atkach) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e69b35f6 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e69b35f6 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e69b35f6 Branch: refs/heads/branch-2.5 Commit: e69b35f6bb1cadb2c7d7843f4cb341398a3f830c Parents: 40cd87d Author: Andrii Tkach <atk...@apache.org> Authored: Wed Jul 12 13:23:49 2017 +0300 Committer: Andrii Tkach <atk...@apache.org> Committed: Wed Jul 12 13:23:49 2017 +0300 ---------------------------------------------------------------------- ambari-web/app/messages.js | 2 ++ ambari-web/app/utils/ajax/ajax.js | 2 +- .../views/main/admin/stack_upgrade/versions_view.js | 14 ++++++++++++++ .../main/admin/stack_upgrade/version_view_test.js | 4 ++++ 4 files changed, 21 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/e69b35f6/ambari-web/app/messages.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index 7a6482f..a51f896 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -1710,6 +1710,8 @@ Em.I18n.translations = { 'admin.stackVersions.version.notInstalled': "Not Installed", 'admin.stackVersions.version.hostsInfoTooltip': "There are {0} hosts that do not need packages installed:<li>{1} Maintenance Mode</li><li>{2} Not Required</li>", 'admin.stackVersions.removeIopSelect': "Remove IOP select", + 'admin.stackVersions.removeIopSelect.done': "IOP select successfully removed.", + 'admin.stackVersions.removeIopSelect.fail': "IOP select remove failed", 'admin.stackVersions.manageVersions': "Manage Versions", 'admin.stackVersions.manageVersions.popup.body': 'You are about to leave the <b>Cluster Management</b> interface' + ' and go to the <b>Ambari Administration</b> interface. You can return to cluster management by using the' + http://git-wip-us.apache.org/repos/asf/ambari/blob/e69b35f6/ambari-web/app/utils/ajax/ajax.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/ajax/ajax.js b/ambari-web/app/utils/ajax/ajax.js index 6dce323..47fd5f9 100644 --- a/ambari-web/app/utils/ajax/ajax.js +++ b/ambari-web/app/utils/ajax/ajax.js @@ -1838,7 +1838,7 @@ var urls = { }, 'admin.stack_versions.removeIopSelect': { - 'real': '/requests', + 'real': '/clusters/{clusterName}/requests', 'mock': '', 'type': 'POST', 'format': function (data) { http://git-wip-us.apache.org/repos/asf/ambari/blob/e69b35f6/ambari-web/app/views/main/admin/stack_upgrade/versions_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/admin/stack_upgrade/versions_view.js b/ambari-web/app/views/main/admin/stack_upgrade/versions_view.js index f3c7b2f..2b57e04 100644 --- a/ambari-web/app/views/main/admin/stack_upgrade/versions_view.js +++ b/ambari-web/app/views/main/admin/stack_upgrade/versions_view.js @@ -257,6 +257,20 @@ App.MainAdminStackVersionsView = Em.View.extend({ data: { hosts: App.get('allHostNames').join(',') } + }).always(function(xhr, status) { + if (status === 'success') { + App.showAlertPopup(Em.I18n.t('admin.stackVersions.removeIopSelect'), Em.I18n.t('admin.stackVersions.removeIopSelect.done')); + } else if (status === 'error') { + App.ModalPopup.show({ + header: Em.I18n.t('admin.stackVersions.removeIopSelect.fail'), + secondary: false, + bodyClass: App.AjaxDefaultErrorPopupBodyView.extend({ + type: 'POST', + status: xhr.status, + message: xhr.responseText + }) + }); + } }); }); } http://git-wip-us.apache.org/repos/asf/ambari/blob/e69b35f6/ambari-web/test/views/main/admin/stack_upgrade/version_view_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/views/main/admin/stack_upgrade/version_view_test.js b/ambari-web/test/views/main/admin/stack_upgrade/version_view_test.js index 8c8d5c7..6da0a19 100644 --- a/ambari-web/test/views/main/admin/stack_upgrade/version_view_test.js +++ b/ambari-web/test/views/main/admin/stack_upgrade/version_view_test.js @@ -516,9 +516,13 @@ describe('App.mainAdminStackVersionsView', function () { describe('#removeIopSelect', function() { beforeEach(function() { sinon.stub(App, 'showConfirmationPopup', Em.clb); + sinon.stub(App, 'showAlertPopup'); + sinon.stub(App.ModalPopup, 'show'); }); afterEach(function() { App.showConfirmationPopup.restore(); + App.showAlertPopup.restore(); + App.ModalPopup.show.restore(); }); it('App.ajax.send should be called', function() {