From 9492b17386086fef7e96a7f46d72a08a3661de0c Mon Sep 17 00:00:00 2001 From: Janis Joderi Shoferi Date: Mon, 12 Jan 2026 16:40:58 +0100 Subject: [PATCH] Added a new "date" variable type for process variables and inputs for dates that are linked to this new variable type --- .../components/html-form-editor/elements/Input.tsx | 11 +++++------ .../lib/process-variable-schema.tsx | 11 ++++++++++- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/management-system-v2/components/html-form-editor/elements/Input.tsx b/src/management-system-v2/components/html-form-editor/elements/Input.tsx index dbb0ab284..9d2bfb1fc 100644 --- a/src/management-system-v2/components/html-form-editor/elements/Input.tsx +++ b/src/management-system-v2/components/html-form-editor/elements/Input.tsx @@ -12,7 +12,7 @@ import useProcessVariables from '@/app/(dashboard)/[environmentId]/processes/[mo type InputProps = { label?: string; - type?: 'text' | 'number' | 'email' | 'url' | 'file'; + type?: 'text' | 'number' | 'email' | 'url' | 'file' | 'date'; defaultValue?: string; labelPosition?: 'top' | 'left' | 'none'; variable?: string; @@ -208,10 +208,6 @@ export const InputSettings = () => { variable: node.data.props.variable, })); - const { variables } = useProcessVariables(); - - const selectedVariable = variables.find((v) => v.name === variable); - return ( <> { setProp((props: InputProps) => { props.variable = newVariable; @@ -252,6 +248,9 @@ export const InputSettings = () => { case 'file': props.type = 'file'; break; + case 'date': + props.type = 'date'; + break; default: props.type = 'text'; } diff --git a/src/management-system-v2/lib/process-variable-schema.tsx b/src/management-system-v2/lib/process-variable-schema.tsx index 21937c4cf..2ccc5a5b6 100644 --- a/src/management-system-v2/lib/process-variable-schema.tsx +++ b/src/management-system-v2/lib/process-variable-schema.tsx @@ -1,6 +1,14 @@ import { z } from 'zod'; -export const allowedTypes = ['string', 'number', 'boolean', 'object', 'array', 'file'] as const; +export const allowedTypes = [ + 'string', + 'number', + 'boolean', + 'object', + 'array', + 'file', + 'date', +] as const; type AllowedType = (typeof allowedTypes)[number]; // maps from the data types to what we want to display to the user @@ -11,6 +19,7 @@ export const typeLabelMap: Record = { object: 'Combined Structure', array: 'List', file: 'File', + date: 'Date', } as const; const allowedFormats = ['email', 'url'] as const;