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

Commit 65e58fb

Browse files
philboothvbudhram
authored andcommitted
wip: replace CAD with CAA
1 parent 8fc1679 commit 65e58fb

22 files changed

Lines changed: 481 additions & 2 deletions
11.3 KB
Loading
2.34 KB
Loading
62.5 KB
Loading
54.1 KB
Loading
459 Bytes
Loading

app/images/open_in_new.svg

Lines changed: 5 additions & 0 deletions
Loading

app/scripts/lib/experiment.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ const STARTUP_EXPERIMENTS = {
2121
* after the app has started.
2222
*/
2323
const MANUAL_EXPERIMENTS = {
24+
'connectAnotherService': BaseExperiment,
2425
'emailFirst': BaseExperiment,
2526
// For now, the send SMS experiment only needs to log "enrolled", so
2627
// no special experiment is created.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License, v. 2.0. If a copy of the MPL was not distributed with this
3+
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4+
5+
/**
6+
* Should the user be part of the Connect Another Service
7+
*/
8+
'use strict';
9+
10+
const BaseGroupingRule = require('./base');
11+
12+
module.exports = class ConnectAnotherServiceGroupingRule extends BaseGroupingRule {
13+
constructor() {
14+
super();
15+
this.name = 'connectAnotherService';
16+
this.ROLLOUT_RATE = 0.0;
17+
}
18+
19+
choose(subject = {}) {
20+
if (! subject.account || ! subject.uniqueUserId || ! subject.userAgent) {
21+
return false;
22+
}
23+
24+
const {
25+
canSignIn,
26+
isFirefoxAndroid,
27+
isFirefoxIos,
28+
isOtherAndroid,
29+
isOtherIos,
30+
} = subject.userAgent;
31+
32+
if (this.isTestEmail(subject.account.get('email'))) {
33+
return true;
34+
} else if (! canSignIn && (isFirefoxAndroid || isFirefoxIos || isOtherAndroid || isOtherIos)) {
35+
if (this.bernoulliTrial(this.ROLLOUT_RATE, subject.uniqueUserId)) {
36+
return true;
37+
}
38+
}
39+
40+
return false;
41+
}
42+
};

app/scripts/lib/experiments/grouping-rules/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const experimentGroupingRules = [
1818
require('./send-sms-install-link'),
1919
require('./sentry'),
2020
require('./token-code'),
21+
require('./connect-another-service'),
2122
].map(ExperimentGroupingRule => new ExperimentGroupingRule());
2223

2324
class ExperimentChoiceIndex {

app/scripts/lib/router.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import CompleteSignUpView from '../views/complete_sign_up';
2424
import ConfirmResetPasswordView from '../views/confirm_reset_password';
2525
import ConfirmView from '../views/confirm';
2626
import ConnectAnotherDeviceView from '../views/connect_another_device';
27+
import ConnectAnotherServiceView from '../views/connect_another_service';
2728
import CookiesDisabledView from '../views/cookies_disabled';
2829
import DeleteAccountView from '../views/settings/delete_account';
2930
import DisplayNameView from '../views/settings/display_name';
@@ -108,6 +109,7 @@ const Router = Backbone.Router.extend({
108109
'confirm_signin(/)': createViewHandler(ConfirmView, { type: VerificationReasons.SIGN_IN }),
109110
'connect_another_device(/)': createViewHandler(ConnectAnotherDeviceView),
110111
'connect_another_device/why(/)': createChildViewHandler(WhyConnectAnotherDeviceView, ConnectAnotherDeviceView),
112+
'connect_another_service(/)': createViewHandler(ConnectAnotherServiceView),
111113
'cookies_disabled(/)': createViewHandler(CookiesDisabledView),
112114
'force_auth(/)': createViewHandler(ForceAuthView),
113115
'legal(/)': createViewHandler('legal'),

0 commit comments

Comments
 (0)