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 39978b10f..bf079054a 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 @@ -13,7 +13,7 @@ import { DeleteButton } from '../DeleteButton'; 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; @@ -214,10 +214,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; @@ -258,6 +254,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;