Skip to content

Commit

Permalink
OpenConceptLab/ocl_issues#2023 | same as map types only
Browse files Browse the repository at this point in the history
  • Loading branch information
snyaggarwal committed Dec 12, 2024
1 parent 4659cd2 commit 4146b4b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
22 changes: 15 additions & 7 deletions src/components/repos/RepoConceptsMatch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ const RepoConceptsMatch = () => {
data.row[newKey] = newValue
}
})
APIService.concepts().appendToUrl('$match/').post(data, null, null, {includeSearchMeta: true, includeMappings: true, mappingBrief: true}).then(response => {
APIService.concepts().appendToUrl('$match/').post(data, null, null, {includeSearchMeta: true, includeMappings: true, mappingBrief: true, mapTypes: 'SAME-AS,SAME AS,SAME_AS', verbose: true}).then(response => {
setConceptsResponse(response)
setTimeout(() => {
highlightTexts(response?.data || [], null, true)
Expand Down Expand Up @@ -355,13 +355,13 @@ const RepoConceptsMatch = () => {
map(same_as_mappings, (mapping, i) => (
<ListItem disablePadding key={i}>
<ListItemText
primary={`[${mapping.map_type}] ${mapping.cascade_target_concept_name || '-'}`}
primary={`${mapping.cascade_target_concept_name || '-'}`}
secondary={`${mapping.cascade_target_source_name}/${mapping.to_concept_code}`}
sx={{
marginTop: '2px',
marginBottom: '2px',
'.MuiListItemText-primary': {fontSize: '12px'},
'.MuiListItemText-secondary': {fontSize: '10px'}
'.MuiListItemText-secondary': {fontSize: '12px'}
}}
/>
</ListItem>
Expand All @@ -382,7 +382,7 @@ const RepoConceptsMatch = () => {
marginTop: '2px',
marginBottom: '2px',
'.MuiListItemText-primary': {fontSize: '12px'},
'.MuiListItemText-secondary': {fontSize: '10px'}
'.MuiListItemText-secondary': {fontSize: '12px'}
}}
/>
</ListItem>
Expand Down Expand Up @@ -485,25 +485,33 @@ const RepoConceptsMatch = () => {
noSorting
resultContainerStyle={{height: showItem?.id ? '25vh' : 'calc(100vh - 200px)'}}
onShowItemSelect={item => setShowItem(item)}
selectedToShow={showItem}
extraColumns={[
{
sortable: false,
id: 'mappings',
labelKey: 'mapping.mappings',
labelKey: 'mapping.same_as_mappings',
renderer: formatMappings,
},
{
sortable: false,
id: 'search_meta.search_confidence',
id: 'search_meta.search_score',
labelKey: 'search.score',
value: 'search_meta.search_confidence',
value: 'search_meta.search_score',
renderer: item => (
<span style={{display: 'flex'}} onClick={event => onConfidenceClick(event, item)}>
<span className='confidence-bar' style={{"--confidence-width": item.search_meta.search_confidence, "--confidence-color": getConfidenceColor(item)}}>
<span className="confidence-text">{parseFloat(item.search_meta.search_score).toFixed(2)}</span>
</span>
</span>
)
},
{
sortable: false,
id: 'search_meta.search_confidence',
labelKey: 'search.confidence',
value: 'search_meta.search_confidence',
align: 'right'
}
]}
toolbarControl={<CloseIconButton color='secondary' onClick={onCloseResults}/>}
Expand Down
2 changes: 1 addition & 1 deletion src/components/search/TableResults.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ const TableResults = ({selected, bgColor, handleClick, handleRowClick, handleSel
>
{value}
</TableCell>:
<TableCell key={idx} align="left" className={column.className} sx={{color: color, ...column.sx}}>
<TableCell key={idx} align={column.align || "left"} className={column.className} sx={{color: color, ...column.sx}}>
{value}
</TableCell>
})
Expand Down

0 comments on commit 4146b4b

Please sign in to comment.