Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ workflows:
branches:
only:
- PROD-4183
- M2MHotfix
# This is alternate dev env for parallel testing
- "build-test":
context : org-global
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,27 +57,6 @@ exports[`Matches shallow shapshot shapshot 1 1`] = `
15:49:35
</div>
</div>
<div
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"
>
<div
className="src-shared-components-challenge-detail-Submissions-SubmissionRow-SubmissionHistoryRow-___style__mobile-header___3NsEQ"
>
Action
</div>
<button
onClick={[Function]}
type="button"
>
<DownloadIcon
fill="none"
height="18"
viewBox="0 0 18 18"
width="18"
xmlns="http://www.w3.org/2000/svg"
/>
</button>
</div>
</div>
</div>
`;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
// import ReactDOM from 'react-dom';
import Renderer from 'react-test-renderer/shallow';
import TU from 'react-dom/test-utils';
// import TU from 'react-dom/test-utils';
import SubmissionHistoryRow from 'components/challenge-detail/Submissions/SubmissionRow/SubmissionHistoryRow';

const mockData = {
Expand Down Expand Up @@ -32,14 +32,14 @@ describe('Matches shallow shapshot', () => {
});
});

/*
class Wrapper extends React.Component {
componentDidMount() {}

render() {
return <SubmissionHistoryRow {...this.props} />;
}
}

describe('render properly', () => {
test('click', () => {
const instance = TU.renderIntoDocument((<Wrapper {...mockData} />));
Expand All @@ -48,3 +48,4 @@ describe('render properly', () => {
TU.Simulate.click(matches[0]);
});
});
*/
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,6 @@ exports[`Matches shallow shapshot shapshot 1 1`] = `
</div>
<div
className="src-shared-components-challenge-detail-Winners-Winner-___style__download-container___OXVza"
>
<button
onClick={[Function]}
type="button"
>
<DownloadIcon
fill="none"
height="18"
viewBox="0 0 18 18"
width="18"
xmlns="http://www.w3.org/2000/svg"
/>
</button>
</div>
/>
</div>
`;
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
// import ReactDOM from 'react-dom';
import Renderer from 'react-test-renderer/shallow';
import TU from 'react-dom/test-utils';
// import TU from 'react-dom/test-utils';
import Winner from 'components/challenge-detail/Winners/Winner';

const mockData = {
Expand Down Expand Up @@ -53,14 +53,14 @@ describe('Matches shallow shapshot', () => {
});
});

/*
class Wrapper extends React.Component {
componentDidMount() {}

render() {
return <Winner {...this.props} />;
}
}

describe('render properly', () => {
test('click', () => {
const instance = TU.renderIntoDocument((<Wrapper {...mockData} />));
Expand All @@ -69,3 +69,4 @@ describe('render properly', () => {
TU.Simulate.click(matches[0]);
});
});
*/
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ export default function SubmissionHistoryRow({
submissionId,
isLoggedIn,
}) {
// todo: hide download button until update submissions API
const hideDownloadForMMRDM = true;
const getInitialReviewResult = () => {
if (provisionalScore && provisionalScore < 0) return <FailedSubmissionTooltip />;
switch (status) {
Expand Down Expand Up @@ -82,7 +84,7 @@ export default function SubmissionHistoryRow({
</div>
</div>
{
isLoggedIn && (isMM || isRDM)
!hideDownloadForMMRDM && isLoggedIn && (isMM || isRDM)
&& (numWinners > 0 || challengeStatus === CHALLENGE_STATUS.COMPLETED) && (
<div styleName="col-2 col center">
<div styleName="mobile-header">Action</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@ class SubmissionsComponent extends React.Component {
type,
tags,
} = challenge;
// todo: hide download button until update submissions API
const hideDownloadForMMRDM = true;

const isMM = this.isMM();
const isRDM = checkIsRDM(challenge);
Expand Down Expand Up @@ -479,7 +481,8 @@ class SubmissionsComponent extends React.Component {
}
<div styleName={`${viewAsTable ? 'view-as-table' : ''}`}>
{
((numWinners > 0 || challenge.status === CHALLENGE_STATUS.COMPLETED)
(!hideDownloadForMMRDM
&& (numWinners > 0 || challenge.status === CHALLENGE_STATUS.COMPLETED)
&& (isMM || isRDM) && isLoggedIn) && (
<div styleName="block-download-all">
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export default function Winner({
isLoggedIn,
auth,
}) {
// todo: hide download button until update submissions API
const hideDownloadForMMRDM = true;
const [windowOrigin, setWindowOrigin] = useState();
useEffect(() => {
setWindowOrigin(window.origin);
Expand Down Expand Up @@ -90,7 +92,9 @@ export default function Winner({
</div>
<div styleName="download-container">
{
((!winner.submissionDownloadLink || !viewable) && (isMM || isRDM) && isLoggedIn) && (
(!hideDownloadForMMRDM
&& (!winner.submissionDownloadLink || !viewable)
&& (isMM || isRDM) && isLoggedIn) && (
<button
onClick={() => {
// download submission
Expand Down
5 changes: 4 additions & 1 deletion src/shared/components/challenge-detail/Winners/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,14 @@ export default function Winners({
auth,
challengeStatus,
}) {
// todo: hide download button until update submissions API
const hideDownloadForMMRDM = true;
const [downloadingAll, setDownloadingAll] = useState(false);
return (
<div styleName="container">
{
((winners.length > 0 || challengeStatus === CHALLENGE_STATUS.COMPLETED)
!hideDownloadForMMRDM
&& ((winners.length > 0 || challengeStatus === CHALLENGE_STATUS.COMPLETED)
&& (isMM || isRDM) && isLoggedIn) && (
<div styleName="block-download-all">
<button
Expand Down