This commit is contained in:
Madhurya Liyanage 2023-04-18 19:59:39 +05:30
commit fbb3b7296b
3 changed files with 26 additions and 3 deletions

View File

@ -617,6 +617,10 @@ class ProcessInstanceReportService:
HumanTaskUserModel,
and_(HumanTaskUserModel.human_task_id == HumanTaskModel.id, HumanTaskUserModel.user_id == user.id),
)
if report_filter.has_active_status:
process_instance_query = process_instance_query.filter(
HumanTaskModel.completed.is_(False) # type: ignore
)
if report_filter.with_tasks_assigned_to_my_group is True:
group_model_join_conditions = [GroupModel.id == HumanTaskModel.lane_assignment_id]

View File

@ -1396,12 +1396,22 @@ export default function ProcessInstanceListTable({
);
}
if (column.accessor === 'waiting_for') {
return <td>{getWaitingForTableCellComponent(row)}</td>;
return (
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
<td
onClick={navigateToProcessInstance}
onKeyDown={navigateToProcessInstance}
>
{getWaitingForTableCellComponent(row)}
</td>
);
}
if (column.accessor === 'updated_at_in_seconds') {
return (
<TableCellWithTimeAgoInWords
timeInSeconds={row.updated_at_in_seconds}
onClick={navigateToProcessInstance}
onKeyDown={navigateToProcessInstance}
/>
);
}
@ -1409,7 +1419,7 @@ export default function ProcessInstanceListTable({
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
<td
data-qa={`process-instance-show-link-${column.accessor}`}
onKeyDown={navigateToProcessModel}
onKeyDown={navigateToProcessInstance}
onClick={navigateToProcessInstance}
>
{formatter(row, value)}

View File

@ -4,13 +4,22 @@ import { convertSecondsToFormattedDateTime } from '../helpers';
type OwnProps = {
timeInSeconds: number;
onClick?: any;
onKeyDown?: any;
};
export default function TableCellWithTimeAgoInWords({
timeInSeconds,
onClick = null,
onKeyDown = null,
}: OwnProps) {
return (
<td title={convertSecondsToFormattedDateTime(timeInSeconds) || '-'}>
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
<td
title={convertSecondsToFormattedDateTime(timeInSeconds) || '-'}
onClick={onClick}
onKeyDown={onKeyDown}
>
{timeInSeconds ? TimeAgo.inWords(timeInSeconds) : '-'}
</td>
);