diff --git a/packages/app/src/components/views/Details.tsx b/packages/app/src/components/views/Details.tsx index 03eaac2e3..50eea68b3 100644 --- a/packages/app/src/components/views/Details.tsx +++ b/packages/app/src/components/views/Details.tsx @@ -15,7 +15,7 @@ configResponsive({ middle: 800, large: 1200, }); -function toGroups(fields: any[]) { +function toGroups(fields: any[], { displayFields = [] }) { const groups = []; let group = { title: undefined, @@ -23,6 +23,9 @@ function toGroups(fields: any[]) { children: [], }; fields.forEach(field => { + if (Array.isArray(displayFields) && displayFields.length && displayFields.indexOf(field.id) === -1) { + return null; + } if (field.interface === 'description' && group.children.length) { groups.push(group); group = { @@ -72,7 +75,7 @@ export function Details(props: any) { } } const { displayFields = [] } = activeTab; - const groups = toGroups(fields); + const groups = toGroups(fields, { displayFields }); console.log({groups}); return (