shortcut to view diagram from instance show
This commit is contained in:
parent
802d80883c
commit
871bac4e77
|
@ -64,6 +64,7 @@ import {
|
||||||
PermissionsToCheck,
|
PermissionsToCheck,
|
||||||
ProcessData,
|
ProcessData,
|
||||||
ProcessInstance,
|
ProcessInstance,
|
||||||
|
ProcessModel,
|
||||||
Task,
|
Task,
|
||||||
TaskDefinitionPropertiesJson,
|
TaskDefinitionPropertiesJson,
|
||||||
User,
|
User,
|
||||||
|
@ -157,6 +158,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
|
||||||
[targetUris.processInstanceSendEventPath]: ['POST'],
|
[targetUris.processInstanceSendEventPath]: ['POST'],
|
||||||
[targetUris.processInstanceCompleteTaskPath]: ['POST'],
|
[targetUris.processInstanceCompleteTaskPath]: ['POST'],
|
||||||
[targetUris.processModelShowPath]: ['PUT'],
|
[targetUris.processModelShowPath]: ['PUT'],
|
||||||
|
[targetUris.processModelFileCreatePath]: ['GET'],
|
||||||
[taskListPath]: ['GET'],
|
[taskListPath]: ['GET'],
|
||||||
};
|
};
|
||||||
const { ability, permissionsLoaded } = usePermissionFetcher(
|
const { ability, permissionsLoaded } = usePermissionFetcher(
|
||||||
|
@ -195,11 +197,30 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const shortcutLoadPrimaryFile = () => {
|
||||||
|
if (ability.can('GET', targetUris.processInstanceActionPath)) {
|
||||||
|
const processResult = (result: ProcessModel) => {
|
||||||
|
const primaryFileName = result.primary_file_name;
|
||||||
|
navigate(
|
||||||
|
`/editor/process-models/${modifiedProcessModelId}/files/${primaryFileName}`
|
||||||
|
);
|
||||||
|
};
|
||||||
|
HttpService.makeCallToBackend({
|
||||||
|
path: `/process-models/${modifiedProcessModelId}?include_file_references=true`,
|
||||||
|
successCallback: processResult,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const keyboardShortcuts: KeyboardShortcuts = {
|
const keyboardShortcuts: KeyboardShortcuts = {
|
||||||
'f,r,enter': {
|
'f,r,enter': {
|
||||||
function: forceRunProcessInstance,
|
function: forceRunProcessInstance,
|
||||||
label: 'Force run process instance',
|
label: 'Force run process instance',
|
||||||
},
|
},
|
||||||
|
'd,enter': {
|
||||||
|
function: shortcutLoadPrimaryFile,
|
||||||
|
label: 'View diagram',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
const keyboardShortcutArea = useKeyboardShortcut(keyboardShortcuts);
|
const keyboardShortcutArea = useKeyboardShortcut(keyboardShortcuts);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue