Skip to content

Commit

Permalink
fix(website): allow null sequences on the edit page #1266
Browse files Browse the repository at this point in the history
  • Loading branch information
fengelniederhammer committed Mar 14, 2024
1 parent a710265 commit 33e451f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion website/src/components/Edit/DataRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const ProcessedDataRow: FC<ProcessedDataRowProps> = ({ row }) => (
<td className={`w-1/4 `}>{row.key}:</td>
<td />
<td className='w-full'>
<div className='px-3'>{row.value}</div>{' '}
<div className='px-3'>{row.value}</div>
</td>
</tr>
);
4 changes: 2 additions & 2 deletions website/src/components/Edit/EditPage.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ const expectTextInSequenceData = {
expect(screen.getByText(sentenceCase(key) + ':')).toBeInTheDocument();
expect(screen.getByDisplayValue(value)).toBeInTheDocument();
}),
processed: (metadata: Record<string, string>): void =>
processed: (metadata: Record<string, string | null>): void =>
Object.entries(metadata).forEach(([key, value]) => {
expect(screen.getByText(key + ':')).toBeInTheDocument();
expect(screen.getByText(value.toString())).toBeInTheDocument();
expect(screen.getByText(value ?? 'null')).toBeInTheDocument();
}),
processedMetadata: (metadata: Record<string, MetadataField>): void =>
Object.entries(metadata).forEach(([key, value]) => {
Expand Down
2 changes: 1 addition & 1 deletion website/src/components/Edit/EditPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ const ProcessedSequences: FC<ProcessedSequencesProps> = ({ processedSequenceRows
<>
<Subtitle key={`preprocessing_sequences_${sequenceType}`} title={sentenceCase(sequenceType)} />
{Object.entries(processedSequenceRows[sequenceType]).map(([key, value]) => (
<ProcessedDataRow key={`processed_${sequenceType}_${key}`} row={{ key, value }} />
<ProcessedDataRow key={`processed_${sequenceType}_${key}`} row={{ key, value: value ?? 'null' }} />
))}
</>
);
Expand Down
6 changes: 3 additions & 3 deletions website/src/types/backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,10 @@ export const sequenceEntryToEdit = accessionVersion.merge(
}),
processedData: z.object({
metadata: metadataRecord,
unalignedNucleotideSequences: z.record(z.string()),
alignedNucleotideSequences: z.record(z.string()),
unalignedNucleotideSequences: z.record(z.string().nullable()),
alignedNucleotideSequences: z.record(z.string().nullable()),
nucleotideInsertions: z.record(z.array(z.string())),
alignedAminoAcidSequences: z.record(z.string()),
alignedAminoAcidSequences: z.record(z.string().nullable()),
aminoAcidInsertions: z.record(z.array(z.string())),
}),
}),
Expand Down
2 changes: 1 addition & 1 deletion website/tests/util/preprocessingPipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ const sequenceData = {
ORF7a: 'K'.repeat(122),
ORF7b: 'I'.repeat(44),
ORF8: 'L'.repeat(122),
ORF9b: 'P'.repeat(98),
ORF9b: null,
S: 'V'.repeat(1274),
},
aminoAcidInsertions: {
Expand Down

0 comments on commit 33e451f

Please sign in to comment.