From 7733ab36184b1b2588a295078aa7e8109bc1f109 Mon Sep 17 00:00:00 2001 From: bh-ethz <158496618+bh-ethz@users.noreply.github.com> Date: Thu, 8 Feb 2024 18:04:07 +0100 Subject: [PATCH] fix(website): allow unaligned sequences #741 (#944) --- .../SequenceDetailsPage/SequenceContainer.spec.tsx | 4 ++-- .../src/components/SequenceDetailsPage/SequenceViewer.tsx | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/website/src/components/SequenceDetailsPage/SequenceContainer.spec.tsx b/website/src/components/SequenceDetailsPage/SequenceContainer.spec.tsx index cf520e164c..203ce84dbd 100644 --- a/website/src/components/SequenceDetailsPage/SequenceContainer.spec.tsx +++ b/website/src/components/SequenceDetailsPage/SequenceContainer.spec.tsx @@ -70,7 +70,7 @@ describe('SequencesContainer', () => { click('Sequence'); await waitFor(() => { - expect(screen.getByText("LAPIS v2 doesn't support unaligned nucleotide sequences yet")).toBeVisible(); + expect(screen.getByText(unalignedSingleSegmentSequence)).toBeVisible(); }); }); @@ -89,7 +89,7 @@ describe('SequencesContainer', () => { click(`${multiSegmentName} (unaligned)`); await waitFor(() => { - expect(screen.getByText("LAPIS v2 doesn't support unaligned nucleotide sequences yet")).toBeVisible(); + expect(screen.getByText(unalignedMultiSegmentSequence)).toBeVisible(); }); }); diff --git a/website/src/components/SequenceDetailsPage/SequenceViewer.tsx b/website/src/components/SequenceDetailsPage/SequenceViewer.tsx index 16ef20c130..e5d092a7ea 100644 --- a/website/src/components/SequenceDetailsPage/SequenceViewer.tsx +++ b/website/src/components/SequenceDetailsPage/SequenceViewer.tsx @@ -4,7 +4,7 @@ import { type FC, useMemo } from 'react'; import { getLapisUrl } from '../../config.ts'; import { lapisClientHooks } from '../../services/serviceHooks.ts'; import type { ClientConfig } from '../../types/runtimeConfig.ts'; -import { isUnalignedSequence, type SequenceType } from '../../utils/sequenceTypeHelpers.ts'; +import { type SequenceType } from '../../utils/sequenceTypeHelpers.ts'; import { splitString } from '../../utils/splitLines'; const LINE_LENGTH = 100; @@ -30,10 +30,6 @@ export const SequencesViewer: FC = ({ const lines = useMemo(() => (data !== undefined ? splitString(data.sequence, LINE_LENGTH) : undefined), [data]); - if (isUnalignedSequence(sequenceType)) { - return
LAPIS v2 doesn't support unaligned nucleotide sequences yet
; - } - if (error !== null) { return (