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

Commit ddb51fd

Browse files
author
vikasrohit
committed
Merge pull request #629 from appirio-tech/qa-integration
Production release SUP-TCApp-v.1.0.19
2 parents c06e4be + 586750b commit ddb51fd

39 files changed

+720
-209
lines changed

.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1.0.17
1+
v1.0.18

app/community/members.jade

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@
2828
small {{ctrl.currentMonth}}
2929
.members-wrapper
3030
.user-tile(ng-repeat="item in ctrl.memberLeaderboard")
31-
.avatar-wrapper: img(ng-src="{{item.avatar}}")
32-
.user-name {{item.name}}
31+
a.avatar-wrapper(ui-sref="profile.about({userHandle: item.name})")
32+
img(ng-src="{{item.avatar}}")
33+
a.user-name(ui-sref="profile.about({userHandle: item.name})") {{item.name}}
3334
.user-tag(class="{{item.class}}") {{item.contestType}}
3435
p.user-desc {{item.description}}
3536
a(ng-href="//www.{{ctrl.domain}}/community/member-programs/topcoder-member-of-the-month/", target="_blank").user-more Read the story

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/directives/srm-tile/srm-tile.directive.jade

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
.challenge-track
44

55
header
6-
a(ng-href="https://community.{{DOMAIN}}/tc?module=MatchDetails&rd={{srm.rounds[0].id}}") {{srm.name}}
6+
a(ng-href="https://community.{{DOMAIN}}/stat?c=round_overview&rd={{roundId}}") {{srm.name}}
77

88
.srm-details
99
p.starts-in Starts in #[span {{srm.codingStartAt | timeDiff:"quantity"}} {{srm.codingStartAt | timeDiff:'unit'}}]
@@ -17,22 +17,22 @@
1717
.phase-status
1818
.registered(ng-show="srm.userStatus === CONSTANTS.REGISTERED") Registered
1919
.unregistered(ng-hide="srm.currentPhase !== CONSTANTS.REGISTRATION || srm.userStatus === CONSTANTS.REGISTERED")
20-
a.tc-btn.tc-btn-s.tc-btn-wide(href="https://community.{{DOMAIN}}/tc?module=MatchDetails&rd={{srm.rounds[0].id}}") Register
20+
a.tc-btn.tc-btn-s.tc-btn-wide(href="https://community.{{DOMAIN}}/tc?module=MatchDetails&rd={{roundId}}") Register
2121

2222
.past-srm(ng-show="srm.status === 'PAST'")
2323
.challenge-track
2424

2525
header
26-
a(ng-href="https://community.{{DOMAIN}}/tc?module=MatchDetails&rd={{srm.rounds[0].id}}") {{srm.name}}
26+
a(ng-href="https://community.{{DOMAIN}}/stat?c=round_overview&rd={{roundId}}") {{srm.name}}
2727
.ended-on #[span {{srm.codingEndAt | localTime:"MMM DD, YYYY" }}]
2828

2929
.member-stats
3030
p.points #[span {{srm.result.finalPoints }}] #[span Points]
3131
.ranks
32-
.division
32+
a.division(href="https://community.{{DOMAIN}}/stat?c=round_stats&rd={{roundId}}&dn={{division}}")
3333
p.rank {{srm.result.divisionPlacement}}
3434
p.label #[span Division {{srm.result.division}}]
35-
.room
35+
a.room(href="https://community.{{DOMAIN}}/stat?c=coder_room_stats&cr={{userId}}&rd={{roundId}}")
3636
p.rank #[span {{srm.result.roomPlacement}}]
3737
p.label #[span Room]
3838
p.placement Placement
@@ -42,21 +42,21 @@
4242
.challenge-track
4343
header
4444
.srm-name
45-
a(ng-href="https://community.{{DOMAIN}}/tc?module=MatchDetails&rd={{srm.rounds[0].id}}") {{srm.name}}
45+
a(ng-href="https://community.{{DOMAIN}}/stat?c=round_overview&rd={{roundId}}") {{srm.name}}
4646

4747
.srm-details
4848
p.starts-in Starts in #[span {{srm.codingStartAt | timeDiff:"quantity"}} {{srm.codingStartAt | timeDiff:'unit'}}]
4949

5050
.phase-status
5151
.registered(ng-show="srm.userStatus === CONSTANTS.REGISTERED") Registered
5252
.unregistered(ng-hide="srm.currentPhase !== CONSTANTS.REGISTRATION || srm.userStatus === CONSTANTS.REGISTERED")
53-
a.tc-btn.tc-btn-s.tc-btn-wide(href="https://community.{{DOMAIN}}/tc?module=MatchDetails&rd={{srm.rounds[0].id}}") Register
53+
a.tc-btn.tc-btn-s.tc-btn-wide(href="https://community.{{DOMAIN}}/tc?module=MatchDetails&rd={{roundId}}") Register
5454

5555
.past-srm(ng-show="srm.status === 'PAST'")
5656
.challenge-track
5757
header
5858
.srm-name
59-
a(ng-href="https://community.{{DOMAIN}}/tc?module=MatchDetails&rd={{srm.rounds[0].id}}") {{srm.name}}
59+
a(ng-href="https://community.{{DOMAIN}}/stat?c=round_overview&rd={{roundId}}") {{srm.name}}
6060

6161
.srm-details
6262
p.ended-on Ended {{srm.codingEndAt | timeDiff:"quantity"}} {{srm.codingEndAt | timeDiff:'unit'}} ago
@@ -65,10 +65,10 @@
6565
p.points #[span {{srm.result.finalPoints }}] Points
6666

6767
.ranks
68-
.division
68+
a.division(ng-class="{noclick: !srm.result.divisionPlacement}", href="https://community.{{DOMAIN}}/stat?c=round_stats&rd={{roundId}}&dn={{division}}")
6969
p.rank {{srm.result.divisionPlacement}}
7070
p.label #[span Div {{srm.result.division}}] #[span Placement]
71-
.room
71+
a.room(ng-class="{noclick: !srm.result.roomPlacement}", href="https://community.{{DOMAIN}}/stat?c=coder_room_stats&cr={{userId}}&rd={{roundId}}")
7272
p.rank #[span {{srm.result.roomPlacement}}]
7373
p.label #[span Room] #[span Placement]
7474

app/directives/srm-tile/srm-tile.directive.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@
88
srm: '=srm',
99
view: '=',
1010
showResults: '=',
11-
showFooter: '='
11+
showFooter: '=',
12+
userId: '='
1213
},
1314
controller: ['$scope', '$filter', 'CONSTANTS', 'SRMService',
1415
function($scope, $filter, CONSTANTS, SRMService) {
15-
$scope.DOMAIN = CONSTANTS.domain;
16-
$scope.CONSTANTS = CONSTANTS;
17-
$scope.srm.userStatus = _.get($scope.srm, 'userStatus', null);
18-
SRMService.processSRM($scope.srm);
16+
$scope.DOMAIN = CONSTANTS.domain;
17+
$scope.CONSTANTS = CONSTANTS;
18+
$scope.srm.userStatus = _.get($scope.srm, 'userStatus', null);
19+
SRMService.processSRM($scope.srm);
20+
$scope.roundId = $scope.srm.rounds.length && $scope.srm.rounds[0].id;
21+
$scope.division = $scope.srm.result && $scope.srm.result.division;
1922
}]
2023
};
2124
});

app/my-dashboard/srms/srms.controller.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
var userId = UserService.getUserIdentity().userId;
1414
var handle = UserService.getUserIdentity().handle;
15+
vm.userId = userId;
1516

1617
activate();
1718

app/my-dashboard/srms/srms.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ header
66

77
tc-section(state="vm.state")
88
.srm-tiles
9-
srm-tile(ng-repeat="srm in vm.srms", srm="srm", view="'tile'", ng-class="'tile-view'")
9+
srm-tile(ng-repeat="srm in vm.srms", srm="srm", view="'tile'", ng-class="'tile-view'", user-id="vm.userId")
1010

1111
.srm-links-card
1212
.flex-wrapper

app/my-srms/my-srms.controller.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
var userId = UserService.getUserIdentity().userId;
3030
var userHandle = UserService.getUserIdentity().handle;
31+
vm.userId = userId;
3132
vm.handle = userHandle;
3233

3334
activate();

app/my-srms/my-srms.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@
2323
.data(ng-class="vm.view + '-view'")
2424
srm-tile.srm-tile(
2525
ng-repeat="srm in vm.srms | orderBy:vm.orderBy:vm.reverseOrder",
26-
srm="srm", view="vm.view", ng-class="vm.view + '-view'", show-results="vm.statusFilter === 'past'")
26+
srm="srm", view="vm.view", ng-class="vm.view + '-view'", show-results="vm.statusFilter === 'past'", user-id="vm.userId")
2727

2828
tc-endless-paginator(state="vm.loading", page-params="vm.pageParams")

app/profile/subtrack/data/data-challenges.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
.challenges(ng-show="vm.subTrack == 'SRM'")
1212
.challenge.tile(ng-repeat="challenge in vm.challenges")
13-
srm-tile(srm="challenge", domain="vm.domain", view="'tile'")
13+
srm-tile(srm="challenge", domain="vm.domain", view="'tile'", user-id="profileVm.profile.userId")
1414

1515
.no-challenges(ng-show="!vm.challenges || vm.challenges.length == 0")
1616
| Sorry, no rated SRMs found.

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) {

0 commit comments

Comments
 (0)