Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 6a135b0

Browse files
author
Victor George
committed
Merge branch 'dev' of github.com:appirio-tech/topcoder-app into forms-refactor
# By vikasrohit # Via vikasrohit * 'dev' of github.com:appirio-tech/topcoder-app: SUP-2255, Remove "Didn't Finish" from past challenges where user was not a submitter SUP-2250, Grey color for handle should be more darker than current one. SUP-2231, New Empty States for Dashboard and Profile SUP-2160, Displayed color for Handle/Rating should be yellow SUP-2250, Grey color for handle should be more darker than current one.
2 parents fc79a38 + 5608a43 commit 6a135b0

File tree

7 files changed

+33
-13
lines changed

7 files changed

+33
-13
lines changed

app/directives/challenge-user-place/design-challenge-user-place.directive.jade

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
p.place(ng-class="{ 'first-place': challenge.wonFirst }", ng-show="challenge.highestPlacement") {{challenge.highestPlacement}}#[span {{challenge.highestPlacement | ordinal:true}}] Place
33
p.place(ng-show="challenge.userStatus === 'NOT_FINISHED'") Didn't Finish
44
p.place(ng-show="challenge.userStatus === 'PASSED_SCREENING'") Passed Screening
5+
p.place(ng-show="challenge.userStatus === 'COMPLETED'") COMPLETED
56

67
.thumbnail(ng-click="openLightbox()", ng-class="{hidden: challenge.userStatus !== 'PASSED_REVIEW'}")
78
img(ng-src="http://studio.{{DOMAIN}}/studio.jpg?module=DownloadSubmission&sbmid={{challenge.thumbnailId}}&sbt=full", fallback-src="/images/ico-picture.svg")
@@ -16,6 +17,7 @@
1617
p.place(ng-class="{ 'first-place': challenge.wonFirst }", ng-show="challenge.highestPlacement") {{challenge.highestPlacement}}#[span {{challenge.highestPlacement | ordinal:true}}] Place
1718
p.place(ng-show="challenge.userStatus === 'NOT_FINISHED'") Didn't Finish
1819
p.place(ng-show="challenge.userStatus === 'PASSED_SCREENING'") Passed Screening
20+
p.place(ng-show="challenge.userStatus === 'COMPLETED'") COMPLETED
1921
p.date-completed {{challenge.submissionEndDate | date : 'MMMM yyyy'}}
2022

2123
.winner-ribbon(ng-show="challenge.wonFirst")

app/directives/challenge-user-place/dev-challenge-user-place.directive.jade

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
p.place(ng-class="{ 'first-place': challenge.wonFirst }", ng-show="challenge.highestPlacement") {{challenge.highestPlacement}}#[span {{challenge.highestPlacement | ordinal:true}}] Place
33
p.place(ng-show="challenge.userStatus === 'NOT_FINISHED'") Didn't Finish
44
p.place(ng-show="challenge.userStatus === 'PASSED_SCREENING'") Passed Screening
5+
p.place(ng-show="challenge.userStatus === 'COMPLETED'") COMPLETED
56

67
.challenge-score(ng-class="{hidden: challenge.userStatus !== 'PASSED_REVIEW'}")
78
p.score {{challenge.userDetails.submissionReviewScore/100 | percentage}}
@@ -13,6 +14,7 @@
1314
p.place(ng-class="{ 'first-place': challenge.wonFirst }", ng-show="challenge.highestPlacement") {{challenge.highestPlacement}}#[span {{challenge.highestPlacement | ordinal:true}}] Place
1415
p.place(ng-show="challenge.userStatus === 'NOT_FINISHED'") Didn't Finish
1516
p.place(ng-show="challenge.userStatus === 'PASSED_SCREENING'") Passed Screening
17+
p.place(ng-show="challenge.userStatus === 'COMPLETED'") Completed
1618
p.date-completed {{challenge.submissionEndDate | date : 'MMMM yyyy'}}
1719

1820
.winner-ribbon(ng-show="challenge.wonFirst")

app/filters/rating-color.filter.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,16 @@
1010
if (typeof rating === 'string')
1111
rating = parseInt(rating.replace(",", ""));
1212
colors = colors.filter(function(color) {
13-
return rating >= color.start && rating <= color.end;
13+
return rating !== null && rating >= color.start && rating <= color.end;
1414
});
1515
return colors[0] && colors[0].color || 'black';
1616
}
1717
var colors = [
18-
// level 0 grey
19-
{
20-
'color': '#F0F0F0',
21-
'darkerColor': '#F0F0F0',
22-
'start': 0,
23-
'end': 0
24-
},
2518
// grey
2619
{
2720
'color': '#9D9FA0',
2821
'darkerColor': '#9D9FA0',
29-
'start': 1,
22+
'start': 0,
3023
'end': 899
3124
},
3225
// green

app/profile/about/about.controller.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
vm.skillIndex = 0;
1414
vm.displaySection = {};
1515
vm.sampleSkills = [
16-
{"tagName":"VisualForce","hidden":false,"score":0,"sources":[], "tagId": 385},
17-
{"tagName":"MongoDB","hidden":false,"score":0,"sources":[], "tagId": 281},
18-
{"tagName":"Heroku","hidden":false,"score":0,"sources":[], "tagId": 210}
16+
{"tagName":"Photoshop","hidden":false,"score":0,"sources":[], "tagId": 302},
17+
{"tagName":"Sketch","hidden":false,"score":0,"sources":[], "tagId": 351},
18+
{"tagName":"HTML5","hidden":false,"score":0,"sources":[], "tagId": 213}
1919
];
2020

2121
activate();

app/services/challenge.service.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,20 @@
196196
}
197197
}
198198

199+
challenge.userHasSubmitterRole = false;
200+
201+
// determines if user has submitter role or not
202+
var roles = challenge.userDetails.roles;
203+
if (roles.length > 0) {
204+
var submitterRole = _.findIndex(roles, function(role) {
205+
var lRole = role.toLowerCase();
206+
return lRole === 'submitter';
207+
});
208+
if (submitterRole >= 0) {
209+
challenge.userHasSubmitterRole = true;
210+
}
211+
}
212+
199213
if (challenge.userDetails.hasUserSubmittedForReview) {
200214
if (!challenge.highestPlacement) {
201215
challenge.userStatus = "PASSED_SCREENING";
@@ -205,6 +219,11 @@
205219
} else {
206220
challenge.userStatus = "NOT_FINISHED";
207221
}
222+
223+
// if user does not has submitter role, just show Completed
224+
if (!challenge.userHasSubmitterRole) {
225+
challenge.userStatus = "COMPLETED";
226+
}
208227
}
209228
});
210229
}

app/services/profile.service.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@
286286
}
287287

288288
function getUserHandleColor(profile) {
289-
var rating = _.get(profile, 'maxRating.rating', 0);
289+
var rating = _.get(profile, 'maxRating.rating', null);
290290
return $filter('ratingColor')(rating);
291291
}
292292

assets/css/profile/about.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@
154154

155155
.skill {
156156
width: 130px;
157+
opacity: 0.3;
158+
a {
159+
cursor: default;
160+
}
157161
}
158162
}
159163
}

0 commit comments

Comments
 (0)