diff --git a/.circleci/config.yml b/.circleci/config.yml index 9a24c6244f..23b1d90989 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -244,7 +244,7 @@ workflows: filters: branches: only: - - issue-5041 + - free # This is beta env for production soft releases - "build-prod-beta": context : org-global diff --git a/src/shared/components/challenge-detail/Header/TabSelector/index.jsx b/src/shared/components/challenge-detail/Header/TabSelector/index.jsx index 98df8985c4..4a3c73e159 100644 --- a/src/shared/components/challenge-detail/Header/TabSelector/index.jsx +++ b/src/shared/components/challenge-detail/Header/TabSelector/index.jsx @@ -36,6 +36,9 @@ export default function ChallengeViewSelector(props) { const numOfSub = numOfSubmissions + (numOfCheckpointSubmissions || 0); const forumId = _.get(challenge, 'legacy.forumId') || 0; + const discuss = _.get(challenge, 'discussions', []).filter(d => ( + d.type === 'challenge' && !_.isEmpty(d.url) + )); const roles = _.get(challenge, 'userDetails.roles') || []; const isDesign = trackLower === 'design'; @@ -174,13 +177,27 @@ export default function ChallengeViewSelector(props) { ) : null } { (hasRegistered || Boolean(roles.length)) - && ( - - CHALLENGE FORUM - + && _.isEmpty(discuss) + ? ( + + CHALLENGE FORUM + + ) : ( + discuss.map(d => ( + + CHALLENGE DISCUSSION + + )) ) } diff --git a/src/shared/components/challenge-detail/Specification/SideBar/index.jsx b/src/shared/components/challenge-detail/Specification/SideBar/index.jsx index 5b4fe7aa2c..7b65735a5e 100644 --- a/src/shared/components/challenge-detail/Specification/SideBar/index.jsx +++ b/src/shared/components/challenge-detail/Specification/SideBar/index.jsx @@ -21,6 +21,7 @@ export default function SideBar({ eventDetail, shareable, forumLink, + discuss, hasRegistered, reviewType, isDesign, @@ -324,10 +325,31 @@ export default function SideBar({

Questions? ‌ - - Ask in the Challenge Discussion Forums. - + {_.isEmpty(discuss) && ( + + Ask in the Challenge Discussion Forums. + + )}

+ {!_.isEmpty(discuss) && ( + + )}

SOURCE FILES:

@@ -429,6 +451,7 @@ export default function SideBar({ SideBar.defaultProps = { eventDetail: null, + discuss: [], documents: undefined, hasRegistered: false, reviewType: 'COMMUNITY', @@ -454,6 +477,7 @@ SideBar.propTypes = { documents: PT.arrayOf(PT.shape()), shareable: PT.bool.isRequired, forumLink: PT.string.isRequired, + discuss: PT.arrayOf(PT.shape()), hasRegistered: PT.bool, reviewType: PT.string, isDesign: PT.bool, diff --git a/src/shared/components/challenge-detail/Specification/index.jsx b/src/shared/components/challenge-detail/Specification/index.jsx index 9f5608931a..8f2f18d150 100644 --- a/src/shared/components/challenge-detail/Specification/index.jsx +++ b/src/shared/components/challenge-detail/Specification/index.jsx @@ -76,6 +76,10 @@ export default function ChallengeDetailsView(props) { codeRepo = codeRepoData.value; } + const discuss = _.get(challenge, 'discussions', []).filter(d => ( + d.type === 'challenge' && !_.isEmpty(d.url) + )); + let forumLink = track.toLowerCase() === 'design' ? `/?module=ThreadList&forumID=${forumId}` : `/?module=Category&categoryID=${forumId}`; @@ -351,6 +355,7 @@ export default function ChallengeDetailsView(props) { challengesUrl={challengesUrl} legacyId={legacyId} forumLink={forumLink} + discuss={discuss} documents={documents} hasRegistered={hasRegistered} isDesign={track.toLowerCase() === 'design'}