mirror of
https://github.com/status-im/spiff-arena.git
synced 2025-01-13 19:55:24 +00:00
load what can be loaded on the pi show page while task-info loads w/ burnettk (#1600)
Co-authored-by: jasquat <jasquat@users.noreply.github.com>
This commit is contained in:
parent
2b332ce110
commit
b92cebc9ff
@ -138,7 +138,11 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
|
||||
const unModifiedProcessModelId = unModifyProcessIdentifierForPathParam(
|
||||
`${params.process_model_id}`
|
||||
);
|
||||
|
||||
const modifiedProcessModelId = params.process_model_id;
|
||||
const processModelId = unModifyProcessIdentifierForPathParam(
|
||||
params.process_model_id ? params.process_model_id : ''
|
||||
);
|
||||
|
||||
const { targetUris } = useUriListForPermissions();
|
||||
const taskListPath =
|
||||
@ -1655,10 +1659,13 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
|
||||
);
|
||||
};
|
||||
|
||||
const diagramArea = (processModelId: string) => {
|
||||
const diagramArea = () => {
|
||||
if (!processInstance) {
|
||||
return null;
|
||||
}
|
||||
if (!tasks && !tasksCallHadError) {
|
||||
return <Loading className="some-class" withOverlay={false} small />;
|
||||
}
|
||||
|
||||
const detailsComponent = (
|
||||
<>
|
||||
@ -1762,21 +1769,17 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
|
||||
);
|
||||
};
|
||||
|
||||
if (processInstance && (tasks || tasksCallHadError) && permissionsLoaded) {
|
||||
const processModelId = unModifyProcessIdentifierForPathParam(
|
||||
params.process_model_id ? params.process_model_id : ''
|
||||
);
|
||||
|
||||
// eslint-disable-next-line sonarjs/cognitive-complexity
|
||||
const getTabs = () => {
|
||||
if (!processInstance) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const canViewLogs = ability.can(
|
||||
'GET',
|
||||
targetUris.processInstanceLogListPath
|
||||
);
|
||||
const canViewMsgs = ability.can(
|
||||
'GET',
|
||||
targetUris.messageInstanceListPath
|
||||
);
|
||||
const canViewMsgs = ability.can('GET', targetUris.messageInstanceListPath);
|
||||
|
||||
const getMessageDisplay = () => {
|
||||
if (canViewMsgs) {
|
||||
@ -1797,7 +1800,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
|
||||
<TabPanels>
|
||||
<TabPanel>
|
||||
{selectedTabIndex === 0 ? (
|
||||
<TabPanel>{diagramArea(processModelId)}</TabPanel>
|
||||
<TabPanel>{diagramArea()}</TabPanel>
|
||||
) : null}
|
||||
</TabPanel>
|
||||
<TabPanel>
|
||||
@ -1831,6 +1834,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
|
||||
);
|
||||
};
|
||||
|
||||
if (processInstance && permissionsLoaded) {
|
||||
return (
|
||||
<>
|
||||
<ProcessBreadcrumb
|
||||
@ -1879,5 +1883,5 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
|
||||
</>
|
||||
);
|
||||
}
|
||||
return null;
|
||||
return <Loading />;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user