mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix: Extend deduplication check to all webhook-based triggers and chat trigger (#18044)
This commit is contained in:
@@ -6,7 +6,7 @@ import { useUIStore } from '@/stores/ui.store';
|
||||
|
||||
import { useRootStore } from '@n8n/stores/useRootStore';
|
||||
import { computed } from 'vue';
|
||||
import { FORM_TRIGGER_NODE_TYPE } from 'n8n-workflow';
|
||||
import { CHAT_TRIGGER_NODE_TYPE, FORM_TRIGGER_NODE_TYPE, WEBHOOK_NODE_TYPE } from 'n8n-workflow';
|
||||
|
||||
const modalBus = createEventBus();
|
||||
const uiStore = useUIStore();
|
||||
@@ -28,9 +28,33 @@ const webhookUrl = computed(() => {
|
||||
return rootStore.webhookUrl;
|
||||
});
|
||||
|
||||
const webhookType = computed(() => {
|
||||
if (data.triggerType === FORM_TRIGGER_NODE_TYPE) return 'form';
|
||||
return 'webhook';
|
||||
const webhookTypeUi = computed((): { title: string; callout: string; suggestion: string } => {
|
||||
const suggestionBase = 'and activate this one, or ';
|
||||
|
||||
if (data.triggerType === FORM_TRIGGER_NODE_TYPE)
|
||||
return {
|
||||
title: 'Form',
|
||||
callout: 'form trigger',
|
||||
suggestion: suggestionBase + 'adjust the following URL path in either workflow:',
|
||||
};
|
||||
if (data.triggerType === CHAT_TRIGGER_NODE_TYPE)
|
||||
return {
|
||||
title: 'Chat',
|
||||
callout: 'chat trigger',
|
||||
suggestion: suggestionBase + 'insert a new Chat Trigger node in either workflow:',
|
||||
};
|
||||
if (data.triggerType === WEBHOOK_NODE_TYPE)
|
||||
return {
|
||||
title: 'Webhook',
|
||||
callout: 'webhook trigger',
|
||||
suggestion: suggestionBase + 'adjust the following URL path in either workflow:',
|
||||
};
|
||||
|
||||
return {
|
||||
title: 'Trigger',
|
||||
callout: 'trigger',
|
||||
suggestion: suggestionBase + 'insert a new trigger node of the same type in either workflow:',
|
||||
};
|
||||
});
|
||||
|
||||
const workflowUrl = computed(() => {
|
||||
@@ -46,21 +70,21 @@ const onClick = async () => {
|
||||
<Modal
|
||||
width="540px"
|
||||
:name="WORKFLOW_ACTIVATION_CONFLICTING_WEBHOOK_MODAL_KEY"
|
||||
:title="`Conflicting ${webhookType === 'form' ? 'Form' : 'Webhook'} Path`"
|
||||
:title="`Conflicting ${webhookTypeUi.title} Path`"
|
||||
:event-bus="modalBus"
|
||||
:center="true"
|
||||
>
|
||||
<template #content>
|
||||
<n8n-callout theme="danger" data-test-id="conflicting-webhook-callout">
|
||||
A {{ webhookType }} trigger '{{ data.node }}' in the workflow '{{ data.workflowName }}' uses
|
||||
a conflicting URL path, so this workflow cannot be activated
|
||||
A {{ webhookTypeUi.callout }} '{{ data.node }}' in the workflow '{{ data.workflowName }}'
|
||||
uses a conflicting URL path, so this workflow cannot be activated
|
||||
</n8n-callout>
|
||||
<div :class="$style.container">
|
||||
<div>
|
||||
<n8n-text color="text-base"> You can deactivate </n8n-text>
|
||||
<n8n-link :to="workflowUrl" :underline="true"> '{{ data.workflowName }}' </n8n-link>
|
||||
<n8n-text color="text-base">
|
||||
and activate this one, or adjust the following URL path in either workflow:
|
||||
<n8n-link :to="workflowUrl" :underline="true"> {{ data.workflowName }} </n8n-link>
|
||||
<n8n-text color="text-base" data-test-id="conflicting-webhook-suggestion">
|
||||
{{ webhookTypeUi.suggestion }}
|
||||
</n8n-text>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user