diff --git a/src/api/config.ts b/src/api/config.ts index 3904e11..baf0831 100644 --- a/src/api/config.ts +++ b/src/api/config.ts @@ -65,7 +65,8 @@ export const ORDER_BOOKING = { recordViews: { ORDERS: '1e424561-9a27-44f5-9b68-64d63296d837', CALLS: 'b4d7a710-24e7-416d-885a-31fd1e727aab', - ANALYTICS: 'b4d7a710-24e7-416d-885a-31fd1e727aab' + ANALYTICS: 'b4d7a710-24e7-416d-885a-31fd1e727aab', + }, detailViews: { ORDERS: '0804c6c3-6cf9-4050-94bb-fa48dd5de87d', diff --git a/src/components/forms/DynamicForm.tsx b/src/components/forms/DynamicForm.tsx index 3755755..0f10a51 100644 --- a/src/components/forms/DynamicForm.tsx +++ b/src/components/forms/DynamicForm.tsx @@ -330,6 +330,13 @@ export function DynamicForm({ client, activityId: initialActivityId, instanceId: const val = values[f.id]; const isDisabled = schema.field_defaults?.[f.id]?.disabled || f.properties?.disabled; + const isPlaceOrder = currentActivityId === ORDER_BOOKING.activities.PLACE_ORDER.uid; + const isOrderId = f.name.toLowerCase() === 'order id' || f.id.toLowerCase().includes('order_id') || f.mapped_workflow_field === 'order_id'; + + if (isPlaceOrder && isOrderId) { + return null; + } + const renderField = () => { if (type === 'wf_lookup') { return ( diff --git a/src/components/forms/fields/FileInput.tsx b/src/components/forms/fields/FileInput.tsx index 9a40207..6717a8b 100644 --- a/src/components/forms/fields/FileInput.tsx +++ b/src/components/forms/fields/FileInput.tsx @@ -29,9 +29,10 @@ export function FileInput({ const files = Array.isArray(value) ? value : (value instanceof File ? [value] : []); const handleFileChange = (e: React.ChangeEvent) => { - if (e.target.files) { + if (e.target.files && e.target.files.length > 0) { const newFiles = Array.from(e.target.files); - onChange([...files, ...newFiles]); + // Since we only want 1 file, replace the existing one instead of appending + onChange(newFiles); } // reset input so the same file can be selected again if needed e.target.value = ''; @@ -53,7 +54,6 @@ export function FileInput({
0 && (
{files.map((file, i) => ( -
+
{type === 'image' ? ( ) : ( @@ -74,7 +74,7 @@ export function FileInput({