allow users to post to process instance list and truncate process model ids on the process instance list table page w/ burnettk

This commit is contained in:
jasquat 2023-05-01 16:30:08 -04:00
parent 1f72904425
commit 5eac97f94d
No known key found for this signature in database
4 changed files with 10 additions and 3 deletions

View File

@ -571,7 +571,7 @@ class AuthorizationService:
def set_basic_permissions(cls) -> list[PermissionToAssign]:
"""Set_basic_permissions."""
permissions_to_assign: list[PermissionToAssign] = []
permissions_to_assign.append(PermissionToAssign(permission="read", target_uri="/process-instances/for-me"))
permissions_to_assign.append(PermissionToAssign(permission="create", target_uri="/process-instances/for-me"))
permissions_to_assign.append(PermissionToAssign(permission="read", target_uri="/process-instances/report-metadata"))
permissions_to_assign.append(PermissionToAssign(permission="read", target_uri="/processes"))
permissions_to_assign.append(PermissionToAssign(permission="read", target_uri="/processes/callers"))

View File

@ -290,7 +290,7 @@ class TestAuthorizationService(BaseTest):
"""Test_explode_permissions_basic."""
expected_permissions = [
("/process-instances/find-by-id/*", "read"),
("/process-instances/for-me", "read"),
("/process-instances/for-me", "create"),
("/process-instances/report-metadata", "read"),
("/process-instances/reports/*", "create"),
("/process-instances/reports/*", "delete"),

View File

@ -1311,6 +1311,7 @@ export default function ProcessInstanceListTable({
}}
processModels={processModelAvailableItems}
selectedItem={processModelSelection}
truncateProcessModelDisplayName
/>
</Column>
<Column md={4}>

View File

@ -9,6 +9,7 @@ type OwnProps = {
processModels: ProcessModel[];
selectedItem?: ProcessModel | null;
titleText?: string;
truncateProcessModelDisplayName?: boolean;
};
export default function ProcessModelSearch({
@ -16,6 +17,7 @@ export default function ProcessModelSearch({
selectedItem,
onChange,
titleText = 'Process',
truncateProcessModelDisplayName = false,
}: OwnProps) {
const getParentGroupsDisplayName = (processModel: ProcessModel) => {
if (processModel.parent_groups) {
@ -29,7 +31,11 @@ export default function ProcessModelSearch({
};
const getProcessModelLabelForDisplay = (processModel: ProcessModel) => {
return `${processModel.display_name} (${processModel.id})`;
let processModelId = processModel.id;
if (truncateProcessModelDisplayName) {
processModelId = processModelId.split('/').slice(-2).join('/');
}
return `${processModel.display_name} (${processModelId})`;
};
const getProcessModelLabelForSearch = (processModel: ProcessModel) => {