Files
Tsering Paljor c95046c2f9 feat: Add Automation recipes for For and While loops (#6338)
* Add recipies for For and While loops

* Add tests

* Add changelog

* Fix the clean-up when rolling back
2026-10-16 08:57:23 +04:00

45 lines
966 B
Vue

<template>
<div>
<ButtonFloating
ref="btn"
icon="iconoir-plus"
size="small"
:disabled="props.disabled"
:title="$t('workflowAddNode.displayTitle')"
@click="toggleCreateContext"
@mousedown.stop
/>
<WorkflowNodeContext
ref="context"
@change="emit('add-node', $event)"
@recipe="emit('add-recipe', $event)"
/>
</div>
</template>
<script setup>
import WorkflowNodeContext from '@baserow/modules/automation/components/workflow/WorkflowNodeContext'
import { useVueFlow } from '@vue-flow/core'
const props = defineProps({
disabled: {
type: Boolean,
default: false,
},
})
const emit = defineEmits(['add-node', 'add-recipe'])
const context = ref()
const btn = ref()
// Hide context on pan
const { onMove } = useVueFlow()
onMove(() => {
context.value.hide()
})
const toggleCreateContext = (nodeId) => {
context.value.show(btn.value.$el, 'bottom', 'left', 10, -225)
}
</script>