= {
+// id: formatProcessInstanceId,
+// process_model_identifier: formatProcessModelIdentifier,
+// process_model_display_name: formatProcessModelDisplayName,
+// start_in_seconds: formatSecondsForDisplay,
+// end_in_seconds: formatSecondsForDisplay,
+// updated_at_in_seconds: formatSecondsForDisplay,
+// };
+// const formatter =
+// reportColumnFormatters[column.accessor] ?? defaultFormatter;
+// const value = row[column.accessor];
+// const modifiedModelId = modifyProcessIdentifierForPathParam(
+// row.process_model_identifier
+// );
+// const navigateToProcessInstance = () => {
+// navigate(`${processInstanceShowPathPrefix}/${modifiedModelId}/${row.id}`);
+// };
+// const navigateToProcessModel = () => {
+// navigate(`/admin/process-models/${modifiedModelId}`);
+// };
+//
+// if (column.accessor === 'status') {
+// return (
+// // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
+//
+// {formatter(row, value)}
+// |
+// );
+// }
+// if (column.accessor === 'process_model_display_name') {
+// const pmStyle = { background: 'rgba(0, 0, 0, .02)' };
+// return (
+// // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
+//
+// {formatter(row, value)}
+// |
+// );
+// }
+// if (column.accessor === 'waiting_for') {
+// return {getWaitingForTableCellComponent(row)} | ;
+// }
+// if (column.accessor === 'updated_at_in_seconds') {
+// return (
+//
+// );
+// }
+// return (
+// // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
+//
+// {formatter(row, value)}
+// |
+// );
+// };
+//
+// const buildTable = () => {
+// const headerLabels: Record = {
+// id: 'Id',
+// process_model_identifier: 'Process',
+// process_model_display_name: 'Process',
+// start_in_seconds: 'Start Time',
+// end_in_seconds: 'End Time',
+// status: 'Status',
+// process_initiator_username: 'Started By',
+// };
+// const getHeaderLabel = (header: string) => {
+// return headerLabels[header] ?? header;
+// };
+// const headers = reportColumns().map((column: any) => {
+// return getHeaderLabel((column as any).Header);
+// });
+// if (showActionsColumn) {
+// headers.push('Actions');
+// }
+//
+// const rows = processInstances.map((row: any) => {
+// const currentRow = reportColumns().map((column: any) => {
+// return formattedColumn(row, column);
+// });
+// if (showActionsColumn) {
+// let buttonElement = null;
+// if (row.task_id) {
+// const taskUrl = `/tasks/${row.id}/${row.task_id}`;
+// const regex = new RegExp(`\\b(${preferredUsername}|${userEmail})\\b`);
+// let hasAccessToCompleteTask = false;
+// if (
+// canCompleteAllTasks ||
+// (row.potential_owner_usernames || '').match(regex)
+// ) {
+// hasAccessToCompleteTask = true;
+// }
+// buttonElement = (
+//
+// );
+// }
+//
+// currentRow.push({buttonElement} | );
+// }
+//
+// const rowStyle = { cursor: 'pointer' };
+//
+// return (
+//
+// {currentRow}
+//
+// );
+// });
+//
+// return (
+//
+//
+//
+// {headers.map((header: any) => (
+//
+// {header}
+//
+// ))}
+//
+//
+// {rows}
+//
+// );
+// };
+//
+// const reportSearchComponent = () => {
+// if (showReports) {
+// const columns = [
+//
+//
+// ,
+// ];
+// return (
+//
+// {columns}
+//
+// );
+// }
+// return null;
+// };
+//
+// if (filtersEnabled) {
+// return (
+// <>
+//
+//
+// {reportSearchComponent()}
+//
+//
+//
+//
+//
+// {filterOptions()}
+// >
+// );
+// }
+// return null;
+// }
diff --git a/spiffworkflow-frontend/src/components/ProcessInstanceListTable.tsx b/spiffworkflow-frontend/src/components/ProcessInstanceListTable.tsx
index 227ae1bc5..55f06fa4a 100644
--- a/spiffworkflow-frontend/src/components/ProcessInstanceListTable.tsx
+++ b/spiffworkflow-frontend/src/components/ProcessInstanceListTable.tsx
@@ -2,7 +2,7 @@ import { useEffect, useMemo, useRef, useState } from 'react';
import { useNavigate, useParams, useSearchParams } from 'react-router-dom';
// @ts-ignore
-import { Filter, Close, AddAlt } from '@carbon/icons-react';
+import { Close, AddAlt } from '@carbon/icons-react';
import {
Button,
ButtonSet,
@@ -71,6 +71,7 @@ import { usePermissionFetcher } from '../hooks/PermissionService';
import { Can } from '../contexts/Can';
import TableCellWithTimeAgoInWords from './TableCellWithTimeAgoInWords';
import UserService from '../services/UserService';
+import Filters from './Filters';
type OwnProps = {
filtersEnabled?: boolean;
@@ -574,982 +575,6 @@ export default function ProcessInstanceListTable({
};
};
- const reportColumns = () => {
- return (reportMetadata as any).columns;
- };
-
- const reportFilterBy = () => {
- return (reportMetadata as any).filter_by;
- };
-
- const navigateToNewReport = (queryParamString: string) => {
- removeError();
- setProcessInstanceReportJustSaved(null);
- setProcessInstanceFilters({});
- navigate(`${processInstanceListPathPrefix}?${queryParamString}`);
- };
-
- const applyFilter = (event: any) => {
- event.preventDefault();
- setProcessInitiatorNotFoundErrorText('');
-
- const { page, perPage } = getPageInfoFromSearchParams(
- searchParams,
- undefined,
- undefined,
- paginationQueryParamPrefix
- );
- let queryParamString = `per_page=${perPage}&page=${page}&user_filter=true`;
- const {
- valid,
- startFromSeconds,
- startToSeconds,
- endFromSeconds,
- endToSeconds,
- } = calculateStartAndEndSeconds();
-
- if (!valid) {
- return;
- }
-
- if (startFromSeconds) {
- queryParamString += `&start_from=${startFromSeconds}`;
- }
- if (startToSeconds) {
- queryParamString += `&start_to=${startToSeconds}`;
- }
- if (endFromSeconds) {
- queryParamString += `&end_from=${endFromSeconds}`;
- }
- if (endToSeconds) {
- queryParamString += `&end_to=${endToSeconds}`;
- }
- if (processStatusSelection.length > 0) {
- queryParamString += `&process_status=${processStatusSelection}`;
- }
-
- if (processModelSelection) {
- queryParamString += `&process_model_identifier=${processModelSelection.id}`;
- }
-
- if (processInstanceReportSelection) {
- queryParamString += `&report_id=${processInstanceReportSelection.id}`;
- }
-
- const reportColumnsBase64 = encodeBase64(JSON.stringify(reportColumns()));
- queryParamString += `&report_columns=${reportColumnsBase64}`;
- const reportFilterByBase64 = encodeBase64(JSON.stringify(reportFilterBy()));
- queryParamString += `&report_filter_by=${reportFilterByBase64}`;
-
- if (processInitiatorSelection) {
- queryParamString += `&process_initiator_username=${processInitiatorSelection.username}`;
- navigateToNewReport(queryParamString);
- } else if (processInitiatorText) {
- HttpService.makeCallToBackend({
- path: targetUris.userExists,
- httpMethod: 'POST',
- postBody: { username: processInitiatorText },
- successCallback: (result: any) => {
- if (result.user_found) {
- queryParamString += `&process_initiator_username=${processInitiatorText}`;
- navigateToNewReport(queryParamString);
- } else {
- setProcessInitiatorNotFoundErrorText(
- `The provided username is invalid. Please type the exact username.`
- );
- }
- },
- });
- } else {
- navigateToNewReport(queryParamString);
- }
- };
-
- const dateComponent = (
- labelString: any,
- name: any,
- initialDate: any,
- initialTime: string,
- onChangeDateFunction: any,
- onChangeTimeFunction: any,
- timeInvalid: boolean,
- setTimeInvalid: any
- ) => {
- return (
- <>
-
- {
- if (!initialDate && !initialTime) {
- onChangeTimeFunction(
- convertDateObjectToFormattedHoursMinutes(new Date())
- );
- }
- onChangeDateFunction(dateChangeEvent.srcElement.value);
- }}
- value={initialDate}
- />
-
- {
- if (event.srcElement.validity.valid) {
- setTimeInvalid(false);
- } else {
- setTimeInvalid(true);
- }
- onChangeTimeFunction(event.srcElement.value);
- }}
- />
- >
- );
- };
-
- const processStatusSearch = () => {
- return (
- {
- setProcessStatusSelection(selection.selectedItems);
- setRequiresRefilter(true);
- }}
- itemToString={(item: any) => {
- return item || '';
- }}
- selectionFeedback="top-after-reopen"
- selectedItems={processStatusSelection}
- />
- );
- };
-
- const clearFilters = () => {
- setProcessModelSelection(null);
- setProcessStatusSelection([]);
- setStartFromDate('');
- setStartFromTime('');
- setStartToDate('');
- setStartToTime('');
- setEndFromDate('');
- setEndFromTime('');
- setEndToDate('');
- setEndToTime('');
- setProcessInitiatorSelection(null);
- setProcessInitiatorText('');
- setRequiresRefilter(true);
- if (reportMetadata) {
- reportMetadata.filter_by = [];
- }
- };
-
- const processInstanceReportDidChange = (selection: any, mode?: string) => {
- clearFilters();
- const selectedReport = selection.selectedItem;
- setProcessInstanceReportSelection(selectedReport);
-
- let queryParamString = '';
- if (selectedReport) {
- queryParamString = `?report_id=${selectedReport.id}`;
- }
-
- removeError();
- setProcessInstanceReportJustSaved(mode || null);
- navigate(`${processInstanceListPathPrefix}${queryParamString}`);
- };
-
- const reportColumnAccessors = () => {
- return reportColumns().map((reportColumn: ReportColumn) => {
- return reportColumn.accessor;
- });
- };
-
- // TODO onSuccess reload/select the new report in the report search
- const onSaveReportSuccess = (result: any, mode: string) => {
- processInstanceReportDidChange(
- {
- selectedItem: result,
- },
- mode
- );
- };
-
- const saveAsReportComponent = () => {
- const {
- valid,
- startFromSeconds,
- startToSeconds,
- endFromSeconds,
- endToSeconds,
- } = calculateStartAndEndSeconds(false);
-
- if (!valid || !reportMetadata) {
- return null;
- }
- return (
-
- );
- };
-
- const onDeleteReportSuccess = () => {
- processInstanceReportDidChange({ selectedItem: null });
- };
-
- const deleteReportComponent = () => {
- return processInstanceReportSelection ? (
-
- ) : null;
- };
-
- const removeColumn = (reportColumn: ReportColumn) => {
- if (reportMetadata) {
- const reportMetadataCopy = { ...reportMetadata };
- const newColumns = reportColumns().filter(
- (rc: ReportColumn) => rc.accessor !== reportColumn.accessor
- );
- Object.assign(reportMetadataCopy, { columns: newColumns });
- setReportMetadata(reportMetadataCopy);
- setRequiresRefilter(true);
- }
- };
-
- const handleColumnFormClose = () => {
- setShowReportColumnForm(false);
- setReportColumnFormMode('');
- setReportColumnToOperateOn(null);
- };
-
- const getFilterByFromReportMetadata = (reportColumnAccessor: string) => {
- if (reportMetadata) {
- return reportMetadata.filter_by.find((reportFilter: ReportFilter) => {
- return reportColumnAccessor === reportFilter.field_name;
- });
- }
- return null;
- };
-
- const getNewFiltersFromReportForEditing = (
- reportColumnForEditing: ReportColumnForEditing
- ) => {
- if (!reportMetadata) {
- return null;
- }
- const reportMetadataCopy = { ...reportMetadata };
- let newReportFilters = reportMetadataCopy.filter_by;
- if (reportColumnForEditing.filterable) {
- const newReportFilter: ReportFilter = {
- field_name: reportColumnForEditing.accessor,
- field_value: reportColumnForEditing.filter_field_value,
- operator: reportColumnForEditing.filter_operator || 'equals',
- };
- const existingReportFilter = getFilterByFromReportMetadata(
- reportColumnForEditing.accessor
- );
- if (existingReportFilter) {
- const existingReportFilterIndex =
- reportMetadataCopy.filter_by.indexOf(existingReportFilter);
- if (reportColumnForEditing.filter_field_value) {
- newReportFilters[existingReportFilterIndex] = newReportFilter;
- } else {
- newReportFilters.splice(existingReportFilterIndex, 1);
- }
- } else if (reportColumnForEditing.filter_field_value) {
- newReportFilters = newReportFilters.concat([newReportFilter]);
- }
- }
- return newReportFilters;
- };
-
- const handleUpdateReportColumn = () => {
- if (reportColumnToOperateOn && reportMetadata) {
- const reportMetadataCopy = { ...reportMetadata };
- let newReportColumns = null;
- if (reportColumnFormMode === 'new') {
- newReportColumns = reportColumns().concat([reportColumnToOperateOn]);
- } else {
- newReportColumns = reportColumns().map((rc: ReportColumn) => {
- if (rc.accessor === reportColumnToOperateOn.accessor) {
- return reportColumnToOperateOn;
- }
- return rc;
- });
- }
- Object.assign(reportMetadataCopy, {
- columns: newReportColumns,
- filter_by: getNewFiltersFromReportForEditing(reportColumnToOperateOn),
- });
- setReportMetadata(reportMetadataCopy);
- setReportColumnToOperateOn(null);
- setShowReportColumnForm(false);
- setRequiresRefilter(true);
- }
- };
-
- const reportColumnToReportColumnForEditing = (reportColumn: ReportColumn) => {
- const reportColumnForEditing: ReportColumnForEditing = Object.assign(
- reportColumn,
- { filter_field_value: '', filter_operator: '' }
- );
- const reportFilter = getFilterByFromReportMetadata(
- reportColumnForEditing.accessor
- );
- if (reportFilter) {
- reportColumnForEditing.filter_field_value = reportFilter.field_value;
- reportColumnForEditing.filter_operator =
- reportFilter.operator || 'equals';
- }
- return reportColumnForEditing;
- };
-
- const updateReportColumn = (event: any) => {
- let reportColumnForEditing = null;
- if (event.selectedItem) {
- reportColumnForEditing = reportColumnToReportColumnForEditing(
- event.selectedItem
- );
- }
- setReportColumnToOperateOn(reportColumnForEditing);
- setRequiresRefilter(true);
- };
-
- // options includes item and inputValue
- const shouldFilterReportColumn = (options: any) => {
- const reportColumn: ReportColumn = options.item;
- const { inputValue } = options;
- return (
- !reportColumnAccessors().includes(reportColumn.accessor) &&
- (reportColumn.accessor || '')
- .toLowerCase()
- .includes((inputValue || '').toLowerCase())
- );
- };
-
- const setReportColumnConditionValue = (event: any) => {
- if (reportColumnToOperateOn) {
- const reportColumnToOperateOnCopy = {
- ...reportColumnToOperateOn,
- };
- reportColumnToOperateOnCopy.filter_field_value = event.target.value;
- setReportColumnToOperateOn(reportColumnToOperateOnCopy);
- setRequiresRefilter(true);
- }
- };
-
- const reportColumnForm = () => {
- if (reportColumnFormMode === '') {
- return null;
- }
- const formElements = [];
- if (reportColumnFormMode === 'new') {
- formElements.push(
- {
- if (reportColumn) {
- return reportColumn.accessor;
- }
- return null;
- }}
- shouldFilterItem={shouldFilterReportColumn}
- placeholder="Choose a column to show"
- titleText="Column"
- selectedItem={reportColumnToOperateOn}
- />
- );
- }
- formElements.push([
- {
- if (reportColumnToOperateOn) {
- setRequiresRefilter(true);
- const reportColumnToOperateOnCopy = {
- ...reportColumnToOperateOn,
- };
- reportColumnToOperateOnCopy.Header = event.target.value;
- setReportColumnToOperateOn(reportColumnToOperateOnCopy);
- }
- }}
- />,
- ]);
- if (reportColumnToOperateOn && reportColumnToOperateOn.filterable) {
- formElements.push(
-
- );
- }
- formElements.push(
-
- );
- const modalHeading =
- reportColumnFormMode === 'new'
- ? 'Add Column'
- : `Edit ${
- reportColumnToOperateOn ? reportColumnToOperateOn.accessor : ''
- } column`;
- return (
-
- {formElements}
-
- );
- };
-
- const columnSelections = () => {
- if (reportColumns()) {
- const tags: any = [];
-
- (reportColumns() as any).forEach((reportColumn: ReportColumn) => {
- const reportColumnForEditing =
- reportColumnToReportColumnForEditing(reportColumn);
-
- let tagType = 'cool-gray';
- let tagTypeClass = '';
- if (reportColumnForEditing.filterable) {
- tagType = 'green';
- tagTypeClass = 'tag-type-green';
- }
- let reportColumnLabel = reportColumnForEditing.Header;
- if (reportColumnForEditing.filter_field_value) {
- reportColumnLabel = `${reportColumnLabel}=${reportColumnForEditing.filter_field_value}`;
- }
- tags.push(
-
-
-
- );
- });
- return (
-
- {tags}
-
- );
- }
- return null;
- };
-
- const filterOptions = () => {
- if (!showFilterOptions) {
- return null;
- }
-
- let queryParamString = '';
- if (processModelSelection) {
- queryParamString += `?process_model_identifier=${processModelSelection.id}`;
- }
- // get the columns anytime we display the filter options if they are empty.
- // and if the columns are not empty, check if the columns are stale
- // because we selected a different process model in the filter options.
- const columnFilterIsStale = lastColumnFilter !== queryParamString;
- if (availableReportColumns.length < 1 || columnFilterIsStale) {
- setLastColumnFilter(queryParamString);
- HttpService.makeCallToBackend({
- path: `/process-instances/reports/columns${queryParamString}`,
- successCallback: setAvailableReportColumns,
- });
- }
-
- return (
- <>
-
-
- Columns
-
- {columnSelections()}
-
-
-
-
- {
- setProcessModelSelection(selection.selectedItem);
- setRequiresRefilter(true);
- }}
- processModels={processModelAvailableItems}
- selectedItem={processModelSelection}
- />
-
-
-
- {(hasAccess: boolean) => {
- if (hasAccess) {
- return (
- {
- setProcessInitiatorSelection(event.selectedItem);
- setRequiresRefilter(true);
- }}
- id="process-instance-initiator-search"
- data-qa="process-instance-initiator-search"
- items={processInstanceInitiatorOptions}
- itemToString={(processInstanceInitatorOption: User) => {
- if (processInstanceInitatorOption) {
- return processInstanceInitatorOption.username;
- }
- return null;
- }}
- placeholder="Start typing username"
- titleText="Process Initiator"
- selectedItem={processInitiatorSelection}
- />
- );
- }
- return (
- {
- setProcessInitiatorText(event.target.value);
- setRequiresRefilter(true);
- }}
- />
- );
- }}
-
-
- {processStatusSearch()}
-
-
-
- {dateComponent(
- 'Start date from',
- 'start-from',
- startFromDate,
- startFromTime,
- (val: string) => {
- setStartFromDate(val);
- setRequiresRefilter(true);
- },
- (val: string) => {
- setStartFromTime(val);
- setRequiresRefilter(true);
- },
- startFromTimeInvalid,
- setStartFromTimeInvalid
- )}
-
-
- {dateComponent(
- 'Start date to',
- 'start-to',
- startToDate,
- startToTime,
- (val: string) => {
- setStartToDate(val);
- setRequiresRefilter(true);
- },
- (val: string) => {
- setStartToTime(val);
- setRequiresRefilter(true);
- },
- startToTimeInvalid,
- setStartToTimeInvalid
- )}
-
-
- {dateComponent(
- 'End date from',
- 'end-from',
- endFromDate,
- endFromTime,
- (val: string) => {
- setEndFromDate(val);
- setRequiresRefilter(true);
- },
- (val: string) => {
- setEndFromTime(val);
- setRequiresRefilter(true);
- },
- endFromTimeInvalid,
- setEndFromTimeInvalid
- )}
-
-
- {dateComponent(
- 'End date to',
- 'end-to',
- endToDate,
- endToTime,
- (val: string) => {
- setEndToDate(val);
- setRequiresRefilter(true);
- },
- (val: string) => {
- setEndToTime(val);
- setRequiresRefilter(true);
- },
- endToTimeInvalid,
- setEndToTimeInvalid
- )}
-
-
-
-
-
-
-
-
-
-
- {saveAsReportComponent()}
- {deleteReportComponent()}
-
-
- >
- );
- };
-
- const getWaitingForTableCellComponent = (processInstanceTask: any) => {
- let fullUsernameString = '';
- let shortUsernameString = '';
- if (processInstanceTask.potential_owner_usernames) {
- fullUsernameString = processInstanceTask.potential_owner_usernames;
- const usernames =
- processInstanceTask.potential_owner_usernames.split(',');
- const firstTwoUsernames = usernames.slice(0, 2);
- if (usernames.length > 2) {
- firstTwoUsernames.push('...');
- }
- shortUsernameString = firstTwoUsernames.join(',');
- }
- if (processInstanceTask.assigned_user_group_identifier) {
- fullUsernameString = processInstanceTask.assigned_user_group_identifier;
- shortUsernameString = processInstanceTask.assigned_user_group_identifier;
- }
- return {shortUsernameString};
- };
- const formatProcessInstanceId = (row: ProcessInstance, id: number) => {
- return {id};
- };
- const formatProcessModelIdentifier = (_row: any, identifier: any) => {
- return {identifier};
- };
- const formatProcessModelDisplayName = (_row: any, identifier: any) => {
- return {identifier};
- };
-
- const formatSecondsForDisplay = (_row: any, seconds: any) => {
- return convertSecondsToFormattedDateTime(seconds) || '-';
- };
- const defaultFormatter = (_row: any, value: any) => {
- return value;
- };
-
- const formattedColumn = (row: any, column: any) => {
- const reportColumnFormatters: Record = {
- id: formatProcessInstanceId,
- process_model_identifier: formatProcessModelIdentifier,
- process_model_display_name: formatProcessModelDisplayName,
- start_in_seconds: formatSecondsForDisplay,
- end_in_seconds: formatSecondsForDisplay,
- updated_at_in_seconds: formatSecondsForDisplay,
- };
- const formatter =
- reportColumnFormatters[column.accessor] ?? defaultFormatter;
- const value = row[column.accessor];
- const modifiedModelId = modifyProcessIdentifierForPathParam(
- row.process_model_identifier
- );
- const navigateToProcessInstance = () => {
- navigate(`${processInstanceShowPathPrefix}/${modifiedModelId}/${row.id}`);
- };
- const navigateToProcessModel = () => {
- navigate(`/admin/process-models/${modifiedModelId}`);
- };
-
- if (column.accessor === 'status') {
- return (
- // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
-
- {formatter(row, value)}
- |
- );
- }
- if (column.accessor === 'process_model_display_name') {
- const pmStyle = { background: 'rgba(0, 0, 0, .02)' };
- return (
- // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
-
- {formatter(row, value)}
- |
- );
- }
- if (column.accessor === 'waiting_for') {
- return {getWaitingForTableCellComponent(row)} | ;
- }
- if (column.accessor === 'updated_at_in_seconds') {
- return (
-
- );
- }
- return (
- // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
-
- {formatter(row, value)}
- |
- );
- };
-
- const buildTable = () => {
- const headerLabels: Record = {
- id: 'Id',
- process_model_identifier: 'Process',
- process_model_display_name: 'Process',
- start_in_seconds: 'Start Time',
- end_in_seconds: 'End Time',
- status: 'Status',
- process_initiator_username: 'Started By',
- };
- const getHeaderLabel = (header: string) => {
- return headerLabels[header] ?? header;
- };
- const headers = reportColumns().map((column: any) => {
- return getHeaderLabel((column as any).Header);
- });
- if (showActionsColumn) {
- headers.push('Actions');
- }
-
- const rows = processInstances.map((row: any) => {
- const currentRow = reportColumns().map((column: any) => {
- return formattedColumn(row, column);
- });
- if (showActionsColumn) {
- let buttonElement = null;
- if (row.task_id) {
- const taskUrl = `/tasks/${row.id}/${row.task_id}`;
- const regex = new RegExp(`\\b(${preferredUsername}|${userEmail})\\b`);
- let hasAccessToCompleteTask = false;
- if (
- canCompleteAllTasks ||
- (row.potential_owner_usernames || '').match(regex)
- ) {
- hasAccessToCompleteTask = true;
- }
- buttonElement = (
-
- );
- }
-
- currentRow.push({buttonElement} | );
- }
-
- const rowStyle = { cursor: 'pointer' };
-
- return (
-
- {currentRow}
-
- );
- });
-
- return (
-
-
-
- {headers.map((header: any) => (
-
- {header}
-
- ))}
-
-
- {rows}
-
- );
- };
-
- const toggleShowFilterOptions = () => {
- setShowFilterOptions(!showFilterOptions);
- };
-
- const reportSearchComponent = () => {
- if (showReports) {
- const columns = [
-
-
- ,
- ];
- return (
-
- {columns}
-
- );
- }
- return null;
- };
-
- const filterComponent = () => {
- if (!filtersEnabled) {
- return null;
- }
- return (
- <>
-
-
- {reportSearchComponent()}
-
-
-
-
-
- {filterOptions()}
- >
- );
- };
-
if (pagination && (!textToShowIfEmpty || pagination.total > 0)) {
// eslint-disable-next-line prefer-const
let { page, perPage } = getPageInfoFromSearchParams(
@@ -1589,7 +614,13 @@ export default function ProcessInstanceListTable({
<>
{reportColumnForm()}
{processInstanceReportSaveTag()}
- {filterComponent()}
+
{resultsTable}
>
);