Skip to content
This repository has been archived by the owner. It is now read-only.

feat(client): Initial Fennec integration work - the new *_complete screens. #3094

Merged
merged 1 commit into from Oct 5, 2015

Conversation

@shane-tomlinson
Copy link
Member

@shane-tomlinson shane-tomlinson commented Sep 22, 2015

issue #2771

@rfk
Copy link
Member

@rfk rfk commented Sep 22, 2015

Add the beginning states of capabilities.

Just to ensure situation awareness: are we planning to depend on some minimal capabilities stuff for this integration? I got the impression we were taking that out of the critical path.

@shane-tomlinson
Copy link
Member Author

@shane-tomlinson shane-tomlinson commented Sep 22, 2015

Just to ensure situation awareness: are we planning to depend on some minimal capabilities stuff for this integration? I got the impression we were taking that out of the critical path.

I am fleshing out how the internal API would look, where something akin to capabilities are still useful for determining whether things like the "open preferences" button is supported.

@ncalexan, @vladikoff and I are going to talk about the external/relier API on Thursday after the fxa-web meeting to see if it's necessary for v1. @vladikoff thinks yes. I don't have enough context yet and want more info.

@shane-tomlinson
Copy link
Member Author

@shane-tomlinson shane-tomlinson commented Sep 22, 2015

Add the beginning states of capabilities.

Ref #3077

@shane-tomlinson shane-tomlinson force-pushed the issue-2771-fennec branch from a3666bc to 80e897d Sep 23, 2015
}
}),

notifyOfSyncPreferences: function () {

This comment has been minimized.

@shane-tomlinson

shane-tomlinson Sep 23, 2015
Author Member

Change this to openSyncPreferences and document it. Add a stub to the BaseAuthenticationBroker too.

@shane-tomlinson
Copy link
Member Author

@shane-tomlinson shane-tomlinson commented Sep 29, 2015

This PR breaks the "oauth force_auth with a registered force_email - allows the user to sign in" functional test, not quite ready.

@shane-tomlinson shane-tomlinson force-pushed the issue-2771-fennec branch 3 times, most recently from eb88785 to fc87fcc Sep 30, 2015
@shane-tomlinson shane-tomlinson changed the title WIP Issue 2771 fennec feat(client): Initial Fennec integration work - the new *_complete screens. Sep 30, 2015
@shane-tomlinson
Copy link
Member Author

@shane-tomlinson shane-tomlinson commented Sep 30, 2015

Removing the WIP, this is ready for review! Should be reviewed after #3118, which contains functional tests to ensure force_auth behavior does not regress for other brokers.

Should be reviewed before #3121, which is a follow on that adds the "choose what to Sync" screen.

* Should the *_complete pages show a `Sync preferences` button
* if the relier is Firefox Sync?
*/
syncPreferencesNotification: false

This comment has been minimized.

@vladikoff

vladikoff Oct 1, 2015
Contributor

👍

{{/isSignIn}}
{{#isSignUp}}
<h1 id="fxa-sign-up-complete-header">{{#t}}Account verified{{/t}}</h1>
{{/isSignUp}}

This comment has been minimized.

@vladikoff

vladikoff Oct 1, 2015
Contributor

nit: we might consider moving this out of here into JS logic and just outputting the correct title, the template is looking a little insane.

This comment has been minimized.

@shane-tomlinson

shane-tomlinson Oct 2, 2015
Author Member

What I really want to do, and the initial approach I used, is to create distinct templates for all of these things, then choose the correct template depending on the type passed in to initialize. This resulted in 5 nearly identical templates. Template partials would reduce the boilerplate, but we haven't gotten that working with compiled Mustache templates.

This comment has been minimized.

@shane-tomlinson

shane-tomlinson Oct 2, 2015
Author Member

Still, maybe that's the correct way to go, because you are right, this is insanity.

{{/isSignIn}}
{{#isSignUp}}
<p class="account-ready-service">{{#t}}You are now ready to use %(serviceName)s{{/t}}</p>
{{/isSignUp}}

This comment has been minimized.

@@ -97,7 +119,7 @@ function (Cocktail, FormView, Template, Url, Constants, ServiceMixin,
type: this.type
};

// spring campaign scheduled to launch 6/2
var marketingSnippet;
if (this._able.choose('springCampaign2015')) {
marketingSnippet = new MarketingSnippetiOS(marketingSnippetOpts);

This comment has been minimized.

@vladikoff

vladikoff Oct 1, 2015
Contributor

side-note: I guess we will need to update this very soon, whenever iOS gets shipped in U.S. 🇺🇸

@vladikoff
Copy link
Contributor

@vladikoff vladikoff commented Oct 1, 2015

Needs rebase

@@ -129,6 +129,7 @@ function (
'confirm_reset_password(/)': showView(ConfirmResetPasswordView),
'cookies_disabled(/)': showView(CookiesDisabledView),
'force_auth(/)': showView(ForceAuthView),
'force_auth_complete(/)': showView(ReadyView, { type: 'force_auth' }),

This comment has been minimized.

@vladikoff

vladikoff Oct 1, 2015
Contributor

this view shows "Your account is ready!" no matter what (with or without existing sessions)

Do we need do any checking / error reporting or is that by design?

This comment has been minimized.

@shane-tomlinson

shane-tomlinson Oct 2, 2015
Author Member

Not by design. A well caught overlook.

account_unlock_complete, force_auth_complete, reset_password_complete and signin_complete can all check the user's status since the user should have a sessionToken (or so we say at this point in time). signup_complete may not have a sessionToken if the user verifies in a second browser - the 1st browser shows signup_complete after confirm but has no sessionToken while the second browser receives the sessionToken.

This comment has been minimized.

@vladikoff

vladikoff Oct 5, 2015
Contributor

Ok we should open an issue if needed for throwing on no-session access to http://localhost:3030/force_auth_complete

@shane-tomlinson shane-tomlinson force-pushed the issue-2771-fennec branch 3 times, most recently from fdc9e03 to e7b1ab6 Oct 2, 2015

/*eslint-disable camelcase*/

// The "header" and "ready to sync" messages are generated

This comment has been minimized.

@shane-tomlinson

shane-tomlinson Oct 2, 2015
Author Member

@vladikoff - is this any better? The template is definitely cleaner, but now the JS is smelly.

Other alternatives:

  • One template per screen - pro - fewer switches per screen. con w/o native template support for layout, lots of duplicate HTML across templates. My attempt at a homegrown layout solution was ugly.
  • One module per screen with the header HTML and ready to sync text as properties of the module. Pro - each module is relatively clean. Con - explosion of modules to take care of strings.
  • Pass the strings in from router.js as configuration. Pro - ready.js is clean. Con - router.js starts to become dirty.

Thoughts?

This comment has been minimized.

@vladikoff

vladikoff Oct 2, 2015
Contributor

See note: https://github.com/mozilla/fxa-content-server/pull/3094/files#r41073115

One template per screen -

I like less HTML

One module per screen

this might work if we can extend "ready" properly

Pass the strings in from router.js

Not sold on doing that, seems like if we add a bit more it won't scale.

The current approach should be okay for now, just not a fan of generating that html in the JS file (per my comment)

{{#accountUnlock}}
<h1 id="fxa-account-unlock-complete-header">{{#t}}Account unlocked{{/t}}</h1>
{{/accountUnlock}}
{{{headerHTML}}}

This comment has been minimized.

@vladikoff

vladikoff Oct 2, 2015
Contributor

@shane-tomlinson generating that html header looks strange, can we change
{{{headerHTML}}} to

<h1 id="{{headerId}}">{{headerTitle}}</h1>

This comment has been minimized.

@shane-tomlinson

shane-tomlinson Oct 5, 2015
Author Member

I like this solution, it's a good middle ground. 👏

@shane-tomlinson shane-tomlinson force-pushed the issue-2771-fennec branch 2 times, most recently from 8d5925b to 449d0fa Oct 5, 2015
* Hook up support for the signin_complete and force_auth_complete screens.
* Disable support for the signup marketing material.
* Add a "Sync preferences" button to the *_complete screens.

issue #2771
@shane-tomlinson shane-tomlinson force-pushed the issue-2771-fennec branch from 449d0fa to 8698f01 Oct 5, 2015
@shane-tomlinson
Copy link
Member Author

@shane-tomlinson shane-tomlinson commented Oct 5, 2015

@vladikoff - updated w/ your suggestion, thanks!

vladikoff added a commit that referenced this pull request Oct 5, 2015
feat(client): Initial Fennec integration work - the new *_complete screens. r=vladikoff
@vladikoff vladikoff merged commit 5d85abc into master Oct 5, 2015
4 checks passed
4 checks passed
ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.007%) to 98.891%
Details
@vladikoff vladikoff deleted the issue-2771-fennec branch Oct 5, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants