From 3e7d3dbf1db3c7c672b6f0e01e294d201262a8ad Mon Sep 17 00:00:00 2001 From: Felix Hennig Date: Wed, 11 Dec 2024 11:24:17 +0100 Subject: [PATCH] Add field, and added test values for the dummy organism --- kubernetes/loculus/values.yaml | 3 +++ website/src/config.ts | 5 ++++- website/src/pages/[organism]/submission/template/index.ts | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/kubernetes/loculus/values.yaml b/kubernetes/loculus/values.yaml index 26e712233..17470011e 100644 --- a/kubernetes/loculus/values.yaml +++ b/kubernetes/loculus/values.yaml @@ -1275,6 +1275,9 @@ defaultOrganisms: schema: image: "https://www.un.org/sites/un2.un.org/files/field/image/1583952355.1997.jpg" organismName: "Test Dummy Organism" + metadataTemplate: + - country + - date metadata: - name: date type: date diff --git a/website/src/config.ts b/website/src/config.ts index dee61b9e2..54df07cae 100644 --- a/website/src/config.ts +++ b/website/src/config.ts @@ -69,8 +69,11 @@ export function getSchema(organism: string): Schema { } export function getMetadataTemplateFields(organism: string): string[] { + const schema = getConfig(organism).schema; + if (schema.metadataTemplate !== undefined) { + return schema.metadataTemplate; + } return getConfig(organism).schema.inputFields.map((field) => field.name); - // TODO } export function getRuntimeConfig(): RuntimeConfig { diff --git a/website/src/pages/[organism]/submission/template/index.ts b/website/src/pages/[organism]/submission/template/index.ts index acc50368b..513eee960 100644 --- a/website/src/pages/[organism]/submission/template/index.ts +++ b/website/src/pages/[organism]/submission/template/index.ts @@ -5,6 +5,7 @@ import type { UploadAction } from '../../../../components/Submission/DataUploadF import { getMetadataTemplateFields } from '../../../../config'; import { ACCESSION_FIELD, SUBMISSION_ID_FIELD } from '../../../../settings.ts'; +/** The TSV template file that users can download from the submission page. */ export const GET: APIRoute = async ({ params, request }) => { const rawOrganism = params.organism!; const { organism } = cleanOrganism(rawOrganism);