-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Fixed pin data in executions when pinData is null. #3787
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -214,20 +214,23 @@ export const store = new Vuex.Store({ | |
|
||
// Pin data | ||
pinData(state, payload: { node: INodeUi, data: IPinData[string] }) { | ||
if (state.workflow.pinData) { | ||
Vue.set(state.workflow.pinData, payload.node.name, payload.data); | ||
if (!state.workflow.pinData) { | ||
Vue.set(state.workflow, 'pinData', {}); | ||
} | ||
|
||
Vue.set(state.workflow.pinData!, payload.node.name, payload.data); | ||
state.stateIsDirty = true; | ||
|
||
dataPinningEventBus.$emit('pin-data', { [payload.node.name]: payload.data }); | ||
}, | ||
unpinData(state, payload: { node: INodeUi }) { | ||
if (state.workflow.pinData) { | ||
Vue.set(state.workflow.pinData, payload.node.name, undefined); | ||
delete state.workflow.pinData[payload.node.name]; | ||
if (!state.workflow.pinData) { | ||
Vue.set(state.workflow, 'pinData', {}); | ||
} | ||
|
||
Vue.set(state.workflow.pinData!, payload.node.name, undefined); | ||
delete state.workflow.pinData![payload.node.name]; | ||
|
||
state.stateIsDirty = true; | ||
|
||
dataPinningEventBus.$emit('unpin-data', { [payload.node.name]: undefined }); | ||
|
@@ -478,7 +481,7 @@ export const store = new Vuex.Store({ | |
} | ||
|
||
if (data.removePinData) { | ||
state.workflow.pinData = {}; | ||
Vue.set(state.workflow, 'pinData', {}); | ||
} | ||
|
||
state.workflow.nodes.splice(0, state.workflow.nodes.length); | ||
|
@@ -652,9 +655,9 @@ export const store = new Vuex.Store({ | |
}, | ||
|
||
setWorkflowPinData(state, pinData: IPinData) { | ||
Vue.set(state.workflow, 'pinData', pinData); | ||
Vue.set(state.workflow, 'pinData', pinData || {}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On second thought, maybe |
||
|
||
dataPinningEventBus.$emit('pin-data', pinData); | ||
dataPinningEventBus.$emit('pin-data', pinData || {}); | ||
}, | ||
|
||
setWorkflowTagIds(state, tags: string[]) { | ||
|
@@ -909,7 +912,7 @@ export const store = new Vuex.Store({ | |
return state.workflow.pinData; | ||
}, | ||
pinDataByNodeName: (state) => (nodeName: string) => { | ||
return state.workflow.pinData && state.workflow.pinData[nodeName]; | ||
return state.workflow.pinData ? state.workflow.pinData[nodeName] : undefined; | ||
}, | ||
pinDataSize: (state) => { | ||
return state.workflow.nodes | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-actionable: Would be nice if
Vue.set()
were smart enough to create missing intermediate properties to avoid the boilerplate. Also I wish TS were able to pick up thatstate.workflow.pinData
is defined viaVue.set()
.