mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 19:32:15 +00:00
feat(editor): Add clear execution button to new canvas (no-changelog) (#10010)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user