Skip to content

Commit

Permalink
Merge pull request #5653 from topcoder-platform/develop
Browse files Browse the repository at this point in the history
Release v.1.10.8
  • Loading branch information
luizrrodrigues authored Jul 23, 2021
2 parents ecda4d7 + 5ddca53 commit 0d78f13
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ ContentSlider.defaultProps = {
cellSpacing: null,
cellAlign: 'center',
wrapAround: true,
heightMode: 'current',
heightMode: 'max',
arrowTheme: 'Gray',
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class ChallengeHistoryModal extends Component {
loading,
isCopilot,
isAlgo,
themeName,
} = this.props;
const { sortParam } = this.state;
const challengesOrdered = _.orderBy(challenges, [sortParam.field], [sortParam.order]);
Expand All @@ -44,7 +45,7 @@ class ChallengeHistoryModal extends Component {
competitor={competitor}
isCopilot={isCopilot}
isAlgo={isAlgo}
themeName="TCO22"
themeName={themeName}
/>
</div>
<table styleName="history-table">
Expand Down Expand Up @@ -178,6 +179,7 @@ ChallengeHistoryModal.propTypes = {
loading: PT.bool.isRequired,
isAlgo: PT.bool,
isCopilot: PT.bool,
themeName: PT.string.isRequired,
};

export default ChallengeHistoryModal;
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $light-gray: #d4d4d4;
width: 70%;
max-height: 90%;
overflow-y: auto;
padding: 80px 78px;
padding: 60px 78px 80px;

@media (max-width: 768px) {
width: 90%;
Expand All @@ -26,7 +26,7 @@ $light-gray: #d4d4d4;
font-weight: 500;
line-height: 38px;
text-align: center;
margin-bottom: 60px;
margin-bottom: 40px;
text-transform: uppercase;

@media (max-width: 768px) {
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
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ function ChallengeHistoryModalContainer({
loading,
isCopilot,
isAlgo,
themeName,
}) {
useEffect(() => {
getChallengesHistory(dataUrl, competitor);
Expand All @@ -26,6 +27,7 @@ function ChallengeHistoryModalContainer({
loading={loading}
isCopilot={isCopilot}
isAlgo={isAlgo}
themeName={themeName}
/>
);
}
Expand All @@ -36,6 +38,7 @@ ChallengeHistoryModalContainer.defaultProps = {
loading: false,
isCopilot: false,
isAlgo: false,
themeName: 'Default',
};

const CHALLENGES_TYPE = PT.arrayOf(PT.shape({
Expand All @@ -61,6 +64,7 @@ ChallengeHistoryModalContainer.propTypes = {
loading: PT.bool,
isAlgo: PT.bool,
isCopilot: PT.bool,
themeName: PT.string,
};

function mapStateToProps(state, ownProps) {
Expand Down
1 change: 1 addition & 0 deletions src/shared/containers/tco/Leaderboard/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class LeaderboardPageContainer extends React.Component {
dataUrl={tcoPointsApiUrl}
isCopilot={isCopilot}
isAlgo={isAlgo}
themeName={themeName}
/>
) : null
}
Expand Down

0 comments on commit 0d78f13

Please sign in to comment.