+export const loadNodeJson =
+ (containerRequest: ContainerRequestResource) => async (dispatch: Dispatch<any>, getState: () => RootState, services: ServiceRepository) => {
+ const noLog = { nodeInfo: null };
+ if (!containerRequest.logUuid) {
+ dispatch<ProcessPanelAction>(processPanelActions.SET_NODE_INFO(noLog));
+ return;
+ }
+ try {
+ const filesPromise = services.collectionService.files(containerRequest.logUuid);
+ const collectionPromise = services.collectionService.get(containerRequest.logUuid);
+ const [files] = await Promise.all([filesPromise, collectionPromise]);
+
+ // Fetch node.json from keep
+ const nodeFile = files.find(file => file.name === "node.json") as CollectionFile | undefined;
+ let nodeData = nodeFile ? await services.collectionService.getFileContents(nodeFile) : undefined;
+ if (nodeData && (nodeData = JSON.parse(nodeData))) {
+ dispatch<ProcessPanelAction>(
+ processPanelActions.SET_NODE_INFO({
+ nodeInfo: nodeData as NodeInstanceType,
+ })
+ );
+ } else {
+ dispatch<ProcessPanelAction>(processPanelActions.SET_NODE_INFO(noLog));
+ }
+ } catch {
+ dispatch<ProcessPanelAction>(processPanelActions.SET_NODE_INFO(noLog));
+ }
+ };
+
+export const loadOutputDefinitions =
+ (containerRequest: ContainerRequestResource) => async (dispatch: Dispatch<any>, getState: () => RootState, services: ServiceRepository) => {
+ if (containerRequest && containerRequest.mounts) {
+ dispatch<ProcessPanelAction>(processPanelActions.SET_OUTPUT_DEFINITIONS(getOutputParameters(containerRequest)));
+ }
+ };
+
+export const updateOutputParams = () => async (dispatch: Dispatch<any>, getState: () => RootState, services: ServiceRepository) => {
+ const outputDefinitions = getState().processPanel.outputDefinitions;
+ const outputRaw = getState().processPanel.outputRaw;
+
+ if (outputRaw && outputRaw.rawOutputs) {
+ dispatch<ProcessPanelAction>(
+ processPanelActions.SET_OUTPUT_PARAMS(formatOutputData(outputDefinitions, outputRaw.rawOutputs, outputRaw.pdh, getState().auth))
+ );
+ }
+};
+
+export const openWorkflow = (uuid: string) => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+ dispatch<any>(navigateToWorkflows);
+ dispatch<any>(showWorkflowDetails(uuid));
+};
+
+export const initProcessPanelFilters = processPanelActions.SET_PROCESS_PANEL_FILTERS([