Improve editor-UI dirty checking

This commit is contained in:
Jan Oberhauser 2020-11-04 13:04:40 +01:00
parent d80d486e59
commit 9465653fab
4 changed files with 8 additions and 23 deletions

View file

@ -33,7 +33,7 @@ export const moveNodeWorkflow = mixins(
const nodeViewOffsetPositionX = offsetPosition[0] + (position.x - this.moveLastPosition[0]);
const nodeViewOffsetPositionY = offsetPosition[1] + (position.y - this.moveLastPosition[1]);
this.$store.commit('setNodeViewOffsetPosition', {newOffset: [nodeViewOffsetPositionX, nodeViewOffsetPositionY], setStateDirty: true});
this.$store.commit('setNodeViewOffsetPosition', {newOffset: [nodeViewOffsetPositionX, nodeViewOffsetPositionY]});
// Update the last position
this.moveLastPosition[0] = position.x;
@ -101,7 +101,7 @@ export const moveNodeWorkflow = mixins(
const offsetPosition = this.$store.getters.getNodeViewOffsetPosition;
const nodeViewOffsetPositionX = offsetPosition[0] - normalized.pixelX;
const nodeViewOffsetPositionY = offsetPosition[1] - normalized.pixelY;
this.$store.commit('setNodeViewOffsetPosition', {newOffset: [nodeViewOffsetPositionX, nodeViewOffsetPositionY], setStateDirty: true});
this.$store.commit('setNodeViewOffsetPosition', {newOffset: [nodeViewOffsetPositionX, nodeViewOffsetPositionY]});
},
},
});

View file

@ -29,7 +29,6 @@ export const workflowRun = mixins(
// because then it can not receive the data as it executes.
throw new Error('No active connection to server. It is maybe down.');
}
const workflow = this.getWorkflow();
this.$store.commit('addActiveAction', 'workflowRunning');

View file

@ -96,7 +96,6 @@ export const store = new Vuex.Store({
// Active Executions
addActiveExecution (state, newActiveExecution: IExecutionsCurrentSummaryExtended) {
state.stateIsDirty = true;
// Check if the execution exists already
const activeExecution = state.activeExecutions.find(execution => {
return execution.idActive === newActiveExecution.idActive;
@ -113,7 +112,6 @@ export const store = new Vuex.Store({
state.activeExecutions.unshift(newActiveExecution);
},
finishActiveExecution (state, finishedActiveExecution: IPushDataExecutionFinished) {
state.stateIsDirty = true;
// Find the execution to set to finished
const activeExecution = state.activeExecutions.find(execution => {
return execution.idActive === finishedActiveExecution.executionIdActive;
@ -132,7 +130,6 @@ export const store = new Vuex.Store({
Vue.set(activeExecution, 'stoppedAt', finishedActiveExecution.data.stoppedAt);
},
setActiveExecutions (state, newActiveExecutions: IExecutionsCurrentSummaryExtended[]) {
state.stateIsDirty = true;
Vue.set(state, 'activeExecutions', newActiveExecutions);
},
@ -165,7 +162,6 @@ export const store = new Vuex.Store({
state.selectedNodes.push(node);
},
removeNodeFromSelection (state, node: INodeUi) {
state.stateIsDirty = true;
let index;
for (index in state.selectedNodes) {
if (state.selectedNodes[index].name === node.name) {
@ -377,7 +373,6 @@ export const store = new Vuex.Store({
// Set/Overwrite the value
Vue.set(node.issues!, nodeIssueData.type, nodeIssueData.value);
state.stateIsDirty = true;
}
return true;
@ -466,7 +461,6 @@ export const store = new Vuex.Store({
state.nodeIndex.push(nodeName);
},
setNodeIndex (state, newData: { index: number, name: string | null}) {
state.stateIsDirty = true;
state.nodeIndex[newData.index] = newData.name;
},
resetNodeIndex (state) {
@ -478,9 +472,6 @@ export const store = new Vuex.Store({
state.nodeViewMoveInProgress = value;
},
setNodeViewOffsetPosition (state, data) {
if (data.setStateDirty === true) {
state.stateIsDirty = true;
}
state.nodeViewOffsetPosition = data.newOffset;
},
@ -541,16 +532,6 @@ export const store = new Vuex.Store({
Vue.set(state, 'oauthCallbackUrls', urls);
},
addNodeType (state, typeData: INodeTypeDescription) {
if (!typeData.hasOwnProperty('name')) {
// All node-types have to have a name
// TODO: Check if there is an error or whatever that is supposed to be returned
return;
}
state.stateIsDirty = true;
state.nodeTypes.push(typeData);
},
setActiveNode (state, nodeName: string) {
state.activeNode = nodeName;
},
@ -573,7 +554,6 @@ export const store = new Vuex.Store({
if (state.workflowExecutionData.data.resultData.runData[pushData.nodeName] === undefined) {
Vue.set(state.workflowExecutionData.data.resultData.runData, pushData.nodeName, []);
}
state.stateIsDirty = true;
state.workflowExecutionData.data.resultData.runData[pushData.nodeName].push(pushData.data);
},

View file

@ -1006,6 +1006,8 @@ export default mixins(
await this.addNodes([newNodeData]);
this.$store.commit('setStateDirty', true);
// Automatically deselect all nodes and select the current one and also active
// current node
this.deselectAllNodes();
@ -1500,6 +1502,8 @@ export default mixins(
await this.addNodes([newNodeData]);
this.$store.commit('setStateDirty', true);
// Automatically deselect all nodes and select the current one and also active
// current node
this.deselectAllNodes();
@ -1834,6 +1838,8 @@ export default mixins(
// Add the nodes with the changed node names, expressions and connections
await this.addNodes(Object.values(tempWorkflow.nodes), tempWorkflow.connectionsBySourceNode);
this.$store.commit('setStateDirty', true);
return {
nodes: Object.values(tempWorkflow.nodes),
connections: tempWorkflow.connectionsBySourceNode,