feat(firstrun): Add fx_firstrun_v2 events to support new firstrun flow. #4717
Conversation
@@ -15,20 +15,101 @@ define(function (require, exports, module) { | |||
const _ = require('underscore'); | |||
const Constants = require('lib/constants'); | |||
const FxFirstrunV1AuthenticationBroker = require('./fx-firstrun-v1'); | |||
const NotifierMixin = require('views/mixins/notifier-mixin'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't want to add more than this PR than necessary, but it's time to move this mixin into a shared location so it can be used by either views or models without the wonkiness of including a view mixin in a model. I'll do that as a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This move was taken care of by @philbooth in #4718
enableForm () { | ||
this.$('button[type=submit]').removeClass('disabled'); | ||
this._isFormEnabled = true; | ||
if (! this.isFormEnabled()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid sending form.disabled and form.enabled every time either of these methods is called (which is pretty often), I only send the messages if a state change occurs.
isFormEnabled () { | ||
return !! this._isFormEnabled; | ||
return ! this.$('button[type=submit]').hasClass('disabled'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is modified to checking the DOM instead of relying on an internal variable because sometimes the form is disabled from the template.
The failing travis tests are the |
Add several new events that are reported to the parent IFRAME: * `navigated` called whenever the user opens a new page * `form_enabled` called whenever the form is enabled * `form_disabled` called whenever the form is disabled * `form_engaged` called whenever the user modifies an input element A lot of unit test suites needed to be updated to create the Views with a notifier reference.
da707e3
to
836eaab
Compare
If it's relevant, I don't need the |
Thanks @ericawright, I'll keep the extra event in for now - the code is in production. |
Add several new events that are reported to the parent IFRAME:
navigated
called whenever the user opens a new pageform_enabled
called whenever the form is enabledform_disabled
called whenever the form is disabledform_engaged
called whenever the user modifies an input elementA lot of unit test suites needed to be updated to create the Views with
a notifier reference.
fixes https://github.com/mozilla/fxa-bugzilla-mirror/issues/239
@vladikoff - r?