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

Commit e44ee40

Browse files
author
Jenkins Continuous Integration Server
committed
Merge commit 'b5193b3c40050cc5824233371ae570c69ef64264' into HEAD
2 parents 4a3b642 + b5193b3 commit e44ee40

File tree

8 files changed

+37
-11
lines changed

8 files changed

+37
-11
lines changed

app/directives/challenge-user-place/challenge-user-place.directive.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@
5959
$scope.imageURL = $scope.challenge.userDetails.submissions[0].submissionImage && $scope.challenge.userDetails.submissions[0].submissionImage.full;
6060
$scope.selectedImage = $scope.imageURL;
6161

62-
$scope.challenge.highestPlacement = _.max($scope.challenge.userDetails.submissions, 'placement').placement;
62+
$scope.challenge.highestPlacement = _.min($scope.challenge.userDetails.submissions.filter(function(submission) {
63+
return submission.type === CONSTANTS.SUBMISSION_TYPE_CONTEST && submission.placement;
64+
}), 'placement').placement;
6365

6466
if ($scope.challenge.highestPlacement == 1) {
6567
$scope.challenge.wonFirst = true;

app/directives/external-account/external-web-links.directive.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
$log.debug("Web link added: " + JSON.stringify(data));
3939
data.data.provider = data.provider;
4040
$scope.linkedAccounts.push(data.data);
41+
// reset the form when it is successfully added
42+
$scope.addWebLinkFrm.$setPristine();
43+
$scope.url = null;
4144
toaster.pop('success', "Success", "Your link has been added. Data from your link will be visible on your profile shortly.");
4245
})
4346
.catch(function(resp) {

app/directives/external-account/external-web-links.directive.spec.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,24 +90,29 @@ describe('ExternalWebLinks Directive', function() {
9090
});
9191
expect(topcoderLink).to.exist;
9292
expect(topcoderLink.status).to.exist.to.equal('PENDING');
93+
expect(element.isolateScope().url).not.to.exist;
9394
expect(toasterSvc.pop).to.have.been.calledWith('success').calledOnce;
9495
});
9596

9697
it('should NOT add new weblink to linkedAccounts', function() {
98+
var urlToAdd = 'https://www.topcoder.com';
9799
element.isolateScope().userHandle = 'throwError';
98-
element.isolateScope().url = 'https://www.topcoder.com';
100+
element.isolateScope().url = urlToAdd;
99101
element.isolateScope().addWebLink();
100102
scope.$digest();
101103
expect(scope.linkedAccounts).to.have.length(1);
104+
expect(element.isolateScope().url).to.exist.to.equal(urlToAdd);
102105
expect(toasterSvc.pop).to.have.been.calledWith('error').calledOnce;
103106
});
104107

105108
it('should NOT add new weblink to linkedAccounts', function() {
109+
var urlToAdd = 'https://www.topcoder.com';
106110
element.isolateScope().userHandle = 'alreadyExistsError';
107-
element.isolateScope().url = 'https://www.topcoder.com';
111+
element.isolateScope().url = urlToAdd;
108112
element.isolateScope().addWebLink();
109113
scope.$digest();
110114
expect(scope.linkedAccounts).to.have.length(1);
115+
expect(element.isolateScope().url).to.exist.to.equal(urlToAdd);
111116
expect(toasterSvc.pop).to.have.been.calledWith('error').calledOnce;
112117
});
113118

app/services/challenge.service.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@
190190
challenge.thumbnailId = challenge.userDetails.submissions[0].id;
191191

192192
challenge.highestPlacement = _.min(challenge.userDetails.submissions.filter(function(submission) {
193-
return submission.placement;
193+
return submission.type === CONSTANTS.SUBMISSION_TYPE_CONTEST && submission.placement;
194194
}), 'placement').placement;
195195

196196
if (challenge.highestPlacement == 1) {

app/topcoder.constants.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ angular.module("CONSTANTS", [])
3232
"BUSY_PROGRESS_MESSAGE": "Processing..",
3333
"REGISTRATION": "REGISTRATION",
3434
"CODING": "CODING",
35-
"REGISTERED": "REGISTERED"
35+
"REGISTERED": "REGISTERED",
36+
"SUBMISSION_TYPE_CONTEST": "Contest Submission"
3637
})
3738

3839
;

assets/css/directives/design-challenge-user-place.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ design-challenge-user-place {
1111
.place {
1212
&.completed, &.passed, &.didnt {
1313
margin-bottom: -36px;
14-
margin-top: 40px;
14+
margin-top: 52px;
1515
}
1616
margin-bottom: 8px;
1717
margin-top: 8px;
File renamed without changes.

config.js

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ module.exports = function() {
4242
CODING: 'CODING',
4343

4444
// users' status
45-
REGISTERED: 'REGISTERED'
45+
REGISTERED: 'REGISTERED',
46+
47+
// submission type
48+
SUBMISSION_TYPE_CONTEST: 'Contest Submission'
4649

4750
}
4851
},
@@ -88,7 +91,10 @@ module.exports = function() {
8891
CODING: 'CODING',
8992

9093
// users' status
91-
REGISTERED: 'REGISTERED'
94+
REGISTERED: 'REGISTERED',
95+
96+
// submission type
97+
SUBMISSION_TYPE_CONTEST: 'Contest Submission'
9298

9399
}
94100
},
@@ -134,7 +140,10 @@ module.exports = function() {
134140
CODING: 'CODING',
135141

136142
// users' status
137-
REGISTERED: 'REGISTERED'
143+
REGISTERED: 'REGISTERED',
144+
145+
// submission type
146+
SUBMISSION_TYPE_CONTEST: 'Contest Submission'
138147

139148
}
140149
},
@@ -180,7 +189,10 @@ module.exports = function() {
180189
CODING: 'CODING',
181190

182191
// users' status
183-
REGISTERED: 'REGISTERED'
192+
REGISTERED: 'REGISTERED',
193+
194+
// submission type
195+
SUBMISSION_TYPE_CONTEST: 'Contest Submission'
184196

185197
}
186198
},
@@ -226,7 +238,10 @@ module.exports = function() {
226238
CODING: 'CODING',
227239

228240
// users' status
229-
REGISTERED: 'REGISTERED'
241+
REGISTERED: 'REGISTERED',
242+
243+
// submission type
244+
SUBMISSION_TYPE_CONTEST: 'Contest Submission'
230245

231246
}
232247
}

0 commit comments

Comments
 (0)