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

Commit 647a46c

Browse files
committed
Merge pull request #281 from appirio-tech/external-links-pending
Fix layout of external tiles
2 parents 3fae568 + 069e7e1 commit 647a46c

File tree

6 files changed

+134
-100
lines changed

6 files changed

+134
-100
lines changed
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
.ext-tile(ng-repeat="account in accountList | orderBy:'order'")
2-
.outer-box(ng-class="{'connected': account.linked, 'disabled': account.disabled}")
3-
a(ng-click="!account.disabled && !readOnly && !account.linked && link(account.provider)", ng-class="{'read-only': readOnly}")
4-
.external-account-icon-box(ng-class="{'connected': account.linked}")
5-
i.fa(ng-class="account.className")
6-
.name {{account.displayName}}
7-
.status.connected(ng-if="account.linked") connected
8-
.status(ng-if="!account.linked && !account.disabled") connect
9-
.status(ng-if="account.disabled") coming soon
1+
.ext-tile(ng-repeat="account in accountList | orderBy:'order'", ng-class="{'connected': account.linked, 'disabled': account.disabled}")
2+
.external-account-box(ng-click="!account.disabled && !readOnly && !account.linked && link(account.provider)", ng-class="{'read-only': readOnly}")
3+
i.fa(ng-class="account.className")
4+
5+
.provider {{account.displayName}}
6+
7+
.status(ng-if="account.linked") Connected
8+
9+
.status(ng-if="!account.linked && !account.disabled") Connect
10+
11+
.status(ng-if="account.disabled") Coming Soon

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

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,13 @@
7373
restrict: 'E',
7474
templateUrl: 'directives/external-account/external-link-data.directive.html',
7575
scope: {
76-
linkedAccountsData: '='
76+
linkedAccountsData: '=',
77+
externalLinks: '='
7778
},
7879
controller: ['$log', '$scope', 'ExternalAccountService',
7980
function($log, $scope, ExternalAccountService) {
8081
$log = $log.getInstance('ExternalLinksDataDirective');
82+
8183
$scope.$watch('linkedAccountsData', function(newValue, oldValue) {
8284
var linkedAccounts = [];
8385
for (var i=0;i<_supportedAccounts.length;i++) {
@@ -92,6 +94,26 @@
9294
}
9395
$scope.linkedAccounts = linkedAccounts;
9496
});
97+
98+
$scope.$watchCollection('externalLinks', function(newValue, oldValue) {
99+
console.log("WATCH COLLECTION EXTERNAL LINKS: ");
100+
console.log("New Value: ", newValue);
101+
console.log("Old Value: ", oldValue);
102+
103+
angular.forEach(newValue, function(link) {
104+
var provider = link.providerType;
105+
106+
if (!$scope.linkedAccountsData[provider]) {
107+
$scope.linkedAccounts.push({
108+
provider: provider,
109+
data: {
110+
handle: link.name,
111+
status: 'PENDING'
112+
}
113+
});
114+
}
115+
});
116+
});
95117
}
96118
]
97119
}

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

Lines changed: 47 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,70 +9,94 @@
99

1010
div(ng-switch-when="github")
1111
.handle {{account.data.handle}}
12-
ul
13-
li
12+
13+
.pending(ng-show="account.data.status === 'PENDING'")
14+
p Loading data. This will take a few minutes.
15+
16+
ul(ng-hide="account.data.status === 'PENDING'")
17+
li
1418
.value {{(account.data.followers|number:0) || 0}}
1519
.key followers
16-
li
20+
li
1721
.value {{(account.data.publicRepos|number:0) || 0}}
1822
.key repositories
1923

2024
div(ng-switch-when="stackoverflow")
2125
.handle {{account.data.handle}}
22-
ul
23-
li
26+
27+
.pending(ng-show="account.data.status === 'PENDING'")
28+
p Loading data. This will take a few minutes.
29+
30+
ul(ng-hide="account.data.status === 'PENDING'")
31+
li
2432
.value {{(account.data.reputation|number:0) || 0}}
2533
.key reputation
26-
li
27-
.value {{(account.data.answers|number:0) || 0}}
34+
li
35+
.value {{(account.data.answers|number:0) || 0}}
2836
.key answers
2937

3038
div(ng-switch-when="behance")
3139
.handle {{account.data.name}}
32-
ul
33-
li
40+
41+
.pending(ng-show="account.data.status === 'PENDING'")
42+
p Loading data. This will take a few minutes.
43+
44+
ul(ng-hide="account.data.status === 'PENDING'")
45+
li
3446
.value {{(account.data.projectViews|number:0) || 0}}
3547
.key views
36-
li
48+
li
3749
.value {{(account.data.projectAppreciations|number:0) || 0}}
3850
.key likes
3951

4052

4153
div(ng-switch-when="dribble")
4254
.handle {{account.data.handle}}
43-
ul
44-
li
55+
56+
.pending(ng-show="account.data.status === 'PENDING'")
57+
p Loading data. This will take a few minutes.
58+
59+
ul(ng-hide="account.data.status === 'PENDING'")
60+
li
4561
.value {{(account.data.followers|number:0) || 0}}
4662
.key followers
47-
li
63+
li
4864
.value {{(account.data.likes|number:0) || 0}}
4965
.key likes
5066

5167
div(ng-switch-when="bitbucket")
5268
.handle {{account.data.username}}
53-
ul
54-
li
69+
70+
.pending(ng-show="account.data.status === 'PENDING'")
71+
p Loading data. This will take a few minutes.
72+
73+
ul(ng-hide="account.data.status === 'PENDING'")
74+
li
5575
.value {{(account.data.followers|number:0) || 0}}
5676
.key followers
57-
li
77+
li
5878
//- {{(account.data.repositories|number:0) || 0}}
5979
.value TBD
6080
.key repositories
6181

6282
div(ng-switch-when="twitter")
6383
.handle @{{account.data.handle}}
64-
ul
65-
li
84+
85+
.pending(ng-show="account.data.status === 'PENDING'")
86+
p Loading data. This will take a few minutes.
87+
88+
ul(ng-hide="account.data.status === 'PENDING'")
89+
li
6690
.value {{(account.data.noOfTweets|number:0) || 0}}
6791
.key tweets
68-
li
92+
li
6993
//- {{(account.data.followers|number:0) || 0}}
70-
.value TBD
71-
.key followers
72-
94+
.value TBD
95+
.key followers
96+
7397
div(ng-switch-when="linkedin")
7498
.handle {{account.data.name}}
75-
99+
76100
.title {{account.data.title}}
77101

78102
div(ng-switch-default)

app/settings/edit-profile/edit-profile.jade

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,12 @@
8484
.description Show off your work and experience outside of Topcoder. Connect accounts from popular services and networks or add a link to any site.
8585

8686
.section-fields
87-
.field-label Link your accounts
87+
.field-label Link Your Accounts
88+
8889
.external-links
89-
external-accounts(linked-accounts="vm.linkedExternalAccounts.length", read-only="false")
90+
external-accounts(linked-accounts="vm.linkedExternalAccounts", read-only="false")
91+
92+
.field-label Linked Accounts
9093

91-
.field-label(ng-show="vm.hasLinks") your accounts
9294
.existing-links
93-
external-links-data(ng-show="vm.hasLinks" linked-accounts-data="vm.linkedExternalAccountsData")
95+
external-links-data(external-links="vm.linkedExternalAccounts", linked-accounts-data="vm.linkedExternalAccountsData")

assets/css/directives/external-account.scss

Lines changed: 30 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -3,81 +3,58 @@
33
.ext-tile {
44
display: flex;
55
flex-direction: column;
6-
text-align: center;
76
align-items: center;
8-
justify-content: flex-start;
9-
width: 90px;
10-
height: 90px;
11-
margin: 5px 5px 10px 5px;
7+
margin: 5px 20px 15px 0;
128

13-
.outer-box {
14-
border: 1px solid #f0f0f0;
9+
&.connected {
10+
11+
12+
.status {
13+
color: $gray-dark;
14+
}
15+
}
16+
17+
&.disabled {
18+
19+
}
20+
21+
.external-account-box {
22+
display: flex;
23+
flex-direction: column;
24+
justify-content: center;
25+
align-items: center;
26+
width: 90px;
27+
height: 90px;
28+
border: 1px solid $gray-light;
29+
margin-top: 12px;
1530
cursor: pointer;
16-
.read-only{
31+
32+
&.read-only{
1733
cursor: default;
1834
pointer-events: none;
1935
}
2036

21-
.external-account-icon-box {
37+
i {
2238
font-size: 45px;
23-
margin-top: 12px;
24-
display: flex;
25-
flex-direction: row;
26-
justify-content: center;
27-
28-
i {
29-
&.inactive {
30-
color: #d1d3d4;
31-
}
32-
&.connected {
33-
cursor: default;
34-
color: #0096FF;
35-
}
36-
}
39+
color: #D1D3D4;
3740
}
3841

39-
.name {
42+
.provider {
4043
margin-top: 8px;
41-
width: 90px;
42-
font-family: 'Sofia Pro';
44+
@include sofia-pro-medium;
4345
font-size: 10px;
4446
line-height: 13px;
45-
font-weight: 500;
4647
text-align: center;
4748
text-transform: uppercase;
48-
color: #A3A3AE;
49+
color: $system-gray;
4950
}
50-
.disabled {
51-
cursor: default;
52-
pointer-events: none;
53-
}
54-
.connected {
55-
cursor: default;
56-
color: #0096FF;
57-
}
58-
59-
60-
}
61-
.connected {
62-
cursor: default;
63-
}
64-
.disabled {
65-
cursor: default;
66-
color: #D1D3D4;
67-
pointer-events: none;
6851
}
6952

7053
.status {
7154
font-size: 10px;
7255
@include sofia-pro-medium;
7356
margin-top: 10px;
7457
text-transform: uppercase;
75-
text-align: center;
76-
.connected {
77-
font-color: #B7B7B7;
78-
}
79-
.disconnected {
80-
font-color: #3D3D3D;
81-
}
58+
color: $gray-darkest;
8259
}
8360
}

assets/css/directives/external-link-data.scss

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1+
@import '../partials/combined';
2+
13
external-accounts {
24
display: flex;
3-
flex-direction: row;
4-
flex-wrap: wrap;
5-
justify-content: space-between;
5+
flex-flow: row wrap;
66
}
7+
78
.external-link-list {
89
display: flex;
910
flex-direction: column;
1011
justify-content: space-between;
11-
padding: 5px;
12+
margin-top: 10px;
1213

1314
.external-link-tile {
1415
border: 1px solid #f0f0f0;
1516
width: 280px;
1617
height: 90px;
1718
display: flex;
1819
flex-direction: row;
19-
justify-content: flex-start;
2020
text-align: center;
21-
margin: 10px;
2221
font-family: 'Sofia Pro';
22+
2323
&:hover {
2424
cursor: pointer;
2525
background-color: #fbfbfb;
@@ -70,6 +70,15 @@ external-accounts {
7070
font-family: 'Sofia Pro';
7171
}
7272

73+
.pending {
74+
p {
75+
@include sofia-pro-regular;
76+
font-size: 16px;
77+
color: $gray-darkest;
78+
margin-bottom: 15px;
79+
}
80+
}
81+
7382
ul {
7483
margin-top: 10px;
7584
height: 40px;
@@ -104,17 +113,14 @@ external-accounts {
104113
flex-direction: row;
105114
flex-wrap: wrap;
106115
justify-content: space-between;
107-
padding: 20px;
108116

109117
.external-link-tile {
110118
border: 1px solid #f0f0f0;
111119
width: 200px;
112120
height: 240px;
113121
display: flex;
114122
flex-direction: column;
115-
justify-content: space-between;
116123
text-align: center;
117-
margin: 10px;
118124
padding: 0px;
119125
font-family: 'Sofia Pro';
120126
i {
@@ -152,7 +158,8 @@ external-accounts {
152158

153159
.handle {
154160
font-weight: normal;
155-
margin-bottom: 40px;
161+
margin-top: 20px;
162+
margin-bottom: 20px;
156163
}
157164
.title {
158165
// placeholder

0 commit comments

Comments
 (0)