diff --git a/src/lib/components/app-sidebar.svelte b/src/lib/components/app-sidebar.svelte
index 4c1a0aa..d1478e1 100644
--- a/src/lib/components/app-sidebar.svelte
+++ b/src/lib/components/app-sidebar.svelte
@@ -113,8 +113,18 @@
},
{
title: "Test",
- url: "/dictionary/test",
+ url: "/dictionary",
icon: FlaskConicalIcon,
+ submenus: [
+ {
+ title: "Test List",
+ url: "/test",
+ },
+ {
+ title: "Test Map",
+ url: "/testmap",
+ },
+ ]
},
]
};
diff --git a/src/lib/components/dictionary/testmap/api/testmap-api.js b/src/lib/components/dictionary/testmap/api/testmap-api.js
new file mode 100644
index 0000000..bc934a7
--- /dev/null
+++ b/src/lib/components/dictionary/testmap/api/testmap-api.js
@@ -0,0 +1,18 @@
+import { API } from '$lib/config/api.js';
+import { getById, searchWithParams, create, update } from '$lib/api/api-client';
+
+export async function getTestMaps(searchQuery) {
+ return await searchWithParams(API.TESTMAP, searchQuery)
+}
+
+export async function getTestMap(searchQuery) {
+ return await getById(API.TESTMAP, searchQuery)
+}
+
+export async function createTestMap(newTestMapForm) {
+ return await create(API.TESTMAP, newTestMapForm)
+}
+
+export async function editTestMap(editTestMapForm, id) {
+ return await update(API.TESTMAP, editTestMapForm, id)
+}
\ No newline at end of file
diff --git a/src/lib/components/dictionary/testmap/config/testmap-config.js b/src/lib/components/dictionary/testmap/config/testmap-config.js
new file mode 100644
index 0000000..c96f8fe
--- /dev/null
+++ b/src/lib/components/dictionary/testmap/config/testmap-config.js
@@ -0,0 +1,61 @@
+import PlusIcon from "@lucide/svelte/icons/plus";
+import Settings2Icon from "@lucide/svelte/icons/settings-2";
+import PencilIcon from "@lucide/svelte/icons/pencil";
+import { API } from "$lib/config/api";
+
+export const searchFields = [
+ {
+ key: "TestSiteCode",
+ label: "Test Code",
+ type: "text",
+ },
+ {
+ key: "TestSiteName",
+ label: "Test Name",
+ type: "text",
+ },
+ {
+ key: "TestMapType",
+ label: "TestMap Type",
+ type: "text",
+ },
+
+];
+
+export const detailSections = [
+ {
+ class: "grid grid-cols-2 gap-4 items-center",
+ fields: [
+ { key: "HostType", label: "Host Type" },
+ { key: "HostID", label: "Host ID" },
+ { key: "HostName", label: "Host Name" },
+ { key: "ClientType", label: "Client Type" },
+ { key: "ClientID", label: "Client ID" },
+ { key: "ClientName", label: "Client Name" },
+ ]
+ },
+];
+
+export function testMapActions(masterDetail) {
+ return [
+ {
+ Icon: PlusIcon,
+ label: 'Add TestMap',
+ onClick: () => masterDetail.enterCreate(),
+ },
+ {
+ Icon: Settings2Icon,
+ label: 'Search Parameters',
+ },
+ ];
+}
+
+export function viewActions(handlers){
+ return [
+ {
+ Icon: PencilIcon,
+ label: 'Edit TestMap',
+ onClick: handlers.editTestMap,
+ },
+ ]
+}
\ No newline at end of file
diff --git a/src/lib/components/dictionary/testmap/config/testmap-form-config.js b/src/lib/components/dictionary/testmap/config/testmap-form-config.js
new file mode 100644
index 0000000..a25cdda
--- /dev/null
+++ b/src/lib/components/dictionary/testmap/config/testmap-form-config.js
@@ -0,0 +1,154 @@
+import { API } from '$lib/config/api';
+import EraserIcon from '@lucide/svelte/icons/eraser';
+import { z } from 'zod';
+import { cleanEmptyStrings } from '$lib/utils/cleanEmptyStrings';
+
+export const testMapSchema = z
+ .object({
+ HostID: z.string().optional(),
+ ClientID: z.string().optional()
+ })
+ .superRefine((data, ctx) => {
+ const hostID = data.HostID;
+ const clientID = data.ClientID;
+
+ if (hostID && clientID && hostID === clientID) {
+ ctx.addIssue({
+ code: z.ZodIssueCode.custom,
+ message: 'ClientID must be different from HostID',
+ path: ['ClientID']
+ });
+ ctx.addIssue({
+ code: z.ZodIssueCode.custom,
+ message: 'HostID must be different from ClientID',
+ path: ['HostID']
+ });
+ }
+ });
+
+export const testMapInitialForm = {
+ TestMapID: '',
+ HostType: '',
+ HostID: '',
+ HostTestCode: '',
+ HostTestName: '',
+ ClientType: '',
+ ClientID: '',
+ ClientTestCode: '',
+ ClientTestName: '',
+ ConDefID: ''
+};
+
+export const testMapDefaultErrors = {
+ HostID: null,
+ ClientID: null
+};
+
+export const testMapFormFields = [
+ {
+ title: 'Host & Client Information',
+ rows: [
+ {
+ type: 'row',
+ columns: [
+ {
+ key: 'HostType',
+ label: 'Host Type',
+ required: false,
+ type: 'select',
+ optionsEndpoint: `${API.BASE_URL}${API.VALUESET}/entity_type`
+ },
+ {
+ key: 'ClientType',
+ label: 'Client Type',
+ required: false,
+ type: 'select',
+ optionsEndpoint: `${API.BASE_URL}${API.VALUESET}/entity_type`
+ }
+ ]
+ },
+ {
+ type: 'row',
+ columns: [
+ {
+ key: 'HostID',
+ label: 'Host ID',
+ required: false,
+ type: 'text',
+ validateOn: ['input']
+ },
+ {
+ key: 'ClientID',
+ label: 'Client ID',
+ required: false,
+ type: 'text',
+ validateOn: ['input']
+ }
+ ]
+ },
+ {
+ type: 'row',
+ columns: [
+ {
+ key: 'HostTestCode',
+ label: 'Host Test Code',
+ required: false,
+ type: 'text'
+ },
+ {
+ key: 'ClientTestCode',
+ label: 'Client Test Code',
+ required: false,
+ type: 'text'
+ }
+ ]
+ },
+ {
+ type: 'row',
+ columns: [
+ {
+ key: 'HostTestName',
+ label: 'Host Test Name',
+ required: false,
+ type: 'text'
+ },
+ {
+ key: 'ClientTestName',
+ label: 'Client Test Name',
+ required: false,
+ type: 'text'
+ }
+ ]
+ },
+ {
+ type: 'row',
+ columns: [
+ {
+ key: 'ConDefID',
+ label: 'Container Definition',
+ required: false,
+ type: 'select',
+ optionsEndpoint: `${API.BASE_URL}${API.CONTAINER}`,
+ valueKey: 'ConDefID',
+ labelKey: (item) => `${item.ConCode} - ${item.ConName}`,
+ fullWidth: false
+ }
+ ]
+ }
+ ]
+ }
+];
+
+export function getTestMapFormActions(handlers) {
+ return [
+ {
+ Icon: EraserIcon,
+ label: 'Clear Form',
+ onClick: handlers.clearForm
+ }
+ ];
+}
+
+export function buildTestPayload() {
+
+}
\ No newline at end of file
diff --git a/src/lib/components/dictionary/testmap/page/create-page.svelte b/src/lib/components/dictionary/testmap/page/create-page.svelte
new file mode 100644
index 0000000..4649907
--- /dev/null
+++ b/src/lib/components/dictionary/testmap/page/create-page.svelte
@@ -0,0 +1 @@
+cr
\ No newline at end of file
diff --git a/src/lib/components/dictionary/testmap/page/edit-page.svelte b/src/lib/components/dictionary/testmap/page/edit-page.svelte
new file mode 100644
index 0000000..9a58f89
--- /dev/null
+++ b/src/lib/components/dictionary/testmap/page/edit-page.svelte
@@ -0,0 +1 @@
+ed
\ No newline at end of file
diff --git a/src/lib/components/dictionary/testmap/page/master-page.svelte b/src/lib/components/dictionary/testmap/page/master-page.svelte
new file mode 100644
index 0000000..d1466a5
--- /dev/null
+++ b/src/lib/components/dictionary/testmap/page/master-page.svelte
@@ -0,0 +1,68 @@
+
+
+{#snippet searchParamSnippet()}
+