Skip to content

Commit 5248e4c

Browse files
Merge pull request #6639 from topcoder-platform/enable_dashboard_on_data_science
Enable dashboard on data science
2 parents 87ccea3 + 028fd7a commit 5248e4c

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-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 & 8 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))) {
@@ -73,8 +73,7 @@ class SubmissionsComponent extends React.Component {
7373
}
7474

7575
componentDidUpdate(prevProps) {
76-
const { challenge } = this.props;
77-
const isMM = checkIsMM(challenge);
76+
const isMM = this.isMM();
7877

7978
const { submissions, mmSubmissions, submissionsSort } = this.props;
8079
if (
@@ -144,8 +143,7 @@ class SubmissionsComponent extends React.Component {
144143
* Update sorted submission array
145144
*/
146145
updateSortedSubmissions() {
147-
const { challenge } = this.props;
148-
const isMM = checkIsMM(challenge);
146+
const isMM = this.isMM();
149147
const { submissions, mmSubmissions } = this.props;
150148
const sortedSubmissions = _.cloneDeep(isMM ? mmSubmissions : submissions);
151149
this.sortSubmissions(sortedSubmissions);
@@ -157,8 +155,7 @@ class SubmissionsComponent extends React.Component {
157155
* @param {Array} submissions array of submission
158156
*/
159157
sortSubmissions(submissions) {
160-
const { challenge } = this.props;
161-
const isMM = checkIsMM(challenge);
158+
const isMM = this.isMM();
162159
const isReviewPhaseComplete = this.checkIsReviewPhaseComplete();
163160
const { field, sort } = this.getSubmissionsSortParam(isMM, isReviewPhaseComplete);
164161
let isHaveFinalScore = false;
@@ -251,6 +248,11 @@ class SubmissionsComponent extends React.Component {
251248
});
252249
}
253250

251+
isMM() {
252+
const { challenge } = this.props;
253+
return challenge.track.toLowerCase() === 'data science' || checkIsMM(challenge);
254+
}
255+
254256
/**
255257
* Check if review phase complete
256258
*/
@@ -299,7 +301,7 @@ class SubmissionsComponent extends React.Component {
299301
tags,
300302
} = challenge;
301303

302-
const isMM = checkIsMM(challenge);
304+
const isMM = this.isMM();
303305
const isReviewPhaseComplete = this.checkIsReviewPhaseComplete();
304306

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

src/shared/containers/challenge-detail/index.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,8 @@ class ChallengeDetailPageContainer extends React.Component {
256256
history.push(history.location.pathname, history.state);
257257
}
258258

259-
if (!checkIsMM(challenge) && selectedTab === DETAIL_TABS.MM_DASHBOARD) {
259+
if (!checkIsMM(challenge) && COMPETITION_TRACKS_V3.DS !== challenge.track
260+
&& selectedTab === DETAIL_TABS.MM_DASHBOARD) {
260261
onSelectorClicked(DETAIL_TABS.DETAILS);
261262
}
262263

0 commit comments

Comments
 (0)