mirror of
https://github.com/baserow/baserow.git
synced 2026-12-04 08:18:42 +00:00
* Add recipies for For and While loops * Add tests * Add changelog * Fix the clean-up when rolling back
45 lines
966 B
Vue
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>
|