Skip to content

Commit

Permalink
CORE-1967 Minor metadata template form refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
psarando committed Feb 29, 2024
1 parent d030330 commit eb3c1ec
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/components/metadata/templates/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -680,10 +680,7 @@ const MetadataTemplateView = (props) => {
attributes
.filter((attribute) => attribute.required)
.forEach((attribute) => {
if (
avus.filter((avu) => avu.attr === attribute.name)
.length < 1
) {
if (!avus.find((avu) => avu.attr === attribute.name)) {
avus.push(newAVU(attribute));
}

Expand Down Expand Up @@ -825,12 +822,11 @@ const MetadataTemplateView = (props) => {
const attrTemplate = attributeMap[avu.attr];

const isNumberAttr =
attrTemplate &&
(attrTemplate.type === AttributeTypes.NUMBER ||
attrTemplate.type === AttributeTypes.INTEGER);
attrTemplate?.type === AttributeTypes.NUMBER ||
attrTemplate?.type === AttributeTypes.INTEGER;

const isGroupingAttr =
attrTemplate && attrTemplate.type === AttributeTypes.GROUPING;
attrTemplate?.type === AttributeTypes.GROUPING;

const hasChildAVUs = avu.avus && avu.avus.length > 0;

Expand Down

0 comments on commit eb3c1ec

Please sign in to comment.