Skip to content

Commit 6a8263e

Browse files
authored
Merge pull request #6841 from topcoder-platform/develop
Revert RDM submission download changes for further QA --> Prod
2 parents b19a9f9 + d84190a commit 6a8263e

File tree

17 files changed

+77
-76
lines changed

17 files changed

+77
-76
lines changed

.eslintrc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
"jsx-a11y/anchor-is-valid": false,
55
"import/no-cycle": [2, { "maxDepth": 1 }],
66
"react/forbid-prop-types": false,
7-
"react/no-unknown-property": false,
8-
"react/jsx-no-bind": false,
9-
"react/destructuring-assignment": false,
10-
"react/no-array-index-key": false
7+
"react/no-unknown-property": ["error", { "ignore": ["styleName"] }]
118
},
129
"env": {
1310
"browser": true

src/shared/components/Contentful/AppComponent/index.jsx

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,41 +18,59 @@ import PathSelector from 'components/MemberPath/PathSelector';
1818
const { fireErrorMessage } = errors;
1919

2020
export function AppComponentSwitch(appComponent) {
21-
if (appComponent.fields.type === 'TCO-Leaderboard') {
21+
const {
22+
fields: {
23+
type,
24+
theme,
25+
props,
26+
props: {
27+
leaderboardApiUrl,
28+
title,
29+
podiumSpots,
30+
isCopilot,
31+
hasChallengeHistory,
32+
tcoPointsApiUrl,
33+
memberLimit,
34+
isAlgo,
35+
},
36+
},
37+
sys: { id },
38+
} = appComponent;
39+
if (type === 'TCO-Leaderboard') {
2240
return (
2341
<Leaderboard
24-
id={appComponent.sys.id}
25-
apiUrl={appComponent.fields.props.leaderboardApiUrl}
26-
title={appComponent.fields.props.title}
27-
podiumSpots={appComponent.fields.props.podiumSpots}
28-
isCopilot={appComponent.fields.props.isCopilot}
29-
hasChallengeHistory={appComponent.fields.props.hasChallengeHistory}
30-
tcoPointsApiUrl={appComponent.fields.props.tcoPointsApiUrl}
31-
memberLimit={appComponent.fields.props.memberLimit}
32-
isAlgo={appComponent.fields.props.isAlgo}
33-
key={appComponent.sys.id}
34-
themeName={appComponent.fields.theme}
42+
id={id}
43+
apiUrl={leaderboardApiUrl}
44+
title={title}
45+
podiumSpots={podiumSpots}
46+
isCopilot={isCopilot}
47+
hasChallengeHistory={hasChallengeHistory}
48+
tcoPointsApiUrl={tcoPointsApiUrl}
49+
memberLimit={memberLimit}
50+
isAlgo={isAlgo}
51+
key={id}
52+
themeName={theme}
3553
/>
3654
);
3755
}
38-
if (appComponent.fields.type === 'RecruitCRM-Jobs') {
39-
return <RecruitCRMJobs {...appComponent.fields.props} key={appComponent.sys.id} />;
56+
if (type === 'RecruitCRM-Jobs') {
57+
return <RecruitCRMJobs {...props} key={id} />;
4058
}
41-
if (appComponent.fields.type === 'EmailSubscribeForm') {
42-
return <EmailSubscribeForm {...appComponent.fields.props} key={appComponent.sys.id} />;
59+
if (type === 'EmailSubscribeForm') {
60+
return <EmailSubscribeForm {...props} key={id} />;
4361
}
44-
if (appComponent.fields.type === 'GSheet') {
45-
return <GSheet {...appComponent.fields.props} key={appComponent.sys.id} />;
62+
if (type === 'GSheet') {
63+
return <GSheet {...props} key={id} />;
4664
}
47-
if (appComponent.fields.type === 'MemberPath') {
65+
if (type === 'MemberPath') {
4866
return (
4967
<PathSelector
50-
{...appComponent.fields.props}
51-
key={appComponent.sys.id}
68+
{...props}
69+
key={id}
5270
/>
5371
);
5472
}
55-
fireErrorMessage(`Unsupported app component type ${appComponent.fields.type}`, '');
73+
fireErrorMessage(`Unsupported app component type ${type}`, '');
5674
return null;
5775
}
5876

src/shared/components/Contentful/Viewport/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ export function ViewportLoader(props) {
272272
}
273273

274274
if (query) {
275-
queries.push({ ...props.query, content_type: 'viewport' });
275+
queries.push({ ...query, content_type: 'viewport' });
276276
}
277277

278278
return (

src/shared/components/Gigs/ReferralCode/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function ReferralCode(props) {
2525
const [growSurfState, setGrowSurfState] = useState(growSurf);
2626
const [copyBtnText, setCopyBtnText] = useState('COPY');
2727
useEffect(() => {
28-
setGrowSurfState(props.growSurf);
28+
setGrowSurfState(growSurf);
2929
}, [growSurf]);
3030

3131
return (

src/shared/components/Settings/Account/LinkedAccount/ExistingLink.jsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,15 @@ export default function ExistingLink(props) {
6464
return (
6565
<div role="link" styleName={`external-link-tile ${pending ? 'external-link-tile--pending' : ''}`} onClick={e => openLink(e, link)}>
6666
<div styleName="ext-link-tile_edit-header">
67-
<div role="button" onClick={e => onConfirmDeleteLink(e, link)} styleName={`ext-link-tile_edit-header_delete ${link.deleting ? 'ext-link-tile_edit-header_delete--disabled' : ''}`} prevent-event-propagation="true" />
67+
<div
68+
role="button"
69+
onClick={(e) => {
70+
e.preventDefault();
71+
e.stopPropagation();
72+
onConfirmDeleteLink(e, link);
73+
}}
74+
styleName={`ext-link-tile_edit-header_delete ${link.deleting ? 'ext-link-tile_edit-header_delete--disabled' : ''}`}
75+
/>
6876
</div>
6977
<div styleName="top">
7078
<div styleName="logo">
@@ -94,7 +102,7 @@ export default function ExistingLink(props) {
94102
<p className={!pending ? 'hidden' : ''} styleName="link-title">
95103
Loading data. This will take a few minutes.
96104
</p>
97-
<a styleName="link-url" id="link-url" href={prependProtocol(link.URL)} target="_blank" rel="noopener noreferrer" prevent-event-propagation="true">
105+
<a styleName="link-url" id="link-url" href={prependProtocol(link.URL)} target="_blank" rel="noopener noreferrer">
98106
{prependProtocol(link.URL)}
99107
</a>
100108
</div>

src/shared/components/challenge-detail/Header/TabSelector/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,9 +404,9 @@ export default function ChallengeViewSelector(props) {
404404
</div>
405405
<div styleName="sort-body">
406406
{
407-
sortOptions.map((option, index) => (
407+
sortOptions.map(option => (
408408
<div
409-
map={`sort-option-${index}`}
409+
key={`sort-option-${option.name}`}
410410
styleName="sort-item"
411411
onClick={() => {
412412
setSelectedSortOption(option.name);

src/shared/components/challenge-detail/Submissions/SubmissionRow/SubmissionHistoryRow/index.jsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ const { getService } = services.submissions;
2121

2222
export default function SubmissionHistoryRow({
2323
isMM,
24-
isRDM,
2524
submission,
2625
finalScore,
2726
provisionalScore,
@@ -82,7 +81,7 @@ export default function SubmissionHistoryRow({
8281
</div>
8382
</div>
8483
{
85-
isLoggedIn && (isMM || isRDM)
84+
isLoggedIn && isMM
8685
&& (numWinners > 0 || challengeStatus === CHALLENGE_STATUS.COMPLETED) && (
8786
<div styleName="col-2 col center">
8887
<div styleName="mobile-header">Action</div>
@@ -122,7 +121,6 @@ SubmissionHistoryRow.defaultProps = {
122121

123122
SubmissionHistoryRow.propTypes = {
124123
isMM: PT.bool.isRequired,
125-
isRDM: PT.bool.isRequired,
126124
submission: PT.number.isRequired,
127125
finalScore: PT.oneOfType([
128126
PT.number,

src/shared/components/challenge-detail/Submissions/SubmissionRow/index.jsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import SubmissionHistoryRow from './SubmissionHistoryRow';
1919
import style from './style.scss';
2020

2121
export default function SubmissionRow({
22-
isMM, isRDM, openHistory, member, submissions, score, toggleHistory, challengeStatus,
22+
isMM, openHistory, member, submissions, score, toggleHistory, challengeStatus,
2323
isReviewPhaseComplete, finalRank, provisionalRank, onShowPopup, rating, viewAsTable,
2424
numWinners, auth, isLoggedIn,
2525
}) {
@@ -166,8 +166,7 @@ export default function SubmissionRow({
166166
Time
167167
</div>
168168
{
169-
(isMM || isRDM)
170-
&& (numWinners > 0 || challengeStatus === CHALLENGE_STATUS.COMPLETED) && (
169+
isMM && (numWinners > 0 || challengeStatus === CHALLENGE_STATUS.COMPLETED) && (
171170
<div styleName="col-2 col center">
172171
Action
173172
</div>
@@ -186,7 +185,6 @@ export default function SubmissionRow({
186185
<SubmissionHistoryRow
187186
isReviewPhaseComplete={isReviewPhaseComplete}
188187
isMM={isMM}
189-
isRDM={isRDM}
190188
challengeStatus={challengeStatus}
191189
submission={submissions.length - index}
192190
{...submissionHistory}
@@ -226,7 +224,6 @@ SubmissionRow.defaultProps = {
226224

227225
SubmissionRow.propTypes = {
228226
isMM: PT.bool.isRequired,
229-
isRDM: PT.bool.isRequired,
230227
openHistory: PT.bool.isRequired,
231228
member: PT.string.isRequired,
232229
challengeStatus: PT.string.isRequired,

src/shared/components/challenge-detail/Submissions/index.jsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import React from 'react';
77
import PT from 'prop-types';
88
import moment from 'moment';
9-
import { isMM as checkIsMM, isRDM as checkIsRDM } from 'utils/challenge';
9+
import { isMM as checkIsMM } from 'utils/challenge';
1010
import _ from 'lodash';
1111
import { connect } from 'react-redux';
1212
import { config } from 'topcoder-react-utils';
@@ -309,7 +309,6 @@ class SubmissionsComponent extends React.Component {
309309
} = challenge;
310310

311311
const isMM = this.isMM();
312-
const isRDM = checkIsRDM(challenge);
313312
const isLoggedIn = !_.isEmpty(auth.tokenV3);
314313
const isReviewPhaseComplete = this.checkIsReviewPhaseComplete();
315314

@@ -605,7 +604,7 @@ class SubmissionsComponent extends React.Component {
605604
}
606605
{
607606
((numWinners > 0 || challenge.status === CHALLENGE_STATUS.COMPLETED)
608-
&& (isMM || isRDM) && isLoggedIn) && (
607+
&& isMM && isLoggedIn) && (
609608
<div styleName="block-download-all">
610609
<button
611610
disabled={downloadingAll}
@@ -846,7 +845,6 @@ class SubmissionsComponent extends React.Component {
846845
submissions={sortedSubmissions}
847846
isReviewPhaseComplete={isReviewPhaseComplete}
848847
isMM={isMM}
849-
isRDM={isRDM}
850848
key={submission.member}
851849
{...submission}
852850
challengeStatus={challenge.status}

src/shared/components/challenge-detail/Winners/Winner/index.jsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ function getId(submissions, placement) {
1919
export default function Winner({
2020
isDesign,
2121
isMM,
22-
isRDM,
2322
prizes,
2423
submissions,
2524
viewable,
@@ -90,7 +89,7 @@ export default function Winner({
9089
</div>
9190
<div styleName="download-container">
9291
{
93-
((!winner.submissionDownloadLink || !viewable) && (isMM || isRDM) && isLoggedIn) && (
92+
((!winner.submissionDownloadLink || !viewable) && isMM && isLoggedIn) && (
9493
<button
9594
onClick={() => {
9695
// download submission
@@ -146,7 +145,6 @@ Winner.defaultProps = {
146145
Winner.propTypes = {
147146
isDesign: PT.bool.isRequired,
148147
isMM: PT.bool.isRequired,
149-
isRDM: PT.bool.isRequired,
150148
prizes: PT.arrayOf(PT.shape()),
151149
submissions: PT.arrayOf(PT.object).isRequired,
152150
viewable: PT.bool.isRequired,

src/shared/components/challenge-detail/Winners/index.jsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ export default function Winners({
2222
viewable,
2323
isDesign,
2424
isMM,
25-
isRDM,
2625
isLoggedIn,
2726
auth,
2827
challengeStatus,
@@ -32,7 +31,7 @@ export default function Winners({
3231
<div styleName="container">
3332
{
3433
((winners.length > 0 || challengeStatus === CHALLENGE_STATUS.COMPLETED)
35-
&& (isMM || isRDM) && isLoggedIn) && (
34+
&& isMM && isLoggedIn) && (
3635
<div styleName="block-download-all">
3736
<button
3837
disabled={downloadingAll}
@@ -81,7 +80,6 @@ export default function Winners({
8180
<Winner
8281
isDesign={isDesign}
8382
isMM={isMM}
84-
isRDM={isRDM}
8583
key={`${w.handle}-${w.placement}`}
8684
prizes={prizes}
8785
submissions={submissions}
@@ -103,7 +101,6 @@ Winners.defaultProps = {
103101
viewable: false,
104102
isDesign: false,
105103
isMM: false,
106-
isRDM: false,
107104
isLoggedIn: false,
108105
challengeStatus: '',
109106
};
@@ -115,7 +112,6 @@ Winners.propTypes = {
115112
viewable: PT.bool,
116113
isDesign: PT.bool,
117114
isMM: PT.bool,
118-
isRDM: PT.bool,
119115
isLoggedIn: PT.bool,
120116
challengeStatus: PT.string,
121117
auth: PT.shape().isRequired,

src/shared/components/challenge-listing/ChallengeCard/Prize/index.jsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import PT from 'prop-types';
88
import React from 'react';
9-
import Tooltip from 'components/Tooltip';
9+
import Tooltip from '../../../Tooltip';
1010
import Tip from './Tip';
1111
import './style.scss';
1212

@@ -35,11 +35,6 @@ export default function Prize({
3535
</div>
3636
);
3737

38-
function placeArrow(TooltipNode) {
39-
const arrow = TooltipNode.querySelector('.rc-tooltip-arrow');
40-
arrow.style.left = '33%';
41-
}
42-
4338
const component = (
4439
<div
4540
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
@@ -48,7 +43,13 @@ export default function Prize({
4843
>
4944
{((onlyShowTooltipForPrize && !withoutTooltip)
5045
? (
51-
<Tooltip content={tip} placeArrow={placeArrow}>
46+
<Tooltip
47+
content={tip}
48+
placeArrow={(TooltipNode) => {
49+
const arrow = TooltipNode.querySelector('.rc-tooltip-arrow');
50+
arrow.style.left = '33%';
51+
}}
52+
>
5253
{prizeUI}
5354
</Tooltip>
5455
)

src/shared/components/tc-communities/AccessDenied/index.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export default function AccessDenied(props) {
2424
spaceName,
2525
environment,
2626
viewportId,
27+
children,
2728
} = props;
2829

2930
if (viewportId) {
@@ -67,7 +68,7 @@ export default function AccessDenied(props) {
6768
<div styleName="msg">
6869
You are not authorized to access this page.
6970
</div>
70-
{props.children}
71+
{children}
7172
</div>
7273
);
7374
case CAUSE.HAVE_NOT_SUBMITTED_TO_THE_CHALLENGE:

src/shared/components/tc-communities/communities/wipro/Home/index.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ const settings = {
123123
export default function Home(props) {
124124
const {
125125
userId,
126+
resetChallengeListing,
126127
} = props;
127128

128129
return (
@@ -199,7 +200,7 @@ export default function Home(props) {
199200
>
200201
<div styleName="ImageTextStyles.linkWrap style.linkWrap">
201202
<Link
202-
onClick={() => props.resetChallengeListing()}
203+
onClick={() => resetChallengeListing()}
203204
styleName="ImageTextStyles.link"
204205
to="challenges?communityId="
205206
>

src/shared/containers/ErrorIcons/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ function Tip({ errors, clear }) {
2525
&#10799;
2626
</a>
2727
{
28-
errors.map(({ title, message }, i) => (
29-
<div key={i.toString()} styleName="item">
28+
errors.map(({ title, message }) => (
29+
<div key={`${title}-${message}`} styleName="item">
3030
<div styleName="title" title={title}>
3131
{title}
3232
</div>

0 commit comments

Comments
 (0)