From 568f55f00f800da0a80698cb05a4c20e627852e7 Mon Sep 17 00:00:00 2001 From: Syed Waseem Date: Mon, 3 Aug 2026 16:21:27 +0530 Subject: [PATCH] feat: implement dynamic form rendering and field management system for action builders --- .../components/ActionCategoryManager.tsx | 18 +++++++++--------- .../components/ActionTypeManager.tsx | 18 +++++++++--------- .../components/DynamicFormRenderer.tsx | 6 +++--- .../components/FieldBuilderManager.tsx | 8 ++++---- src/app/actionBuilder/index.tsx | 6 +++--- src/app/masterData/index.tsx | 2 +- src/layout/AppHeader.tsx | 4 ++++ 7 files changed, 33 insertions(+), 29 deletions(-) diff --git a/src/app/actionBuilder/components/ActionCategoryManager.tsx b/src/app/actionBuilder/components/ActionCategoryManager.tsx index f56831b..b6357ba 100644 --- a/src/app/actionBuilder/components/ActionCategoryManager.tsx +++ b/src/app/actionBuilder/components/ActionCategoryManager.tsx @@ -201,9 +201,9 @@ export function ActionCategoryManager() { ); return ( -
+
{/* Top Banner / Controls */} -
+

@@ -219,7 +219,7 @@ export function ActionCategoryManager() { variant="primary" onClick={handleOpenCreate} leftIcon={} - className="!bg-[#1E7D5C] hover:!bg-[#17664B] !rounded-[12px] font-semibold text-[14px]" + className="!bg-[#1E7D5C] hover:!bg-[#17664B] !rounded-[10px] !gap-[10px] !h-[40px] font-semibold text-[14px]" > Add New Category @@ -337,17 +337,17 @@ export function ActionCategoryManager() { {/* Category List Table Card */} -
+
{/* Table Filter Bar */}
-
- - + handleSearchChange(e.target.value)} placeholder="Search category by name or code..." - className="w-full pl-10 pr-4 py-2 text-[13px] bg-white border border-gray-200 rounded-[10px] focus:outline-none focus:border-[#1E7D5C] focus:ring-1 focus:ring-[#1E7D5C] transition-colors" + leftIcon={} + className="!bg-[#F3F6F5] !rounded-[10px] !h-[38px] !border !border-[#E5E7EB]" + containerClassName="!gap-0" />
diff --git a/src/app/actionBuilder/components/ActionTypeManager.tsx b/src/app/actionBuilder/components/ActionTypeManager.tsx index 15680a7..13a5649 100644 --- a/src/app/actionBuilder/components/ActionTypeManager.tsx +++ b/src/app/actionBuilder/components/ActionTypeManager.tsx @@ -225,9 +225,9 @@ export function ActionTypeManager() { ); return ( -
+
{/* Top Banner / Controls */} -
+

@@ -243,7 +243,7 @@ export function ActionTypeManager() { variant="primary" onClick={handleOpenCreate} leftIcon={} - className="!bg-[#1E7D5C] hover:!bg-[#17664B] !rounded-[12px] font-semibold text-[14px]" + className="!bg-[#1E7D5C] hover:!bg-[#17664B] !rounded-[10px] !gap-[10px] !h-[40px] font-semibold text-[14px]" > Add Action Type @@ -375,7 +375,7 @@ export function ActionTypeManager() { {/* Action Types Table Card */} -
+
{/* Table Filter Bar */}
@@ -387,14 +387,14 @@ export function ActionTypeManager() { />
-
- - + handleSearchChange(e.target.value)} placeholder="Search action types..." - className="w-full pl-10 pr-4 py-2 text-[13px] bg-white border border-gray-200 rounded-[10px] focus:outline-none focus:border-[#1E7D5C] focus:ring-1 focus:ring-[#1E7D5C] transition-colors" + leftIcon={} + className="!bg-[#F3F6F5] !rounded-[10px] !h-[38px] !border !border-[#E5E7EB]" + containerClassName="!gap-0" />
diff --git a/src/app/actionBuilder/components/DynamicFormRenderer.tsx b/src/app/actionBuilder/components/DynamicFormRenderer.tsx index e8a82d4..cc66a2e 100644 --- a/src/app/actionBuilder/components/DynamicFormRenderer.tsx +++ b/src/app/actionBuilder/components/DynamicFormRenderer.tsx @@ -382,9 +382,9 @@ export function DynamicFormRenderer() { const selectedTypeObj = actionTypes.find((t) => t.id === selectedActionTypeId); return ( -
+
{/* Top Control Bar */} -
+

@@ -424,7 +424,7 @@ export function DynamicFormRenderer() {

{/* Main Dynamic Form Card */} -
+
diff --git a/src/app/actionBuilder/components/FieldBuilderManager.tsx b/src/app/actionBuilder/components/FieldBuilderManager.tsx index 982a25b..8b223b8 100644 --- a/src/app/actionBuilder/components/FieldBuilderManager.tsx +++ b/src/app/actionBuilder/components/FieldBuilderManager.tsx @@ -323,9 +323,9 @@ export function FieldBuilderManager() { const selectedTypeObj = actionTypes.find((t) => t.id === selectedActionTypeId); return ( -
+
{/* Top Banner / Selectors */} -
+

@@ -343,7 +343,7 @@ export function FieldBuilderManager() { onClick={handleOpenCreate} disabled={!selectedActionTypeId} leftIcon={} - className="!bg-[#1E7D5C] hover:!bg-[#17664B] !rounded-[12px] font-semibold text-[14px]" + className="!bg-[#1E7D5C] hover:!bg-[#17664B] !rounded-[10px] !gap-[10px] !h-[40px] font-semibold text-[14px]" > Add Field Definition @@ -387,7 +387,7 @@ export function FieldBuilderManager() { )} {/* Fields List Card */} -
+
Configured Fields for: diff --git a/src/app/actionBuilder/index.tsx b/src/app/actionBuilder/index.tsx index e7d784a..e1ac518 100644 --- a/src/app/actionBuilder/index.tsx +++ b/src/app/actionBuilder/index.tsx @@ -46,9 +46,9 @@ export default function ActionBuilderPage() { ]; return ( -
+
{/* Top Header */} -
+
@@ -76,7 +76,7 @@ export default function ActionBuilderPage() {
{/* Main Tabs Navigation */} -
+
+
{/* Top Header Component */} = { '/': { title: 'Dashboard', subtitle: 'Overview of system status and active incidents.' }, '/cohorts': { title: 'Cohort Management', subtitle: 'Dynamic passenger segmentation for targeted recovery and recovery intelligence.' }, + '/policy-engine': { title: 'Policy Engine Framework Registry', subtitle: 'Manage framework policies, conditions, and automated actions.' }, + '/policy-engine/add': { title: 'Deploy New Policy', subtitle: 'Configure policy framework details, targeting rules, and action payloads.' }, + '/action-builder': { title: 'Action Builder', subtitle: 'Configure dynamic categories, action types, metadata fields, and dynamic user form workflows.' }, + '/config': { title: 'Master Data Configurations', subtitle: 'Manage system rule categories, lookup values, and master data parameters.' }, '/recovery': { title: 'Recovery Incidents', subtitle: 'Operational workspace for managing passenger disruption cases.' }, };