Skip to content
This repository was archived by the owner on Apr 3, 2019. It is now read-only.

Commit e7ea627

Browse files
committed
feat(service): more updates
1 parent 8f9588a commit e7ea627

File tree

5 files changed

+108
-38
lines changed

5 files changed

+108
-38
lines changed
459 Bytes
Loading

app/images/open_in_new.svg

Lines changed: 5 additions & 0 deletions
Loading
Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
<div id="main-content" class="card connect-another-service">
22
<header id="fxa-connect-another-service-header"><h1>{{#t}}Connect another service{{/t}}</h1></header>
33

4+
{{#showSuccessMessage}}
5+
{{#isSignUp}}
6+
<div class="success success-not-authenticated visible">{{#t}}Email verified{{/t}}</div>
7+
{{/isSignUp}}
8+
{{#isSignIn}}
9+
<div class="success success-not-authenticated visible">{{#t}}Sign-in confirmed{{/t}}</div>
10+
{{/isSignIn}}
11+
{{/showSuccessMessage}}
12+
413
<p>Do more with your Firefox Account with these new services.</p>
514

615
{{#connect-services}}
@@ -13,12 +22,10 @@
1322
<div class="service-description">{{description}}</div>
1423
</div>
1524
<div class="service-links">
16-
<a class="service-link" target="_blank" href="{{link}}">Connect</a>
25+
<a class="service-link" target="_blank" href="{{link}}">
26+
<img src="/images/open_in_new.svg">
27+
</a>
1728
</div>
1829
</div>
1930
{{/connect-services}}
20-
21-
<div class="links">
22-
<a href="/connect_another_device">Not now</a>
23-
</div>
2431
</div>

app/scripts/views/connect_another_service.js

Lines changed: 87 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,48 +5,107 @@
55
import Cocktail from 'cocktail';
66
import BaseView from './base';
77
import Template from 'templates/connect_another_service.mustache';
8+
import UserAgentMixin from '../lib/user-agent-mixin';
9+
import VerificationReasonMixin from './mixins/verification-reason-mixin';
10+
11+
const SERVICES = [
12+
{
13+
description: 'A Secure Notepad App.',
14+
image: 'notes',
15+
links: {
16+
android: 'https://play.google.com/store/apps/details?id=org.mozilla.testpilot.notes&hl=en',
17+
},
18+
name: 'Notes',
19+
},
20+
{
21+
description: 'Save articles, videos and stories from any publication, page or app.',
22+
image: 'pocket',
23+
links: {
24+
android: 'https://getpocket.com/ff_signin?s=pocket&t=login',
25+
ios: 'https://getpocket.com/ff_signin?s=pocket&t=login'
26+
},
27+
name: 'Pocket',
28+
},
29+
{
30+
description: 'Take your passwords everywhere with Firefox Lockbox.',
31+
image: 'lockbox',
32+
links: {
33+
ios: 'https://itunes.apple.com/us/app/firefox-lockbox/id1314000270?mt=8',
34+
},
35+
name: 'Lockbox',
36+
},
37+
{
38+
description: 'Detects threats against your online accounts.',
39+
image: 'monitor',
40+
links: {
41+
website: 'https://monitor.firefox.com/',
42+
},
43+
name: 'Monitor',
44+
},
45+
{
46+
description: 'Screenshots made simple.',
47+
image: 'screenshots',
48+
links: {
49+
website: 'https://screenshots.firefox.com/',
50+
},
51+
name: 'Screenshots',
52+
}
53+
];
54+
855

956
const View = BaseView.extend({
1057
className: 'connect-another-service',
1158
template: Template,
1259

13-
setInitialContext (context) {
14-
const services = [
15-
{
16-
description: 'A Secure Notepad App.',
17-
image: 'notes',
18-
link: 'https://play.google.com/store/apps/details?id=org.mozilla.testpilot.notes&hl=en',
19-
name: 'Notes',
20-
},
21-
{
22-
description: 'Save articles, videos and stories from any publication, page or app.',
23-
image: 'pocket',
24-
link: 'https://getpocket.com/ff_signin?s=pocket&t=login',
25-
name: 'Pocket',
26-
},
27-
{
28-
description: 'Take your passwords everywhere with Firefox Lockbox.',
29-
image: 'lockbox',
30-
link: 'https://itunes.apple.com/us/app/firefox-lockbox/id1314000270?mt=8',
31-
name: 'Lockbox',
32-
},
33-
{
34-
description: 'Detects threats against your online accounts.',
35-
image: 'monitor',
36-
link: 'https://monitor.firefox.com/',
37-
name: 'Monitor',
38-
}
39-
];
60+
setInitialContext(context) {
61+
const services = this._filterServices();
62+
const isSignIn = this.isSignIn();
63+
const isSignUp = this.isSignUp();
64+
const showSuccessMessage = this._showSuccessMessage();
4065

4166
context.set({
42-
'connect-services': services
67+
'connect-services': services,
68+
isSignIn,
69+
isSignUp,
70+
showSuccessMessage
4371
});
4472
},
73+
74+
_filterServices() {
75+
const {
76+
isFirefoxAndroid,
77+
isFirefoxIos,
78+
isOtherAndroid,
79+
isOtherIos,
80+
} = this.getContext();
81+
82+
const supportedServices = SERVICES.filter((service) => {
83+
if (service.links.android && (isFirefoxAndroid || isOtherAndroid)) {
84+
service.link = service.links.android;
85+
return service;
86+
} else if (service.links.ios && (isFirefoxIos || isOtherIos)) {
87+
service.link = service.links.ios;
88+
return service;
89+
} else if (service.links.website) {
90+
service.link = service.links.website;
91+
return service;
92+
}
93+
});
94+
95+
return supportedServices;
96+
},
97+
98+
_showSuccessMessage() {
99+
return !! this.model.get('showSuccessMessage') ||
100+
!! this.getSearchParam('showSuccessMessage');
101+
}
45102
});
46103

47104

48105
Cocktail.mixin(
49106
View,
107+
UserAgentMixin,
108+
VerificationReasonMixin,
50109
);
51110

52111
module.exports = View;

app/styles/modules/_connect-another-service.scss

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929
&[data='Monitor'] {
3030
background-image: url('/images/connect_another_service/monitor.png');
3131
}
32+
33+
&[data='Screenshots'] {
34+
background-image: url('/images/connect_another_service/screenshots.png');
35+
}
3236
}
3337
}
3438

@@ -52,11 +56,6 @@
5256
.service-links {
5357
align-self: center;
5458
justify-content: flex-end;
55-
56-
.service-link {
57-
color: #008000;
58-
font-size: 12px;
59-
}
6059
}
6160
}
6261
}

0 commit comments

Comments
 (0)