From c79b4a4a84b3fba1cb0088e461c1d35be69afc72 Mon Sep 17 00:00:00 2001 From: Paulo Castellano Date: Sat, 13 Jun 2026 17:15:20 -0300 Subject: [PATCH] Type node enum props with their value unions The required method/unit/operator/mode props were typed as plain string after dropping their defaults. Use the matching *Value union types (HttpMethodValue, DelayUnitValue, ConditionOperatorValue, PublishModeValue) so the renderers are constrained to real enum values, matching the config panels. --- resources/js/components/automations/nodes/ConditionNode.vue | 3 ++- resources/js/components/automations/nodes/DelayNode.vue | 4 +++- resources/js/components/automations/nodes/HttpRequestNode.vue | 4 +++- resources/js/components/automations/nodes/PublishNode.vue | 4 ++-- resources/js/components/automations/nodes/WebhookNode.vue | 4 +++- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/resources/js/components/automations/nodes/ConditionNode.vue b/resources/js/components/automations/nodes/ConditionNode.vue index 5ac37f50..ae4002f1 100644 --- a/resources/js/components/automations/nodes/ConditionNode.vue +++ b/resources/js/components/automations/nodes/ConditionNode.vue @@ -5,11 +5,12 @@ import { trans } from 'laravel-vue-i18n'; import { computed } from 'vue'; import { ConditionHandle } from '@/types/automation/condition-handle'; +import type { ConditionOperatorValue } from '@/types/automation/condition-operator'; const props = defineProps<{ data: { field?: string; - operator: string; + operator: ConditionOperatorValue; value?: string; }; selected?: boolean; diff --git a/resources/js/components/automations/nodes/DelayNode.vue b/resources/js/components/automations/nodes/DelayNode.vue index cd0d1279..179e7796 100644 --- a/resources/js/components/automations/nodes/DelayNode.vue +++ b/resources/js/components/automations/nodes/DelayNode.vue @@ -4,10 +4,12 @@ import { Handle, Position } from '@vue-flow/core'; import { trans } from 'laravel-vue-i18n'; import { computed } from 'vue'; +import type { DelayUnitValue } from '@/types/automation/delay-unit'; + const props = defineProps<{ data: { duration: number; - unit: string; + unit: DelayUnitValue; }; selected?: boolean; }>(); diff --git a/resources/js/components/automations/nodes/HttpRequestNode.vue b/resources/js/components/automations/nodes/HttpRequestNode.vue index 0c1aa360..8210dc40 100644 --- a/resources/js/components/automations/nodes/HttpRequestNode.vue +++ b/resources/js/components/automations/nodes/HttpRequestNode.vue @@ -3,10 +3,12 @@ import { IconWorld } from '@tabler/icons-vue'; import { Handle, Position } from '@vue-flow/core'; import { computed } from 'vue'; +import type { HttpMethodValue } from '@/types/automation/http-method'; + const props = defineProps<{ data: { url?: string; - method: string; + method: HttpMethodValue; }; selected?: boolean; }>(); diff --git a/resources/js/components/automations/nodes/PublishNode.vue b/resources/js/components/automations/nodes/PublishNode.vue index 10d49b79..07d62338 100644 --- a/resources/js/components/automations/nodes/PublishNode.vue +++ b/resources/js/components/automations/nodes/PublishNode.vue @@ -4,11 +4,11 @@ import { Handle, Position } from '@vue-flow/core'; import { trans } from 'laravel-vue-i18n'; import { computed } from 'vue'; -import { PublishMode } from '@/types/automation/publish-mode'; +import { PublishMode, type PublishModeValue } from '@/types/automation/publish-mode'; const props = defineProps<{ data: { - mode: string; + mode: PublishModeValue; scheduled_offset?: number; }; selected?: boolean; diff --git a/resources/js/components/automations/nodes/WebhookNode.vue b/resources/js/components/automations/nodes/WebhookNode.vue index 3e145f99..2bd36bcc 100644 --- a/resources/js/components/automations/nodes/WebhookNode.vue +++ b/resources/js/components/automations/nodes/WebhookNode.vue @@ -3,10 +3,12 @@ import { IconWebhook } from '@tabler/icons-vue'; import { Handle, Position } from '@vue-flow/core'; import { computed } from 'vue'; +import type { HttpMethodValue } from '@/types/automation/http-method'; + const props = defineProps<{ data: { url?: string; - method: string; + method: HttpMethodValue; }; selected?: boolean; }>();