Fix an issue where query tool is stuck when running query after discarding changed data. #5955

pull/5965/head
Aditya Toshniwal 2023-03-16 17:23:57 +05:30 committed by GitHub
parent 42ac0d577d
commit 3ce1589681
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -10,7 +10,7 @@
/*
* The ERDCore is the middleware between the canvas engine and the UI DOM.
*/
import createEngine, {DagreEngine, PathFindingLinkFactory, PortModelAlignment} from '@projectstorm/react-diagrams';
import createEngine, {DagreEngine, PortModelAlignment} from '@projectstorm/react-diagrams';
import { ZoomCanvasAction } from '@projectstorm/react-canvas-core';
import _ from 'lodash';
@ -665,10 +665,6 @@ export default class ERDCore {
dagreDistributeNodes() {
this.dagre_engine.redistribute(this.getModel());
this.getEngine()
.getLinkFactories()
.getFactory(PathFindingLinkFactory.NAME)
.calculateRoutingMatrix();
this.repaint();
}

View File

@ -819,18 +819,22 @@ export function ResultSet() {
);
};
const executeAndPoll = async ()=>{
let goForPoll = await yesCallback();
if (goForPoll) pollCallback();
};
if(isDataChanged()) {
queryToolCtx.modal.confirm(
gettext('Unsaved changes'),
gettext('The data has been modified, but not saved. Are you sure you wish to discard the changes?'),
yesCallback,
executeAndPoll,
function() {
eventBus.fireEvent(QUERY_TOOL_EVENTS.EXECUTION_END);
}
);
} else {
let goForPoll = await yesCallback();
if (goForPoll) pollCallback();
await executeAndPoll();
}
};