Merge remote-tracking branch 'origin/main' into feature/bpmn_user_permissions

This commit is contained in:
jasquat 2022-12-20 17:00:58 -05:00
commit 00ba65d12a
4 changed files with 17 additions and 16 deletions

View File

@ -601,7 +601,7 @@ paths:
description: Specifies the identifier of a report to use, if any description: Specifies the identifier of a report to use, if any
schema: schema:
type: integer type: integer
- name: group_identifier - name: user_group_identifier
in: query in: query
required: false required: false
description: The identifier of the group to get the process instances for description: The identifier of the group to get the process instances for
@ -714,7 +714,7 @@ paths:
description: Specifies the identifier of a report to use, if any description: Specifies the identifier of a report to use, if any
schema: schema:
type: integer type: integer
- name: group_identifier - name: user_group_identifier
in: query in: query
required: false required: false
description: The identifier of the group to get the process instances for description: The identifier of the group to get the process instances for
@ -1328,7 +1328,7 @@ paths:
/tasks/for-my-groups: /tasks/for-my-groups:
parameters: parameters:
- name: group_identifier - name: user_group_identifier
in: query in: query
required: false required: false
description: The identifier of the group to get the tasks for description: The identifier of the group to get the tasks for

View File

@ -380,7 +380,11 @@ class ProcessInstanceReportService:
ProcessInstanceModel.status.in_(ProcessInstanceModel.terminal_statuses()) # type: ignore ProcessInstanceModel.status.in_(ProcessInstanceModel.terminal_statuses()) # type: ignore
) )
if report_filter.with_relation_to_me is True: if (
not report_filter.with_tasks_completed_by_me
and not report_filter.with_tasks_assigned_to_my_group
and report_filter.with_relation_to_me is True
):
process_instance_query = process_instance_query.outerjoin( process_instance_query = process_instance_query.outerjoin(
HumanTaskModel HumanTaskModel
).outerjoin( ).outerjoin(
@ -410,17 +414,14 @@ class ProcessInstanceReportService:
) )
if report_filter.with_tasks_assigned_to_my_group is True: if report_filter.with_tasks_assigned_to_my_group is True:
group_model_join_conditions = [GroupModel.id == HumanTaskModel.lane_assignment_id]
if report_filter.user_group_identifier: if report_filter.user_group_identifier:
process_instance_query = process_instance_query.join( group_model_join_conditions.append(GroupModel.identifier == report_filter.user_group_identifier)
GroupModel, process_instance_query = process_instance_query.join(HumanTaskModel)
GroupModel.identifier == report_filter.user_group_identifier, process_instance_query = process_instance_query.join(
) GroupModel,
else: and_(*group_model_join_conditions)
process_instance_query = process_instance_query.join(HumanTaskModel) )
process_instance_query = process_instance_query.join(
GroupModel,
GroupModel.id == HumanTaskModel.lane_assignment_id,
)
process_instance_query = process_instance_query.join( process_instance_query = process_instance_query.join(
UserGroupAssignmentModel, UserGroupAssignmentModel,
UserGroupAssignmentModel.group_id == GroupModel.id, UserGroupAssignmentModel.group_id == GroupModel.id,

View File

@ -21,7 +21,7 @@ export default function TasksWaitingForMyGroups() {
return ( return (
<TaskListTable <TaskListTable
apiPath="/tasks/for-my-groups" apiPath="/tasks/for-my-groups"
additionalParams={`group_identifier=${userGroup}`} additionalParams={`user_group_identifier=${userGroup}`}
paginationQueryParamPrefix={`group-tasks-${userGroup}`} paginationQueryParamPrefix={`group-tasks-${userGroup}`}
tableTitle={`Tasks waiting for group: ${userGroup}`} tableTitle={`Tasks waiting for group: ${userGroup}`}
tableDescription={`This is a list of tasks for the ${userGroup} group. They can be completed by any member of the group.`} tableDescription={`This is a list of tasks for the ${userGroup} group. They can be completed by any member of the group.`}

View File

@ -33,7 +33,7 @@ export default function CompletedInstances() {
reportIdentifier="system_report_completed_instances_with_tasks_completed_by_my_groups" reportIdentifier="system_report_completed_instances_with_tasks_completed_by_my_groups"
showReports={false} showReports={false}
textToShowIfEmpty="This group has no completed instances at this time." textToShowIfEmpty="This group has no completed instances at this time."
additionalParams={`group_identifier=${userGroup}`} additionalParams={`user_group_identifier=${userGroup}`}
/> />
</> </>
); );