Skip to content

Commit e6f6e8b

Browse files
committed
Test for enabling dashboard on data science challenge
1 parent 2f9c626 commit e6f6e8b

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

src/shared/components/challenge-detail/Header/TabSelector/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ export default function ChallengeViewSelector(props) {
300300
return '';
301301
})()}
302302
{
303-
isMM && (
303+
(isMM || challenge.track.toLowerCase() === 'data science') && (
304304
<a
305305
tabIndex="0"
306306
role="tab"

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

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class SubmissionsComponent extends React.Component {
5858

5959
componentDidMount() {
6060
const { challenge, loadMMSubmissions, auth } = this.props;
61-
const isMM = checkIsMM(challenge);
61+
const isMM = this.isMM();
6262

6363
// Check auth token, go to login page if invalid
6464
if (isMM && (_.isEmpty(auth) || _.isEmpty(auth.tokenV3) || isTokenExpired(auth.tokenV3))) {
@@ -71,10 +71,8 @@ class SubmissionsComponent extends React.Component {
7171
}
7272
this.updateSortedSubmissions();
7373
}
74-
7574
componentDidUpdate(prevProps) {
76-
const { challenge } = this.props;
77-
const isMM = checkIsMM(challenge);
75+
const isMM = this.isMM();
7876

7977
const { submissions, mmSubmissions, submissionsSort } = this.props;
8078
if (
@@ -144,8 +142,7 @@ class SubmissionsComponent extends React.Component {
144142
* Update sorted submission array
145143
*/
146144
updateSortedSubmissions() {
147-
const { challenge } = this.props;
148-
const isMM = checkIsMM(challenge);
145+
const isMM = this.isMM();
149146
const { submissions, mmSubmissions } = this.props;
150147
const sortedSubmissions = _.cloneDeep(isMM ? mmSubmissions : submissions);
151148
this.sortSubmissions(sortedSubmissions);
@@ -157,8 +154,7 @@ class SubmissionsComponent extends React.Component {
157154
* @param {Array} submissions array of submission
158155
*/
159156
sortSubmissions(submissions) {
160-
const { challenge } = this.props;
161-
const isMM = checkIsMM(challenge);
157+
const isMM = this.isMM();
162158
const isReviewPhaseComplete = this.checkIsReviewPhaseComplete();
163159
const { field, sort } = this.getSubmissionsSortParam(isMM, isReviewPhaseComplete);
164160
let isHaveFinalScore = false;
@@ -251,6 +247,11 @@ class SubmissionsComponent extends React.Component {
251247
});
252248
}
253249

250+
isMM() {
251+
const { challenge } = this.props;
252+
return challenge.track.toLowerCase() === 'data science' || checkIsMM(challenge);
253+
}
254+
254255
/**
255256
* Check if review phase complete
256257
*/
@@ -299,7 +300,7 @@ class SubmissionsComponent extends React.Component {
299300
tags,
300301
} = challenge;
301302

302-
const isMM = checkIsMM(challenge);
303+
const isMM = this.isMM();
303304
const isReviewPhaseComplete = this.checkIsReviewPhaseComplete();
304305

305306
const { field, sort } = this.getSubmissionsSortParam(isMM, isReviewPhaseComplete);

0 commit comments

Comments
 (0)