Skip to content

Commit b36957a

Browse files
committed
Additional download submission UAT tweaks
1 parent eb99d69 commit b36957a

File tree

7 files changed

+21
-15
lines changed

7 files changed

+21
-15
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const mockData = {
1818
tokenV3: 'tokenV3',
1919
},
2020
submissionId: '1',
21+
isLoggedIn: true,
2122
};
2223

2324
describe('Matches shallow shapshot', () => {

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export default function SubmissionHistoryRow({
3131
auth,
3232
numWinners,
3333
submissionId,
34+
isLoggedIn,
3435
}) {
3536
const getInitialReviewResult = () => {
3637
if (provisionalScore && provisionalScore < 0) return <FailedSubmissionTooltip />;
@@ -80,7 +81,8 @@ export default function SubmissionHistoryRow({
8081
</div>
8182
</div>
8283
{
83-
isMM && (numWinners > 0 || challengeStatus === CHALLENGE_STATUS.COMPLETED) && (
84+
isLoggedIn && isMM
85+
&& (numWinners > 0 || challengeStatus === CHALLENGE_STATUS.COMPLETED) && (
8486
<div styleName="col-2 col center">
8587
<div styleName="mobile-header">Action</div>
8688
<button
@@ -114,6 +116,7 @@ SubmissionHistoryRow.defaultProps = {
114116
finalScore: null,
115117
provisionalScore: null,
116118
isReviewPhaseComplete: false,
119+
isLoggedIn: false,
117120
};
118121

119122
SubmissionHistoryRow.propTypes = {
@@ -134,4 +137,5 @@ SubmissionHistoryRow.propTypes = {
134137
auth: PT.shape().isRequired,
135138
numWinners: PT.number.isRequired,
136139
submissionId: PT.string.isRequired,
140+
isLoggedIn: PT.bool,
137141
};

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

+5-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import style from './style.scss';
2121
export default function SubmissionRow({
2222
isMM, openHistory, member, submissions, score, toggleHistory, challengeStatus,
2323
isReviewPhaseComplete, finalRank, provisionalRank, onShowPopup, rating, viewAsTable,
24-
numWinners, auth,
24+
numWinners, auth, isLoggedIn,
2525
}) {
2626
const {
2727
submissionTime, provisionalScore, status, submissionId,
@@ -173,7 +173,7 @@ export default function SubmissionRow({
173173
)
174174
}
175175
{
176-
isMM && (
176+
isMM && isLoggedIn && (
177177
<div styleName="col">&nbsp;</div>
178178
)
179179
}
@@ -193,6 +193,7 @@ export default function SubmissionRow({
193193
member={member}
194194
numWinners={numWinners}
195195
auth={auth}
196+
isLoggedIn={isLoggedIn}
196197
submissionId={submissionHistory.submissionId}
197198
/>
198199
))
@@ -218,6 +219,7 @@ SubmissionRow.defaultProps = {
218219
finalRank: null,
219220
provisionalRank: null,
220221
rating: null,
222+
isLoggedIn: false,
221223
};
222224

223225
SubmissionRow.propTypes = {
@@ -259,6 +261,7 @@ SubmissionRow.propTypes = {
259261
provisionalRank: PT.number,
260262
onShowPopup: PT.func.isRequired,
261263
viewAsTable: PT.bool.isRequired,
264+
isLoggedIn: PT.bool,
262265
numWinners: PT.number.isRequired,
263266
auth: PT.shape().isRequired,
264267
};

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ class SubmissionsComponent extends React.Component {
309309
} = challenge;
310310

311311
const isMM = this.isMM();
312+
const isLoggedIn = !_.isEmpty(auth.tokenV3);
312313
const isReviewPhaseComplete = this.checkIsReviewPhaseComplete();
313314

314315
const { field, sort } = this.getSubmissionsSortParam(isMM, isReviewPhaseComplete);
@@ -603,7 +604,7 @@ class SubmissionsComponent extends React.Component {
603604
}
604605
{
605606
((numWinners > 0 || challenge.status === CHALLENGE_STATUS.COMPLETED)
606-
&& isMM) && (
607+
&& isMM && isLoggedIn) && (
607608
<div styleName="block-download-all">
608609
<button
609610
disabled={downloadingAll}
@@ -858,6 +859,7 @@ class SubmissionsComponent extends React.Component {
858859
viewAsTable={viewAsTable}
859860
numWinners={numWinners}
860861
auth={auth}
862+
isLoggedIn={isLoggedIn}
861863
/>
862864
))
863865
)

src/shared/components/challenge-detail/Submissions/style.scss

+3-5
Original file line numberDiff line numberDiff line change
@@ -477,18 +477,16 @@
477477
font-size: 15px;
478478
line-height: 16px;
479479
color: #137d60;
480+
background-color: transparent;
480481

481482
&:hover {
482483
color: #0ab88a;
483484
}
484485

485486
&:disabled {
486-
color: #767676;
487487
pointer-events: none;
488-
489-
&:hover {
490-
color: #767676;
491-
}
488+
background-color: transparent;
489+
color: #137d60;
492490
}
493491

494492
&.MM {

src/shared/components/challenge-detail/Winners/Winner/style.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@
233233
.download-container {
234234
display: flex;
235235
align-items: center;
236-
margin-left: 20px;
236+
margin-left: 40px;
237237

238238
.download {
239239
text-decoration: none;

src/shared/components/challenge-detail/Winners/style.scss

+3-5
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,16 @@
3434
font-size: 15px;
3535
line-height: 16px;
3636
color: #137d60;
37+
background-color: transparent;
3738

3839
&:hover {
3940
color: #0ab88a;
4041
}
4142

4243
&:disabled {
43-
color: #767676;
4444
pointer-events: none;
45-
46-
&:hover {
47-
color: #767676;
48-
}
45+
background-color: transparent;
46+
color: #137d60;
4947
}
5048

5149
&.MM {

0 commit comments

Comments
 (0)