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

Commit 410addc

Browse files
author
Parth Shah
committed
Merge branch 'dev' of github.com:appirio-tech/topcoder-app into dev
2 parents 2b4984e + 7ae1a21 commit 410addc

File tree

12 files changed

+127
-18
lines changed

12 files changed

+127
-18
lines changed

app/directives/account/toggle-password-with-tips/toggle-password-with-tips.jade

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

1313
ng-minlength="8",
1414
ng-maxlength="64",
15+
maxlength="64",
1516
has-letter,
1617
has-symbol-or-number,
1718
required)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
p(ng-switch-when="MARATHON_MATCH") {{challenge.numRegistrants[0]}}
66
p(ng-switch-default) {{challenge.numRegistrants}}
77

8-
a.submissions(ng-hide="challenge.track === 'DATA_SCIENCE'", ng-href="")
8+
a.submissions(ng-hide="challenge.track === 'DATA_SCIENCE'", ng-href="{{challenge|challengeLinks:'registrants'}}")
99
.icon.submissions-icon
1010
p {{challenge.numSubmissions}}
1111

app/directives/empty-state-placeholder/empty-state-placeholder.directive.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
});
2424
scope.transcluded = angular.element(contentDiv)[0].children.length > 0;
2525
},
26-
controller: ['$scope', 'CONSTANTS', '$attrs', '$element',
27-
function($scope, CONSTANTS, $attrs, $element) {
26+
controller: ['$scope', '$attrs', '$element',
27+
function($scope, $attrs, $element) {
2828
$scope.DOMAIN = CONSTANTS.domain;
2929
var vm = this;
3030
vm.title = null;
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
/* jshint -W117, -W030 */
2+
describe('Empty State Placeholder Directive', function() {
3+
var scope;
4+
var element;
5+
var emptyStateService;
6+
var stateToTest = null;
7+
var stateToTestName = "dashboard-challenges";
8+
9+
beforeEach(function() {
10+
bard.appModule('topcoder');
11+
bard.inject(this, '$compile', '$rootScope', 'EmptyStateService');
12+
emptyStateService = EmptyStateService;
13+
stateToTest = emptyStateService.getState(stateToTestName);
14+
});
15+
16+
bard.verifyNoOutstandingHttpRequests();
17+
18+
describe('Without transcluded content', function() {
19+
var emptyState;
20+
21+
beforeEach(function() {
22+
scope = $rootScope.$new();
23+
scope.show = true;
24+
scope.theme = 'black';
25+
scope.stateName = stateToTestName;
26+
element = angular.element('<empty-state-placeholder state-name="{{stateName}}" theme="{{theme}}" show="show"></empty-state-placeholder>)');
27+
emptyState = $compile(element)(scope);
28+
scope.$digest();
29+
controller = element.controller('emptyStatePlaceholder');
30+
});
31+
32+
it('should have found a valid empty state', function() {
33+
expect(controller.title).to.exist.to.equal(stateToTest.title);
34+
expect(controller.description).to.exist.to.equal(stateToTest.description);
35+
expect(controller.helpLinks).to.exist;
36+
expect(controller.helpLinks.length).to.equal(stateToTest.helpLinks.length);
37+
});
38+
39+
it('should have valid visibilty state', function() {
40+
expect(controller.show).to.exist.to.equal(true);
41+
expect(controller.theme).to.exist.to.equal('black');
42+
});
43+
44+
it('should have valid transcluded state', function() {
45+
expect(element.isolateScope().transcluded).to.exist.to.equal(false);
46+
});
47+
48+
it('should watch changes in show param expression', function() {
49+
expect(controller.show).to.exist.to.equal(true);
50+
// update the show variable expression
51+
scope.show = false;
52+
scope.$digest();
53+
// should update controller's state
54+
expect(controller.show).to.exist.to.equal(false);
55+
});
56+
});
57+
58+
describe('With transcluded content', function() {
59+
var emptyState;
60+
61+
beforeEach(function() {
62+
scope = $rootScope.$new();
63+
scope.show = true;
64+
scope.theme = 'black';
65+
scope.stateName = stateToTestName;
66+
element = angular.element('<empty-state-placeholder state-name="{{stateName}}" theme="{{theme}}" show="show"><span>Test</span></empty-state-placeholder>)');
67+
emptyState = $compile(element)(scope);
68+
scope.$digest();
69+
controller = element.controller('emptyStatePlaceholder');
70+
});
71+
72+
it('should have found a valid empty state', function() {
73+
expect(controller.title).to.exist.to.equal(stateToTest.title);
74+
expect(controller.description).to.exist.to.equal(stateToTest.description);
75+
expect(controller.helpLinks).to.exist;
76+
expect(controller.helpLinks.length).to.equal(stateToTest.helpLinks.length);
77+
});
78+
79+
it('should have valid visibilty state', function() {
80+
expect(controller.show).to.exist.to.equal(true);
81+
expect(controller.theme).to.exist.to.equal('black');
82+
});
83+
84+
it('should have valid transcluded state', function() {
85+
expect(element.isolateScope().transcluded).to.exist.to.equal(true);
86+
});
87+
88+
it('should watch changes in show param expression', function() {
89+
expect(controller.show).to.exist.to.equal(true);
90+
// update the show variable expression
91+
scope.show = false;
92+
scope.$digest();
93+
// should update controller's state
94+
expect(controller.show).to.exist.to.equal(false);
95+
});
96+
});
97+
});

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
.info
77
h1.handle(style="color:{{handleColor}};") {{profile.handle}}
88

9-
h3.location-challenges {{profile.homeCountryCode | isoCountry}}
10-
span.bar(ng-show="profile.homeCountryCode && numWins") &nbsp;|&nbsp;
9+
h3.location-challenges {{profile.competitionCountryCode | isoCountry}}
10+
span.bar(ng-show="profile.competitionCountryCode && numWins") &nbsp;|&nbsp;
1111
span(ng-show="numWins") {{numWins}} Wins
1212

1313
h3.tenure(ng-if="profile.startMonth")
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
section(ng-switch="state")
22
.section-loading(ng-switch-when="loading")
33

4-
p(ng-switch-when="error") {{errMsg}}
4+
.section-error(ng-switch-when="error")
5+
p {{errMsg}}
56

67
div(ng-transclude, ng-switch-when="ready")

app/my-dashboard/srms/srms.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ section(ng-hide="vm.loading")
1616

1717
a.tc-btn.tc-btn-s.tc-btn-wide.tc-btn-ghost(ng-href="https://community.{{DOMAIN}}/wiki/display/tc/Algorithm+Problem+Set+Analysis") Match Editorials
1818

19-
a.tc-btn.tc-btn-s.tc-btn-wide.tc-btn-ghost(ng-href="https://www.{{DOMAIN}}/member-onboarding") Learn More
19+
a.tc-btn.tc-btn-s.tc-btn-wide.tc-btn-ghost(ng-href="https://www.{{DOMAIN}}/member-onboarding/learning-practicing-skills/") Learn More
2020

2121
.srms-links(ng-hide="vm.loading")
2222
a(ui-sref="my-srms") View Past SRMs

app/my-srms/my-srms.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
empty-state-placeholder(title="Past SRMs", description="You have not participated in any SRMs yet.", show="vm.statusFilter === 'past'")
2020
.info-links
2121
a.find-srms.tc-btn.tc-btn-s.tc-btn-ghost(ng-href="https://www.{{DOMAIN}}/challenges/data?pageIndex=1") Find SRMs
22-
a.learn-more(href="https://www.{{DOMAIN}}/member-onboarding") Learn More
22+
a.learn-more(href="https://www.{{DOMAIN}}/member-onboarding/competing-in-an-algorithm-match-srm/ ") Learn More
2323
empty-state-placeholder(title="Upcoming SRMs", description="There are no upcoming SRMs.", show="vm.statusFilter === 'future'")
2424

2525
.has-srms(ng-show="vm.srms.length")

app/services/emptyState.service.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
cssClass: "find-challenges tc-btn tc-btn-s"
6565
}, {
6666
title: "Learn More",
67-
url: _getUrl("/member-onboarding"),
67+
url: _getUrl("/getting-started"),
6868
cssClass: "learn-more"
6969
}]
7070
},
@@ -86,7 +86,7 @@
8686
cssClass: "find-challenges tc-btn tc-btn-s tc-btn-ghost"
8787
}, {
8888
title: "Learn More",
89-
url: _getUrl("/member-onboarding"),
89+
url: _getUrl("/getting-started"),
9090
cssClass: "learn-more"
9191
}]
9292
},
@@ -99,7 +99,7 @@
9999
cssClass: "find-challenges tc-btn tc-btn-s tc-btn-ghost"
100100
}, {
101101
title: "Learn More",
102-
url: _getUrl("/member-onboarding"),
102+
url: _getUrl("/getting-started"),
103103
cssClass: "learn-more"
104104
}]
105105
},
@@ -112,7 +112,7 @@
112112
cssClass: "find-challenges tc-btn tc-btn-s tc-btn-ghost"
113113
}, {
114114
title: "Learn More",
115-
url: _getUrl("/member-onboarding"),
115+
url: _getUrl("/getting-started"),
116116
cssClass: "learn-more"
117117
}]
118118
},

app/services/nav.service.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616

1717
service.menuLinks = {
1818
'compete': [
19-
{ 'href': "/challenges/design/active/", 'text': 'DESIGN CHALLENGES', 'icon': '/images/nav/track-design.svg' },
20-
{ 'href': "/challenges/develop/active", 'text': 'DEVELOPMENT CHALLENGES', 'icon': '/images/nav/track-develop.svg' },
21-
{ 'href': "/challenges/data/active", 'text': 'DATA SCIENCE CHALLENGES', 'icon': '/images/nav/track-data.svg' },
22-
{ 'href': CONSTANTS.ARENA_URL, 'text': 'THE ARENA', 'icon': '/images/nav/track-cp.svg', 'target': '_blank' },
19+
{ 'href': "/challenges/design/active/?pageIndex=1", 'text': 'DESIGN CHALLENGES', 'icon': '/images/nav/track-design.svg' },
20+
{ 'href': "/challenges/develop/active/?pageIndex=1", 'text': 'DEVELOPMENT CHALLENGES', 'icon': '/images/nav/track-develop.svg' },
21+
{ 'href': "/challenges/data/active/?pageIndex=1", 'text': 'DATA SCIENCE CHALLENGES', 'icon': '/images/nav/track-data.svg' },
22+
{ 'href': CONSTANTS.ARENA_URL, 'text': 'COMPETITIVE PROGRAMMING', 'icon': '/images/nav/track-cp.svg', 'target': '_blank' },
2323
],
2424
'learn': [
25-
{ 'href': '/member-onboarding/', 'text': 'GET STARTED', 'icon': '/images/nav/rocket.svg' },
25+
{ 'href': '/getting-started/', 'text': 'GETTING STARTED', 'icon': '/images/nav/rocket.svg' },
2626
{ 'href': '/community/design/', 'text': 'DESIGN', 'icon': '/images/nav/book-design.svg' },
2727
{ 'href': '/community/development/', 'text': 'DEVELOPMENT', 'icon': '/images/nav/book-develop.svg' },
2828
{ 'href': '/community/data-science/', 'text': 'DATA SCIENCE', 'icon': '/images/nav/book-data.svg' },

assets/css/directives/tc-section.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,14 @@
99
min-height: 100px;
1010
background: url(/images/ripple.gif) no-repeat center center;
1111
}
12+
13+
.section-error {
14+
width: 100%;
15+
min-height: 100px;
16+
background: $white;
17+
border-top: 1px solid $gray-light;
18+
display: flex;
19+
justify-content: center;
20+
align-items: center;
21+
}
1222
}

assets/css/partials/_tc-buttons.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ button {
99
transition: .15s all;
1010
cursor: pointer;
1111

12-
&:disabled {
12+
&:disabled, &.disabled {
1313
background-color: $gray !important;
1414
border-color: $gray-dark !important;
1515
opacity: 1;

0 commit comments

Comments
 (0)