Skip to content

Commit 32232f8

Browse files
authored
Pre 2.0 bug fixes for automation and app builder (baserow#4161)
* Fix error when creating a branch * Fix workflow import issue * Fix previous action data provider
1 parent e769c27 commit 32232f8

File tree

8 files changed

+39
-10
lines changed

8 files changed

+39
-10
lines changed

backend/src/baserow/contrib/automation/workflows/handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ def import_workflows(
519519
cache=cache,
520520
)
521521

522-
workflow_instance.get_graph().migrate_graph(id_mapping)
522+
workflow_instance.get_graph().migrate_graph(id_mapping)
523523

524524
return [i[0] for i in imported_workflows]
525525

web-frontend/modules/automation/components/workflow/WorkflowNode.vue

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,18 @@ const coordsPerEdge = computed(() => {
145145
146146
return nodeEdges.value.map((edge) => {
147147
const wrap = workflowNode.value
148-
const edgeElt = refs[`edge-${edge.uid}`][0].$el
149-
150-
return [edge.uid, computeEdgeCoords(wrap, edgeElt, hasMultipleEdges.value)]
148+
if (Array.isArray(refs[`edge-${edge.uid}`])) {
149+
const edgeElt = refs[`edge-${edge.uid}`][0].$el
150+
151+
return [
152+
edge.uid,
153+
computeEdgeCoords(wrap, edgeElt, hasMultipleEdges.value),
154+
]
155+
} else {
156+
// We might have a delay between the edge addition
157+
// and the branch being visible
158+
return [edge.uid, { startX: 0, startY: 0, endX: 0, endY: 0 }]
159+
}
151160
})
152161
})
153162

web-frontend/modules/automation/components/workflow/sidePanels/NodeSidePanel.vue

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
:application="automation"
3131
enable-integration-picker
3232
:default-values="node.service"
33+
:edge-in-use-fn="nodeEdgeInUseFn"
3334
class="margin-top-2"
3435
@values-changed="handleNodeChange({ service: $event })"
3536
/>
@@ -59,6 +60,7 @@ import { helpers, maxLength } from '@vuelidate/validators'
5960
import { notifyIf } from '@baserow/modules/core/utils/error'
6061
6162
const store = useStore()
63+
6264
const { app } = useContext()
6365
6466
provide('formulaComponent', AutomationBuilderFormulaInput)
@@ -188,4 +190,17 @@ const handleNodeChange = async ({
188190
const nodeLoading = computed(() => {
189191
return store.getters['automationWorkflowNode/getLoading'](node.value)
190192
})
193+
194+
/**
195+
* Responsible for informing the core router service form if an edge has an
196+
* output. As the service form can't refer to automation nodes, we have to
197+
* perform the check here, and pass the function as a prop into the form.
198+
*/
199+
const nodeEdgeInUseFn = (edge) => {
200+
return !!store.getters['automationWorkflowNode/getNextNodes'](
201+
workflow.value,
202+
node.value,
203+
edge.uid
204+
).length
205+
}
191206
</script>

web-frontend/modules/automation/nodeTypes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ export class CoreHttpRequestNodeType extends ActionNodeTypeMixin(NodeType) {
601601
}
602602

603603
export class CoreIteratorNodeType extends containerNodeTypeMixin(
604-
ActionNodeTypeMixin(NodeType)
604+
ActionNodeTypeMixin(UtilityNodeMixin(NodeType))
605605
) {
606606
static getType() {
607607
return 'iterator'

web-frontend/modules/builder/dataProviderTypes.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -824,15 +824,19 @@ export class PreviousActionDataProviderType extends DataProviderType {
824824

825825
const workflowAction = this.app.store.getters[
826826
'builderWorkflowAction/getWorkflowActionById'
827-
](applicationContext.page, workflowActionId)
827+
](applicationContext.page, parseInt(workflowActionId))
828828

829829
const actionType = this.app.$registry.get(
830830
'workflowAction',
831831
workflowAction.type
832832
)
833833

834-
return content
835-
? actionType.getValueAtPath(workflowAction, content, rest)
834+
return content[workflowActionId]
835+
? actionType.getValueAtPath(
836+
workflowAction,
837+
content[workflowActionId],
838+
rest
839+
)
836840
: null
837841
}
838842

web-frontend/modules/builder/workflowActionTypes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ export class WorkflowActionServiceType extends WorkflowActionType {
305305
return this.serviceType.getValueAtPath(
306306
workflowAction.service,
307307
content,
308-
path.join('.')
308+
path
309309
)
310310
}
311311

web-frontend/modules/core/runtimeFormulaContext.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export class RuntimeFormulaContext {
4949
try {
5050
return dataProviderType.getDataChunk(this.applicationContext, rest)
5151
} catch (e) {
52+
console.debug(`DATA PROVIDER DEBUG: ${e}`)
5253
throw new UnresolvablePathError(dataProviderType.type, rest.join('.'))
5354
}
5455
}

web-frontend/modules/integrations/localBaserow/serviceTypes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export class LocalBaserowTableServiceType extends ServiceType {
8686
const [field, ...rest] = path
8787
let humanName = field
8888

89-
if (schema) {
89+
if (schema && field.startsWith('field_')) {
9090
if (this.returnsList) {
9191
if (schema.items?.properties?.[field]?.title) {
9292
humanName = schema.items.properties[field].title

0 commit comments

Comments
 (0)