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

Commit b2b953f

Browse files
author
vikasrohit
committed
SUP-2231, New Empty States for Dashboard and Profile
-- Updated empty states for My Challenges and My SRMs pages.
1 parent b43e990 commit b2b953f

File tree

8 files changed

+57
-25
lines changed

8 files changed

+57
-25
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.empty-state-placeholder
1+
.empty-state-placeholder(ng-show="vm.show")
22
.title(ng-bind="vm.title")
33
.description(ng-bind="vm.description")
44
.upsell(ng-transclude)

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

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,25 @@
1111
templateUrl: 'directives/empty-state-placeholder/empty-state-placeholder.directive.html',
1212
scope: {
1313
title: '@',
14-
description: '@'
14+
description: '@',
15+
show: '='
1516
},
1617
controller: ['$scope', 'CONSTANTS', '$attrs',
1718
function($scope, CONSTANTS, $attrs) {
18-
$scope.DOMAIN = CONSTANTS.domain;
19-
var vm = this;
20-
vm.title = $scope.title;
21-
vm.description = $scope.description;
19+
$scope.DOMAIN = CONSTANTS.domain;
20+
var vm = this;
21+
vm.title = $scope.title;
22+
vm.description = $scope.description;
23+
console.log($scope.show);
24+
vm.show = _.get($scope, 'show', false);
2225

23-
activate();
26+
activate();
2427

25-
function activate() {
26-
27-
}
28+
function activate() {
29+
$scope.$watch('show', function (newValue, oldValue) {
30+
vm.show = newValue;
31+
})
32+
}
2833
}],
2934
controllerAs: "vm"
3035
};

app/my-challenges/my-challenges.jade

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@
2424

2525
button.list(ng-click="vm.changeView('list')", ng-class="{ disabled: vm.view === 'list' }") List
2626

27-
.noChallenges(ng-show="vm.myChallenges.length === 0 && vm.loading === 'ready'")
28-
p(ng-show="vm.statusFilter === 'completed'") You have not participated in any challenges yet.
29-
p(ng-if="vm.statusFilter === 'active'")
30-
empty-state-placeholder(title="My Challenges", description="There are no active challenges.")
31-
.info-links
32-
a.find-challenges.tc-btn.tc-btn-s(ng-href="https://www.{{DOMAIN}}/challenges/?pageIndex=1") Find Challenges
33-
34-
a.learn-more(href="https://www.{{DOMAIN}}/community/getting-started/") Learn More
27+
section.noChallenges(ng-show="vm.myChallenges.length === 0 && vm.loading === 'ready'")
28+
empty-state-placeholder(title="Past Challenges", description="You have not participated in any challenges yet.", show="vm.statusFilter === 'completed'")
29+
.info-links
30+
a.find-challenges.tc-btn.tc-btn-s(ng-href="https://www.{{DOMAIN}}/challenges/?pageIndex=1") Find Challenges
31+
a.learn-more(href="https://www.{{DOMAIN}}/community/getting-started/") Learn More
32+
empty-state-placeholder(title="Active Challenges", description="There are no active challenges.", show="vm.statusFilter === 'active'")
33+
.info-links
34+
a.find-challenges.tc-btn.tc-btn-s(ng-href="https://www.{{DOMAIN}}/challenges/?pageIndex=1") Find Challenges
35+
a.learn-more(href="https://www.{{DOMAIN}}/community/getting-started/") Learn More
3536

3637
tc-section.hasChallenges(ng-show="vm.myChallenges.length", state="vm.loading")
3738

app/my-dashboard/my-challenges/my-challenges.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ header(ng-hide="vm.loading || !vm.userHasChallenges")
99
.section-loading(ng-show="vm.loading")
1010

1111
section.noChallenges(ng-if="!vm.userHasChallenges && !vm.loading")
12-
empty-state-placeholder(title="My Challenges", description="Compete in challenges to win money, test yourself against the world's best, and learn new skills")
12+
empty-state-placeholder(title="My Challenges", description="Compete in challenges to win money, test yourself against the world's best, and learn new skills", show="!vm.userHasChallenges")
1313
.info-links
1414
a.find-challenges.tc-btn.tc-btn-s(ng-href="https://www.{{DOMAIN}}/challenges/?pageIndex=1") Find Challenges
1515

app/my-dashboard/programs/programs.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ header(ng-hide="vm.loading || !vm.registered")
55

66
section.ios(ng-hide="vm.loading")
77
.unregistered(ng-hide="vm.registered")
8-
empty-state-placeholder(title="iOS COMMUNITY", description="Earn iOS topcoder badges and exclusive access to iOS challenges, prizes and special community-related events.")
8+
empty-state-placeholder(title="iOS COMMUNITY", description="Earn iOS topcoder badges and exclusive access to iOS challenges, prizes and special community-related events.", show="!vm.registered")
99
.info-links
1010
a.participate.tc-btn.tc-btn-s(ng-click="vm.registerUser()") Participate
1111

app/my-srms/my-srms.jade

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@
1616
button.list(ng-click="vm.changeView('list')", ng-class="{ disabled: vm.view === 'list' }") List
1717

1818
.no-srms(ng-if="!vm.srms.length && vm.loading === 'ready'")
19-
p(ng-if="vm.statusFilter === 'future'") There are no upcoming SRMs.
20-
p(ng-if="vm.statusFilter === 'past'") You have not participated in any SRMs yet.
19+
empty-state-placeholder(title="Past SRMs", description="You have not participated in any SRMs yet.", show="vm.statusFilter === 'past'")
20+
.info-links
21+
a.find-challenges.tc-btn.tc-btn-s(ng-href="https://www.{{DOMAIN}}/challenges/data?pageIndex=1") Find SRMs
22+
a.learn-more(href="https://www.{{DOMAIN}}/community/getting-started/") Learn More
23+
empty-state-placeholder(title="Upcoming SRMs", description="There are no upcoming SRMs.", show="vm.statusFilter === 'future'")
2124

2225
.has-srms(ng-show="vm.srms.length")
2326
.data(ng-class="vm.view + '-view'")

assets/css/my-challenges/my-challenges.scss

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,7 @@
5858
}
5959

6060
section.noChallenges {
61-
text-align: center;
62-
margin-top: 10px;
63-
font-size: 18px;
61+
padding-top: 30px;
6462
}
6563

6664
.hasChallenges {

assets/css/my-srms/my-srms.scss

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,31 @@
6969
display: flex;
7070
flex-direction: inherit;
7171
align-items: center;
72+
73+
.info-links {
74+
text-align: center;
75+
display: flex;
76+
flex-direction: column;
77+
78+
a {
79+
text-transform: uppercase;
80+
@include sofia-pro-medium;
81+
82+
&:not(:last-child) {
83+
margin-bottom: 30px;
84+
}
85+
86+
&.participate {
87+
color: $white;
88+
}
89+
90+
&.learn-more {
91+
font-size: 12px;
92+
line-height: 12px;
93+
color: $gray-lighter;
94+
}
95+
}
96+
}
7297
}
7398
.has-srms {
7499
display: flex;

0 commit comments

Comments
 (0)