-
-
+
+ Deployment A
+
+
+
+ Deployment B
+
+
diff --git a/src/pages/tests/ab/detail.tsx b/src/pages/tests/ab/detail.tsx
index 866464c..f3ac485 100644
--- a/src/pages/tests/ab/detail.tsx
+++ b/src/pages/tests/ab/detail.tsx
@@ -6,11 +6,11 @@ import { snackbarAtom } from '../../../atoms/snackbar';
import { abTestsAtom } from '../../../atoms/tests';
import { DetailCard } from '../../../components/detail/card';
import OverViewTab from '../../../components/detail/overview-tab';
-import { useABTestsData } from '../../../hooks/useABTestsData';
+import { useABTestsData } from '../../../hooks/data/useABTestsData';
import { useDelete } from '../../../hooks/useDelete';
-import { useDeploymentsData } from '../../../hooks/useDeploymentsData';
-import { IABTestView } from '../../../interfaces/pages/tests';
-import { convertABTestToView } from '../../../utils/pages/tests/ab';
+import { useDeploymentsData } from '../../../hooks/data/useDeploymentsData';
+import { IABTestJoined } from '../../../interfaces/pages/tests';
+import { joinABTest } from '../../../utils/pages/tests/ab';
export const ABTestDetail = () => {
useABTestsData();
@@ -46,7 +46,7 @@ export const ABTestDetail = () => {
return <>>;
}
- const abTestView: IABTestView = convertABTestToView(abTest, deployments);
+ const abTestJoined: IABTestJoined = joinABTest(abTest, deployments);
const performDelete = useDelete(deleteABTest);
@@ -84,21 +84,21 @@ export const ABTestDetail = () => {
'Deployment B Deployment Strategy',
]}
>
- {abTestView.id}
- {abTestView.name}
- {abTestView.domain}
-
- {abTestView.a?.deploymentName}
- {abTestView.a?.status}
- {abTestView.a?.modelName}
- {abTestView.a?.modelVersion}
- {abTestView.a?.strategy}
-
- {abTestView.b?.deploymentName}
- {abTestView.b?.status}
- {abTestView.b?.modelName}
- {abTestView.b?.modelVersion}
- {abTestView.b?.strategy}
+ {abTestJoined.id}
+ {abTestJoined.name}
+ {abTestJoined.domain}
+
+ {abTestJoined.a?.deploymentName}
+ {abTestJoined.a?.status}
+ {abTestJoined.a?.modelName}
+ {abTestJoined.a?.modelVersion}
+ {abTestJoined.a?.strategy}
+
+ {abTestJoined.b?.deploymentName}
+ {abTestJoined.b?.status}
+ {abTestJoined.b?.modelName}
+ {abTestJoined.b?.modelVersion}
+ {abTestJoined.b?.strategy}
Not Implemented
diff --git a/src/pages/tests/ab/index.tsx b/src/pages/tests/ab/index.tsx
index 4e33085..56d7cf2 100644
--- a/src/pages/tests/ab/index.tsx
+++ b/src/pages/tests/ab/index.tsx
@@ -3,9 +3,9 @@ import { deleteABTest } from '../../../api/tests';
import { deploymentsAtom } from '../../../atoms/deployments';
import { abTestsAtom } from '../../../atoms/tests';
import ListTable from '../../../components/table';
-import { useABTestsData } from '../../../hooks/useABTestsData';
+import { useABTestsData } from '../../../hooks/data/useABTestsData';
import { useDelete } from '../../../hooks/useDelete';
-import { useDeploymentsData } from '../../../hooks/useDeploymentsData';
+import { useDeploymentsData } from '../../../hooks/data/useDeploymentsData';
import { IABTestView } from '../../../interfaces/pages/tests';
import { convertABTestToView } from '../../../utils/pages/tests/ab';
diff --git a/src/utils/pages/tests/ab/index.ts b/src/utils/pages/tests/ab/index.ts
index b7655fe..324a98a 100644
--- a/src/utils/pages/tests/ab/index.ts
+++ b/src/utils/pages/tests/ab/index.ts
@@ -1,18 +1,32 @@
import { IDeploymentDatum } from '../../../../interfaces/pages/deployments';
import {
+ IABTestJoined,
IABTestReadResponse,
IABTestView,
} from '../../../../interfaces/pages/tests';
-export const convertABTestToView = (
+export const joinABTest = (
abTest: IABTestReadResponse,
deployments: IDeploymentDatum[]
-): IABTestView => {
+): IABTestJoined => {
return {
id: abTest.id,
name: abTest.name,
- a: deployments.find((dep) => dep.id === abTest.aId),
- b: deployments.find((dep) => dep.id === abTest.bId),
+ a: deployments.find((dep) => dep.id === abTest.aid),
+ b: deployments.find((dep) => dep.id === abTest.bid),
domain: abTest.domain,
};
};
+
+export const convertABTestToView = (
+ abTest: IABTestReadResponse,
+ deployments: IDeploymentDatum[]
+): IABTestView => {
+ const joined = joinABTest(abTest, deployments);
+ return {
+ name: joined.name,
+ a: joined.a?.deploymentName ?? '',
+ b: joined.b?.deploymentName ?? '',
+ domain: joined.domain,
+ };
+};