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:
parent
1f72904425
commit
5eac97f94d
|
@ -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"))
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -1311,6 +1311,7 @@ export default function ProcessInstanceListTable({
|
|||
}}
|
||||
processModels={processModelAvailableItems}
|
||||
selectedItem={processModelSelection}
|
||||
truncateProcessModelDisplayName
|
||||
/>
|
||||
</Column>
|
||||
<Column md={4}>
|
||||
|
|
|
@ -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) => {
|
||||
|
|
Loading…
Reference in New Issue