Skip to content

Commit 157b29e

Browse files
authored
Support excision message in homologous recombination (#529)
* support excission message in homologous recombination * change DOM nesting to pass tests
1 parent bb6c6c5 commit 157b29e

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/components/sources/FinishedSource.jsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,21 @@ function FileMessage({ source }) {
270270
return common;
271271
}
272272

273+
function HomologousRecombinationMessage({ source }) {
274+
if (source.input.length === 1) {
275+
return (
276+
<>
277+
Excission by homologous recombination.
278+
</>
279+
);
280+
}
281+
return (
282+
<>
283+
Homologous recombination with {source.input[0].sequence} as template and {source.input[1].sequence} as insert.
284+
</>
285+
);
286+
}
287+
273288
function FinishedSource({ sourceId }) {
274289
const source = useSelector((state) => state.cloning.sources.find((s) => s.id === sourceId), isEqual);
275290
const primers = useSelector((state) => state.cloning.primers, isEqual);
@@ -298,7 +313,7 @@ function FinishedSource({ sourceId }) {
298313
case 'OligoHybridizationSource':
299314
message = `Hybridization of primers ${primers.find((p) => source.input[0].sequence === p.id).name} and ${primers.find((p) => source.input[1].sequence === p.id).name}`;
300315
break;
301-
case 'HomologousRecombinationSource': message = `Homologous recombination with ${source.input[0].sequence} as template and ${source.input[1].sequence} as insert.`; break;
316+
case 'HomologousRecombinationSource': message = <HomologousRecombinationMessage source={source} />; break;
302317
case 'CRISPRSource': {
303318
const guidesString = source.input.filter(({ type }) => type === 'SourceInput').map(({ sequence }) => primers.find((p) => sequence === p.id).name).join(', ');
304319
message = `CRISPR HDR with ${source.input[0].sequence} as template, ${source.input[1].sequence} as insert and ${guidesString} as a guide${source.input.length > 3 ? 's' : ''}`;

0 commit comments

Comments
 (0)