From eb12f45e8e58c0506f140f238f4053b4f60b2ed8 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Fri, 13 Mar 2020 15:47:58 -0400 Subject: [PATCH] add ngToast disable on timeout for log agg notifications, and disable test button until active test completes. --- .../forms/system-form/configuration-system.controller.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/awx/ui/client/src/configuration/forms/system-form/configuration-system.controller.js b/awx/ui/client/src/configuration/forms/system-form/configuration-system.controller.js index 63fed820d2..520a0d5516 100644 --- a/awx/ui/client/src/configuration/forms/system-form/configuration-system.controller.js +++ b/awx/ui/client/src/configuration/forms/system-form/configuration-system.controller.js @@ -205,18 +205,25 @@ export default [ $scope.$parent.vm.testLogging = function () { if (!$scope.$parent.vm.disableTestButton) { + $scope.$parent.vm.disableTestButton = true; Rest.setUrl("/api/v2/settings/logging/test/"); Rest.post({}) .then(() => { + $scope.$parent.vm.disableTestButton = false; ngToast.success({ + dismissButton: false, + dismissOnTimeout: true, content: `` + i18n._('Log aggregator test sent successfully.') }); }) .catch(({ data, status }) => { + $scope.$parent.vm.disableTestButton = false; if (status === 400 || status == 500) { ngToast.danger({ + dismissButton: false, + dismissOnTimeout: true, content: '' + i18n._('Log aggregator test failed.
Detail: ') + $filter('sanitize')(data.error), additionalClasses: "LogAggregator-failedNotification"