Skip to content

Commit 7ef11d7

Browse files
authored
Merge pull request #4271 from topcoder-platform/hot-fix-show-best-rating-color-in-profile
Hot fix show best rating color in profile
2 parents 10b9ed4 + c889de2 commit 7ef11d7

File tree

4 files changed

+28
-5
lines changed

4 files changed

+28
-5
lines changed

.circleci/config.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ workflows:
175175
branches:
176176
only:
177177
- develop
178-
- hot-fix-profile-issue
179178
# This is alternate dev env for parallel testing
180179
- "build-test":
181180
context : org-global
@@ -192,7 +191,6 @@ workflows:
192191
branches:
193192
only:
194193
- develop
195-
- hotfix-legacy-mm
196194
# Production builds are exectuted
197195
# when PR is merged to the master
198196
# Don't change anything in this configuration

src/shared/components/ProfilePage/Header/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { noop, get } from 'lodash';
77
import moment from 'moment';
88
import ReactSVG from 'react-svg';
99

10-
import { getRatingColor } from 'utils/tc';
10+
import { getRatingLevel } from 'utils/tc';
1111
import { config, isomorphy } from 'topcoder-react-utils';
1212

1313
import CopilotIcon from 'assets/images/profile/ico-track-copilot.svg';
@@ -63,7 +63,7 @@ class ProfileHeader extends React.Component {
6363
{ imageUrl ? <img src={imageUrl} onError={this.loadImageError} styleName="profile-circle" alt="Member Portait" /> : <ReactSVG path={assets('./ico-user-default.svg')} /> }
6464
</div>
6565
<div styleName="info">
66-
<h1 style={{ color: getRatingColor(get(info, 'maxRating.rating', 0)) }} styleName="handle">
66+
<h1 styleName={`handle level-${getRatingLevel(get(info, 'maxRating.rating', 0))}`}>
6767
{info.handle}
6868
</h1>
6969
<h3 styleName="location-challenges">

src/shared/components/ProfilePage/Header/styles.scss

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,26 @@
3939
line-height: 34px;
4040

4141
@include sofia-pro-medium;
42+
43+
&.level-1 {
44+
color: $tc-level-1;
45+
}
46+
47+
&.level-2 {
48+
color: $tc-level-2;
49+
}
50+
51+
&.level-3 {
52+
color: $tc-level-3;
53+
}
54+
55+
&.level-4 {
56+
color: $tc-level-4;
57+
}
58+
59+
&.level-5 {
60+
color: $tc-level-5;
61+
}
4262
}
4363

4464
h3.tenure {

src/shared/components/ProfilePage/index.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ class ProfilePage extends React.Component {
119119
copilot,
120120
externalAccounts,
121121
externalLinks,
122-
info,
123122
skills: propSkills,
124123
stats,
125124
lookupData,
@@ -131,6 +130,12 @@ class ProfilePage extends React.Component {
131130
skillsExpanded,
132131
} = this.state;
133132

133+
let { info } = this.props;
134+
135+
if (_.isNull(_.get(info, 'maxRating.rating', 0)) && !_.isEmpty(stats)) {
136+
info = _.assign(info, { maxRating: stats[0].maxRating });
137+
}
138+
134139
// get country
135140
let country = '';
136141
if (_.has(lookupData, 'countries') && lookupData.countries.length > 0) {

0 commit comments

Comments
 (0)