mirror of
https://github.com/sartography/spiff-arena.git
synced 2025-02-22 14:18:27 +00:00
fix table
This commit is contained in:
parent
030b7c5659
commit
5f370a9724
@ -1,5 +1,5 @@
|
|||||||
import { ReactElement, useEffect, useState } from 'react';
|
import { ReactElement, useEffect, useState } from 'react';
|
||||||
import { Button, Table, Modal, Stack } from '@mui/material';
|
import { Button, Table, TableHead, TableBody, TableRow, TableCell, Modal, Stack } from '@mui/material';
|
||||||
import { Link, useSearchParams } from 'react-router-dom';
|
import { Link, useSearchParams } from 'react-router-dom';
|
||||||
import { TimeAgo } from '../helpers/timeago';
|
import { TimeAgo } from '../helpers/timeago';
|
||||||
import UserService from '../services/UserService';
|
import UserService from '../services/UserService';
|
||||||
@ -218,7 +218,7 @@ export default function TaskListTable({
|
|||||||
processInstanceTask.process_model_identifier,
|
processInstanceTask.process_model_identifier,
|
||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<td>
|
<TableCell>
|
||||||
<Link
|
<Link
|
||||||
data-qa="process-instance-show-link-id"
|
data-qa="process-instance-show-link-id"
|
||||||
to={`/newui/process-instances/for-me/${modifiedProcessModelIdentifier}/${processInstanceTask.process_instance_id}`}
|
to={`/newui/process-instances/for-me/${modifiedProcessModelIdentifier}/${processInstanceTask.process_instance_id}`}
|
||||||
@ -226,7 +226,7 @@ export default function TaskListTable({
|
|||||||
>
|
>
|
||||||
{processInstanceTask.process_instance_id}
|
{processInstanceTask.process_instance_id}
|
||||||
</Link>
|
</Link>
|
||||||
</td>
|
</TableCell>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -243,7 +243,7 @@ export default function TaskListTable({
|
|||||||
processInstanceTask.process_model_identifier,
|
processInstanceTask.process_model_identifier,
|
||||||
);
|
);
|
||||||
rowElements.push(
|
rowElements.push(
|
||||||
<td>
|
<TableCell>
|
||||||
<Link
|
<Link
|
||||||
data-qa="process-model-show-link"
|
data-qa="process-model-show-link"
|
||||||
to={`/newui/process-models/${modifiedProcessModelIdentifier}`}
|
to={`/newui/process-models/${modifiedProcessModelIdentifier}`}
|
||||||
@ -251,7 +251,7 @@ export default function TaskListTable({
|
|||||||
>
|
>
|
||||||
{processInstanceTask.process_model_display_name}
|
{processInstanceTask.process_model_display_name}
|
||||||
</Link>
|
</Link>
|
||||||
</td>,
|
</TableCell>,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -305,34 +305,34 @@ export default function TaskListTable({
|
|||||||
dealWithProcessCells(rowElements, processInstanceTask);
|
dealWithProcessCells(rowElements, processInstanceTask);
|
||||||
|
|
||||||
rowElements.push(
|
rowElements.push(
|
||||||
<td
|
<TableCell
|
||||||
title={`task id: ${processInstanceTask.name}, spiffworkflow task guid: ${processInstanceTask.id}`}
|
title={`task id: ${processInstanceTask.name}, spiffworkflow task guid: ${processInstanceTask.id}`}
|
||||||
>
|
>
|
||||||
{processInstanceTask.task_title
|
{processInstanceTask.task_title
|
||||||
? processInstanceTask.task_title
|
? processInstanceTask.task_title
|
||||||
: processInstanceTask.task_name}
|
: processInstanceTask.task_name}
|
||||||
</td>,
|
</TableCell>,
|
||||||
);
|
);
|
||||||
if (showStartedBy) {
|
if (showStartedBy) {
|
||||||
rowElements.push(
|
rowElements.push(
|
||||||
<td>{processInstanceTask.process_initiator_username}</td>,
|
<TableCell>{processInstanceTask.process_initiator_username}</TableCell>,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (showWaitingOn) {
|
if (showWaitingOn) {
|
||||||
rowElements.push(
|
rowElements.push(
|
||||||
<td>{getWaitingForTableCellComponent(processInstanceTask)}</td>,
|
<TableCell>{getWaitingForTableCellComponent(processInstanceTask)}</TableCell>,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (showCompletedBy) {
|
if (showCompletedBy) {
|
||||||
rowElements.push(<td>{processInstanceTask.completed_by_username}</td>);
|
rowElements.push(<TableCell>{processInstanceTask.completed_by_username}</TableCell>);
|
||||||
}
|
}
|
||||||
if (showDateStarted) {
|
if (showDateStarted) {
|
||||||
rowElements.push(
|
rowElements.push(
|
||||||
<td>
|
<TableCell>
|
||||||
{DateAndTimeService.convertSecondsToFormattedDateTime(
|
{DateAndTimeService.convertSecondsToFormattedDateTime(
|
||||||
processInstanceTask.created_at_in_seconds,
|
processInstanceTask.created_at_in_seconds,
|
||||||
) || '-'}
|
) || '-'}
|
||||||
</td>,
|
</TableCell>,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (showLastUpdated) {
|
if (showLastUpdated) {
|
||||||
@ -343,9 +343,9 @@ export default function TaskListTable({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (showActionsColumn) {
|
if (showActionsColumn) {
|
||||||
rowElements.push(<td>{getActionButtons(processInstanceTask)}</td>);
|
rowElements.push(<TableCell>{getActionButtons(processInstanceTask)}</TableCell>);
|
||||||
}
|
}
|
||||||
return <tr key={processInstanceTask.id}>{rowElements}</tr>;
|
return <TableRow key={processInstanceTask.id}>{rowElements}</TableRow>;
|
||||||
};
|
};
|
||||||
|
|
||||||
const getTableHeaders = () => {
|
const getTableHeaders = () => {
|
||||||
@ -388,14 +388,14 @@ export default function TaskListTable({
|
|||||||
});
|
});
|
||||||
return (
|
return (
|
||||||
<Table>
|
<Table>
|
||||||
<thead>
|
<TableHead>
|
||||||
<tr>
|
<TableRow>
|
||||||
{tableHeaders.map((tableHeader: string) => {
|
{tableHeaders.map((tableHeader: string) => {
|
||||||
return <th>{tableHeader}</th>;
|
return <TableCell>{tableHeader}</TableCell>;
|
||||||
})}
|
})}
|
||||||
</tr>
|
</TableRow>
|
||||||
</thead>
|
</TableHead>
|
||||||
<tbody>{rows}</tbody>
|
<TableBody>{rows}</TableBody>
|
||||||
</Table>
|
</Table>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user