Skip to content

Commit

Permalink
OpenConceptLab/ocl_issues#1659 | showing contributors summary when it…
Browse files Browse the repository at this point in the history
…s available
  • Loading branch information
snyaggarwal committed Sep 12, 2023
1 parent 368d134 commit 7e21640
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/components/sources/SourceSummary.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,18 @@ const SelfSummary = ({ summary, source, isVersion, includeReferences }) => {
if(includeReferences)
columns += 2
const width = `${100/columns}%`
let distibutionTypes = 5
if(summary?.concepts?.contributors)
distibutionTypes +=1
if(summary?.mappings?.contributors)
distibutionTypes +=1
return (
<React.Fragment>
<TableContainer component={Paper}>
<Table size="small">
<TableHead>
<TableRow>
<TableCell colSpan={7} style={{backgroundColor: 'rgb(224, 224, 224)', fontWeight: 'bold'}}>
<TableCell colSpan={distibutionTypes} style={{backgroundColor: 'rgb(224, 224, 224)', fontWeight: 'bold'}}>
Overview
</TableCell>
</TableRow>
Expand Down Expand Up @@ -279,8 +284,14 @@ const SelfSummary = ({ summary, source, isVersion, includeReferences }) => {
<SelfSummaryCell value={summary?.mappings?.map_type} label='MapTypes' onClick={event => toggle(event, 'map_type', summary?.mappings?.map_type, 'mappings')} />
<SelfSummaryCell value={summary?.concepts?.locale} label='Languages' onClick={event => toggle(event, 'locale', summary?.concepts?.locale, 'concepts')} />
<SelfSummaryCell value={summary?.concepts?.name_type} label='Name Types' onClick={event => toggle(event, 'name_type', summary?.concepts?.name_type, 'concepts')} />
<SelfSummaryCell value={summary?.concepts?.contributors} label='Concept Contributors' onClick={event => toggle(event, 'updated_by', summary?.concepts?.contributors, 'concepts')} />
<SelfSummaryCell value={summary?.mappings?.contributors} label='Mapping Contributors' onClick={event => toggle(event, 'updated_by', summary?.mappings?.contributors, 'mappings')} />
{
distibutionTypes > 5 &&
<SelfSummaryCell value={summary?.concepts?.contributors} label='Concept Contributors' onClick={event => toggle(event, 'updated_by', summary?.concepts?.contributors, 'concepts')} />
}
{
distibutionTypes > 6 &&
<SelfSummaryCell value={summary?.mappings?.contributors} label='Mapping Contributors' onClick={event => toggle(event, 'updated_by', summary?.mappings?.contributors, 'mappings')} />
}
</TableRow>
</TableBody>
{
Expand Down

0 comments on commit 7e21640

Please sign in to comment.