16672: Rearranges code related to getting current process' UUID.
[arvados-workbench2.git] / src / store / process-panel / process-panel.ts
index 935cfa58b4bf6929a1ed6c3e27428fd4b258a79d..49c2691d9d4c21c3fdd2ee48eea60a74f2db31c6 100644 (file)
@@ -2,7 +2,16 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
+import { RouterState } from "react-router-redux";
+import { matchProcessRoute } from "routes/routes";
+
 export interface ProcessPanel {
     containerRequestUuid: string;
     filters: { [status: string]: boolean };
 }
+
+export const getProcessPanelCurrentUuid = (router: RouterState) => {
+    const pathname = router.location ? router.location.pathname : '';
+    const match = matchProcessRoute(pathname);
+    return match ? match.params.id : undefined;
+};
\ No newline at end of file