Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
snyaggarwal committed Oct 6, 2021
1 parent a7fa2d8 commit 593c6d3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/components/concepts/ConceptHierarchyRow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import {
TableRow, TableCell, Chip
} from '@material-ui/core';
import { map } from 'lodash';
import { map, get } from 'lodash';

const ConceptHierarchyRow = ({ mapType, concepts, source }) => {
const onDefaultClick = (event, concept) => {
Expand All @@ -11,12 +11,14 @@ const ConceptHierarchyRow = ({ mapType, concepts, source }) => {
window.location.hash = concept.url
}

const count = get(concepts, 'length') || 0

return (
<React.Fragment>
{
mapType &&
<TableRow hover>
<TableCell align='left' rowSpan={concepts.length + 1} style={{paddingRight: '5px', verticalAlign: 'top', paddingTop: '7px'}}>
<TableCell align='left' rowSpan={count + 1} style={{paddingRight: '5px', verticalAlign: 'top', paddingTop: '7px'}}>
<Chip
size='small'
variant='outlined'
Expand Down
3 changes: 2 additions & 1 deletion src/components/concepts/LocalizedTextRow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ const LocalizedTextRow = ({concept, locale, localizedTexts, isDescription}) => {
const nameAttr = isDescription ? 'description' : 'name'
const urlAttr = isDescription ? 'descriptions' : 'names'
const onCopyClick = localizedTextId => copyURL(toFullAPIURL(concept.url + urlAttr + '/' + localizedTextId + '/'))
const count = get(localizedTexts, 'length') || 0

return (
<React.Fragment key={locale}>
<TableRow hover>
<TableCell align='left' rowSpan={localizedTexts.length + 1} style={{paddingRight: '5px', verticalAlign: 'top', paddingLeft: '15px', width: '50px', paddingTop: '5px'}}>
<TableCell align='left' rowSpan={count + 1} style={{paddingRight: '5px', verticalAlign: 'top', paddingLeft: '15px', width: '50px', paddingTop: '5px'}}>
<div className='gray-italics-small flex-vertical-center'>
{`[${locale}]`}
</div>
Expand Down
4 changes: 3 additions & 1 deletion src/components/mappings/ConceptHomeMappingsTableRows.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ const ConceptHomeMappingsTableRows = ({ mapType, mappings, isIndirect }) => {
return get(mapping, `${attr.split('_name')[0]}.display_name`)
}

const count = get(mappings, 'length') || 0

return (
<React.Fragment>
{
mapType &&
<TableRow hover>
<TableCell align='left' rowSpan={mappings.length + 1} style={{paddingRight: '5px', verticalAlign: 'top', paddingTop: '7px'}}>
<TableCell align='left' rowSpan={count + 1} style={{paddingRight: '5px', verticalAlign: 'top', paddingTop: '7px'}}>
<Tooltip title={isIndirect ? 'Inverse Mappings' : 'Direct Mappings'}>
<Chip
size='small'
Expand Down

0 comments on commit 593c6d3

Please sign in to comment.