From 1894b1f9a5020da6736f5240a3f6304861396cec Mon Sep 17 00:00:00 2001 From: suryacp23 Date: Tue, 21 Jul 2026 17:54:49 +0530 Subject: [PATCH] tile design done --- src/api/config.ts | 3 +- src/components/forms/DynamicForm.tsx | 7 + src/components/forms/fields/FileInput.tsx | 10 +- .../forms/fields/SmartGridField.tsx | 58 +++++-- src/components/reusable/AnalyticsChart.tsx | 22 ++- src/components/reusable/Input.tsx | 2 +- src/components/reusable/Modal.tsx | 2 +- src/components/reusable/Select.tsx | 2 +- src/components/reusable/StatsTile.tsx | 37 +++-- src/components/reusable/Textarea.tsx | 2 +- src/components/reusable/reusable.css | 145 ++++++++---------- src/screens/ConsoleLayout.tsx | 2 +- src/styles/styles.css | 5 +- src/styles/tokens/colors.css | 2 +- 14 files changed, 169 insertions(+), 130 deletions(-) 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({