From d38d0ce805c66abd9bdbdb87980810b02cfb0f6a Mon Sep 17 00:00:00 2001 From: Yogesh Mahajan Date: Thu, 15 Sep 2022 18:44:07 +0530 Subject: [PATCH] 1) Fixed the error message displayed when clicking the cloud server for which deployment is in progress. Fixes #5144 2) Ensure that if big animal authentication is aborted, API calls should be stopped. Fixes #5275 --- docs/en_US/release_notes_6_14.rst | 40 ++++++++++--------- .../bgprocess/static/js/BgProcessManager.js | 2 +- .../misc/cloud/static/js/CloudWizard.jsx | 15 +++++-- web/pgadmin/misc/cloud/static/js/cloud.js | 2 +- 4 files changed, 35 insertions(+), 24 deletions(-) diff --git a/docs/en_US/release_notes_6_14.rst b/docs/en_US/release_notes_6_14.rst index 3b3445bca..a226bbe36 100644 --- a/docs/en_US/release_notes_6_14.rst +++ b/docs/en_US/release_notes_6_14.rst @@ -19,26 +19,28 @@ New features Housekeeping ************ - | `Issue #6133 `_ - Port schema diff to React. - | `Issue #6134 `_ - Remove Backgrid and Backform. - | `Issue #7343 `_ - Port the remaining components of the ERD Tool to React. - | `Issue #7446 `_ - Updated keyboard shortcut documentation. - | `Issue #7619 `_ - Remove Alertify from pgAdmin completely. - | `Issue #7622 `_ - Port search object dialog to React. + | `Issue #4059 `_ - Port schema diff to React. (RM #6133) + | `Issue #4060 `_ - Remove Backgrid and Backform. (RM #6134) + | `Issue #5035 `_ - Port the remaining components of the ERD Tool to React. (RM #7343) + | `Issue #5120 `_ - Updated keyboard shortcut documentation. (RM #7446) + | `Issue #5260 `_ - Remove Alertify from pgAdmin completely. (RM #7619) + | `Issue #5263 `_ - Port search object dialog to React. (RM #7622) Bug fixes ********* - | `Issue #7557 `_ - Fixed an issue where pgAdmin failed to start due to bin path migration. - | `Issue #7580 `_ - Fixed an issue where backup does not work due to parameter 'preexec_fn' no longer being supported. - | `Issue #7607 `_ - Ensure that the browser tree should be refreshed after changing the ownership. - | `Issue #7637 `_ - Fixed an issue where the wrong SQL displayed in difference if the user create an RLS policy on the table without a column. - | `Issue #7644 `_ - Ensure that the dump servers functionality works from setup.py. - | `Issue #7646 `_ - Ensure that the Import/Export server menu option is visible. - | `Issue #7648 `_ - Fixed API test case for change password in the server mode. - | `Issue #7649 `_ - Fixed an issue with the non-visibility of columns added prior to import/export data. - | `Issue #7656 `_ - Fixed an issue where textarea of the JSON Editor does not resize with dialog. - | `Issue #7663 `_ - Fixed ModuleNotFoundError when running setup.py to load/dump servers. - | `Issue #7693 `_ - Replace the language selection 'Brazilian' with 'Portuguese (Brazilian). - | `Issue #7695 `_ - Fixed an issue where server names with special characters are not displayed correctly in the process tab. - | `Issue #7709 `_ - Fixed an issue where ERD throws an error if variable is added to the column. + | `Issue #5144 `_ - Ensure that if big animal authentication is aborted, API calls should be stopped. (RM #7472) + | `Issue #5209 `_ - Fixed an issue where pgAdmin failed to start due to bin path migration. (RM #7557) + | `Issue #5230 `_ - Fixed an issue where backup does not work due to parameter 'preexec_fn' no longer being supported. (RM #7580) + | `Issue #5250 `_ - Ensure that the browser tree should be refreshed after changing the ownership. (RM #7607) + | `Issue #5274 `_ - Fixed the error message displayed when clicking the cloud server for which deployment is in progress. (RM #7636) + | `Issue #5275 `_ - Fixed an issue where the wrong SQL displayed in difference if the user create an RLS policy on the table without a column. (RM #7637) + | `Issue #5282 `_ - Ensure that the dump servers functionality works from setup.py. (RM #7644) + | `Issue #5284 `_ - Ensure that the Import/Export server menu option is visible. (RM #7646) + | `Issue #5286 `_ - Fixed API test case for change password in the server mode. (RM #7648) + | `Issue #5287 `_ - Fixed an issue with the non-visibility of columns added prior to import/export data. (RM #7649) + | `Issue #5292 `_ - Fixed an issue where textarea of the JSON Editor does not resize with dialog. (RM #7656) + | `Issue #5299 `_ - Fixed ModuleNotFoundError when running setup.py to load/dump servers. (RM #7663) + | `Issue #5323 `_ - Replace the language selection 'Brazilian' with 'Portuguese (Brazilian). (RM #7693) + | `Issue #5325 `_ - Fixed an issue where server names with special characters are not displayed correctly in the process tab. (RM #7695) + | `Issue #5333 `_ - Fixed an issue where ERD throws an error if variable is added to the column. (RM #7709) diff --git a/web/pgadmin/misc/bgprocess/static/js/BgProcessManager.js b/web/pgadmin/misc/bgprocess/static/js/BgProcessManager.js index fabaf6fa5..134d7785d 100644 --- a/web/pgadmin/misc/bgprocess/static/js/BgProcessManager.js +++ b/web/pgadmin/misc/bgprocess/static/js/BgProcessManager.js @@ -186,7 +186,7 @@ export default class BgProcessManager { .then((res)=>{ let _server = res.data?.data?.node; if(!_server) { - Notifier.error(gettext('Cloud server information not available')); + Notifier.error(gettext('Cloud server deployment is pending')); return; } let _server_path = '/browser/server_group_' + _server.gid + '/' + _server.id, diff --git a/web/pgadmin/misc/cloud/static/js/CloudWizard.jsx b/web/pgadmin/misc/cloud/static/js/CloudWizard.jsx index d6b10e534..414d05da8 100644 --- a/web/pgadmin/misc/cloud/static/js/CloudWizard.jsx +++ b/web/pgadmin/misc/cloud/static/js/CloudWizard.jsx @@ -62,7 +62,7 @@ const useStyles = makeStyles(() => export const CloudWizardEventsContext = React.createContext(); -export default function CloudWizard({ nodeInfo, nodeData, onClose}) { +export default function CloudWizard({ nodeInfo, nodeData, onClose, cloudPanel}) { const classes = useStyles(); const eventBus = React.useRef(new EventBus()); @@ -288,7 +288,7 @@ export default function CloudWizard({ nodeInfo, nodeData, onClose}) { ); setErrMsg([MESSAGE_TYPE.INFO, gettext('EDB BigAnimal authentication process is in progress...') + '' + gettext('Loading...') + '']); - window.open(verificationURI, 'edb_biganimal_authentication'); + let child = window.open(verificationURI, 'edb_biganimal_authentication'); let _url = url_for('biganimal.verification_ack') ; const myInterval = setInterval(() => { axiosApi.get(_url) @@ -307,6 +307,10 @@ export default function CloudWizard({ nodeInfo, nodeData, onClose}) { setErrMsg([MESSAGE_TYPE.INFO, gettext('Authentication completed successfully but you do not have permission to create the cluster.')]); setVerificationIntiated(false); clearInterval(myInterval); + }else if (child.closed) { + setVerificationIntiated(false); + setErrMsg([MESSAGE_TYPE.ERROR, gettext('Authentication is aborted.')]); + clearInterval(myInterval); } }) .catch((error) => { @@ -314,6 +318,10 @@ export default function CloudWizard({ nodeInfo, nodeData, onClose}) { }); }, 1000); + cloudPanel.on(window.wcDocker.EVENT.CLOSED, function() { + clearInterval(myInterval); + }); + }; @@ -450,5 +458,6 @@ export default function CloudWizard({ nodeInfo, nodeData, onClose}) { CloudWizard.propTypes = { nodeInfo: PropTypes.object, nodeData: PropTypes.object, - onClose: PropTypes.func + onClose: PropTypes.func, + cloudPanel: PropTypes.object }; diff --git a/web/pgadmin/misc/cloud/static/js/cloud.js b/web/pgadmin/misc/cloud/static/js/cloud.js index 9a671b475..f3ea51833 100644 --- a/web/pgadmin/misc/cloud/static/js/cloud.js +++ b/web/pgadmin/misc/cloud/static/js/cloud.js @@ -92,7 +92,7 @@ define('pgadmin.misc.cloud', [ ReactDOM.render( - { ReactDOM.unmountComponentAtNode(j[0]); panel.close();