shortcut to view diagram from instance show
This commit is contained in:
parent
802d80883c
commit
871bac4e77
|
@ -64,6 +64,7 @@ import {
|
|||
PermissionsToCheck,
|
||||
ProcessData,
|
||||
ProcessInstance,
|
||||
ProcessModel,
|
||||
Task,
|
||||
TaskDefinitionPropertiesJson,
|
||||
User,
|
||||
|
@ -157,6 +158,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
|
|||
[targetUris.processInstanceSendEventPath]: ['POST'],
|
||||
[targetUris.processInstanceCompleteTaskPath]: ['POST'],
|
||||
[targetUris.processModelShowPath]: ['PUT'],
|
||||
[targetUris.processModelFileCreatePath]: ['GET'],
|
||||
[taskListPath]: ['GET'],
|
||||
};
|
||||
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 = {
|
||||
'f,r,enter': {
|
||||
function: forceRunProcessInstance,
|
||||
label: 'Force run process instance',
|
||||
},
|
||||
'd,enter': {
|
||||
function: shortcutLoadPrimaryFile,
|
||||
label: 'View diagram',
|
||||
},
|
||||
};
|
||||
const keyboardShortcutArea = useKeyboardShortcut(keyboardShortcuts);
|
||||
|
||||
|
|
Loading…
Reference in New Issue