From c932213abd12a151e18277c1acb417866095fdd6 Mon Sep 17 00:00:00 2001 From: Nagesh Dhope Date: Tue, 2 Jun 2020 11:23:52 +0530 Subject: [PATCH] Disabled the Stop process button after clicking it and added a message 'Terminating the process...' to notify the user. Fixes #3787 --- docs/en_US/release_notes_4_23.rst | 1 + web/pgadmin/misc/bgprocess/static/js/bgprocess.js | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/docs/en_US/release_notes_4_23.rst b/docs/en_US/release_notes_4_23.rst index 4504f9ea8..427e93b39 100644 --- a/docs/en_US/release_notes_4_23.rst +++ b/docs/en_US/release_notes_4_23.rst @@ -19,6 +19,7 @@ Housekeeping Bug fixes ********* +| `Issue #3787 `_ - Disabled the Stop process button after clicking it and added a message 'Terminating the process...' to notify the user. | `Issue #5416 `_ - Ensure that the query tool panel gets closed when clicking on the 'Don't Save' button. | `Issue #5465 `_ - Fixed an issue where the Edge browser version is showing wrong and warning message gets displayed. | `Issue #5521 `_ - Fixed an issue when dumping servers from a desktop pgAdmin app by providing an option '--sqlite-path'. diff --git a/web/pgadmin/misc/bgprocess/static/js/bgprocess.js b/web/pgadmin/misc/bgprocess/static/js/bgprocess.js index f80a42599..8ab09c6a8 100644 --- a/web/pgadmin/misc/bgprocess/static/js/bgprocess.js +++ b/web/pgadmin/misc/bgprocess/static/js/bgprocess.js @@ -234,6 +234,8 @@ define('misc.bgprocess', [ {status_text:gettext('Failed (exit code: %s).', String(self.exit_code))} ); } + } else if (_.isNull(self.exit_code) && self.state === 3) { + self.curr_status = self.other_status_tpl({status_text:gettext('Terminating the process...')}); } if (self.state == 0 && self.stime) { @@ -312,7 +314,7 @@ define('misc.bgprocess', [
- +
@@ -372,9 +374,9 @@ define('misc.bgprocess', [ var $status_bar = $(self.container.find('.pg-bg-status')); $status_bar.html(self.curr_status); - // Enable/Disable stop process button var $btn_stop_process = $(self.container.find('.bg-process-stop')); - if (isNaN(parseInt(self.exit_code))) { + // Enable Stop Process button only when process is running + if (parseInt(self.state) === 1) { $btn_stop_process.attr('disabled', false); } else { $btn_stop_process.attr('disabled', true); @@ -403,8 +405,8 @@ define('misc.bgprocess', [ $footer = container.find('.bg-process-footer'), $btn_stop_process = container.find('.bg-process-stop'); - // Enable/Disable stop process button - if (isNaN(parseInt(self.exit_code))) { + // Enable Stop Process button only when process is running + if (parseInt(self.state) === 1) { $btn_stop_process.attr('disabled', false); } else { $btn_stop_process.attr('disabled', true); @@ -621,7 +623,7 @@ define('misc.bgprocess', [ ''+ '
' + '
' + - '' + + '' + '
' + '' + '' +