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:
Yogesh Mahajan
2022-09-15 18:44:07 +05:30
committed by Akshay Joshi
parent 04b1e26041
commit d38d0ce805
4 changed files with 35 additions and 24 deletions

View File

@@ -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
};

View File

@@ -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();