File tree 9 files changed +24
-43
lines changed
__tests__/shared/components/challenge-detail
Submissions/SubmissionRow/SubmissionHistoryRow
src/shared/components/challenge-detail
SubmissionRow/SubmissionHistoryRow
9 files changed +24
-43
lines changed Original file line number Diff line number Diff line change @@ -350,6 +350,7 @@ workflows:
350
350
branches :
351
351
only :
352
352
- PROD-4183
353
+ - M2MHotfix
353
354
# This is alternate dev env for parallel testing
354
355
- " build-test " :
355
356
context : org-global
Original file line number Diff line number Diff line change @@ -57,27 +57,6 @@ exports[`Matches shallow shapshot shapshot 1 1`] = `
57
57
15:49:35
58
58
</div >
59
59
</div >
60
- <div
61
- className = " src-shared-components-challenge-detail-Submissions-SubmissionRow-SubmissionHistoryRow-___style__col-2___2KjRa src-shared-components-challenge-detail-Submissions-SubmissionRow-SubmissionHistoryRow-___style__col___2-hjE src-shared-components-challenge-detail-Submissions-SubmissionRow-SubmissionHistoryRow-___style__center___2l_Ch"
62
- >
63
- <div
64
- className = " src-shared-components-challenge-detail-Submissions-SubmissionRow-SubmissionHistoryRow-___style__mobile-header___3NsEQ"
65
- >
66
- Action
67
- </div >
68
- <button
69
- onClick = { [Function ]}
70
- type = " button"
71
- >
72
- <DownloadIcon
73
- fill = " none"
74
- height = " 18"
75
- viewBox = " 0 0 18 18"
76
- width = " 18"
77
- xmlns = " http://www.w3.org/2000/svg"
78
- />
79
- </button >
80
- </div >
81
60
</div >
82
61
</div >
83
62
` ;
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
// import ReactDOM from 'react-dom';
3
3
import Renderer from 'react-test-renderer/shallow' ;
4
- import TU from 'react-dom/test-utils' ;
4
+ // import TU from 'react-dom/test-utils';
5
5
import SubmissionHistoryRow from 'components/challenge-detail/Submissions/SubmissionRow/SubmissionHistoryRow' ;
6
6
7
7
const mockData = {
@@ -32,14 +32,14 @@ describe('Matches shallow shapshot', () => {
32
32
} ) ;
33
33
} ) ;
34
34
35
+ /*
35
36
class Wrapper extends React.Component {
36
37
componentDidMount() {}
37
38
38
39
render() {
39
40
return <SubmissionHistoryRow {...this.props} />;
40
41
}
41
42
}
42
-
43
43
describe('render properly', () => {
44
44
test('click', () => {
45
45
const instance = TU.renderIntoDocument((<Wrapper {...mockData} />));
@@ -48,3 +48,4 @@ describe('render properly', () => {
48
48
TU.Simulate.click(matches[0]);
49
49
});
50
50
});
51
+ */
Original file line number Diff line number Diff line change @@ -55,19 +55,6 @@ exports[`Matches shallow shapshot shapshot 1 1`] = `
55
55
</div >
56
56
<div
57
57
className = " src-shared-components-challenge-detail-Winners-Winner-___style__download-container___OXVza"
58
- >
59
- <button
60
- onClick = { [Function ]}
61
- type = " button"
62
- >
63
- <DownloadIcon
64
- fill = " none"
65
- height = " 18"
66
- viewBox = " 0 0 18 18"
67
- width = " 18"
68
- xmlns = " http://www.w3.org/2000/svg"
69
- />
70
- </button >
71
- </div >
58
+ />
72
59
</div >
73
60
` ;
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
// import ReactDOM from 'react-dom';
3
3
import Renderer from 'react-test-renderer/shallow' ;
4
- import TU from 'react-dom/test-utils' ;
4
+ // import TU from 'react-dom/test-utils';
5
5
import Winner from 'components/challenge-detail/Winners/Winner' ;
6
6
7
7
const mockData = {
@@ -53,14 +53,14 @@ describe('Matches shallow shapshot', () => {
53
53
} ) ;
54
54
} ) ;
55
55
56
+ /*
56
57
class Wrapper extends React.Component {
57
58
componentDidMount() {}
58
59
59
60
render() {
60
61
return <Winner {...this.props} />;
61
62
}
62
63
}
63
-
64
64
describe('render properly', () => {
65
65
test('click', () => {
66
66
const instance = TU.renderIntoDocument((<Wrapper {...mockData} />));
@@ -69,3 +69,4 @@ describe('render properly', () => {
69
69
TU.Simulate.click(matches[0]);
70
70
});
71
71
});
72
+ */
Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ export default function SubmissionHistoryRow({
34
34
submissionId,
35
35
isLoggedIn,
36
36
} ) {
37
+ // todo: hide download button until update submissions API
38
+ const hideDownloadForMMRDM = true ;
37
39
const getInitialReviewResult = ( ) => {
38
40
if ( provisionalScore && provisionalScore < 0 ) return < FailedSubmissionTooltip /> ;
39
41
switch ( status ) {
@@ -82,7 +84,7 @@ export default function SubmissionHistoryRow({
82
84
</ div >
83
85
</ div >
84
86
{
85
- isLoggedIn && ( isMM || isRDM )
87
+ ! hideDownloadForMMRDM && isLoggedIn && ( isMM || isRDM )
86
88
&& ( numWinners > 0 || challengeStatus === CHALLENGE_STATUS . COMPLETED ) && (
87
89
< div styleName = "col-2 col center" >
88
90
< div styleName = "mobile-header" > Action</ div >
Original file line number Diff line number Diff line change @@ -307,6 +307,8 @@ class SubmissionsComponent extends React.Component {
307
307
type,
308
308
tags,
309
309
} = challenge ;
310
+ // todo: hide download button until update submissions API
311
+ const hideDownloadForMMRDM = true ;
310
312
311
313
const isMM = this . isMM ( ) ;
312
314
const isRDM = checkIsRDM ( challenge ) ;
@@ -479,7 +481,8 @@ class SubmissionsComponent extends React.Component {
479
481
}
480
482
< div styleName = { `${ viewAsTable ? 'view-as-table' : '' } ` } >
481
483
{
482
- ( ( numWinners > 0 || challenge . status === CHALLENGE_STATUS . COMPLETED )
484
+ ( ! hideDownloadForMMRDM
485
+ && ( numWinners > 0 || challenge . status === CHALLENGE_STATUS . COMPLETED )
483
486
&& ( isMM || isRDM ) && isLoggedIn ) && (
484
487
< div styleName = "block-download-all" >
485
488
< button
Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ export default function Winner({
27
27
isLoggedIn,
28
28
auth,
29
29
} ) {
30
+ // todo: hide download button until update submissions API
31
+ const hideDownloadForMMRDM = true ;
30
32
const [ windowOrigin , setWindowOrigin ] = useState ( ) ;
31
33
useEffect ( ( ) => {
32
34
setWindowOrigin ( window . origin ) ;
@@ -90,7 +92,9 @@ export default function Winner({
90
92
</ div >
91
93
< div styleName = "download-container" >
92
94
{
93
- ( ( ! winner . submissionDownloadLink || ! viewable ) && ( isMM || isRDM ) && isLoggedIn ) && (
95
+ ( ! hideDownloadForMMRDM
96
+ && ( ! winner . submissionDownloadLink || ! viewable )
97
+ && ( isMM || isRDM ) && isLoggedIn ) && (
94
98
< button
95
99
onClick = { ( ) => {
96
100
// download submission
Original file line number Diff line number Diff line change @@ -27,11 +27,14 @@ export default function Winners({
27
27
auth,
28
28
challengeStatus,
29
29
} ) {
30
+ // todo: hide download button until update submissions API
31
+ const hideDownloadForMMRDM = true ;
30
32
const [ downloadingAll , setDownloadingAll ] = useState ( false ) ;
31
33
return (
32
34
< div styleName = "container" >
33
35
{
34
- ( ( winners . length > 0 || challengeStatus === CHALLENGE_STATUS . COMPLETED )
36
+ ! hideDownloadForMMRDM
37
+ && ( ( winners . length > 0 || challengeStatus === CHALLENGE_STATUS . COMPLETED )
35
38
&& ( isMM || isRDM ) && isLoggedIn ) && (
36
39
< div styleName = "block-download-all" >
37
40
< button
You can’t perform that action at this time.
0 commit comments