+
{
status[index]
?
Pass
diff --git a/ui/src/libs/useQuery.js b/ui/src/libs/useQuery.js
new file mode 100644
index 0000000..905eb24
--- /dev/null
+++ b/ui/src/libs/useQuery.js
@@ -0,0 +1,3 @@
+export default function useQuery() {
+ return new URLSearchParams(useLocation().search);
+}
diff --git a/ui/src/pages/DetailPage.jsx b/ui/src/pages/DetailPage.jsx
index 2c8ea48..c903398 100644
--- a/ui/src/pages/DetailPage.jsx
+++ b/ui/src/pages/DetailPage.jsx
@@ -2,15 +2,22 @@ import React, { useEffect, useState } from 'react';
import {
Container, Grid, Paper,
} from '@material-ui/core';
-import { useParams } from 'react-router-dom';
+import { useLocation } from 'react-router-dom';
import { getFlow, getFlowTest } from '../utils/flowtests/flowDetails';
import TestStatus from '../components/TestStatus';
+function useQuery() {
+ return new URLSearchParams(useLocation().search);
+}
+
export default function DetailView() {
- const { namespace, name } = useParams();
+ const query = useQuery();
const [flowTest, setFlowTest] = useState(undefined);
const [flow, setFlow] = useState(undefined);
+ const name = query.get('name');
+ const namespace = query.get('namespace');
+
useEffect(async () => {
if (flowTest?.spec?.referenceFlow) {
setFlow(await getFlow(
@@ -38,19 +45,19 @@ export default function DetailView() {
Reference Flow
-
{`Kind: ${flowTest?.spec.referenceFlow.kind}`}
-
{`Namespace: ${flowTest?.spec.referenceFlow.namespace}`}
-
{`Name: ${flowTest?.spec.referenceFlow.name}`}
+
{`Kind: ${flowTest?.spec?.referenceFlow?.kind}`}
+
{`Namespace: ${flowTest?.spec?.referenceFlow?.namespace}`}
+
{`Name: ${flowTest?.spec?.referenceFlow?.name}`}
Reference Pod
-
{`Namespace: ${flowTest?.spec.referencePod.namespace}`}
-
{`Name: ${flowTest?.spec.referencePod.name}`}
+
{`Namespace: ${flowTest?.spec?.referencePod?.namespace}`}
+
{`Name: ${flowTest?.spec?.referencePod?.name}`}
Testing Logs
{flowTest?.spec?.sentMessages?.map((message) => (
-
+
{ message }
))}