From 9a6336a03b96d437f9cc5ce7a771b8e91b163cf4 Mon Sep 17 00:00:00 2001 From: "Anna (Anya) Parker" <50943381+anna-parker@users.noreply.github.com> Date: Thu, 31 Oct 2024 15:41:40 +0100 Subject: [PATCH 1/6] try going back --- kubernetes/loculus/templates/_common-metadata.tpl | 4 ---- kubernetes/loculus/values.yaml | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/kubernetes/loculus/templates/_common-metadata.tpl b/kubernetes/loculus/templates/_common-metadata.tpl index 9c6ca7d82..2e5f75928 100644 --- a/kubernetes/loculus/templates/_common-metadata.tpl +++ b/kubernetes/loculus/templates/_common-metadata.tpl @@ -92,10 +92,6 @@ fields: type: string notSearchable: true hideOnSequenceDetailsPage: true - - name: versionComment - type: string - displayName: Version comment - header: Submission details {{- end}} {{/* Patches schema by adding to it and overwriting overlapping fields by the value in metadataAdd*/}} diff --git a/kubernetes/loculus/values.yaml b/kubernetes/loculus/values.yaml index d7c343068..74bef2311 100644 --- a/kubernetes/loculus/values.yaml +++ b/kubernetes/loculus/values.yaml @@ -1251,6 +1251,10 @@ defaultOrganisms: autocomplete: true required: true type: string + - name: versionComment + type: string + displayName: Version comment + header: Submission details website: tableColumns: - country From 59798e43c2c416b4b81f5c601f1597698eda658d Mon Sep 17 00:00:00 2001 From: "Anna (Anya) Parker" <50943381+anna-parker@users.noreply.github.com> Date: Thu, 31 Oct 2024 15:51:46 +0100 Subject: [PATCH 2/6] actually put it into default organism --- kubernetes/loculus/values.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kubernetes/loculus/values.yaml b/kubernetes/loculus/values.yaml index 74bef2311..a3199b0d6 100644 --- a/kubernetes/loculus/values.yaml +++ b/kubernetes/loculus/values.yaml @@ -1063,6 +1063,10 @@ defaultOrganismConfig: &defaultOrganismConfig type: percentage preprocessing: inputs: {input: nextclade.coverage} + - name: versionComment + type: string + displayName: Version comment + header: Submission details website: &website tableColumns: - sampleCollectionDate @@ -1251,10 +1255,6 @@ defaultOrganisms: autocomplete: true required: true type: string - - name: versionComment - type: string - displayName: Version comment - header: Submission details website: tableColumns: - country From 60f0ef78b1a452a4b0719bb75fec423dd1a8bdbe Mon Sep 17 00:00:00 2001 From: "Anna (Anya) Parker" <50943381+anna-parker@users.noreply.github.com> Date: Thu, 31 Oct 2024 16:15:19 +0100 Subject: [PATCH 3/6] fix backend --- .../kotlin/org/loculus/backend/model/ReleasedDataModel.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/src/main/kotlin/org/loculus/backend/model/ReleasedDataModel.kt b/backend/src/main/kotlin/org/loculus/backend/model/ReleasedDataModel.kt index 07924592d..2d097487c 100644 --- a/backend/src/main/kotlin/org/loculus/backend/model/ReleasedDataModel.kt +++ b/backend/src/main/kotlin/org/loculus/backend/model/ReleasedDataModel.kt @@ -108,8 +108,11 @@ open class ReleasedDataModel( ("versionStatus" to TextNode(versionStatus.name)), ("dataUseTerms" to TextNode(currentDataUseTerms.type.name)), ("dataUseTermsRestrictedUntil" to restrictedDataUseTermsUntil), - ("versionComment" to TextNode(rawProcessedData.versionComment)), - ).let { + ) + if (!rawProcessedData.processedData.metadata.containsKey("versionComment")) { + mapOf("versionComment" to TextNode(rawProcessedData.versionComment)) + } else { + emptyMap() + }.let { when (backendConfig.dataUseTermsUrls) { null -> it else -> { From 586f6075eef2b6b9fc2ee872da1f19f998f0641e Mon Sep 17 00:00:00 2001 From: "Anna (Anya) Parker" <50943381+anna-parker@users.noreply.github.com> Date: Thu, 31 Oct 2024 16:34:16 +0100 Subject: [PATCH 4/6] fix --- .../kotlin/org/loculus/backend/model/ReleasedDataModel.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/src/main/kotlin/org/loculus/backend/model/ReleasedDataModel.kt b/backend/src/main/kotlin/org/loculus/backend/model/ReleasedDataModel.kt index 2d097487c..b23d4ffba 100644 --- a/backend/src/main/kotlin/org/loculus/backend/model/ReleasedDataModel.kt +++ b/backend/src/main/kotlin/org/loculus/backend/model/ReleasedDataModel.kt @@ -108,7 +108,10 @@ open class ReleasedDataModel( ("versionStatus" to TextNode(versionStatus.name)), ("dataUseTerms" to TextNode(currentDataUseTerms.type.name)), ("dataUseTermsRestrictedUntil" to restrictedDataUseTermsUntil), - ) + if (!rawProcessedData.processedData.metadata.containsKey("versionComment")) { + ) + + if (!rawProcessedData.processedData.metadata.containsKey("versionComment") || + (rawProcessedData.processedData.metadata["versionComment"] == null) + ) { mapOf("versionComment" to TextNode(rawProcessedData.versionComment)) } else { emptyMap() From cff495ff4ca16a0edd7d48e5d86b5ff38ec1e0be Mon Sep 17 00:00:00 2001 From: "Anna (Anya) Parker" <50943381+anna-parker@users.noreply.github.com> Date: Thu, 31 Oct 2024 16:50:13 +0100 Subject: [PATCH 5/6] just check is revoked --- .../kotlin/org/loculus/backend/model/ReleasedDataModel.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/backend/src/main/kotlin/org/loculus/backend/model/ReleasedDataModel.kt b/backend/src/main/kotlin/org/loculus/backend/model/ReleasedDataModel.kt index b23d4ffba..4d8ade75e 100644 --- a/backend/src/main/kotlin/org/loculus/backend/model/ReleasedDataModel.kt +++ b/backend/src/main/kotlin/org/loculus/backend/model/ReleasedDataModel.kt @@ -109,9 +109,7 @@ open class ReleasedDataModel( ("dataUseTerms" to TextNode(currentDataUseTerms.type.name)), ("dataUseTermsRestrictedUntil" to restrictedDataUseTermsUntil), ) + - if (!rawProcessedData.processedData.metadata.containsKey("versionComment") || - (rawProcessedData.processedData.metadata["versionComment"] == null) - ) { + if (rawProcessedData.isRevocation) { mapOf("versionComment" to TextNode(rawProcessedData.versionComment)) } else { emptyMap() From 70ccdc32bdf9529726119d5ab953bab40c784fb3 Mon Sep 17 00:00:00 2001 From: "Anna (Anya) Parker" <50943381+anna-parker@users.noreply.github.com> Date: Thu, 31 Oct 2024 17:01:34 +0100 Subject: [PATCH 6/6] fix tests -> do not always overwrite versionComment --- .../backend/controller/submission/GetReleasedDataEndpointTest.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/backend/src/test/kotlin/org/loculus/backend/controller/submission/GetReleasedDataEndpointTest.kt b/backend/src/test/kotlin/org/loculus/backend/controller/submission/GetReleasedDataEndpointTest.kt index 1bfaa0de5..34be07daa 100644 --- a/backend/src/test/kotlin/org/loculus/backend/controller/submission/GetReleasedDataEndpointTest.kt +++ b/backend/src/test/kotlin/org/loculus/backend/controller/submission/GetReleasedDataEndpointTest.kt @@ -149,7 +149,6 @@ class GetReleasedDataEndpointTest( "releasedDate" to TextNode(currentDate), "submittedDate" to TextNode(currentDate), "dataUseTermsRestrictedUntil" to NullNode.getInstance(), - "versionComment" to NullNode.getInstance(), "booleanColumn" to BooleanNode.TRUE, )