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

Commit 9822510

Browse files
author
vikasrohit
committed
SUP-2754, [Edit Profile] Allow user to hide external links
-- Added Edit header to the external data cards
1 parent cc4190e commit 9822510

File tree

7 files changed

+69
-5
lines changed

7 files changed

+69
-5
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
.external-link-list
2-
div.external-link-tile(ng-repeat="account in linkedAccountsData")
2+
div.external-link-tile(ng-repeat="account in linkedAccountsData", ng-class="{'external-link-tile--editable' : editable}")
3+
.ext-link-tile_edit-header(ng-show="editable")
4+
.ext-link-tile_edit-header_show-on-profile
5+
span.show-on-profile_label Show on Profile
6+
onoff-switch(model="account.hide", unique-id="account.provider + '_' + (account.key || account.data.handle)")
37
.top
48
div.logo
59
i.fa(ng-class="(account|providerData:'className') || 'fa-globe'")
@@ -98,7 +102,7 @@
98102

99103
.title {{account.data.title}}
100104

101-
div(ng-switch-when="weblink")
105+
div(ng-switch-when="weblink", key="{{account.key}}")
102106
p.link-title(data-ellipsis, ng-bind="account.title", ng-hide="account.status === 'PENDING'")
103107
p.link-title(ng-show="account.status === 'PENDING'") Loading data. This will take a few minutes.
104108

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
restrict: 'E',
1515
templateUrl: 'directives/external-account/external-link-data.directive.html',
1616
scope: {
17-
linkedAccountsData: '='
17+
linkedAccountsData: '=',
18+
editable: '='
1819
}
1920
};
2021
return directive;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.onoffswitch
2+
input.onoffswitch-checkbox(type='checkbox', name='onoffswitch', checked='', ng-model="model", id="{{uniqueId}}-onoffswitch")
3+
label.onoffswitch-label(for='{{uniqueId}}-onoffswitch')
4+
span.onoffswitch-inner
5+
span.onoffswitch-switch
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
(function() {
2+
'use strict';
3+
4+
angular.module('tcUIComponents').directive('onoffSwitch', onoffSwitch);
5+
6+
function onoffSwitch() {
7+
return {
8+
restrict: 'E',
9+
templateUrl: 'directives/onoffswitch/onoffswitch.directive.html',
10+
scope: {
11+
model: '=',
12+
uniqueId: '='
13+
},
14+
link: function(scope, element, attrs) {
15+
16+
}
17+
};
18+
}
19+
})();

app/index.jade

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ html
201201
script(src="directives/input-sticky-placeholder/input-sticky-placeholder.directive.js")
202202
script(src="directives/ios-card/ios-card.directive.js")
203203
script(src="directives/on-file-change.directive.js")
204+
script(src="directives/onoffswitch/onoffswitch.directive.js")
204205
script(src="directives/page-state-header/page-state-header.directive.js")
205206
script(src="directives/profile-widget/profile-widget.directive.js")
206207
script(src="directives/responsive-carousel/responsive-carousel.directive.js")

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,4 @@
108108
.field-label Linked Accounts
109109

110110
.existing-links
111-
external-links-data(linked-accounts-data="vm.linkedExternalAccountsData")
111+
external-links-data(linked-accounts-data="vm.linkedExternalAccountsData", editable="true")

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

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,44 @@ external-accounts {
55
flex-flow: row wrap;
66
}
77

8+
.ext-link-tile_edit-header {
9+
border-bottom: 1px solid $gray-light;
10+
11+
&:hover {
12+
.show-on-profile_label {
13+
color: $accent-gray-dark;
14+
}
15+
}
16+
}
17+
18+
.ext-link-tile_edit-header_show-on-profile {
19+
display: flex;
20+
justify-content: space-between;
21+
padding: 10px 10px;
22+
23+
.show-on-profile_label {
24+
@include sofia-pro-medium;
25+
font-size: 10px;
26+
line-height: 13px;
27+
color: $accent-gray;
28+
text-transform: uppercase;
29+
align-self: center;
30+
}
31+
32+
// TODO remove this and handle in onoffswitch directive's css
33+
.onoffswitch {
34+
margin: 0px;
35+
}
36+
}
37+
838
.external-link-list {
939
display: flex;
1040
flex-direction: column;
1141
justify-content: space-between;
1242
margin-top: 10px;
1343

1444
.external-link-tile {
15-
border: 1px solid #f0f0f0;
45+
border: 1px solid $gray-light;
1646
width: 280px;
1747
height: 90px;
1848
display: flex;
@@ -252,5 +282,9 @@ external-accounts {
252282
}
253283
}
254284
}
285+
286+
.external-link-tile--editable {
287+
height: 285px;
288+
}
255289
}
256290
}

0 commit comments

Comments
 (0)