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

feat(devices): add mobile get app placeholders #4261

Merged
merged 3 commits into from Oct 24, 2016
Merged

feat(devices): add mobile get app placeholders #4261

merged 3 commits into from Oct 24, 2016

Conversation

@vladikoff
Copy link
Contributor

@vladikoff vladikoff commented Oct 7, 2016

Copy link
Contributor

@vbudhram vbudhram left a comment

Just the minor nit, maybe better for another PR? Otherwise, LGTM 👍

@@ -23,8 +23,11 @@ define(function (require, exports, module) {
var UTM_PARAMS = '?utm_source=accounts.firefox.com&utm_medium=referral&utm_campaign=fxa-devices';
var DEVICES_SUPPORT_URL = 'https://support.mozilla.org/kb/fxa-managing-devices' + UTM_PARAMS;
var FIREFOX_DOWNLOAD_LINK = 'https://www.mozilla.org/firefox/new/' + UTM_PARAMS;
var FIREFOX_ANDROID_DOWNLOAD_LINK = 'https://www.mozilla.org/firefox/android/' + UTM_PARAMS;
var FIREFOX_IOS_DOWNLOAD_LINK = 'https://www.mozilla.org/firefox/ios/' + UTM_PARAMS;
var FIREFOX_ANDROID_DOWNLOAD_LINK = 'https://app.adjust.com/2uo1qc' +

This comment has been minimized.

@vbudhram

vbudhram Oct 11, 2016
Contributor

Should we pull all these into constants file? Looks like it is done both way in view files.

This comment has been minimized.

@shane-tomlinson

shane-tomlinson Oct 12, 2016
Member

If the URLs are shared perhaps, otherwise seems fine to leave them here. Might as well const these things while you are at it!

This comment has been minimized.

@vladikoff

vladikoff Oct 24, 2016
Author Contributor

Yeah urls are different, it has a different campaign.

Copy link
Member

@shane-tomlinson shane-tomlinson left a comment

A couple of tiny changes requested, otherwise the code looks great! I have not yet manually tested this.

<li class="client mobile">
<div class="client-name">{{#t}}Firefox for iOS{{/t}}</div>
<div class="last-connected">none connected</div>
<a target="_blank" href="{{ linkIOS }}" class="settings-button secondary" data-get-app="ios">{{#t}}Get app{{/t}}</a>

This comment has been minimized.

@shane-tomlinson

shane-tomlinson Oct 12, 2016
Member

Can settings ever be viewed from within the Fx for iOS WebView where plinks are converted to their visible text](

convertExternalLinksToText: true
)?

This comment has been minimized.

@vladikoff

vladikoff Oct 24, 2016
Author Contributor

Yea need to kill these on mobile and only show on desktop.

@@ -23,8 +23,11 @@ define(function (require, exports, module) {
var UTM_PARAMS = '?utm_source=accounts.firefox.com&utm_medium=referral&utm_campaign=fxa-devices';
var DEVICES_SUPPORT_URL = 'https://support.mozilla.org/kb/fxa-managing-devices' + UTM_PARAMS;
var FIREFOX_DOWNLOAD_LINK = 'https://www.mozilla.org/firefox/new/' + UTM_PARAMS;
var FIREFOX_ANDROID_DOWNLOAD_LINK = 'https://www.mozilla.org/firefox/android/' + UTM_PARAMS;
var FIREFOX_IOS_DOWNLOAD_LINK = 'https://www.mozilla.org/firefox/ios/' + UTM_PARAMS;
var FIREFOX_ANDROID_DOWNLOAD_LINK = 'https://app.adjust.com/2uo1qc' +

This comment has been minimized.

@shane-tomlinson

shane-tomlinson Oct 12, 2016
Member

If the URLs are shared perhaps, otherwise seems fine to leave them here. Might as well const these things while you are at it!

* @private
*/
_hasMobileDevices (clients) {
return _.find(clients, function (client) {

This comment has been minimized.

@shane-tomlinson

shane-tomlinson Oct 12, 2016
Member

_.find returns the first one that passes a truth test whereas the return value is stated to be a Boolean. I'd add a !! or use _.some which does that conversion.

/**
* Returns true if the clients collection has mobile devices
*
* @param {Array} clients - array of attached clients

This comment has been minimized.

@shane-tomlinson

shane-tomlinson Oct 12, 2016
Member

Should Array be Object[] or Client[] to go along with the JSDoc standard?


return numberOfDevices === 1 ? true : null;
}, [ TEST_DEVICE_NAME_UPDATED ], 10000))

// clicking disconnect on the current device should sign you out
.findByCssSelector('.client:nth-child(1) .client-disconnect')
.findByCssSelector('.client-device:nth-child(1) .client-disconnect')

This comment has been minimized.

@shane-tomlinson

shane-tomlinson Oct 12, 2016
Member

You should be able to convert this and the next to lines to use .then(click(...

@vladikoff vladikoff force-pushed the device-get-app branch from 3df5b05 to 0ee3970 Oct 24, 2016
@vladikoff vladikoff merged commit 861af52 into master Oct 24, 2016
3 of 4 checks passed
3 of 4 checks passed
ci/circleci Your tests failed 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 (+4.08%) to 98.744%
Details
@vladikoff vladikoff deleted the device-get-app branch Oct 24, 2016
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

4 participants