Skip to content

Commit

Permalink
Merge pull request #6841 from topcoder-platform/develop
Browse files Browse the repository at this point in the history
Revert RDM submission download changes for further QA --> Prod
  • Loading branch information
jmgasper authored Mar 3, 2023
2 parents b19a9f9 + d84190a commit 6a8263e
Show file tree
Hide file tree
Showing 17 changed files with 77 additions and 76 deletions.
5 changes: 1 addition & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
"jsx-a11y/anchor-is-valid": false,
"import/no-cycle": [2, { "maxDepth": 1 }],
"react/forbid-prop-types": false,
"react/no-unknown-property": false,
"react/jsx-no-bind": false,
"react/destructuring-assignment": false,
"react/no-array-index-key": false
"react/no-unknown-property": ["error", { "ignore": ["styleName"] }]
},
"env": {
"browser": true
Expand Down
62 changes: 40 additions & 22 deletions src/shared/components/Contentful/AppComponent/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,41 +18,59 @@ import PathSelector from 'components/MemberPath/PathSelector';
const { fireErrorMessage } = errors;

export function AppComponentSwitch(appComponent) {
if (appComponent.fields.type === 'TCO-Leaderboard') {
const {
fields: {
type,
theme,
props,
props: {
leaderboardApiUrl,
title,
podiumSpots,
isCopilot,
hasChallengeHistory,
tcoPointsApiUrl,
memberLimit,
isAlgo,
},
},
sys: { id },
} = appComponent;
if (type === 'TCO-Leaderboard') {
return (
<Leaderboard
id={appComponent.sys.id}
apiUrl={appComponent.fields.props.leaderboardApiUrl}
title={appComponent.fields.props.title}
podiumSpots={appComponent.fields.props.podiumSpots}
isCopilot={appComponent.fields.props.isCopilot}
hasChallengeHistory={appComponent.fields.props.hasChallengeHistory}
tcoPointsApiUrl={appComponent.fields.props.tcoPointsApiUrl}
memberLimit={appComponent.fields.props.memberLimit}
isAlgo={appComponent.fields.props.isAlgo}
key={appComponent.sys.id}
themeName={appComponent.fields.theme}
id={id}
apiUrl={leaderboardApiUrl}
title={title}
podiumSpots={podiumSpots}
isCopilot={isCopilot}
hasChallengeHistory={hasChallengeHistory}
tcoPointsApiUrl={tcoPointsApiUrl}
memberLimit={memberLimit}
isAlgo={isAlgo}
key={id}
themeName={theme}
/>
);
}
if (appComponent.fields.type === 'RecruitCRM-Jobs') {
return <RecruitCRMJobs {...appComponent.fields.props} key={appComponent.sys.id} />;
if (type === 'RecruitCRM-Jobs') {
return <RecruitCRMJobs {...props} key={id} />;
}
if (appComponent.fields.type === 'EmailSubscribeForm') {
return <EmailSubscribeForm {...appComponent.fields.props} key={appComponent.sys.id} />;
if (type === 'EmailSubscribeForm') {
return <EmailSubscribeForm {...props} key={id} />;
}
if (appComponent.fields.type === 'GSheet') {
return <GSheet {...appComponent.fields.props} key={appComponent.sys.id} />;
if (type === 'GSheet') {
return <GSheet {...props} key={id} />;
}
if (appComponent.fields.type === 'MemberPath') {
if (type === 'MemberPath') {
return (
<PathSelector
{...appComponent.fields.props}
key={appComponent.sys.id}
{...props}
key={id}
/>
);
}
fireErrorMessage(`Unsupported app component type ${appComponent.fields.type}`, '');
fireErrorMessage(`Unsupported app component type ${type}`, '');
return null;
}

Expand Down
2 changes: 1 addition & 1 deletion src/shared/components/Contentful/Viewport/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ export function ViewportLoader(props) {
}

if (query) {
queries.push({ ...props.query, content_type: 'viewport' });
queries.push({ ...query, content_type: 'viewport' });
}

return (
Expand Down
2 changes: 1 addition & 1 deletion src/shared/components/Gigs/ReferralCode/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function ReferralCode(props) {
const [growSurfState, setGrowSurfState] = useState(growSurf);
const [copyBtnText, setCopyBtnText] = useState('COPY');
useEffect(() => {
setGrowSurfState(props.growSurf);
setGrowSurfState(growSurf);
}, [growSurf]);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,15 @@ export default function ExistingLink(props) {
return (
<div role="link" styleName={`external-link-tile ${pending ? 'external-link-tile--pending' : ''}`} onClick={e => openLink(e, link)}>
<div styleName="ext-link-tile_edit-header">
<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" />
<div
role="button"
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
onConfirmDeleteLink(e, link);
}}
styleName={`ext-link-tile_edit-header_delete ${link.deleting ? 'ext-link-tile_edit-header_delete--disabled' : ''}`}
/>
</div>
<div styleName="top">
<div styleName="logo">
Expand Down Expand Up @@ -94,7 +102,7 @@ export default function ExistingLink(props) {
<p className={!pending ? 'hidden' : ''} styleName="link-title">
Loading data. This will take a few minutes.
</p>
<a styleName="link-url" id="link-url" href={prependProtocol(link.URL)} target="_blank" rel="noopener noreferrer" prevent-event-propagation="true">
<a styleName="link-url" id="link-url" href={prependProtocol(link.URL)} target="_blank" rel="noopener noreferrer">
{prependProtocol(link.URL)}
</a>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,9 @@ export default function ChallengeViewSelector(props) {
</div>
<div styleName="sort-body">
{
sortOptions.map((option, index) => (
sortOptions.map(option => (
<div
map={`sort-option-${index}`}
key={`sort-option-${option.name}`}
styleName="sort-item"
onClick={() => {
setSelectedSortOption(option.name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const { getService } = services.submissions;

export default function SubmissionHistoryRow({
isMM,
isRDM,
submission,
finalScore,
provisionalScore,
Expand Down Expand Up @@ -82,7 +81,7 @@ export default function SubmissionHistoryRow({
</div>
</div>
{
isLoggedIn && (isMM || isRDM)
isLoggedIn && isMM
&& (numWinners > 0 || challengeStatus === CHALLENGE_STATUS.COMPLETED) && (
<div styleName="col-2 col center">
<div styleName="mobile-header">Action</div>
Expand Down Expand Up @@ -122,7 +121,6 @@ SubmissionHistoryRow.defaultProps = {

SubmissionHistoryRow.propTypes = {
isMM: PT.bool.isRequired,
isRDM: PT.bool.isRequired,
submission: PT.number.isRequired,
finalScore: PT.oneOfType([
PT.number,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import SubmissionHistoryRow from './SubmissionHistoryRow';
import style from './style.scss';

export default function SubmissionRow({
isMM, isRDM, openHistory, member, submissions, score, toggleHistory, challengeStatus,
isMM, openHistory, member, submissions, score, toggleHistory, challengeStatus,
isReviewPhaseComplete, finalRank, provisionalRank, onShowPopup, rating, viewAsTable,
numWinners, auth, isLoggedIn,
}) {
Expand Down Expand Up @@ -166,8 +166,7 @@ export default function SubmissionRow({
Time
</div>
{
(isMM || isRDM)
&& (numWinners > 0 || challengeStatus === CHALLENGE_STATUS.COMPLETED) && (
isMM && (numWinners > 0 || challengeStatus === CHALLENGE_STATUS.COMPLETED) && (
<div styleName="col-2 col center">
Action
</div>
Expand All @@ -186,7 +185,6 @@ export default function SubmissionRow({
<SubmissionHistoryRow
isReviewPhaseComplete={isReviewPhaseComplete}
isMM={isMM}
isRDM={isRDM}
challengeStatus={challengeStatus}
submission={submissions.length - index}
{...submissionHistory}
Expand Down Expand Up @@ -226,7 +224,6 @@ SubmissionRow.defaultProps = {

SubmissionRow.propTypes = {
isMM: PT.bool.isRequired,
isRDM: PT.bool.isRequired,
openHistory: PT.bool.isRequired,
member: PT.string.isRequired,
challengeStatus: PT.string.isRequired,
Expand Down
6 changes: 2 additions & 4 deletions src/shared/components/challenge-detail/Submissions/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import React from 'react';
import PT from 'prop-types';
import moment from 'moment';
import { isMM as checkIsMM, isRDM as checkIsRDM } from 'utils/challenge';
import { isMM as checkIsMM } from 'utils/challenge';
import _ from 'lodash';
import { connect } from 'react-redux';
import { config } from 'topcoder-react-utils';
Expand Down Expand Up @@ -309,7 +309,6 @@ class SubmissionsComponent extends React.Component {
} = challenge;

const isMM = this.isMM();
const isRDM = checkIsRDM(challenge);
const isLoggedIn = !_.isEmpty(auth.tokenV3);
const isReviewPhaseComplete = this.checkIsReviewPhaseComplete();

Expand Down Expand Up @@ -605,7 +604,7 @@ class SubmissionsComponent extends React.Component {
}
{
((numWinners > 0 || challenge.status === CHALLENGE_STATUS.COMPLETED)
&& (isMM || isRDM) && isLoggedIn) && (
&& isMM && isLoggedIn) && (
<div styleName="block-download-all">
<button
disabled={downloadingAll}
Expand Down Expand Up @@ -846,7 +845,6 @@ class SubmissionsComponent extends React.Component {
submissions={sortedSubmissions}
isReviewPhaseComplete={isReviewPhaseComplete}
isMM={isMM}
isRDM={isRDM}
key={submission.member}
{...submission}
challengeStatus={challenge.status}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ function getId(submissions, placement) {
export default function Winner({
isDesign,
isMM,
isRDM,
prizes,
submissions,
viewable,
Expand Down Expand Up @@ -90,7 +89,7 @@ export default function Winner({
</div>
<div styleName="download-container">
{
((!winner.submissionDownloadLink || !viewable) && (isMM || isRDM) && isLoggedIn) && (
((!winner.submissionDownloadLink || !viewable) && isMM && isLoggedIn) && (
<button
onClick={() => {
// download submission
Expand Down Expand Up @@ -146,7 +145,6 @@ Winner.defaultProps = {
Winner.propTypes = {
isDesign: PT.bool.isRequired,
isMM: PT.bool.isRequired,
isRDM: PT.bool.isRequired,
prizes: PT.arrayOf(PT.shape()),
submissions: PT.arrayOf(PT.object).isRequired,
viewable: PT.bool.isRequired,
Expand Down
6 changes: 1 addition & 5 deletions src/shared/components/challenge-detail/Winners/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export default function Winners({
viewable,
isDesign,
isMM,
isRDM,
isLoggedIn,
auth,
challengeStatus,
Expand All @@ -32,7 +31,7 @@ export default function Winners({
<div styleName="container">
{
((winners.length > 0 || challengeStatus === CHALLENGE_STATUS.COMPLETED)
&& (isMM || isRDM) && isLoggedIn) && (
&& isMM && isLoggedIn) && (
<div styleName="block-download-all">
<button
disabled={downloadingAll}
Expand Down Expand Up @@ -81,7 +80,6 @@ export default function Winners({
<Winner
isDesign={isDesign}
isMM={isMM}
isRDM={isRDM}
key={`${w.handle}-${w.placement}`}
prizes={prizes}
submissions={submissions}
Expand All @@ -103,7 +101,6 @@ Winners.defaultProps = {
viewable: false,
isDesign: false,
isMM: false,
isRDM: false,
isLoggedIn: false,
challengeStatus: '',
};
Expand All @@ -115,7 +112,6 @@ Winners.propTypes = {
viewable: PT.bool,
isDesign: PT.bool,
isMM: PT.bool,
isRDM: PT.bool,
isLoggedIn: PT.bool,
challengeStatus: PT.string,
auth: PT.shape().isRequired,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import PT from 'prop-types';
import React from 'react';
import Tooltip from 'components/Tooltip';
import Tooltip from '../../../Tooltip';
import Tip from './Tip';
import './style.scss';

Expand Down Expand Up @@ -35,11 +35,6 @@ export default function Prize({
</div>
);

function placeArrow(TooltipNode) {
const arrow = TooltipNode.querySelector('.rc-tooltip-arrow');
arrow.style.left = '33%';
}

const component = (
<div
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
Expand All @@ -48,7 +43,13 @@ export default function Prize({
>
{((onlyShowTooltipForPrize && !withoutTooltip)
? (
<Tooltip content={tip} placeArrow={placeArrow}>
<Tooltip
content={tip}
placeArrow={(TooltipNode) => {
const arrow = TooltipNode.querySelector('.rc-tooltip-arrow');
arrow.style.left = '33%';
}}
>
{prizeUI}
</Tooltip>
)
Expand Down
3 changes: 2 additions & 1 deletion src/shared/components/tc-communities/AccessDenied/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export default function AccessDenied(props) {
spaceName,
environment,
viewportId,
children,
} = props;

if (viewportId) {
Expand Down Expand Up @@ -67,7 +68,7 @@ export default function AccessDenied(props) {
<div styleName="msg">
You are not authorized to access this page.
</div>
{props.children}
{children}
</div>
);
case CAUSE.HAVE_NOT_SUBMITTED_TO_THE_CHALLENGE:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ const settings = {
export default function Home(props) {
const {
userId,
resetChallengeListing,
} = props;

return (
Expand Down Expand Up @@ -199,7 +200,7 @@ export default function Home(props) {
>
<div styleName="ImageTextStyles.linkWrap style.linkWrap">
<Link
onClick={() => props.resetChallengeListing()}
onClick={() => resetChallengeListing()}
styleName="ImageTextStyles.link"
to="challenges?communityId="
>
Expand Down
4 changes: 2 additions & 2 deletions src/shared/containers/ErrorIcons/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ function Tip({ errors, clear }) {
&#10799;
</a>
{
errors.map(({ title, message }, i) => (
<div key={i.toString()} styleName="item">
errors.map(({ title, message }) => (
<div key={`${title}-${message}`} styleName="item">
<div styleName="title" title={title}>
{title}
</div>
Expand Down
Loading

0 comments on commit 6a8263e

Please sign in to comment.