feat(editor): Add clear execution button to new canvas (no-changelog) (#10010)

This commit is contained in:
Alex Grozav
2024-07-11 16:37:01 +03:00
committed by GitHub
parent 071130a2dc
commit c2adaa58cd
4 changed files with 52 additions and 0 deletions

View File

@@ -83,6 +83,7 @@ import { getNodeViewTab } from '@/utils/canvasUtils';
import { parseCanvasConnectionHandleString } from '@/utils/canvasUtilsV2';
import CanvasStopCurrentExecutionButton from '@/components/canvas/elements/buttons/CanvasStopCurrentExecutionButton.vue';
import CanvasStopWaitingForWebhookButton from '@/components/canvas/elements/buttons/CanvasStopWaitingForWebhookButton.vue';
import CanvasClearExecutionDataButton from '@/components/canvas/elements/buttons/CanvasClearExecutionDataButton.vue';
import { nodeViewEventBus } from '@/event-bus';
const NodeCreation = defineAsyncComponent(
@@ -614,6 +615,16 @@ const isStopExecutionButtonVisible = computed(
const isStopWaitingForWebhookButtonVisible = computed(
() => isWorkflowRunning.value && isExecutionWaitingForWebhook.value,
);
const isClearExecutionButtonVisible = computed(
() =>
!isReadOnlyRoute.value &&
!isReadOnlyEnvironment.value &&
!isWorkflowRunning.value &&
!allTriggerNodesDisabled.value &&
workflowExecutionData.value,
);
const workflowExecutionData = computed(() => workflowsStore.workflowExecutionData);
async function onRunWorkflow() {
trackRunWorkflow();
@@ -672,6 +683,11 @@ async function onStopWaitingForWebhook() {
await stopWaitingForWebhook();
}
async function onClearExecutionData() {
workflowsStore.workflowExecutionData = null;
nodeHelpers.updateNodesExecutionIssues();
}
function onRunWorkflowButtonMouseEnter() {
nodeViewEventBus.emit('runWorkflowButton:mouseenter');
}
@@ -1083,6 +1099,10 @@ onBeforeUnmount(() => {
v-if="isStopWaitingForWebhookButtonVisible"
@click="onStopWaitingForWebhook"
/>
<CanvasClearExecutionDataButton
v-if="isClearExecutionButtonVisible"
@click="onClearExecutionData"
/>
</div>
<Suspense>
<NodeCreation