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

Commit 8392e0f

Browse files
committed
Merge branch 'dev' into feature/tom-address/validation
2 parents eee89ff + f9a8b32 commit 8392e0f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+661
-360
lines changed

.version

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

app/account/login/login.spec.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ describe('Login Controller', function() {
88
});
99

1010
beforeEach(function() {
11-
controller = $controller('LoginController');
11+
$scope = $rootScope.$new();
12+
controller = $controller('LoginController', {
13+
$scope : $scope
14+
});
1215
$rootScope.$apply();
1316
});
1417

app/directives/challenge-tile/challenge-tile.directive.jade

Lines changed: 4 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -75,23 +75,10 @@
7575
p BLAH
7676

7777
.challenge-details(ng-switch-when="DEVELOP")
78-
p.place(ng-class="{ 'first-place': challenge.wonFirst }") {{challenge.highestPlacement}}#[span {{challenge.highestPlacement | ordinal:true}}] Place
79-
80-
.challenge-score
81-
p.score {{challenge.userDetails.submissionReviewScore/100 | percentage}}
82-
83-
p Review Score
78+
dev-challenge-user-place(challenge="challenge", view="view")
8479

8580
.challenge-details(ng-switch-when="DESIGN")
86-
p.place(ng-class="{ 'first-place': challenge.wonFirst }") {{challenge.highestPlacement}}#[span {{challenge.highestPlacement | ordinal:true}}] Place
87-
88-
.thumbnail(ng-click="openLightbox()")
89-
img(ng-src="http://studio.{{DOMAIN}}/studio.jpg?module=DownloadSubmission&sbmid={{challenge.thumbnailId}}&sbt=full", fallback-src="/images/ico-picture.svg")
90-
91-
.thumbnail-gallery(ng-click="challenge.showLightbox()")
92-
.gallery-icon
93-
94-
.num-images 1 image
81+
design-challenge-user-place(challenge="challenge", view="view")
9582

9683
.challenge.list-view(ng-show="view=='list'", ng-class="challenge.track")
9784
.active-challenge(ng-show="challenge.status === 'ACTIVE'")
@@ -163,28 +150,7 @@
163150
p Total Points
164151

165152
.challenge-details(ng-switch-when="DEVELOP")
166-
.place-date
167-
p.place(ng-class="{ 'first-place': challenge.wonFirst }") {{challenge.highestPlacement}}#[span {{challenge.highestPlacement | ordinal:true}}] Place
168-
p.date-completed {{challenge.submissionEndDate | date : 'MMMM yyyy'}}
169-
170-
.winner-ribbon(ng-show="challenge.wonFirst")
171-
172-
.challenge-score
173-
p.score {{challenge.userDetails.submissionReviewScore/100 | percentage}}
174-
175-
p Review Score
153+
dev-challenge-user-place(challenge="challenge", view="view")
176154

177155
.challenge-details(ng-switch-when="DESIGN")
178-
.place-date
179-
p.place(ng-class="{ 'first-place': challenge.wonFirst }") {{challenge.highestPlacement}}#[span {{challenge.highestPlacement | ordinal:true}}] Place
180-
p.date-completed {{challenge.submissionEndDate | date : 'MMMM yyyy'}}
181-
182-
.winner-ribbon(ng-show="challenge.wonFirst")
183-
184-
.thumbnail(ng-click="openLightbox()")
185-
img(ng-src="http://studio.{{DOMAIN}}/studio.jpg?module=DownloadSubmission&sbmid={{challenge.thumbnailId}}&sbt=full", fallback-src="/images/ico-picture.svg")
186-
187-
.thumbnail-gallery(ng-click="challenge.showLightbox()")
188-
.gallery-icon
189-
190-
.num-images 1 image
156+
design-challenge-user-place(challenge="challenge", view="view")

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,6 @@
2323
$scope.challenge.subTrack === 'MARATHON_MATCH') {
2424
ChallengeService.processPastMarathonMatch($scope.challenge);
2525
}
26-
if ($scope.challenge.track == 'DESIGN' && $scope.challenge.userDetails.submissions && $scope.challenge.userDetails.submissions.length > 0) {
27-
$scope.challenge.thumbnailId = $scope.challenge.userDetails.submissions[0].id;
28-
29-
$scope.challenge.highestPlacement = _.max($scope.challenge.userDetails.submissions, 'placement').placement;
30-
31-
if ($scope.challenge.highestPlacement == 1) {
32-
$scope.challenge.wonFirst = true;
33-
}
34-
}
3526
}
3627

3728
function openLightbox() {
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
(function() {
2+
'use strict';
3+
4+
angular.module('tcUIComponents')
5+
.directive('devChallengeUserPlace', devChallengeUserPlace)
6+
.directive('designChallengeUserPlace', designChallengeUserPlace);
7+
8+
function devChallengeUserPlace() {
9+
return {
10+
restrict: 'E',
11+
templateUrl: 'directives/challenge-user-place/dev-challenge-user-place.directive.html',
12+
scope: {
13+
challenge: '=',
14+
view: '='
15+
},
16+
controller: ['$scope', 'CONSTANTS', '$attrs', 'ChallengeService',
17+
function($scope, CONSTANTS, $attrs, ChallengeService) {
18+
$scope.DOMAIN = CONSTANTS.domain;
19+
20+
activate();
21+
22+
function activate() {
23+
}
24+
}]
25+
};
26+
}
27+
28+
function designChallengeUserPlace() {
29+
return {
30+
restrict: 'E',
31+
templateUrl: 'directives/challenge-user-place/design-challenge-user-place.directive.html',
32+
scope: {
33+
challenge: '=',
34+
view: '='
35+
},
36+
controller: ['$scope', 'CONSTANTS', '$attrs', 'ChallengeService',
37+
function($scope, CONSTANTS, $attrs, ChallengeService) {
38+
$scope.DOMAIN = CONSTANTS.domain;
39+
40+
activate();
41+
42+
function activate() {
43+
if ($scope.challenge.userDetails.submissions && $scope.challenge.userDetails.submissions.length > 0) {
44+
$scope.challenge.thumbnailId = $scope.challenge.userDetails.submissions[0].id;
45+
46+
$scope.challenge.highestPlacement = _.max($scope.challenge.userDetails.submissions, 'placement').placement;
47+
48+
if ($scope.challenge.highestPlacement == 1) {
49+
$scope.challenge.wonFirst = true;
50+
}
51+
}
52+
}
53+
}]
54+
};
55+
}
56+
})();
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
.tile-view(ng-show="view === 'tile'")
2+
p.place(ng-class="{ 'first-place': challenge.wonFirst }", ng-show="challenge.highestPlacement") {{challenge.highestPlacement}}#[span {{challenge.highestPlacement | ordinal:true}}] Place
3+
p.place(ng-show="challenge.userStatus === 'NOT_FINISHED'") Didn't Finish
4+
p.place(ng-show="challenge.userStatus === 'PASSED_SCREENING'") Passed Screening
5+
6+
.thumbnail(ng-click="openLightbox()", ng-class="{hidden: challenge.userStatus !== 'PASSED_REVIEW'}")
7+
img(ng-src="http://studio.{{DOMAIN}}/studio.jpg?module=DownloadSubmission&sbmid={{challenge.thumbnailId}}&sbt=full", fallback-src="/images/ico-picture.svg")
8+
9+
.thumbnail-gallery(ng-click="challenge.showLightbox()")
10+
.gallery-icon
11+
12+
.num-images 1 image
13+
14+
.list-view(ng-show="view === 'list'")
15+
.place-date
16+
p.place(ng-class="{ 'first-place': challenge.wonFirst }", ng-show="challenge.highestPlacement") {{challenge.highestPlacement}}#[span {{challenge.highestPlacement | ordinal:true}}] Place
17+
p.place(ng-show="challenge.userStatus === 'NOT_FINISHED'") Didn't Finish
18+
p.place(ng-show="challenge.userStatus === 'PASSED_SCREENING'") Passed Screening
19+
p.date-completed {{challenge.submissionEndDate | date : 'MMMM yyyy'}}
20+
21+
.winner-ribbon(ng-show="challenge.wonFirst")
22+
23+
.thumbnail(ng-click="openLightbox()", ng-class="{hidden: challenge.userStatus !== 'PASSED_REVIEW'}")
24+
img(ng-src="http://studio.{{DOMAIN}}/studio.jpg?module=DownloadSubmission&sbmid={{challenge.thumbnailId}}&sbt=full", fallback-src="/images/ico-picture.svg")
25+
26+
.thumbnail-gallery(ng-click="challenge.showLightbox()")
27+
.gallery-icon
28+
29+
.num-images 1 image
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.tile-view(ng-show="view === 'tile'")
2+
p.place(ng-class="{ 'first-place': challenge.wonFirst }", ng-show="challenge.highestPlacement") {{challenge.highestPlacement}}#[span {{challenge.highestPlacement | ordinal:true}}] Place
3+
p.place(ng-show="challenge.userStatus === 'NOT_FINISHED'") Didn't Finish
4+
p.place(ng-show="challenge.userStatus === 'PASSED_SCREENING'") Passed Screening
5+
6+
.challenge-score(ng-class="{hidden: challenge.userStatus !== 'PASSED_REVIEW'}")
7+
p.score {{challenge.userDetails.submissionReviewScore/100 | percentage}}
8+
9+
p Review Score
10+
11+
.list-view(ng-show="view === 'list'")
12+
.place-date
13+
p.place(ng-class="{ 'first-place': challenge.wonFirst }", ng-show="challenge.highestPlacement") {{challenge.highestPlacement}}#[span {{challenge.highestPlacement | ordinal:true}}] Place
14+
p.place(ng-show="challenge.userStatus === 'NOT_FINISHED'") Didn't Finish
15+
p.place(ng-show="challenge.userStatus === 'PASSED_SCREENING'") Passed Screening
16+
p.date-completed {{challenge.submissionEndDate | date : 'MMMM yyyy'}}
17+
18+
.winner-ribbon(ng-show="challenge.wonFirst")
19+
20+
.challenge-score(ng-class="{hidden: challenge.userStatus !== 'PASSED_REVIEW'}")
21+
p.score {{challenge.userDetails.submissionReviewScore/100 | percentage}}
22+
23+
p Review Score

app/directives/external-account/external-account.directive.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.ext-tile(ng-repeat="account in accountList | orderBy:'order'", ng-click="!account.disabled && !readOnly && handleClick(account.provider, account.status)", ng-class="{'connected': account.status === 'linked', 'disabled': account.disabled, 'enabled': !account.disabled, 'read-only': readOnly}")
1+
.ext-tile(ng-repeat="account in accountList | orderBy:'order'", ng-click="!account.disabled && !readOnly && handleClick(account.provider, account.status)", ng-class="{'connected': account.status === 'linked', 'connecting': account.status === 'pending', 'disabled': account.disabled, 'enabled': !account.disabled, 'read-only': readOnly}")
22
.external-account-box(ng-class="account.colorClass")
33
i.fa(ng-class="account.className")
44

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

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* jshint -W117, -W030 */
2-
describe.only('External Accounts Directive', function() {
2+
describe('External Accounts Directive', function() {
33
var scope;
44
var element;
55

@@ -66,13 +66,30 @@ describe('External Links Data Directive', function() {
6666
bard.verifyNoOutstandingHttpRequests();
6767

6868
describe('Linked external accounts', function() {
69+
var externalLinks = [
70+
{
71+
providerType: 'linkedin',
72+
// don't care about other details
73+
},
74+
{
75+
providerType: 'github'
76+
},
77+
{
78+
providerType: 'behance'
79+
},
80+
{
81+
providerType: 'dribbble'
82+
},
83+
{
84+
providerType: 'bitbucket'
85+
}
86+
];
6987
var linkedAccounts = {
7088
github: {
7189
handle: "github-handle",
7290
followers: 1,
7391
publicRepos: 1
7492
},
75-
7693
stackoverflow: {
7794
handle: 'so-handle',
7895
reputation: 2,
@@ -83,7 +100,7 @@ describe('External Links Data Directive', function() {
83100
projectViews: 3,
84101
projectAppreciations: 3
85102
},
86-
dribble: {
103+
dribbble: {
87104
handle: 'dribble-handle',
88105
followers: 4,
89106
likes: 4
@@ -107,14 +124,16 @@ describe('External Links Data Directive', function() {
107124

108125
beforeEach(function() {
109126
scope.linkedAccounts = linkedAccounts;
110-
element = angular.element('<external-links-data linked-accounts-data="linkedAccounts"></external-links-data>)');
127+
scope.externalLinks = externalLinks;
128+
element = angular.element('<external-links-data linked-accounts-data="linkedAccounts" external-links="externalLinks"></external-links-data>)');
111129
externalLinksData = $compile(element)(scope);
112130
scope.$digest();
113131
});
114132

115133
it('should have added linkedAccounts to scope', function() {
116134
expect(element.isolateScope().linkedAccounts).to.exist;
117-
expect(element.isolateScope().linkedAccounts).to.have.length(1);
135+
// linkedAccounts should have 5 entries because externalLinks contains only 5 records
136+
expect(element.isolateScope().linkedAccounts).to.have.length(5);
118137
});
119138

120139
});

app/directives/external-account/external-link-data.directive.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
.key likes
6666

6767
div(ng-switch-when="bitbucket")
68-
.handle {{account.data.username}}
68+
.handle {{account.data.handle}}
6969

7070
.pending(ng-show="account.data.status === 'PENDING'")
7171
p Loading data. This will take a few minutes.

app/directives/header/header-menu-item.directive.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ li.submenu-item(ng-if="item.sref && !item.srefParams")
66

77
// external links
88
li.submenu-item(ng-if="item.href && !item.srefParams")
9-
a.menu-link(ng-click="$event.stopPropagation();" ng-href="{{item.href}}" ng-class="{ 'active': isActive() }" target="_blank")
9+
a.menu-link(ng-click="$event.stopPropagation();" ng-href="{{item.href}}" ng-class="{ 'active': isActive() }" target="{{ item.target ? item.target : '_self'}}")
1010
img.menu-icon(ng-src="{{item.icon}}")
1111
.menu-text {{item.text}}
1212

app/directives/profile-widget/profile-widget.directive.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
(function() {
22
'use strict';
33

4-
angular.module('tcUIComponents').directive('profileWidget', ['CONSTANTS', profileWidget]);
4+
angular.module('tcUIComponents').directive('profileWidget', ['CONSTANTS', '$filter', profileWidget]);
55

6-
function profileWidget(CONSTANTS) {
6+
function profileWidget(CONSTANTS, $filter) {
77
return {
88
restrict: 'E',
99
templateUrl: 'directives/profile-widget/profile-widget.html',
@@ -16,7 +16,9 @@
1616
link: function(scope, elem, attrs) {
1717
scope.DOMAIN = CONSTANTS.domain;
1818
scope.ASSET_PREFIX = CONSTANTS.ASSET_PREFIX;
19-
19+
// get max rating or default to 0
20+
var rating = _.get(scope.profile, 'maxRating.rating', 0);
21+
scope.handleColor = $filter('ratingColor')(rating);
2022
scope.$watch('editProfileLink', function(newValue, oldValue, scope) {
2123
if (newValue) {
2224
scope.editProfileLink = newValue;

app/directives/profile-widget/profile-widget.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
img.profile-circle(ng-if="!profile.photoURL", src="/images/ico-user-default.svg")
55

66
.info
7-
h1.handle {{profile.handle}}
7+
h1.handle(style="color:{{handleColor}};") {{profile.handle}}
88

99
h3.tenure(ng-if="profile.startMonth")
1010
| Member Since {{profile.startMonth}}

0 commit comments

Comments
 (0)