minor permissions related fixes for the new ui.

This commit is contained in:
danfunk 2023-06-16 12:00:27 -04:00
parent d1a1e40f29
commit 284d12e32c
3 changed files with 15 additions and 5 deletions

View File

@ -14,6 +14,7 @@ export const useUriListForPermissions = () => {
processInstanceCreatePath: `/v1.0/process-instances/${params.process_model_id}`, processInstanceCreatePath: `/v1.0/process-instances/${params.process_model_id}`,
processInstanceErrorEventDetails: `/v1.0/event-error-details/${params.process_model_id}/${params.process_instance_id}`, processInstanceErrorEventDetails: `/v1.0/event-error-details/${params.process_model_id}/${params.process_instance_id}`,
processInstanceListPath: '/v1.0/process-instances', processInstanceListPath: '/v1.0/process-instances',
processInstanceListForMePath: `/v1.0/process-instances/for-me`,
processInstanceLogListPath: `/v1.0/logs/${params.process_model_id}/${params.process_instance_id}`, processInstanceLogListPath: `/v1.0/logs/${params.process_model_id}/${params.process_instance_id}`,
processInstanceReportListPath: '/v1.0/process-instances/reports', processInstanceReportListPath: '/v1.0/process-instances/reports',
processInstanceResetPath: `/v1.0/process-instance-reset/${params.process_model_id}/${params.process_instance_id}`, processInstanceResetPath: `/v1.0/process-instance-reset/${params.process_model_id}/${params.process_instance_id}`,

View File

@ -1041,6 +1041,13 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
targetUris.messageInstanceListPath targetUris.messageInstanceListPath
); );
const getMessageDisplay = () => {
if (canViewMsgs) {
return <MessageInstanceList processInstanceId={processInstance.id} />;
}
return null;
};
return ( return (
<Tabs> <Tabs>
<TabList aria-label="List of tabs"> <TabList aria-label="List of tabs">
@ -1077,9 +1084,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
processInstanceId={processInstance.id} processInstanceId={processInstance.id}
/> />
</TabPanel> </TabPanel>
<TabPanel> <TabPanel>{getMessageDisplay()}</TabPanel>
<MessageInstanceList processInstanceId={processInstance.id} />
</TabPanel>
</TabPanels> </TabPanels>
</Tabs> </Tabs>
); );

View File

@ -70,7 +70,7 @@ export default function ProcessModelShow() {
[targetUris.processModelShowPath]: ['PUT', 'DELETE'], [targetUris.processModelShowPath]: ['PUT', 'DELETE'],
[targetUris.processModelTestsPath]: ['POST'], [targetUris.processModelTestsPath]: ['POST'],
[targetUris.processModelPublishPath]: ['POST'], [targetUris.processModelPublishPath]: ['POST'],
[targetUris.processInstanceListPath]: ['GET'], [targetUris.processInstanceListForMePath]: ['POST'],
[targetUris.processInstanceCreatePath]: ['POST'], [targetUris.processInstanceCreatePath]: ['POST'],
[targetUris.processModelFileCreatePath]: ['POST', 'PUT', 'GET', 'DELETE'], [targetUris.processModelFileCreatePath]: ['POST', 'PUT', 'GET', 'DELETE'],
}; };
@ -696,7 +696,11 @@ export default function ProcessModelShow() {
</Can> </Can>
</Stack> </Stack>
{processModelFilesSection()} {processModelFilesSection()}
<Can I="GET" a={targetUris.processInstanceListPath} ability={ability}> <Can
I="POST"
a={targetUris.processInstanceListForMePath}
ability={ability}
>
<ProcessInstanceListTable <ProcessInstanceListTable
headerElement={<h2>My Process Instances</h2>} headerElement={<h2>My Process Instances</h2>}
filtersEnabled={false} filtersEnabled={false}