Skip to content

Commit 9629a8f

Browse files
committed
feat: subSection type "portal" supports "hiddenCondition" and "hiddenOnEdit"
Now when portal subSection type shows section it take into account if original section is not hidden by condition or hiddenOnEdit This is to support issue #3281
1 parent 8ac9009 commit 9629a8f

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/projects/detail/components/PortalSubSection.jsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,22 @@ const PortalSubSection = ({
2626
removeAttachment,
2727
canManageAttachments,
2828
attachmentsStorePath,
29+
isCreation,
2930
}) => (
3031
<div>
3132
{content.map(({ sectionIndex }) => {
3233
if (sectionIndex !== -1 && template && template.sections[sectionIndex]) {
3334
const section = template.sections[sectionIndex]
35+
36+
if (
37+
// hide if section is hidden by condition
38+
_.get(section, '__wizard.hiddenByCondition') ||
39+
// hide section in edit mode, if it should be hidden on edit
40+
!isCreation && section.hiddenOnEdit
41+
) {
42+
return null
43+
}
44+
3445
return (
3546
<SpecSection
3647
key={'portal-' + (section.id || `section-${sectionIndex}`)}

src/projects/detail/components/SpecSection.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,8 @@ const SpecSection = props => {
369369
dirtyProject,
370370
currentWizardStep,
371371
productTemplates,
372-
productCategories
372+
productCategories,
373+
isCreation
373374
}}
374375
/>
375376
)

0 commit comments

Comments
 (0)