Fix an issue where query tool is stuck when running query after discarding changed data. #5955
parent
42ac0d577d
commit
3ce1589681
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue