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

Commit cabfc06

Browse files
committed
fix(force_auth): mention service name in force_auth
Fixes #4928
1 parent 87f40f1 commit cabfc06

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

app/scripts/templates/force_auth.mustache

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
<div id="main-content" class="card">
22
<header>
3-
<h1 id="fxa-force-auth-header">{{#t}}Sign in to continue{{/t}}</h1>
3+
<h1 id="fxa-force-auth-header">
4+
{{#serviceName}}
5+
<!-- L10N: For languages structured like English, the second phrase can read "to continue to %(serviceName)s" -->
6+
{{#t}}Sign in{{/t}} <span class="service">{{#t}}Continue to %(serviceName)s{{/t}}</span>
7+
{{/serviceName}}
8+
{{^serviceName}}
9+
{{#t}}Sign in to continue{{/t}}
10+
{{/serviceName}}
11+
</h1>
412
</header>
513

614
<section>

app/scripts/views/force_auth.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import FormView from './form';
1010
import NullBehavior from './behaviors/null';
1111
import PasswordResetMixin from './mixins/password-reset-mixin';
1212
import SignInView from './sign_in';
13+
import ServiceMixin from './mixins/service-mixin';
1314
import Template from 'templates/force_auth.mustache';
1415
import Transform from '../lib/transform';
1516
import Vat from '../lib/vat';
@@ -193,7 +194,8 @@ var View = SignInView.extend({
193194

194195
Cocktail.mixin(
195196
View,
196-
PasswordResetMixin
197+
PasswordResetMixin,
198+
ServiceMixin
197199
);
198200

199201
module.exports = View;

app/tests/spec/views/force_auth.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,29 @@ define(function (require, exports, module) {
172172
assert.isFalse(view.navigate.called);
173173
});
174174

175+
it('has no service name', function () {
176+
assert.lengthOf(view.$('.service'), 0);
177+
});
178+
175179
it('does not error', function () {
176180
assert.lengthOf(view.$('.error.visible'), 0);
177181
});
178182
});
179183

184+
describe('with service=sync', function () {
185+
it('has the service title', function () {
186+
187+
relier.set({
188+
serviceName: 'Firefox Sync',
189+
uid: TestHelpers.createUid()
190+
});
191+
192+
return view.render().then(() => {
193+
assert.equal(view.$('.service').text(), 'Continue to Firefox Sync');
194+
});
195+
});
196+
});
197+
180198
describe('with registered email, unregistered uid', function () {
181199
beforeEach(function () {
182200
relier.set({

0 commit comments

Comments
 (0)