Skip to content

Commit

Permalink
OpenConceptLab/ocl_issues#1013 | concept details | custom attrs order…
Browse files Browse the repository at this point in the history
…ing alphabatically
  • Loading branch information
snyaggarwal committed Oct 4, 2021
1 parent 998e332 commit e7456ff
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/common/CustomAttributesAccordian.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
Accordion, AccordionSummary, AccordionDetails, Button,
} from '@material-ui/core';
import {
map, isEmpty, isBoolean, isArray, isObject, find, startCase, keys
map, isEmpty, isBoolean, isArray, isObject, find, startCase, keys, orderBy
} from 'lodash';
import CustomAttributes from './CustomAttributes'
import TabCountLabel from './TabCountLabel'
Expand Down Expand Up @@ -41,7 +41,7 @@ const CustomAttributesAccordian = ({headingStyles, detailStyles, attributes}) =>
{
hasAttributes &&
<span>
<Button color='primary' onClick={onRawClick }>
<Button color='primary' onClick={onRawClick} style={{textTransform: 'capitalize'}}>
{ raw ? 'Formatted' : 'Raw' }
</Button>
</span>
Expand All @@ -59,7 +59,8 @@ const CustomAttributesAccordian = ({headingStyles, detailStyles, attributes}) =>
/> :
<div className='col-md-12 no-side-padding'>
{
map(attributes, (value, name) => {
map(orderBy(keys(attributes)), name => {
const value = attributes[name]
const isBool = isBoolean(value)
const needNesting = !isBool && shouldBeNested(value)
const isArr = isArray(value)
Expand Down

0 comments on commit e7456ff

Please sign in to comment.