- {
- hasRegistered && documents && documents.length > 0 && (
-
)
}
- {shareable && (
+ {/* {shareable && (
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')
- && (
-
-
-
- Sub communities
-
-
-
-
- )
- }
-
{
isRecommendedChallengesVisible && _.get(auth, 'user.userId')
&& (
@@ -707,10 +511,6 @@ FiltersPanel.defaultProps = {
};
FiltersPanel.propTypes = {
- communityFilters: PT.arrayOf(PT.shape({
- communityId: PT.string.isRequired,
- communityName: PT.string.isRequired,
- })).isRequired,
defaultCommunityId: PT.string.isRequired,
activeBucket: PT.string.isRequired,
filterState: PT.shape().isRequired,
diff --git a/src/shared/components/challenge-listing/Filters/FiltersPanel/style.scss b/src/shared/components/challenge-listing/Filters/FiltersPanel/style.scss
index 286cab3266..1d1cb846f7 100644
--- a/src/shared/components/challenge-listing/Filters/FiltersPanel/style.scss
+++ b/src/shared/components/challenge-listing/Filters/FiltersPanel/style.scss
@@ -21,7 +21,6 @@
margin: 16px 0 16px 0;
border-radius: 24px;
border: 1.5px solid #137d60;
- text-transform: uppercase;
@include xs-to-md {
display: block;
@@ -411,6 +410,7 @@
.checkboxes {
display: flex;
flex-wrap: wrap;
+ flex-direction: column;
width: 100%;
justify-content: space-between;
gap: 18px;
@@ -492,7 +492,7 @@
@include sm-to-md {
width: 100%;
display: flex;
- flex-direction: row;
+ flex-direction: column;
justify-content: space-between;
}
}
diff --git a/src/shared/components/challenge-listing/Listing/Bucket/index.jsx b/src/shared/components/challenge-listing/Listing/Bucket/index.jsx
index 5c1fd07350..22a21d39bc 100644
--- a/src/shared/components/challenge-listing/Listing/Bucket/index.jsx
+++ b/src/shared/components/challenge-listing/Listing/Bucket/index.jsx
@@ -49,6 +49,7 @@ export default function Bucket({
setSort,
sort,
userId,
+ auth,
expandedTags,
expandTag,
activeBucket,
@@ -65,6 +66,8 @@ export default function Bucket({
};
const activeSort = sort || 'startDate';
+ const roles = _.get(auth, 'user.roles');
+
// const sortedChallenges = activeBucket === 'all' ?
// _.clone(challenges.slice(0, 10)) : _.clone(challenges);
let sortedChallenges;
@@ -79,17 +82,19 @@ export default function Bucket({
}
let filteredChallenges = sortedChallenges;
- filteredChallenges = sortedChallenges.filter((ch) => {
- if (ch.type === 'Task'
- && ch.task
- && ch.task.isTask
- && ch.task.isAssigned
- && Number(ch.task.memberId) !== Number(userId)) {
- return null;
- }
- return ch;
- });
+ if (!_.includes(roles, 'administrator')) {
+ filteredChallenges = sortedChallenges.filter((ch) => {
+ if (ch.type === 'Task'
+ && ch.task
+ && ch.task.isTask
+ && ch.task.isAssigned
+ && Number(ch.task.memberId) !== Number(userId)) {
+ return null;
+ }
+ return ch;
+ });
+ }
// sortedChallenges.sort(Sort[activeSort].func);
// const bucketQuery = qs.stringify({
@@ -276,6 +281,7 @@ Bucket.defaultProps = {
openChallengesInNewTabs: false,
sort: null,
userId: '',
+ auth: {},
expandedTags: [],
expandTag: null,
activeBucket: '',
@@ -306,6 +312,7 @@ Bucket.propTypes = {
setSort: PT.func.isRequired,
sort: PT.string,
userId: PT.number,
+ auth: PT.shape(),
expandedTags: PT.arrayOf(PT.number),
expandTag: PT.func,
activeBucket: PT.string,
diff --git a/src/shared/components/challenge-listing/Listing/index.jsx b/src/shared/components/challenge-listing/Listing/index.jsx
index 6392d2db5a..badc681731 100644
--- a/src/shared/components/challenge-listing/Listing/index.jsx
+++ b/src/shared/components/challenge-listing/Listing/index.jsx
@@ -197,6 +197,7 @@ function Listing({
setSort={sort => setSort(bucket, sort)}
sort={sorts[bucket]}
userId={_.get(auth, 'user.userId')}
+ auth={auth}
activeBucket={activeBucket}
// searchTimestamp={searchTimestamp}
isLoggedIn={isLoggedIn}
diff --git a/src/shared/components/challenge-listing/Sidebar/BucketSelector/index.jsx b/src/shared/components/challenge-listing/Sidebar/BucketSelector/index.jsx
index db92ca637c..cdcd599307 100644
--- a/src/shared/components/challenge-listing/Sidebar/BucketSelector/index.jsx
+++ b/src/shared/components/challenge-listing/Sidebar/BucketSelector/index.jsx
@@ -127,7 +127,7 @@ export default function BucketSelector({
*/}
) : (
-
+
{getBucket(BUCKETS.ALL_PAST)}
{isAuth ? getBucket(BUCKETS.MY_PAST) : null}
diff --git a/src/shared/components/tc-communities/communities/iot/AssetDetail/index.jsx b/src/shared/components/tc-communities/communities/iot/AssetDetail/index.jsx
index c48929453f..35f9fc5a54 100644
--- a/src/shared/components/tc-communities/communities/iot/AssetDetail/index.jsx
+++ b/src/shared/components/tc-communities/communities/iot/AssetDetail/index.jsx
@@ -10,7 +10,7 @@ import PT from 'prop-types';
import { PrimaryButton } from 'topcoder-react-ui-kit';
import JoinSection from '../JoinSection';
-import ShareSocial from './ShareSocial';
+// import ShareSocial from './ShareSocial';
import './styles.scss';
import assetsData from '../Assets/data/predix-assets.json';
@@ -113,7 +113,7 @@ export default function AssetDetail({
-
+ {/*
*/}
diff --git a/src/shared/containers/Dashboard/ChallengesFeed.jsx b/src/shared/containers/Dashboard/ChallengesFeed.jsx
index acbc707914..113aa5881c 100644
--- a/src/shared/containers/Dashboard/ChallengesFeed.jsx
+++ b/src/shared/containers/Dashboard/ChallengesFeed.jsx
@@ -76,7 +76,7 @@ ChallengesFeedContainer.defaultProps = {
excludeTags: [],
title: 'Opportunities',
challengeListingQuery: undefined,
- tracks: ['DES', 'DEV', 'DS', 'QA'],
+ tracks: [],
};
ChallengesFeedContainer.propTypes = {
diff --git a/src/shared/containers/Gigs/RecruitCRMJobDetails.jsx b/src/shared/containers/Gigs/RecruitCRMJobDetails.jsx
index 8ec55e9b0e..130c84073e 100644
--- a/src/shared/containers/Gigs/RecruitCRMJobDetails.jsx
+++ b/src/shared/containers/Gigs/RecruitCRMJobDetails.jsx
@@ -10,33 +10,9 @@ import GigDetails from 'components/Gigs/GigDetails';
import PT from 'prop-types';
import React from 'react';
import { connect } from 'react-redux';
-import { config } from 'topcoder-react-utils';
-import fetch from 'isomorphic-fetch';
import RecruitCRMJobApply from './RecruitCRMJobApply';
-const PROXY_ENDPOINT = `${config.URL.COMMUNITY_APP}/api`;
-
class RecruitCRMJobDetailsContainer extends React.Component {
- constructor(props) {
- super(props);
-
- this.state = {
- isReferrSucess: false,
- formErrors: {},
- formData: {
- body: `Hey there!
-
-Topcoder has a freelance gig that I thought you would be interested in. If you get the gig, I could earn cash!
-
-Check it out:
-${config.URL.BASE}${config.GIGS_PAGES_PATH}/${props.id}`,
- },
- };
-
- this.onSendClick = this.onSendClick.bind(this);
- this.onReferralDone = this.onReferralDone.bind(this);
- }
-
componentDidMount() {
const {
getJob,
@@ -49,136 +25,6 @@ ${config.URL.BASE}${config.GIGS_PAGES_PATH}/${props.id}`,
}
}
- /**
- * Send gig referral invite
- */
- async onSendClick(email) {
- const {
- profile, growSurf, tokenV3,
- } = this.props;
- const { formData } = this.state;
- // should not be able to send emails to themselves
- if (profile.email === email) {
- this.setState({
- isReferrError: {
- message: 'You are not allowed to send to yourself.',
- userError: true,
- },
- });
- // exit no email sending
- return;
- }
- // check if email is already referred?
- const growCheck = await fetch(`${PROXY_ENDPOINT}/growsurf/participant/${email}`);
- if (growCheck.status === 200) {
- const growCheckData = await growCheck.json();
- if (growCheckData.referrer) {
- this.setState({
- isReferrError: {
- message: `${email} has already been referred.`,
- userError: true,
- },
- });
- // exit no email sending
- return;
- }
- }
- // // email the invite
- const res = await fetch(`${PROXY_ENDPOINT}/mailchimp/email`, {
- method: 'POST',
- body: JSON.stringify({
- personalizations: [
- {
- to: [{ email }],
- subject: `${profile.firstName} ${profile.lastName} Thinks This Topcoder Gig Is For You!`,
- },
- ],
- from: { email: 'noreply@topcoder.com', name: `${profile.firstName} ${profile.lastName} via Topcoder Gigwork` },
- content: [{
- type: 'text/plain', value: `${formData.body}?referralId=${growSurf.data.id}`,
- }],
- }),
- headers: {
- 'Content-Type': 'application/json',
- },
- redirect: 'follow',
- });
- if (res.status >= 300) {
- this.setState({
- isReferrError: await res.json(),
- });
- // exit no email tracking due to the error
- return;
- }
- // process sent log
- let { emailInvitesLog, emailInvitesStatus } = growSurf.data.metadata;
- if (!emailInvitesLog) emailInvitesLog = '';
- // check if email is in sent log alredy?
- const foundInLog = emailInvitesLog.indexOf(email);
- // only when email is new - put it in log, update counters and etc.
- if (foundInLog === -1) {
- // parse the log to array of emails
- if (emailInvitesLog.length) {
- emailInvitesLog = emailInvitesLog.split(',');
- } else emailInvitesLog = [];
- // prepare growSurf update payload
- // we keep only 10 emails in the log to justify program rules
- if (emailInvitesLog.length < 10) {
- emailInvitesLog.push(email);
- }
- // Auto change status when 10 emails sent
- if (emailInvitesLog.length === 10 && emailInvitesStatus !== 'Paid' && emailInvitesStatus !== 'Payment Pending') {
- emailInvitesStatus = 'Payment Pending';
- }
- // put the tracking update in growsurf
- const updateRed = await fetch(`${PROXY_ENDPOINT}/growsurf/participant/${growSurf.data.id}`, {
- method: 'PATCH',
- headers: {
- 'Content-Type': 'application/json',
- Authorization: `Bearer ${tokenV3}`,
- },
- body: JSON.stringify({
- ...growSurf.data,
- metadata: {
- ...growSurf.data.metadata,
- emailInvitesSent: Number(growSurf.data.metadata.emailInvitesSent || 0) + 1,
- emailInvitesLog: emailInvitesLog.join(),
- emailInvitesStatus,
- },
- }),
- });
- if (updateRed.status >= 300) {
- this.setState({
- isReferrError: await updateRed.json(),
- });
- // exit no email tracking due to the error
- // just notify the user about it
- return;
- }
- }
- // finally do:
- this.setState({
- isReferrSucess: true,
- });
- }
-
- /**
- * Reset the form when referral done
- */
- onReferralDone(refresh = false) {
- if (refresh) {
- window.location.reload(false);
- return;
- }
- const { formData } = this.state;
- delete formData.email;
- this.setState({
- isReferrSucess: false,
- isReferrError: false,
- formData,
- });
- }
-
render() {
const {
loading,
@@ -186,15 +32,7 @@ ${config.URL.BASE}${config.GIGS_PAGES_PATH}/${props.id}`,
isApply,
application,
profile,
- growSurf,
} = this.props;
- const {
- formErrors,
- formData,
- isReferrSucess,
- isReferrError,
- // referralId,
- } = this.state;
if (loading) {
return
;
@@ -207,13 +45,6 @@ ${config.URL.BASE}${config.GIGS_PAGES_PATH}/${props.id}`,
job={job}
application={application}
profile={profile}
- onSendClick={this.onSendClick}
- isReferrSucess={isReferrSucess}
- formErrors={formErrors}
- formData={formData}
- isReferrError={isReferrError}
- onReferralDone={this.onReferralDone}
- growSurf={growSurf}
/>
);
}
@@ -223,8 +54,6 @@ RecruitCRMJobDetailsContainer.defaultProps = {
job: {},
application: null,
profile: {},
- growSurf: {},
- tokenV3: null,
};
RecruitCRMJobDetailsContainer.propTypes = {
@@ -235,21 +64,16 @@ RecruitCRMJobDetailsContainer.propTypes = {
isApply: PT.bool.isRequired,
application: PT.shape(),
profile: PT.shape(),
- growSurf: PT.shape(),
- tokenV3: PT.string,
};
function mapStateToProps(state, ownProps) {
const data = state.recruitCRM[ownProps.id];
const profile = state.auth && state.auth.profile ? { ...state.auth.profile } : {};
- const { growSurf } = state;
return {
job: data ? data.job : {},
loading: data ? data.loading : true,
application: data ? data.application : null,
profile,
- growSurf,
- tokenV3: state.auth ? state.auth.tokenV3 : null,
};
}
diff --git a/src/shared/containers/GigsPages/index.jsx b/src/shared/containers/GigsPages/index.jsx
index 757d3167e9..bcb33d4a4e 100644
--- a/src/shared/containers/GigsPages/index.jsx
+++ b/src/shared/containers/GigsPages/index.jsx
@@ -15,9 +15,7 @@ import { connect } from 'react-redux';
import _ from 'lodash';
import { v4 as uuidv4 } from 'uuid';
import { getQuery } from 'utils/url';
-import ReferralCode from 'components/Gigs/ReferralCode';
import ChallengeTab from 'components/challenge-listing/ChallengeTab';
-import actions from 'actions/growSurf';
import './style.scss';
@@ -32,9 +30,6 @@ function GigsPagesContainer(props) {
const {
match,
profile,
- growSurf,
- getReferralId,
- tokenV3,
history,
location,
} = props;
@@ -46,12 +41,6 @@ function GigsPagesContainer(props) {
optProfile.attributes.TC_Handle = profile.handle;
optProfile.attributes.HomeCountryCode = profile.homeCountryCode;
optProfile.attributes.email = profile.email;
- // trigger referral id fetching when profile is loaded
- if (isomorphy.isClientSide()) {
- if (_.isEmpty(growSurf) || (!growSurf.loading && !growSurf.data && !growSurf.error)) {
- getReferralId(profile, tokenV3);
- }
- }
} else if (isomorphy.isClientSide()) {
const idCookie = cookies.get('_tc.aid');
if (idCookie) {
@@ -115,7 +104,6 @@ window._chatlio = window._chatlio||[];
{
!id && !type ? (
-
{
- dispatch(a.getReferralidInit());
- dispatch(a.getReferralidDone(profile, tokenV3));
- },
};
}
export default connect(
mapStateToProps,
- mapDispatchToActions,
)(GigsPagesContainer);
diff --git a/src/shared/containers/challenge-listing/Listing/index.jsx b/src/shared/containers/challenge-listing/Listing/index.jsx
index 2bd205796c..c37c9d9b0b 100644
--- a/src/shared/containers/challenge-listing/Listing/index.jsx
+++ b/src/shared/containers/challenge-listing/Listing/index.jsx
@@ -687,11 +687,6 @@ export class ListingContainer extends React.Component {
reviewOpportunities={reviewOpportunities}
setFilterState={(state) => {
setFilter(state);
- // if (activeBucket === BUCKETS.SAVED_FILTER) {
- // selectBucket(BUCKETS.OPEN_FOR_REGISTRATION);
- // } else if (activeBucket === BUCKETS.SAVED_REVIEW_OPPORTUNITIES_FILTER) {
- // selectBucket(BUCKETS.REVIEW_OPPORTUNITIES);
- // }
}}
setSort={setSort}
sorts={sorts}
diff --git a/src/shared/reducers/growSurf.js b/src/shared/reducers/growSurf.js
deleted file mode 100644
index 9ee65bb740..0000000000
--- a/src/shared/reducers/growSurf.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Reducer for state.growSurf
- */
-import _ from 'lodash';
-import actions from 'actions/growSurf';
-import { handleActions } from 'redux-actions';
-
-/**
- * Handles getReferralIdInit action.
- * @param {Object} state Previous state.
- */
-function onInit(state, { payload }) {
- return {
- ...state,
- ...payload,
- };
-}
-
-/**
- * Handles getReferralIdDone action.
- * @param {Object} state Previous state.
- * @param {Object} action The action.
- */
-function onDone(state, { payload }) {
- return {
- ...state,
- loading: false,
- data: payload.data,
- error: payload.error || false,
- };
-}
-
-/**
- * Creates mmleaderboard reducer with the specified initial state.
- * @param {Object} state Optional. If not given, the default one is
- * generated automatically.
- * @return {Function} Reducer.
- */
-function create(state = {}) {
- return handleActions({
- [actions.growsurf.getReferralidInit]: onInit,
- [actions.growsurf.getReferralidDone]: onDone,
- }, _.defaults(state, {
- loading: false,
- }));
-}
-
-/* Reducer with the default initial state. */
-export default create();
diff --git a/src/shared/reducers/index.js b/src/shared/reducers/index.js
index a3172cc2a6..f5e9782065 100644
--- a/src/shared/reducers/index.js
+++ b/src/shared/reducers/index.js
@@ -43,7 +43,6 @@ import tcoLeaderboards from './tco/leaderboards';
import recruitCRM from './recruitCRM';
import gSheet from './gSheet';
import timelineWall from './timelineWall';
-import growSurf from './growSurf';
import thrive from './contentful/thrive';
import dashboard from './dashboard';
import blog from './blog';
@@ -181,7 +180,6 @@ export function factory(req) {
recruitCRM,
mmLeaderboard,
gSheet,
- growSurf,
thrive,
tcoLeaderboards,
dashboard,
diff --git a/src/shared/utils/url.js b/src/shared/utils/url.js
index 89d676b59f..7c20194b5b 100644
--- a/src/shared/utils/url.js
+++ b/src/shared/utils/url.js
@@ -215,7 +215,7 @@ export const getSubPageConfiguration = (location, loginUserHandle) => {
}
if (url.includes('/challenges')) {
- toolName = 'Activity Feed';
+ toolName = 'Opportunities';
toolRoot = '/challenges';
loginRedirect = '/challenges';
type = 'tool';