diff --git a/.eslintrc b/.eslintrc index c323322f56..02ace66fc8 100644 --- a/.eslintrc +++ b/.eslintrc @@ -4,7 +4,10 @@ "jsx-a11y/anchor-is-valid": false, "import/no-cycle": [2, { "maxDepth": 1 }], "react/forbid-prop-types": false, - "react/no-unknown-property": ["error", { "ignore": ["styleName"] }] + "react/no-unknown-property": false, + "react/jsx-no-bind": false, + "react/destructuring-assignment": false, + "react/no-array-index-key": false }, "env": { "browser": true diff --git a/src/shared/components/Contentful/AppComponent/index.jsx b/src/shared/components/Contentful/AppComponent/index.jsx index f1d84bcd03..a012fb82e9 100644 --- a/src/shared/components/Contentful/AppComponent/index.jsx +++ b/src/shared/components/Contentful/AppComponent/index.jsx @@ -18,59 +18,41 @@ import PathSelector from 'components/MemberPath/PathSelector'; const { fireErrorMessage } = errors; export function AppComponentSwitch(appComponent) { - const { - fields: { - type, - theme, - props, - props: { - leaderboardApiUrl, - title, - podiumSpots, - isCopilot, - hasChallengeHistory, - tcoPointsApiUrl, - memberLimit, - isAlgo, - }, - }, - sys: { id }, - } = appComponent; - if (type === 'TCO-Leaderboard') { + if (appComponent.fields.type === 'TCO-Leaderboard') { return ( ); } - if (type === 'RecruitCRM-Jobs') { - return ; + if (appComponent.fields.type === 'RecruitCRM-Jobs') { + return ; } - if (type === 'EmailSubscribeForm') { - return ; + if (appComponent.fields.type === 'EmailSubscribeForm') { + return ; } - if (type === 'GSheet') { - return ; + if (appComponent.fields.type === 'GSheet') { + return ; } - if (type === 'MemberPath') { + if (appComponent.fields.type === 'MemberPath') { return ( ); } - fireErrorMessage(`Unsupported app component type ${type}`, ''); + fireErrorMessage(`Unsupported app component type ${appComponent.fields.type}`, ''); return null; } diff --git a/src/shared/components/Contentful/Viewport/index.jsx b/src/shared/components/Contentful/Viewport/index.jsx index cf89dec2ac..30d3a78e28 100644 --- a/src/shared/components/Contentful/Viewport/index.jsx +++ b/src/shared/components/Contentful/Viewport/index.jsx @@ -272,7 +272,7 @@ export function ViewportLoader(props) { } if (query) { - queries.push({ ...query, content_type: 'viewport' }); + queries.push({ ...props.query, content_type: 'viewport' }); } return ( diff --git a/src/shared/components/Gigs/ReferralCode/index.jsx b/src/shared/components/Gigs/ReferralCode/index.jsx index 1de0976d45..1ed5597794 100644 --- a/src/shared/components/Gigs/ReferralCode/index.jsx +++ b/src/shared/components/Gigs/ReferralCode/index.jsx @@ -25,7 +25,7 @@ function ReferralCode(props) { const [growSurfState, setGrowSurfState] = useState(growSurf); const [copyBtnText, setCopyBtnText] = useState('COPY'); useEffect(() => { - setGrowSurfState(growSurf); + setGrowSurfState(props.growSurf); }, [growSurf]); return ( diff --git a/src/shared/components/Settings/Account/LinkedAccount/ExistingLink.jsx b/src/shared/components/Settings/Account/LinkedAccount/ExistingLink.jsx index 27fb7c9019..c0654a5b43 100644 --- a/src/shared/components/Settings/Account/LinkedAccount/ExistingLink.jsx +++ b/src/shared/components/Settings/Account/LinkedAccount/ExistingLink.jsx @@ -64,15 +64,7 @@ export default function ExistingLink(props) { return (
openLink(e, link)}>
-
{ - e.preventDefault(); - e.stopPropagation(); - onConfirmDeleteLink(e, link); - }} - styleName={`ext-link-tile_edit-header_delete ${link.deleting ? 'ext-link-tile_edit-header_delete--disabled' : ''}`} - /> +
onConfirmDeleteLink(e, link)} styleName={`ext-link-tile_edit-header_delete ${link.deleting ? 'ext-link-tile_edit-header_delete--disabled' : ''}`} prevent-event-propagation="true" />
@@ -102,7 +94,7 @@ export default function ExistingLink(props) {

Loading data. This will take a few minutes.

- + {prependProtocol(link.URL)}
diff --git a/src/shared/components/challenge-detail/Header/TabSelector/index.jsx b/src/shared/components/challenge-detail/Header/TabSelector/index.jsx index f7c9d104f1..dcdc49f122 100644 --- a/src/shared/components/challenge-detail/Header/TabSelector/index.jsx +++ b/src/shared/components/challenge-detail/Header/TabSelector/index.jsx @@ -404,9 +404,9 @@ export default function ChallengeViewSelector(props) {
{ - sortOptions.map(option => ( + sortOptions.map((option, index) => (
{ setSelectedSortOption(option.name); diff --git a/src/shared/components/challenge-detail/Submissions/SubmissionRow/SubmissionHistoryRow/index.jsx b/src/shared/components/challenge-detail/Submissions/SubmissionRow/SubmissionHistoryRow/index.jsx index 750458887b..5510ef4741 100644 --- a/src/shared/components/challenge-detail/Submissions/SubmissionRow/SubmissionHistoryRow/index.jsx +++ b/src/shared/components/challenge-detail/Submissions/SubmissionRow/SubmissionHistoryRow/index.jsx @@ -21,6 +21,7 @@ const { getService } = services.submissions; export default function SubmissionHistoryRow({ isMM, + isRDM, submission, finalScore, provisionalScore, @@ -81,7 +82,7 @@ export default function SubmissionHistoryRow({
{ - isLoggedIn && isMM + isLoggedIn && (isMM || isRDM) && (numWinners > 0 || challengeStatus === CHALLENGE_STATUS.COMPLETED) && (
Action
@@ -121,6 +122,7 @@ SubmissionHistoryRow.defaultProps = { SubmissionHistoryRow.propTypes = { isMM: PT.bool.isRequired, + isRDM: PT.bool.isRequired, submission: PT.number.isRequired, finalScore: PT.oneOfType([ PT.number, diff --git a/src/shared/components/challenge-detail/Submissions/SubmissionRow/index.jsx b/src/shared/components/challenge-detail/Submissions/SubmissionRow/index.jsx index f4a61b11bb..b2fc9cca9b 100644 --- a/src/shared/components/challenge-detail/Submissions/SubmissionRow/index.jsx +++ b/src/shared/components/challenge-detail/Submissions/SubmissionRow/index.jsx @@ -19,7 +19,7 @@ import SubmissionHistoryRow from './SubmissionHistoryRow'; import style from './style.scss'; export default function SubmissionRow({ - isMM, openHistory, member, submissions, score, toggleHistory, challengeStatus, + isMM, isRDM, openHistory, member, submissions, score, toggleHistory, challengeStatus, isReviewPhaseComplete, finalRank, provisionalRank, onShowPopup, rating, viewAsTable, numWinners, auth, isLoggedIn, }) { @@ -166,7 +166,8 @@ export default function SubmissionRow({ Time
{ - isMM && (numWinners > 0 || challengeStatus === CHALLENGE_STATUS.COMPLETED) && ( + (isMM || isRDM) + && (numWinners > 0 || challengeStatus === CHALLENGE_STATUS.COMPLETED) && (
Action
@@ -185,6 +186,7 @@ export default function SubmissionRow({ 0 || challenge.status === CHALLENGE_STATUS.COMPLETED) - && isMM && isLoggedIn) && ( + && (isMM || isRDM) && isLoggedIn) && (