Skip to content

Commit a57a666

Browse files
authored
Better fix for workflow action reactivity (baserow#4242)
1 parent 7bd7569 commit a57a666

File tree

3 files changed

+15
-19
lines changed

3 files changed

+15
-19
lines changed

web-frontend/modules/builder/components/event/WorkflowAction.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export default {
105105
await this.actionUpdateWorkflowAction({
106106
page: this.elementPage,
107107
workflowAction: this.workflowAction,
108-
values,
108+
values: differences,
109109
})
110110
} catch (error) {
111111
this.$refs.actionForm?.reset()

web-frontend/modules/builder/store/builderWorkflowAction.js

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -60,21 +60,19 @@ const mutations = {
6060
order,
6161
} = page.workflowActions[index]
6262

63-
const newValue = overwrite
64-
? populateWorkflowAction({
65-
id,
66-
page_id: pageId,
67-
element_id: elementId,
68-
event,
69-
order,
70-
...values,
71-
})
72-
: {
73-
...page.workflowActions[index],
74-
...values,
75-
}
76-
77-
page.workflowActions.splice(index, 1, newValue)
63+
if (overwrite) {
64+
const newValue = populateWorkflowAction({
65+
id,
66+
page_id: pageId,
67+
element_id: elementId,
68+
event,
69+
order,
70+
...values,
71+
})
72+
page.workflowActions.splice(index, 1, newValue)
73+
} else {
74+
Object.assign(page.workflowActions[index], values)
75+
}
7876
},
7977
SET_ITEM(state, { page, workflowAction: workflowActionToSet, values }) {
8078
page.workflowActions = page.workflowActions.map((workflowAction) =>

web-frontend/modules/core/components/formula/FormulaInputField.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,7 @@ export default {
315315
nodesHierarchy(newValue, oldValue) {
316316
// fixes reactivity issue with components in tiptap by forcing the input to
317317
// render.
318-
if (!_.isEqual(newValue, oldValue)) {
319-
this.key += 1
320-
}
318+
this.key += 1
321319
},
322320
disabled(newValue) {
323321
this.editor.setOptions({ editable: !newValue && !this.readOnly })

0 commit comments

Comments
 (0)