From afc657f8227f30f353140197443f644fde5e4ad5 Mon Sep 17 00:00:00 2001 From: Felix Hennig Date: Fri, 8 Nov 2024 13:39:24 +0100 Subject: [PATCH] progress --- .../loculus/backend/api/SubmissionTypes.kt | 9 ++++++ .../submission/SubmissionDatabaseService.kt | 10 +++++++ .../src/components/ReviewPage/ReviewCard.tsx | 1 + website/src/types/backend.ts | 28 +++++++++++-------- 4 files changed, 36 insertions(+), 12 deletions(-) diff --git a/backend/src/main/kotlin/org/loculus/backend/api/SubmissionTypes.kt b/backend/src/main/kotlin/org/loculus/backend/api/SubmissionTypes.kt index 007efdd95..a0bbced01 100644 --- a/backend/src/main/kotlin/org/loculus/backend/api/SubmissionTypes.kt +++ b/backend/src/main/kotlin/org/loculus/backend/api/SubmissionTypes.kt @@ -219,6 +219,15 @@ data class SequenceEntryStatus( val isRevocation: Boolean = false, val submissionId: String, val dataUseTerms: DataUseTerms, + val processedData: ProcessedData, + val originalData: OriginalData, + @Schema(description = "The preprocessing will be considered failed if this is not empty") + val errors: List? = null, + @Schema( + description = + "Issues where data is not necessarily wrong, but the user might want to look into those warnings.", + ) + val warnings: List? = null, ) : AccessionVersionInterface data class EditedSequenceEntryData( diff --git a/backend/src/main/kotlin/org/loculus/backend/service/submission/SubmissionDatabaseService.kt b/backend/src/main/kotlin/org/loculus/backend/service/submission/SubmissionDatabaseService.kt index 92a168839..fc64f531c 100644 --- a/backend/src/main/kotlin/org/loculus/backend/service/submission/SubmissionDatabaseService.kt +++ b/backend/src/main/kotlin/org/loculus/backend/service/submission/SubmissionDatabaseService.kt @@ -707,6 +707,16 @@ class SubmissionDatabaseService( DataUseTermsType.fromString(row[DataUseTermsTable.dataUseTermsTypeColumn]), row[DataUseTermsTable.restrictedUntilColumn], ), + processedData = compressionService.decompressSequencesInProcessedData( + row[SequenceEntriesView.processedDataColumn]!!, + organism!!, + ), + originalData = compressionService.decompressSequencesInOriginalData( + row[SequenceEntriesView.originalDataColumn]!!, + organism!!, + ), + errors = row[SequenceEntriesView.errorsColumn], + warnings = row[SequenceEntriesView.warningsColumn], ) } diff --git a/website/src/components/ReviewPage/ReviewCard.tsx b/website/src/components/ReviewPage/ReviewCard.tsx index 6f75f01b3..0676e3b62 100644 --- a/website/src/components/ReviewPage/ReviewCard.tsx +++ b/website/src/components/ReviewPage/ReviewCard.tsx @@ -167,6 +167,7 @@ const isAnnotationPresent = (metadataField: string) => (item: ProcessingAnnotati item.source[0].name === metadataField; const MetadataList: FC = ({ data }) => + data.processedData !== undefined && Object.entries(data.processedData.metadata).map(([metadataName, value], index) => value === null ? null : (