From a9449cf7ec3dfe7a77bcf516f624f6d8302a1461 Mon Sep 17 00:00:00 2001 From: burnettk Date: Fri, 4 Nov 2022 17:21:25 -0400 Subject: [PATCH] unhardcode --- .../src/routes/ProcessInstanceList.tsx | 183 +++++------------- 1 file changed, 47 insertions(+), 136 deletions(-) diff --git a/spiffworkflow-frontend/src/routes/ProcessInstanceList.tsx b/spiffworkflow-frontend/src/routes/ProcessInstanceList.tsx index 84ce676f..39794f9f 100644 --- a/spiffworkflow-frontend/src/routes/ProcessInstanceList.tsx +++ b/spiffworkflow-frontend/src/routes/ProcessInstanceList.tsx @@ -378,144 +378,55 @@ export default function ProcessInstanceList() { }; const buildTable = () => { - // const rows = processInstances.map((row: any) => { - // const formattedStartDate = - // convertSecondsToFormattedDate(row.start_in_seconds) || '-'; - // const formattedEndDate = - // convertSecondsToFormattedDate(row.end_in_seconds) || '-'; - // - // return ( - // - // - // - // {row.id} - // - // - // - // - // {row.process_group_identifier} - // - // - // - // - // {row.process_model_identifier} - // - // - // {formattedStartDate} - // {formattedEndDate} - // - // {row.status} - // - // - // ); - // }); - // return ( - // - // - // - // - // - // - // - // - // - // - // - // {rows} - //
Process Instance IdProcess GroupProcess ModelStart TimeEnd TimeStatus
- // ); - const rows = [ - { - id: 'load-balancer-1', - name: 'Load Balancer 1', - rule: 'Round robin', - Status: 'Starting', - other: 'Test', - example: '22', - }, - { - id: 'load-balancer-2', - name: 'Load Balancer 2', - rule: 'DNS delegation', - status: 'Active', - other: 'Test', - example: '22', - }, - { - id: 'load-balancer-3', - name: 'Load Balancer 3', - rule: 'Round robin', - status: 'Disabled', - other: 'Test', - example: '22', - }, - { - id: 'load-balancer-4', - name: 'Load Balancer 4', - rule: 'Round robin', - status: 'Disabled', - other: 'Test', - example: '22', - }, - { - id: 'load-balancer-5', - name: 'Load Balancer 5', - rule: 'Round robin', - status: 'Disabled', - other: 'Test', - example: '22', - }, - { - id: 'load-balancer-6', - name: 'Load Balancer 6', - rule: 'Round robin', - status: 'Disabled', - other: 'Test', - example: '22', - }, - { - id: 'load-balancer-7', - name: 'Load Balancer 7', - rule: 'Round robin', - status: 'Disabled', - other: 'Test', - example: '22', - }, - ]; - const headers = ['Name', 'Rule', 'Status', 'Other', 'Example']; + const rows = processInstances.map((row: any) => { + const formattedStartDate = + convertSecondsToFormattedDate(row.start_in_seconds) || '-'; + const formattedEndDate = + convertSecondsToFormattedDate(row.end_in_seconds) || '-'; + return ( + + + + {row.id} + + + + + {row.process_group_identifier} + + + + + {row.process_model_identifier} + + + {formattedStartDate} + {formattedEndDate} + + {row.status} + + + ); + }); return ( - - - - {headers.map((header) => ( - - {header} - - ))} - - - - {rows.map((row) => ( - - {Object.keys(row) - .filter((key) => key !== 'id') - .map((key) => { - return {(row as any)[key]}; - })} - - ))} - +
+ + + + + + + + + + + {rows}
Process Instance IdProcess GroupProcess ModelStart TimeEnd TimeStatus
); };