Skip to content

Commit 556879c

Browse files
committed
issue #2119 - Need support for hiding scope questions on creation wizard
1 parent 7360a78 commit 556879c

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/projects/create/components/ProjectBasicDetailsForm.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ class ProjectBasicDetailsForm extends Component {
9494
// TODO we shoudl not update the props (section is coming from props)
9595
// further, it is not used for this component as we are not rendering spec screen section here
9696
validate={() => {}}//dummy
97+
isCreation
9798
/>
9899
</div>
99100
<div className="section-footer section-footer-spec">

src/projects/detail/components/SpecSection.jsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ const SpecSection = props => {
7272
validate,
7373
sectionNumber,
7474
showHidden,
75+
isCreation,
7576
addAttachment,
7677
updateAttachment,
7778
removeAttachment,
@@ -238,7 +239,12 @@ const SpecSection = props => {
238239
<p className="gray-text">
239240
{description}
240241
</p>
241-
{subSections.filter((subSection) => showHidden || !subSection.hidden).map(renderSubSection)}
242+
{subSections.filter((subSection) => (
243+
// hide section marked with hiddenOnCreation during creation process
244+
(!isCreation || !subSection.hiddenOnCreation) &&
245+
// hide hidden section, unless we not force to show them
246+
(showHidden || !subSection.hidden)
247+
)).map(renderSubSection)}
242248
</div>
243249
</div>
244250
)
@@ -248,6 +254,7 @@ SpecSection.propTypes = {
248254
project: PropTypes.object.isRequired,
249255
sectionNumber: PropTypes.number.isRequired,
250256
showHidden: PropTypes.bool,
257+
isCreation: PropTypes.bool,
251258
addAttachment: PropTypes.func.isRequired,
252259
updateAttachment: PropTypes.func.isRequired,
253260
removeAttachment: PropTypes.func.isRequired,

0 commit comments

Comments
 (0)