Skip to content

Commit

Permalink
Merge pull request #5635 from topcoder-platform/fix/hide-developer-ma…
Browse files Browse the repository at this point in the history
…rathon-match-subtrack

fixes #5495: hide developer marathon match subtrack
  • Loading branch information
luizrrodrigues authored Jul 23, 2021
2 parents fe83432 + c2f8384 commit 5ddca53
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ workflows:
filters:
branches:
only:
- tco21-leaderboard-fix
- free
# This is stage env for production QA releases
- "build-prod-staging":
context : org-global
Expand Down
19 changes: 17 additions & 2 deletions src/shared/components/ProfilePage/StatsCategory/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,27 @@ const isActiveSubtrack = (subtrack) => {
}
if (subtrack.rank && subtrack.rank.rating > 0) {
return true;
} if (_.isNumber(subtrack.submissions)) {
}
if (_.isNumber(subtrack.submissions)) {
return subtrack.submissions > 0;
}
return subtrack.submissions && subtrack.submissions.submissions > 0;
};

/**
* Inspects a subtrack and determines if it should be hidden
*
* @param {Object} subtrack Subtrack object
* @returns {Boolean}
*/
const isHidden = (subtrack) => {
if (subtrack.name === 'DEVELOP_MARATHON_MATCH') {
return true;
}

return false;
};

class StatsCategory extends React.Component {
getActiveTracks() {
let { stats } = this.props;
Expand Down Expand Up @@ -72,7 +87,7 @@ class StatsCategory extends React.Component {
}

subTracks.forEach((subtrack) => {
if (isActiveSubtrack(subtrack)) {
if (isActiveSubtrack(subtrack) && !isHidden(subtrack)) {
active.push({ ...subtrack, active: true });
}
});
Expand Down

0 comments on commit 5ddca53

Please sign in to comment.