diff --git a/spiffworkflow-frontend/src/components/ProcessInstanceListTable.tsx b/spiffworkflow-frontend/src/components/ProcessInstanceListTable.tsx index 548418b1..250eb6a0 100644 --- a/spiffworkflow-frontend/src/components/ProcessInstanceListTable.tsx +++ b/spiffworkflow-frontend/src/components/ProcessInstanceListTable.tsx @@ -139,10 +139,11 @@ export default function ProcessInstanceListTable({ >([]); const [processInstanceReportJustSaved, setProcessInstanceReportJustSaved] = useState(false); - const [showColumnForm, setShowColumnForm] = useState(false); + const [showReportColumnForm, setShowReportColumnForm] = + useState(false); const [reportColumnToOperateOn, setReportColumnToOperateOn] = useState(null); - const [columnFormMode, setColumnFormMode] = useState(''); + const [reportColumnFormMode, setReportColumnFormMode] = useState(''); const dateParametersToAlwaysFilterBy: dateParameters = useMemo(() => { return { @@ -664,8 +665,8 @@ export default function ProcessInstanceListTable({ }; const handleColumnFormClose = () => { - setShowColumnForm(false); - setColumnFormMode(''); + setShowReportColumnForm(false); + setReportColumnFormMode(''); setReportColumnToOperateOn(null); }; @@ -673,7 +674,7 @@ export default function ProcessInstanceListTable({ if (reportColumnToOperateOn) { const reportMetadataCopy = { ...reportMetadata }; let newReportColumns = null; - if (columnFormMode === 'new') { + if (reportColumnFormMode === 'new') { newReportColumns = reportColumns().concat([reportColumnToOperateOn]); } else { newReportColumns = reportColumns().map((rc: ReportColumn) => { @@ -688,8 +689,8 @@ export default function ProcessInstanceListTable({ }); setReportMetadata(reportMetadataCopy); setReportColumnToOperateOn(null); - setShowColumnForm(false); - setShowColumnForm(false); + setShowReportColumnForm(false); + setShowReportColumnForm(false); } }; @@ -709,8 +710,8 @@ export default function ProcessInstanceListTable({ ); }; - const columnForm = () => { - if (columnFormMode === '') { + const reportColumnForm = () => { + if (reportColumnFormMode === '') { return null; } const formElements = [ @@ -731,7 +732,7 @@ export default function ProcessInstanceListTable({ }} />, ]; - if (columnFormMode === 'new') { + if (reportColumnFormMode === 'new') { formElements.push( { setReportColumnToOperateOn(reportColumn); - setShowColumnForm(true); - setColumnFormMode('edit'); + setShowReportColumnForm(true); + setReportColumnFormMode('edit'); }} > {reportColumn.Header} @@ -822,8 +823,8 @@ export default function ProcessInstanceListTable({ hasIconOnly size="sm" onClick={() => { - setShowColumnForm(true); - setColumnFormMode('new'); + setShowReportColumnForm(true); + setReportColumnFormMode('new'); }} /> @@ -985,7 +986,7 @@ export default function ProcessInstanceListTable({ return value; }; - const columnFormatters: Record = { + const reportColumnFormatters: Record = { id: formatProcessInstanceId, process_model_identifier: formatProcessModelIdentifier, process_model_display_name: FormatProcessModelDisplayName, @@ -993,7 +994,8 @@ export default function ProcessInstanceListTable({ end_in_seconds: formatSecondsForDisplay, }; const formattedColumn = (row: any, column: any) => { - const formatter = columnFormatters[column.accessor] ?? defaultFormatter; + const formatter = + reportColumnFormatters[column.accessor] ?? defaultFormatter; const value = row[column.accessor]; if (column.accessor === 'status') { return ( @@ -1093,7 +1095,7 @@ export default function ProcessInstanceListTable({ } return ( <> - {columnForm()} + {reportColumnForm()} {processInstanceReportSaveTag()} {filterComponent()} {reportSearchComponent()}