-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OpenConceptLab/ocl_issues#991 | concept hierarchy as part of mappings
- Loading branch information
1 parent
7ac6b90
commit 930cdcb
Showing
5 changed files
with
167 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import React from 'react'; | ||
import { | ||
TableRow, TableCell, Chip | ||
} from '@material-ui/core'; | ||
import { map } from 'lodash'; | ||
|
||
const ConceptHierarchyRow = ({ mapType, concepts, source }) => { | ||
const onDefaultClick = (event, concept) => { | ||
event.stopPropagation() | ||
event.preventDefault() | ||
window.location.hash = concept.url | ||
} | ||
|
||
return ( | ||
<React.Fragment> | ||
{ | ||
mapType && | ||
<TableRow hover> | ||
<TableCell align='left' rowSpan={concepts.length + 1} style={{paddingRight: '5px', verticalAlign: 'top', paddingTop: '7px'}}> | ||
<Chip | ||
size='small' | ||
variant='outlined' | ||
color='default' | ||
label={mapType} | ||
style={{border: 'none'}} | ||
/> | ||
</TableCell> | ||
</TableRow> | ||
} | ||
{ | ||
map(concepts, concept => { | ||
return ( | ||
<TableRow | ||
hover key={concept.uuid} onClick={event => onDefaultClick(event, concept)} style={{cursor: 'pointer'}} className='underline-text'> | ||
<TableCell align='left' className='ellipsis-text' style={{maxWidth: '200px'}}> | ||
{concept.id} | ||
</TableCell> | ||
<TableCell align='left'> | ||
{ concept.name } | ||
</TableCell> | ||
<TableCell align='left'> | ||
{ `${source.owner} / ${source.id}` } | ||
</TableCell> | ||
<TableCell align='right' style={{width: '24px', paddingRight: '5px'}}> | ||
</TableCell> | ||
</TableRow> | ||
) | ||
}) | ||
} | ||
</React.Fragment> | ||
) | ||
} | ||
|
||
export default ConceptHierarchyRow; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters