Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -214,10 +214,6 @@ export const InputSettings = () => {
variable: node.data.props.variable,
}));

const { variables } = useProcessVariables();

const selectedVariable = variables.find((v) => v.name === variable);

return (
<>
<Setting
Expand All @@ -242,7 +238,7 @@ export const InputSettings = () => {

<VariableSetting
variable={variable}
allowedTypes={['string', 'number', 'file']}
allowedTypes={['string', 'number', 'file', 'date']}
onChange={(newVariable, newVariableType, newVariableTextFormat) =>
setProp((props: InputProps) => {
props.variable = newVariable;
Expand All @@ -258,6 +254,9 @@ export const InputSettings = () => {
case 'file':
props.type = 'file';
break;
case 'date':
props.type = 'date';
break;
default:
props.type = 'text';
}
Expand Down
11 changes: 10 additions & 1 deletion src/management-system-v2/lib/process-variable-schema.tsx
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -11,6 +19,7 @@ export const typeLabelMap: Record<AllowedType, string> = {
object: 'Combined Structure',
array: 'List',
file: 'File',
date: 'Date',
} as const;

const allowedFormats = ['email', 'url'] as const;
Expand Down