File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,13 @@ function AssemblerLink({ overhang }) {
3232 )
3333}
3434
35+ function formatItemName ( item ) {
36+ if ( item . plasmid_name && item . id !== item . plasmid_name ) {
37+ return `${ item . id } (${ item . plasmid_name } )`
38+ }
39+ return item . id
40+ }
41+
3542function AssemblerComponent ( { data, categories } ) {
3643
3744 const [ assembly , setAssembly ] = React . useState ( [ { category : '' , id : [ ] } ] )
@@ -152,6 +159,7 @@ function AssemblerComponent({ data, categories }) {
152159 onChange = { ( e , value ) => setId ( value , index ) }
153160 label = "ID"
154161 options = { data . filter ( ( d ) => allowedCategories . includes ( d . category ) ) . map ( ( item ) => item . id ) }
162+ getOptionLabel = { ( id ) => formatItemName ( data . find ( ( d ) => d . id === id ) ) }
155163 renderInput = { ( params ) => < TextField { ...params } label = "ID" /> }
156164 />
157165 </ FormControl >
@@ -204,7 +212,7 @@ function AssemblerComponent({ data, categories }) {
204212 </ TableCell >
205213 { parts . map ( ( part , colIndex ) => (
206214 < TableCell key = { colIndex } >
207- { part }
215+ { formatItemName ( data . find ( ( d ) => d . id === part ) ) }
208216 </ TableCell >
209217 ) ) }
210218
You can’t perform that action at this time.
0 commit comments