Skip to content

Commit f91d575

Browse files
committed
Associations/hierarchy | fixing code display (copied from v3)
1 parent 670307a commit f91d575

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/components/concepts/Associations.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import ButtonGroup from '@mui/material/ButtonGroup'
1717
import SelectedIcon from '@mui/icons-material/Done';
1818
import UpIcon from '@mui/icons-material/KeyboardArrowUp';
1919
import DownIcon from '@mui/icons-material/KeyboardArrowDown';
20-
import { get, isEmpty, forEach, map, find, compact, flatten, values, filter, without } from 'lodash';
20+
import { get, isEmpty, forEach, map, find, compact, flatten, values, filter, without, has } from 'lodash';
2121
import ConceptIcon from './ConceptIcon'
2222
import { generateRandomString, dropVersion, URIToParentParams, toParentURI } from '../../common/utils'
2323
import TagCountLabel from '../common/TagCountLabel'
@@ -57,7 +57,7 @@ const MappingCells = ({mapping, isIndirect}) => {
5757
if(name) return name;
5858
return get(mapping, `${attr.split('_name')}.0.display_name`)
5959
}
60-
const isDefinedInOCL = Boolean(mapping.cascade_target_concept_url)
60+
const isDefinedInOCL = Boolean(mapping.cascade_target_concept_url || mapping.url)
6161
const getTitle = () => {
6262
return isDefinedInOCL ?
6363
(isIndirect ? t('mapping.from_concept_defined') : t('mapping.to_concept_defined')) :
@@ -73,14 +73,14 @@ const MappingCells = ({mapping, isIndirect}) => {
7373
<ConceptIcon selected={isDefinedInOCL} sx={{width: '10px', height: '10px', marginRight: '12px'}} />
7474
</span>
7575
</Tooltip>
76-
{ mapping[conceptCodeAttr] }
76+
{ has(mapping, conceptCodeAttr) ? mapping[conceptCodeAttr] : mapping?.id }
7777
</span>
7878
</TableCell>
7979
<TableCell>
8080
{ getConceptName(mapping, conceptCodeName) }
8181
</TableCell>
8282
<TableCell align='left'>
83-
{get(mapping, sourceAttr)}
83+
{has(mapping, sourceAttr) ? get(mapping, sourceAttr) : URIToParentParams(mapping.url)?.repo}
8484
</TableCell>
8585
</React.Fragment>
8686
)

0 commit comments

Comments
 (0)