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.
This commit is contained in:
parent
1ac4795575
commit
c79b4a4a84
5 changed files with 13 additions and 6 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}>();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}>();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}>();
|
||||
|
|
|
|||
Loading…
Reference in a new issue