File tree Expand file tree Collapse file tree 9 files changed +24
-43
lines changed
__tests__/shared/components/challenge-detail
Submissions/SubmissionRow/SubmissionHistoryRow
src/shared/components/challenge-detail
SubmissionRow/SubmissionHistoryRow Expand file tree Collapse file tree 9 files changed +24
-43
lines changed Original file line number Diff line number Diff line change @@ -350,6 +350,7 @@ workflows:
350350 branches :
351351 only :
352352 - PROD-4183
353+ - M2MHotfix
353354 # This is alternate dev env for parallel testing
354355 - " build-test " :
355356 context : org-global
Original file line number Diff line number Diff line change @@ -57,27 +57,6 @@ exports[`Matches shallow shapshot shapshot 1 1`] = `
5757 15:49:35
5858 </div >
5959 </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 >
8160 </div >
8261</div >
8362` ;
Original file line number Diff line number Diff line change 11import React from 'react' ;
22// import ReactDOM from 'react-dom';
33import Renderer from 'react-test-renderer/shallow' ;
4- import TU from 'react-dom/test-utils' ;
4+ // import TU from 'react-dom/test-utils';
55import SubmissionHistoryRow from 'components/challenge-detail/Submissions/SubmissionRow/SubmissionHistoryRow' ;
66
77const mockData = {
@@ -32,14 +32,14 @@ describe('Matches shallow shapshot', () => {
3232 } ) ;
3333} ) ;
3434
35+ /*
3536class Wrapper extends React.Component {
3637 componentDidMount() {}
3738
3839 render() {
3940 return <SubmissionHistoryRow {...this.props} />;
4041 }
4142}
42-
4343describe('render properly', () => {
4444 test('click', () => {
4545 const instance = TU.renderIntoDocument((<Wrapper {...mockData} />));
@@ -48,3 +48,4 @@ describe('render properly', () => {
4848 TU.Simulate.click(matches[0]);
4949 });
5050});
51+ */
Original file line number Diff line number Diff line change @@ -55,19 +55,6 @@ exports[`Matches shallow shapshot shapshot 1 1`] = `
5555 </div >
5656 <div
5757 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+ />
7259</div >
7360` ;
Original file line number Diff line number Diff line change 11import React from 'react' ;
22// import ReactDOM from 'react-dom';
33import Renderer from 'react-test-renderer/shallow' ;
4- import TU from 'react-dom/test-utils' ;
4+ // import TU from 'react-dom/test-utils';
55import Winner from 'components/challenge-detail/Winners/Winner' ;
66
77const mockData = {
@@ -53,14 +53,14 @@ describe('Matches shallow shapshot', () => {
5353 } ) ;
5454} ) ;
5555
56+ /*
5657class Wrapper extends React.Component {
5758 componentDidMount() {}
5859
5960 render() {
6061 return <Winner {...this.props} />;
6162 }
6263}
63-
6464describe('render properly', () => {
6565 test('click', () => {
6666 const instance = TU.renderIntoDocument((<Wrapper {...mockData} />));
@@ -69,3 +69,4 @@ describe('render properly', () => {
6969 TU.Simulate.click(matches[0]);
7070 });
7171});
72+ */
Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ export default function SubmissionHistoryRow({
3434 submissionId,
3535 isLoggedIn,
3636} ) {
37+ // todo: hide download button until update submissions API
38+ const hideDownloadForMMRDM = true ;
3739 const getInitialReviewResult = ( ) => {
3840 if ( provisionalScore && provisionalScore < 0 ) return < FailedSubmissionTooltip /> ;
3941 switch ( status ) {
@@ -82,7 +84,7 @@ export default function SubmissionHistoryRow({
8284 </ div >
8385 </ div >
8486 {
85- isLoggedIn && ( isMM || isRDM )
87+ ! hideDownloadForMMRDM && isLoggedIn && ( isMM || isRDM )
8688 && ( numWinners > 0 || challengeStatus === CHALLENGE_STATUS . COMPLETED ) && (
8789 < div styleName = "col-2 col center" >
8890 < 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 {
307307 type,
308308 tags,
309309 } = challenge ;
310+ // todo: hide download button until update submissions API
311+ const hideDownloadForMMRDM = true ;
310312
311313 const isMM = this . isMM ( ) ;
312314 const isRDM = checkIsRDM ( challenge ) ;
@@ -479,7 +481,8 @@ class SubmissionsComponent extends React.Component {
479481 }
480482 < div styleName = { `${ viewAsTable ? 'view-as-table' : '' } ` } >
481483 {
482- ( ( numWinners > 0 || challenge . status === CHALLENGE_STATUS . COMPLETED )
484+ ( ! hideDownloadForMMRDM
485+ && ( numWinners > 0 || challenge . status === CHALLENGE_STATUS . COMPLETED )
483486 && ( isMM || isRDM ) && isLoggedIn ) && (
484487 < div styleName = "block-download-all" >
485488 < button
Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ export default function Winner({
2727 isLoggedIn,
2828 auth,
2929} ) {
30+ // todo: hide download button until update submissions API
31+ const hideDownloadForMMRDM = true ;
3032 const [ windowOrigin , setWindowOrigin ] = useState ( ) ;
3133 useEffect ( ( ) => {
3234 setWindowOrigin ( window . origin ) ;
@@ -90,7 +92,9 @@ export default function Winner({
9092 </ div >
9193 < div styleName = "download-container" >
9294 {
93- ( ( ! winner . submissionDownloadLink || ! viewable ) && ( isMM || isRDM ) && isLoggedIn ) && (
95+ ( ! hideDownloadForMMRDM
96+ && ( ! winner . submissionDownloadLink || ! viewable )
97+ && ( isMM || isRDM ) && isLoggedIn ) && (
9498 < button
9599 onClick = { ( ) => {
96100 // download submission
Original file line number Diff line number Diff line change @@ -27,11 +27,14 @@ export default function Winners({
2727 auth,
2828 challengeStatus,
2929} ) {
30+ // todo: hide download button until update submissions API
31+ const hideDownloadForMMRDM = true ;
3032 const [ downloadingAll , setDownloadingAll ] = useState ( false ) ;
3133 return (
3234 < div styleName = "container" >
3335 {
34- ( ( winners . length > 0 || challengeStatus === CHALLENGE_STATUS . COMPLETED )
36+ ! hideDownloadForMMRDM
37+ && ( ( winners . length > 0 || challengeStatus === CHALLENGE_STATUS . COMPLETED )
3538 && ( isMM || isRDM ) && isLoggedIn ) && (
3639 < div styleName = "block-download-all" >
3740 < button
You can’t perform that action at this time.
0 commit comments