From da6131b06df99aecbb399cdfea231785a8ccc4ec Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Mon, 6 Apr 2020 18:00:48 +0800 Subject: [PATCH 1/2] add navigation option --- .circleci/config.yml | 4 ++-- .../tc-communities/AccessDenied/index.jsx | 3 +++ src/shared/containers/SubmissionPage.jsx | 15 ++++++++++++--- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5902d4597d..625f77c4fd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -174,7 +174,7 @@ workflows: filters: branches: only: - - develop + - hot-fix-submit-blank # This is alternate dev env for parallel testing - "build-test": context : org-global @@ -189,7 +189,7 @@ workflows: filters: branches: only: - - develop + - notifications-analytics # Production builds are exectuted only on tagged commits to the # master branch. - "build-prod": diff --git a/src/shared/components/tc-communities/AccessDenied/index.jsx b/src/shared/components/tc-communities/AccessDenied/index.jsx index 7e76e9e018..61923073f6 100644 --- a/src/shared/components/tc-communities/AccessDenied/index.jsx +++ b/src/shared/components/tc-communities/AccessDenied/index.jsx @@ -67,6 +67,7 @@ export default function AccessDenied(props) {
You are not authorized to access this page.
+ {props.children} ); case CAUSE.HAVE_NOT_SUBMITTED_TO_THE_CHALLENGE: @@ -94,6 +95,7 @@ AccessDenied.defaultProps = { spaceName: null, environment: null, viewportId: null, + children: null, }; AccessDenied.propTypes = { @@ -103,4 +105,5 @@ AccessDenied.propTypes = { spaceName: PT.string, environment: PT.string, viewportId: PT.string, + children: PT.node, }; diff --git a/src/shared/containers/SubmissionPage.jsx b/src/shared/containers/SubmissionPage.jsx index a74be9674e..6051bdc0f0 100644 --- a/src/shared/containers/SubmissionPage.jsx +++ b/src/shared/containers/SubmissionPage.jsx @@ -8,6 +8,7 @@ */ import actions from 'actions/page/submission'; import communityActions from 'actions/tc-communities'; +import { PrimaryButton } from 'topcoder-react-ui-kit'; import shortId from 'shortid'; import React from 'react'; import PT from 'prop-types'; @@ -50,9 +51,17 @@ class SubmissionsPageContainer extends React.Component { } render() { - const { registrants, handle } = this.props; + const { registrants, handle, challengeId } = this.props; const isRegistered = registrants.find(r => _.toString(r.handle) === _.toString(handle)); - if (!isRegistered) return ; + if (!isRegistered) { + return ( + + + Go to Challenge Details + + + ); + } return ( { allPhases: state.challenge.details.allPhases, communitiesList: state.tcCommunities.list, /* Older stuff below. */ - userId: state.auth.user.userId, + userId: state.auth.user ? state.auth.user.userId : '', challengeId: state.challenge.details.id, challengeName: state.challenge.details.name, challengesUrl: ownProps.challengesUrl, From 8236e6ea3fc7bc2c0bddba5c63fcd7ee9c53b5f6 Mon Sep 17 00:00:00 2001 From: LieutenantRoger Date: Mon, 6 Apr 2020 19:21:06 +0800 Subject: [PATCH 2/2] trigger test --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 625f77c4fd..1561519152 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -175,6 +175,7 @@ workflows: branches: only: - hot-fix-submit-blank + - develop # This is alternate dev env for parallel testing - "build-test": context : org-global