Skip to content

Commit

Permalink
OpenConceptLab/ocl_issues#1013 | custom attributes | ordering attribu…
Browse files Browse the repository at this point in the history
…tes by ignoring the case
  • Loading branch information
snyaggarwal committed Oct 6, 2021
1 parent 5e45bf1 commit a8e5452
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/common/CustomAttributesAccordian.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ const CustomAttributesAccordian = ({headingStyles, detailStyles, attributes}) =>
<code key={index}>{JSON.stringify(value)}</code>
}

const getAttributeKeys = () => {
if(!hasAttributes)
return []
return orderBy(keys(attributes), attr => attr.toLowerCase())
}

return (
<Accordion defaultExpanded expanded>
<AccordionSummary
Expand Down Expand Up @@ -62,7 +68,7 @@ const CustomAttributesAccordian = ({headingStyles, detailStyles, attributes}) =>
/> :
<div className='col-md-12 no-side-padding'>
{
map(orderBy(keys(attributes)), name => {
map(getAttributeKeys(), name => {
const value = attributes[name]
const isBool = isBoolean(value)
const needNesting = !isBool && shouldBeNested(value)
Expand Down

0 comments on commit a8e5452

Please sign in to comment.