diff --git a/__tests__/shared/components/challenge-listing/Filters/__snapshots__/FiltersPanel.jsx.snap b/__tests__/shared/components/challenge-listing/Filters/__snapshots__/FiltersPanel.jsx.snap index 280226c6bf..558ab5ccde 100644 --- a/__tests__/shared/components/challenge-listing/Filters/__snapshots__/FiltersPanel.jsx.snap +++ b/__tests__/shared/components/challenge-listing/Filters/__snapshots__/FiltersPanel.jsx.snap @@ -171,46 +171,6 @@ exports[`Matches shallow shapshot 2`] = ` /> -
-
- - -
- { - const copyhelper = document.createElement('input'); - copyhelper.className = 'copyhelper'; - document.body.appendChild(copyhelper); - copyhelper.value = `https://www.topcoder.com/gigs/${job.slug}?referralId=${growSurf.data.id}`; - copyhelper.select(); - document.execCommand('copy'); - document.body.removeChild(copyhelper); - setCopyBtnText('COPIED'); - setTimeout(() => { - setCopyBtnText('COPY'); - }, 3000); - }} - > - {copyBtnText} - -
- Share on:   - - - - - - - - - -
-
- - ) : ( -
- Share this job on:   - - - - - - - - - -
- ) - } -
-
- or -
-
-

Refer someone to this gig and earn $500. Just add their email below. See how it works.

-
- setreferrEmail(e.target.value)} ref={ref => refEmailInput = ref} /> - -
-
SUBSCRIBE TO WEEKLY GIG UPDATES
@@ -256,27 +161,6 @@ function GigDetails(props) {
If you have any questions or doubts, don’t hesitate to email gigwork@topcoder.com.
-
- { - isModalOpen - && ( - { - onReferralDone(); - setModalOpen(false); - }} - isReferrSucess={isReferrSucess} - isReferrError={isReferrError} - referralId={growSurf && growSurf.data ? growSurf.data.id : null} - onReferralDone={() => { - onReferralDone(true); - setModalOpen(false); - }} - /> - ) - } -
{ isLoginModalOpen && setLoginModalOpen(false)} /> } @@ -292,19 +176,12 @@ function GigDetails(props) { GigDetails.defaultProps = { application: null, profile: {}, - growSurf: {}, - isReferrError: null, }; GigDetails.propTypes = { job: PT.shape().isRequired, application: PT.shape(), profile: PT.shape(), - onSendClick: PT.func.isRequired, - isReferrSucess: PT.bool.isRequired, - isReferrError: PT.shape(), - onReferralDone: PT.func.isRequired, - growSurf: PT.shape(), }; function mapStateToProps(state) { diff --git a/src/shared/components/Gigs/GigDetails/style.scss b/src/shared/components/Gigs/GigDetails/style.scss index 63e6036d04..145ecf9e39 100644 --- a/src/shared/components/Gigs/GigDetails/style.scss +++ b/src/shared/components/Gigs/GigDetails/style.scss @@ -31,10 +31,6 @@ @include primaryBtn; } -.referral { - display: flex; -} - .container { max-width: $screen-lg; min-height: 50vh; diff --git a/src/shared/components/Gigs/ReferralCode/index.jsx b/src/shared/components/Gigs/ReferralCode/index.jsx deleted file mode 100644 index 1de0976d45..0000000000 --- a/src/shared/components/Gigs/ReferralCode/index.jsx +++ /dev/null @@ -1,120 +0,0 @@ -/* eslint-disable max-len */ -/** - * Connects the Redux store to the GigsPages component. - */ -import React, { useState, useEffect } from 'react'; -import PT from 'prop-types'; -import _ from 'lodash'; -import { PrimaryButton } from 'topcoder-react-ui-kit'; -import LoadingIndicator from 'components/LoadingIndicator'; -import tc from 'components/buttons/themed/tc.scss'; -import ReferralModal from '../ReferralModal'; -import defautlStyle from './style.scss'; - -/** Themes for buttons - * those overwrite PrimaryButton style to match achieve various styles. - * Should implement pattern of classes. - */ -const buttonThemes = { - tc, -}; - -function ReferralCode(props) { - const { profile, growSurf } = props; - const [loginModalOpen, setLoginModalOpen] = useState(false); - const [growSurfState, setGrowSurfState] = useState(growSurf); - const [copyBtnText, setCopyBtnText] = useState('COPY'); - useEffect(() => { - setGrowSurfState(growSurf); - }, [growSurf]); - - return ( -
- { - _.isEmpty(profile) ? ( - Topcoder Referral Program: - ) : ( - Topcoder Referral Program: - ) - } - { - _.isEmpty(profile) ? ( - - Do you know someone who is perfect for a gig? You could earn $500 for referring them! - { - setLoginModalOpen(true); - }} - theme={{ - button: buttonThemes.tc['primary-borderless-sm'], - }} - > - REFER A FRIEND - - { - loginModalOpen - && ( - setLoginModalOpen(false)} - isReferrSucess={false} - isReferrError={false} - onReferralDone={() => { }} - /> - ) - } - - ) : ( - - Your referral link: - { - growSurfState.loading && - } - { - growSurfState.data && ( -
- {`https://www.topcoder.com/gigs?referralId=${growSurfState.data.id}`} - { - const copyhelper = document.createElement('input'); - copyhelper.className = 'copyhelper'; - document.body.appendChild(copyhelper); - copyhelper.value = `https://www.topcoder.com/gigs?referralId=${growSurfState.data.id}`; - copyhelper.select(); - document.execCommand('copy'); - document.body.removeChild(copyhelper); - setCopyBtnText('COPIED'); - setTimeout(() => { - setCopyBtnText('COPY'); - }, 3000); - }} - theme={{ - button: buttonThemes.tc['primary-borderless-xs'], - }} - > - {copyBtnText} - -
- ) - } - { - growSurfState.error && Oops, we couldn't load your profile. Please try again later or contact support. - } -
- ) - } -
- ); -} - -ReferralCode.defaultProps = { - profile: {}, - growSurf: {}, -}; - -ReferralCode.propTypes = { - profile: PT.shape(), - growSurf: PT.shape(), -}; - -export default ReferralCode; diff --git a/src/shared/components/Gigs/ReferralCode/style.scss b/src/shared/components/Gigs/ReferralCode/style.scss deleted file mode 100644 index 3c35b10fef..0000000000 --- a/src/shared/components/Gigs/ReferralCode/style.scss +++ /dev/null @@ -1,107 +0,0 @@ -.container, -.containerWithLink { - display: flex; - background-image: linear-gradient(97.21deg, #2984bd 0%, #0ab88a 100%); - border-radius: 10px; - width: 100%; - max-width: 1280px; - margin: 30px auto 0; - align-items: center; - padding: 13px 25px 11px; - - @media screen and (max-width: 1280px) { - margin: 30px 15px 0; - width: auto; - } - - @media screen and (max-width: 768px) { - flex-direction: column; - align-items: flex-start; - } - - .title { - font-weight: bold; - color: #fff; - font-family: Roboto, sans-serif; - font-size: 18px; - margin-right: 5px; - - @media screen and (max-width: 768px) { - margin-bottom: 10px; - } - } - - span { - font-family: Roboto, sans-serif; - font-size: 18px; - color: #fff; - line-height: 22px; - margin-right: 5px; - } - - button { - margin-left: 10px !important; - - &:hover { - margin-left: 10px !important; - } - - @media screen and (max-width: 768px) { - margin: 10px 0 0 !important; - - &:hover { - margin: 10px 0 0 !important; - } - } - } - - .rondedArea { - border: 1px solid rgba(255, 255, 255, 0.4); - border-radius: 2px; - height: 35px; - display: flex; - align-items: center; - padding: 0 12px; - - @media screen and (max-width: 768px) { - max-width: 100%; - flex-direction: column; - align-items: flex-start; - position: relative; - width: 100%; - height: auto; - padding: 6px; - margin-bottom: 40px; - } - - span { - white-space: nowrap; - - @media screen and (max-width: 768px) { - max-width: 100%; - display: block; - overflow: auto; - margin-right: 0; - } - } - - button { - @media screen and (max-width: 768px) { - position: absolute; - bottom: -30px; - margin: 0 !important; - left: 0; - } - } - } -} - -.containerWithLink { - padding: 10px 25px 9px; - - svg { - width: 34px; - height: 34px; - margin: initial; - } -} diff --git a/src/shared/components/Gigs/ReferralModal/index.jsx b/src/shared/components/Gigs/ReferralModal/index.jsx deleted file mode 100644 index 82f4d3c998..0000000000 --- a/src/shared/components/Gigs/ReferralModal/index.jsx +++ /dev/null @@ -1,137 +0,0 @@ -/* eslint-disable max-len */ -/** - * The modal used for gig referral flow - */ - -/* global window */ - -import { isEmpty } from 'lodash'; -import PT from 'prop-types'; -import React from 'react'; -import { Modal, PrimaryButton } from 'topcoder-react-ui-kit'; -import { config, Link } from 'topcoder-react-utils'; -import tc from 'components/buttons/themed/tc.scss'; -import LoadingIndicator from 'components/LoadingIndicator'; -import modalStyle from './modal.scss'; - -/** Themes for buttons - * those overwrite PrimaryButton style to match achieve various styles. - * Should implement pattern of classes. - */ -const buttonThemes = { - tc, -}; - -// help article link -const HELP_INFO_LINK = '/community/gig-referral'; - -function ReferralModal({ - profile, - onCloseButton, - isReferrSucess, - isReferrError, - referralId, - onReferralDone, -}) { - const retUrl = window.location.href; - return ( - - { !isEmpty(profile) ? ( -
- { - referralId && !isReferrError && !isReferrSucess && ( -
-

Sending your referral...

- -
- ) - } - { - isReferrSucess ? ( -
-

CONGRATULATIONS!

-

Your referral has been sent.

-
- - CLOSE - - FIND ANOTHER GIG -
-
- ) : null - } - { - isReferrError ? ( -
-

OOPS!

-

{isReferrError.message}

- { - isReferrError.userError ? ( -

If you think this is an error please contact support@topcoder.com.

- ) : ( -

Looks like there is a problem on our end. Please try again.
If this persists please contact support@topcoder.com.

- ) - } -
- - CLOSE - - FIND ANOTHER GIG -
-
- ) : null - } -
- ) : ( -
-

REFERRAL PROGRAM

-

Please login to receive your referral code.

-
- { - window.location = `${config.URL.AUTH}/member?retUrl=${encodeURIComponent(retUrl)}`; - }} - theme={{ - button: buttonThemes.tc['primary-green-md'], - }} - > - LOGIN - - REGISTER -
-

Find out how the referral program works here.

-
- )} -
- ); -} - -ReferralModal.defaultProps = { - profile: null, - referralId: null, - isReferrError: null, -}; - -ReferralModal.propTypes = { - profile: PT.shape(), - onCloseButton: PT.func.isRequired, - isReferrSucess: PT.bool.isRequired, - isReferrError: PT.shape(), - referralId: PT.string, - onReferralDone: PT.func.isRequired, -}; - -export default ReferralModal; diff --git a/src/shared/components/Gigs/ReferralModal/modal.scss b/src/shared/components/Gigs/ReferralModal/modal.scss deleted file mode 100644 index ec36a10e32..0000000000 --- a/src/shared/components/Gigs/ReferralModal/modal.scss +++ /dev/null @@ -1,133 +0,0 @@ -/* stylelint-disable no-descending-specificity */ -@import "~styles/mixins"; -@import "~components/Contentful/default"; - -.container { - padding: 0; - width: auto; - max-width: 95vw; - height: auto; - max-height: 95vh; - border-radius: 10px; - display: flex; - flex-direction: column; - justify-content: center; - - @include gui-kit-headers; - @include gui-kit-content; - - .title { - color: #1e94a3; - font-family: BarlowCondensed, sans-serif; - font-size: 34px; - line-height: 38px; - font-weight: 500; - margin: 0; - margin-bottom: 20px; - } - - .loginMsg { - color: #2a2a2a; - font-size: 24px; - line-height: 36px; - margin-bottom: 40px; - } - - .ctaButtons { - display: flex; - align-content: center; - justify-content: center; - - & > button:first-child { - margin-right: 10px !important; - } - - & > a:first-child { - margin-right: 10px !important; - } - } - - .referrals { - display: flex; - overflow: auto; - - .sucessMsg { - font-size: 24px; - line-height: 36px; - margin-bottom: 40px; - } - - .rightAlign { - justify-content: flex-end; - } - - .referrForm { - display: flex; - flex-direction: column; - padding: 60px 84px 40px; - min-width: 618px; - - @include xs-to-sm { - padding: 20px; - width: 90vw; - min-width: auto; - } - - h3 { - margin-bottom: 12px; - text-align: center; - } - - .margin { - margin-top: 10px; - } - - :global { - textarea { - height: 250px; - } - } - - .ctaButtons { - justify-content: flex-end; - margin-top: 20px; - } - } - } - - .loginRequired, - .referrSucess { - display: flex; - flex-direction: column; - padding: 100px 80px; - text-align: center; - - @include xs-to-sm { - padding: 50px 40px; - } - - .loginMsg { - font-size: 20px; - } - - .regTxt { - font-size: 14px; - margin: 10px 0 0; - } - - .ctaButtons { - @include xs-to-sm { - flex-direction: column; - - > button { - margin: 0 0 20px !important; - } - } - } - } -} - -.overlay { - background-color: #2a2a2a; - opacity: 0.95; -} diff --git a/src/shared/components/challenge-detail/Header/TabSelector/style.scss b/src/shared/components/challenge-detail/Header/TabSelector/style.scss index 720a0601ab..48ccb3f99c 100644 --- a/src/shared/components/challenge-detail/Header/TabSelector/style.scss +++ b/src/shared/components/challenge-detail/Header/TabSelector/style.scss @@ -36,7 +36,6 @@ color: $tco-black; font-size: 14px; line-height: 20px; - text-transform: uppercase; padding-left: 16px; padding-top: 10px; } @@ -111,7 +110,6 @@ color: #555; font-size: 14px; line-height: 20px; - text-transform: uppercase; padding-left: 16px; padding-top: 10px; } diff --git a/src/shared/components/challenge-detail/Header/index.jsx b/src/shared/components/challenge-detail/Header/index.jsx index 6d7783e857..a7426e0d7c 100644 --- a/src/shared/components/challenge-detail/Header/index.jsx +++ b/src/shared/components/challenge-detail/Header/index.jsx @@ -424,13 +424,13 @@ export default function ChallengeHeader(props) { {hasRegistered ? ( Unregister @@ -452,6 +452,7 @@ export default function ChallengeHeader(props) { disabled={disabled} theme={{ button: disabled ? style.submitButtonDisabled : style.submitButton }} to={`${challengesUrl}/${challengeId}/submit`} + forceA > Submit a solution @@ -474,7 +475,7 @@ export default function ChallengeHeader(props) { to={`${topcrowdLink}`} styleName="topcrowd-container" > - View details on Topcoder plaform + View details on Topcoder platform )} diff --git a/src/shared/components/challenge-detail/Header/style.scss b/src/shared/components/challenge-detail/Header/style.scss index c8b98c2439..920ba155e7 100644 --- a/src/shared/components/challenge-detail/Header/style.scss +++ b/src/shared/components/challenge-detail/Header/style.scss @@ -29,6 +29,7 @@ } .challenge-ops-container button, +.challenge-ops-container a, .challenge-ops-container div { margin: 0 !important; } @@ -75,58 +76,22 @@ } } -.challenge-ops-container .unregisterButton { - @include button-styles; - - color: #137d60 !important; - border: 2px solid #137d60 !important; - background: #fff !important; - - @include xs-to-sm { - width: fit-content; - } -} - -.challenge-ops-container .unregisterButtonDisabled { - @include button-styles; - - color: #767676 !important; - border: 2px solid #f4f4f4; - background: #fff !important; - - @include xs-to-sm { - width: fit-content; - } -} - .challenge-ops-container .submitButton:hover, +.challenge-ops-container .unregisterButton:hover, .challenge-ops-container .registerBtn:hover { color: #fff !important; background: #219174 !important; border-color: #219174 !important; } -.challenge-ops-container .unregisterButton:hover { - color: #219174 !important; - border-color: #219174 !important; - background: #fff !important; -} - .challenge-ops-container .submitButton:active, +.challenge-ops-container .unregisterButton:active, .challenge-ops-container .registerBtn:active { color: #fff !important; background: #0d664e !important; border-color: #0d664e !important; } -.challenge-ops-container .unregisterButton:active { - outline: none !important; - box-shadow: none !important; - color: #0d664e !important; - border-color: #0d664e !important; - background: #fff !important; -} - .challenge-ops-container .submitButton:focus, .challenge-ops-container .submitButton:focus-within, .challenge-ops-container .submitButton:focus-visible { @@ -165,6 +130,7 @@ justify-content: center; div, + button, a { width: fit-content !important; } @@ -298,14 +264,12 @@ height: 20px; display: flex; align-items: center; - text-transform: uppercase; &.link { @include roboto-bold; cursor: pointer; color: #137d60; - text-transform: uppercase; font-weight: 700; } diff --git a/src/shared/components/challenge-detail/Specification/SideBar/index.jsx b/src/shared/components/challenge-detail/Specification/SideBar/index.jsx index 01c9e84dcc..fef4ed762f 100644 --- a/src/shared/components/challenge-detail/Specification/SideBar/index.jsx +++ b/src/shared/components/challenge-detail/Specification/SideBar/index.jsx @@ -11,19 +11,17 @@ import { config } from 'topcoder-react-utils'; import TooltipIcon from 'assets/images/tooltip-info.svg'; import EligibleEvents from './EligibleEvents'; -import ShareSocial from './ShareSocial'; +// import ShareSocial from './ShareSocial'; import styles from './styles.scss'; export default function SideBar({ challengesUrl, legacyId, - documents, eventDetail, - shareable, + // shareable, forumLink, discuss, - hasRegistered, reviewType, isDesign, terms, @@ -116,29 +114,6 @@ export default function SideBar({ return (
- { - hasRegistered && documents && documents.length > 0 && ( -
-

- DOWNLOADS: -

-
    - { - documents.map((doc) => { - const url = `${config.URL.COMMUNITY}/tc?module=DownloadDocument&docid=${doc.documentId}`; - return ( -
  • - - {doc.documentName} - -
  • - ); - }) - } -
-
- ) - }

Learn @@ -497,14 +472,14 @@ export default function SideBar({

) } - {shareable && ( + {/* {shareable && (

Share

- )} + )} */} {legacyId && (

ID: {legacyId}

@@ -518,8 +493,6 @@ export default function SideBar({ SideBar.defaultProps = { eventDetail: null, discuss: [], - documents: undefined, - hasRegistered: false, reviewType: 'COMMUNITY', isDesign: false, terms: [], @@ -541,11 +514,9 @@ SideBar.propTypes = { eventName: PT.string.isRequired, description: PT.string.isRequired, }), - documents: PT.arrayOf(PT.shape()), - shareable: PT.bool.isRequired, + // shareable: PT.bool.isRequired, forumLink: PT.string.isRequired, discuss: PT.arrayOf(PT.shape()), - hasRegistered: PT.bool, reviewType: PT.string, isDesign: PT.bool, terms: PT.arrayOf(PT.shape()), diff --git a/src/shared/components/challenge-detail/Specification/index.jsx b/src/shared/components/challenge-detail/Specification/index.jsx index a838e6e218..73cf3c1d87 100644 --- a/src/shared/components/challenge-detail/Specification/index.jsx +++ b/src/shared/components/challenge-detail/Specification/index.jsx @@ -28,7 +28,6 @@ export default function ChallengeDetailsView(props) { const { communitiesList, terms, - hasRegistered, challenge, challengesUrl, savingChallenge, @@ -44,7 +43,6 @@ export default function ChallengeDetailsView(props) { descriptionFormat, legacy, legacyId, - documents, userDetails, metadata, events, @@ -56,7 +54,6 @@ export default function ChallengeDetailsView(props) { reviewScorecardId, screeningScorecardId, forumId, - selfService, } = legacy; let stockArtValue = ''; @@ -231,38 +228,6 @@ export default function ChallengeDetailsView(props) { description && (
- { - selfService && ( -

- - On Demand Challenges are customer-initiated single round design challenges. - -
- Please note the following important information for Topcoder competitors who participate in this challenge: -

    -
  • Any communication needed, should be done directly with the customer in the Challenge Forum.
  • -
  • In order to pass challenge screening and review, all challenge requirements and requested screens must be completed as described below.
  • -
  • Submission source files must be created with the application(s) listed in the requirements.
  • -
  • There will be no appeals or final fixes.
  • -
  • The challenge winner selections will be based upon completed requirements and associated Topcoder review scoring.
  • -
-
- - REQUEST MARVEL PROTOTYPES HERE: - -
- - Request Marvel for On Demand Challenges - -
- - DO NOT request Marvel access in the challenge forum with the customer. - -
- Figma or XD Prototypes are acceptable for submissions created with those applications. -

- ) - }

Challenge Summary

@@ -378,16 +343,14 @@ export default function ChallengeDetailsView(props) {

- For employees of Wipro Technologies, following are the - payment terms. Winner/s would be awarded the prize money on - successful completion and acceptance of the submission by - the stakeholder. Accumulated prize money for the month will - be paid through Wipro payroll as part of subsequent month’s - salary (eg. Aug month challenge winners payment will be - credited as part Sept month salary). For payment of prize - money, respective country currency conversion shall be - considered as per Wipro standard currency conversion - guidelines. + For employees of Wipro Technologies, following are the payment terms. + Winner(s) will be awarded the reward money/Winner Circle Points (WCPs) on + successful completion and acceptance of the submission by the stakeholder. + Accumulated reward money for the month will be paid through Wipro payroll as part of subsequent + month’s salary (eg. Aug month challenge winners payment will be credited as part of Sept month salary). + WCPs will be credited to winner’s WCP wallet in 3-4 weeks post challenge closure. + For payment of reward money/WCPs, respective country currency conversion will be + considered as per Wipro standard currency conversion guidelines.

@@ -400,14 +363,12 @@ export default function ChallengeDetailsView(props) { legacyId={legacyId} forumLink={forumLink} discuss={discuss} - documents={documents} - hasRegistered={hasRegistered} isDesign={track.toLowerCase() === 'design'} isDevelop={track.toLowerCase() === 'development'} eventDetail={_.isEmpty(events) ? null : events[0]} isMM={isMM(challenge)} terms={terms} - shareable={_.isEmpty(groups)} + // shareable={_.isEmpty(groups)} environment={environment} codeRepo={codeRepo} metadata={metadata} @@ -441,7 +402,6 @@ ChallengeDetailsView.defaultProps = { ChallengeDetailsView.propTypes = { terms: PT.arrayOf(PT.shape()), - hasRegistered: PT.bool.isRequired, challenge: PT.shape({ description: PT.string, descriptionFormat: PT.string, diff --git a/src/shared/components/challenge-detail/Specification/styles.scss b/src/shared/components/challenge-detail/Specification/styles.scss index d753cf581a..13db0603c5 100644 --- a/src/shared/components/challenge-detail/Specification/styles.scss +++ b/src/shared/components/challenge-detail/Specification/styles.scss @@ -1,6 +1,12 @@ @import "~styles/mixins"; $tc-link-visited: #0c4e98; +*:not(br) + h1, +*:not(br) + h2, +*:not(br) + h3 { + margin-top: 40px; +} + .container { border-radius: 0 0 (3 * $corner-radius) (3 * $corner-radius); } @@ -97,7 +103,6 @@ $tc-link-visited: #0c4e98; color: $tc-black; line-height: 25px; margin: (5 * $base-unit) 0 0; - text-transform: uppercase; } h4 { @@ -274,7 +279,6 @@ $tc-link-visited: #0c4e98; color: $tc-black; line-height: 25px; margin: (5 * $base-unit) 0 0; - text-transform: uppercase; } h4 { @@ -444,3 +448,24 @@ $tc-link-visited: #0c4e98; max-width: 95vw; } } + +article { + > *:first-child { + margin-top: 0; + } +} + +a[href*="/talent-routes/details"] { + width: fit-content; + padding: 11px 23px 11px 19px; + border: 1px solid $color-link-blue-dark; + border-radius: 3px; + font-weight: 500; + text-decoration: none; + display: flex; + gap: 8px; + + &:hover { + text-decoration: none; + } +} diff --git a/src/shared/components/challenge-detail/Submissions/index.jsx b/src/shared/components/challenge-detail/Submissions/index.jsx index 6e64161058..377259daaa 100644 --- a/src/shared/components/challenge-detail/Submissions/index.jsx +++ b/src/shared/components/challenge-detail/Submissions/index.jsx @@ -102,6 +102,31 @@ class SubmissionsComponent extends React.Component { } } + /** + * Returns the value of the "Initial Score" shown on the submissions tab + * We have to check a couple things because sometimes we're running code challenges that + * likely should be marathon matches (PS-295), so the logic is a bit more complex. + * + * We want to show provisional scores _during_ Innovation Challenges, even if run + * as a code challenge, with MM scoring, but for a normal code challenge we don't + * want to show provisional review scores until the challenge completes, so that + * competitors don't have access to scores during appeals. + * + * @param {Object} submission The submission to return the score for + */ + getInitialScore(submission) { + let score = 'N/A'; + const { challenge } = this.props; + if (!_.isEmpty(submission.review) + && !_.isEmpty(submission.review[0]) + && submission.review[0].score + && (challenge.status === 'Completed' + || (_.includes(challenge.tags, 'Innovation Challenge') && _.find(challenge.metadata, { name: 'show_data_dashboard' })))) { + score = Number(submission.review[0].score).toFixed(2); + } + return score; + } + /** * Check if it have flag for first try * @param {Object} registrant registrant info @@ -209,6 +234,10 @@ class SubmissionsComponent extends React.Component { if (isHaveFinalScore) { valueA = getFinalScore(a); valueB = getFinalScore(b); + } else if (valueA.score || valueB.score) { + // Handle MM formatted scores in a code challenge (PS-295) + valueA = Number(valueA.score); + valueB = Number(valueB.score); } else { valueA = !_.isEmpty(a.review) && a.review[0].score; valueB = !_.isEmpty(b.review) && b.review[0].score; @@ -904,11 +933,7 @@ class SubmissionsComponent extends React.Component {
INITIAL SCORE

- { - (!_.isEmpty(s.review) && !_.isEmpty(s.review[0]) && s.review[0].score && challenge.status === 'Completed') - ? Number(s.review[0].score).toFixed(2) - : 'N/A' - } + {this.getInitialScore(s)}

@@ -981,6 +1006,7 @@ SubmissionsComponent.propTypes = { registrants: PT.any, status: PT.string.isRequired, phases: PT.any, + metadata: PT.arrayOf(PT.object), }).isRequired, toggleSubmissionHistory: PT.func.isRequired, submissionHistoryOpen: PT.shape({}).isRequired, diff --git a/src/shared/components/challenge-listing/ChallengeCard/Status/index.jsx b/src/shared/components/challenge-listing/ChallengeCard/Status/index.jsx index 8110f76e14..503718e85e 100644 --- a/src/shared/components/challenge-listing/ChallengeCard/Status/index.jsx +++ b/src/shared/components/challenge-listing/ChallengeCard/Status/index.jsx @@ -61,7 +61,6 @@ export default function ChallengeStatus(props) { newChallengeDetails, selectChallengeDetailsTab, openChallengesInNewTabs, - userId, isLoggedIn, } = props; @@ -242,9 +241,13 @@ export default function ChallengeStatus(props) { if (statusPhase) phaseMessage = statusPhase.name; else if (status === 'Draft') phaseMessage = DRAFT_MSG; - const users = challenge.users || {}; + const showRegisterInfo = false; - const showRegisterInfo = (challenge.currentPhaseNames || []).includes('Registration') && !users[userId]; + // NOTE: the commented code below can be used to turn the "Register" button + // back on from the challenge listing page, if we ever want that again. + // This was turned off (set to always false above) via a change request in TOP-1549 + // const showRegisterInfo = (challenge.currentPhaseNames || []) + // .includes('Registration') && !users[userId]; return (
@@ -316,7 +319,6 @@ ChallengeStatus.defaultProps = { detailLink: '', openChallengesInNewTabs: false, className: '', - userId: '', }; ChallengeStatus.propTypes = { @@ -327,6 +329,5 @@ ChallengeStatus.propTypes = { openChallengesInNewTabs: PT.bool, // eslint-disable-line react/no-unused-prop-types selectChallengeDetailsTab: PT.func.isRequired, className: PT.string, - userId: PT.number, isLoggedIn: PT.bool.isRequired, }; diff --git a/src/shared/components/challenge-listing/Filters/FiltersPanel/index.jsx b/src/shared/components/challenge-listing/Filters/FiltersPanel/index.jsx index 465cf491a4..6824c03d36 100644 --- a/src/shared/components/challenge-listing/Filters/FiltersPanel/index.jsx +++ b/src/shared/components/challenge-listing/Filters/FiltersPanel/index.jsx @@ -24,11 +24,10 @@ import _ from 'lodash'; import React, { useState, useEffect } from 'react'; import PT from 'prop-types'; -import Select from 'components/Select'; import DateRangePicker from 'components/DateRangePicker'; import moment from 'moment'; import Tooltip from 'components/Tooltip'; -import { config, Link } from 'topcoder-react-utils'; +import { config } from 'topcoder-react-utils'; import { COMPOSE, PRIORITY } from 'react-css-super-themr'; import { REVIEW_OPPORTUNITY_TYPES } from 'utils/tc'; import { isFilterEmpty, isPastBucket, BUCKETS } from 'utils/challenge-listing/buckets'; @@ -36,18 +35,15 @@ import SwitchWithLabel from 'components/SwitchWithLabel'; import ChallengeSearchBar from 'containers/challenge-listing/ChallengeSearchBar'; import { challenge as challengeUtils } from 'topcoder-react-lib'; import { createStaticRanges } from 'utils/challenge-listing/date-range'; -import ArrowIcon from 'assets/images/ico-arrow-down.svg'; import CircleIcon from 'assets/images/icon-circle.svg'; import Button from '../Button'; import UiSimpleRemove from '../../Icons/ui-simple-remove.svg'; import BucketSelector from '../../Sidebar/BucketSelector'; -import CheckmarkIcon from './CheckmarkIcon'; import style from './style.scss'; const Filter = challengeUtils.filter; export default function FiltersPanel({ - communityFilters, defaultCommunityId, filterState, // challenges, @@ -92,156 +88,10 @@ export default function FiltersPanel({ ); } - const isVisitorRegisteredToCommunity = (visitorGroupIds, communityGroupIds) => Boolean( - _.intersection(visitorGroupIds, communityGroupIds).length, - ); - // const isAllBucket = activeBucket === BUCKETS.ALL; - const getLabel = (community) => { - const { communityName } = community; - if (!isAuth) { - return ( -
- {communityName} -
- ); - } - - // eslint-disable-next-line max-len - const visitorGroupIds = (auth.profile && auth.profile.groups) ? auth.profile.groups.map(g => g.id) : []; - const visitorRegisteredToCommunity = isVisitorRegisteredToCommunity( - visitorGroupIds, - community.groupIds, - ); - - const registrationStatus = visitorRegisteredToCommunity - ? ( -
- Registered -
- ) - : ( -
- You are - {' '} - - not - - {' '} - registered. - { - const url = community.mainSubdomain ? ( - config.URL.BASE.replace(/www/, community.mainSubdomain) - ) : `/community/${community.communityId}`; - window.open(url); - e.stopPropagation(); - e.preventDefault(); - }} - styleName="learn-more-link" - to="" - openInNewTab - > - Learn more - -
- ); - - // const filterFunction = Filter.getFilterFunction(community.challengeFilter); - // const challengesInCommunity = challenges.filter(filterFunction).length; - - const selectItem = ( -
-
-
-
- {communityName} -
- {visitorRegisteredToCommunity && ( -
- -
- )} -
-
- {communityName === 'All' - ? 'Select to see all challenges' - : registrationStatus} -
-
-
- {/* {challengesInCommunity} */} -
-
- ); - - if (communityName === 'All') { - return selectItem; - } - - return ( -
- -

- You are - { !visitorRegisteredToCommunity && ( - - NOT - - )} - {' '} - registered for this sub community. -

-

- There are - {/* {challengesInCommunity} */} - {' '} - challenges in this sub community -

-
- )} - > - {selectItem} - -
- ); - }; - - const mapCommunityOps = (community) => { - if (community.challengeFilter - && community.challengeFilter.events && community.challengeFilter.events.length) { - return `event_${community.challengeFilter.events[0]}`; - } - - return community.communityName === 'All' ? '' : community.groupIds[0]; - }; - - const communityOps = communityFilters.filter(community => ( - ((!community.hidden && !community.hideFilter) || community.communityName === 'All') && !community.communityName.includes('TCO') - )) - .map(community => ({ - label: community.communityName, - value: mapCommunityOps(community), - name: community.communityName, - data: getLabel(community), - })); - // const mapOps = item => ({ label: item, value: item }); const mapTypes = item => ({ label: item.name, value: item.abbreviation }); - const getCommunityOption = () => { - if (filterState.events && filterState.events.length) { - return `event_${filterState.events[0]}`; - } - if (filterState.groups && filterState.groups.length) { - return filterState.groups[0]; - } - return ''; - }; const isTrackOn = track => filterState.tracks && filterState.tracks[track]; @@ -572,52 +422,6 @@ export default function FiltersPanel({ ) : null } - { !isReviewOpportunitiesBucket && !(recommendedToggle && activeBucket === 'openForRegistration') - && ( -
-
- -