mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
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
This commit is contained in:
committed by
Akshay Joshi
parent
04b1e26041
commit
d38d0ce805
@@ -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...') + '<img src="' + loading_icon_url + '" alt="' + 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
|
||||
};
|
||||
|
||||
@@ -92,7 +92,7 @@ define('pgadmin.misc.cloud', [
|
||||
|
||||
ReactDOM.render(
|
||||
<Theme>
|
||||
<CloudWizard nodeInfo={info} nodeData={d}
|
||||
<CloudWizard nodeInfo={info} nodeData={d} cloudPanel={panel}
|
||||
onClose={() => {
|
||||
ReactDOM.unmountComponentAtNode(j[0]);
|
||||
panel.close();
|
||||
|
||||
Reference in New Issue
Block a user