Skip to content
This repository has been archived by the owner on Feb 11, 2020. It is now read-only.

Side test ab minus iefix #2131

Merged
merged 4 commits into from
Dec 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions assets/js/ab-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,21 @@

if (typeof Mozilla !== "undefined" && Mozilla.TrafficCop) {

// Only run this test on the home page in en-US.
var tc = new Mozilla.TrafficCop({
// This test runs in amount-buttons.jsx
(new Mozilla.TrafficCop({
id: "button-ordering",
variations: {
"test=lth": 50,
"test=htl": 50
"test=lth": 50, // Low To High
"test=htl": 50 // High To Low
}
});
})).init();

tc.init();
// This test runs on the main page (Currently about.js), for en-US only
(new Mozilla.TrafficCop({
id: "side-text",
variations: {
"test=ost": 100, // Original Side Text
"test=nst": 0 // New Side Text
}
})).init();
}
1 change: 1 addition & 0 deletions locales/en-US/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ participation_guidelines=Participation Guidelines

# About page
additional_info_internet_health_bold=<b>We are proudly non-profit</b>, non-corporate and non-compromised. Thousands of people like you help us stand up for a healthy internet for all. We rely on donations to carry out our mission to keep the Web open and free. Will you give today?
updated_additional_info_internet_health_bold=With a deep respect for our supporters’ privacy and a unique global reach, the non-profit Mozilla Foundation fights every day for a healthier internet, through projects like our *Privacy Not Included buyer’s guide. <b>This work depends on contributions from people like you. Will you chip in today?</b>
additional_info_thunderbird=We’re the leading open source cross-platform email and calendaring client, free for business and personal use. By donating you’ll help ensure it stays that way and contribute towards future development. Will you give today?
additional_info_thunderbird_2=While Thunderbird is now an independent project separate from Mozilla, Mozilla has agreed to collect donations on our behalf.
# String only displayed on https://donate-mozilla-org-us-staging.herokuapp.com/thunderbird/?test=tbdownload
Expand Down
9 changes: 5 additions & 4 deletions src/components/amount-buttons.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,13 @@ var AmountButtons = React.createClass({

// Test conversion based on donation amount ordering.
var test = this.props.test;
if (test !== "htl") {
// low-to-high presentation
presets.sort((a,b) => parseFloat(a) - parseFloat(b));
} else if (test === "htl") {

if (test && test.indexOf('htl') > -1) {
// high-to-low presentation
presets.sort((a,b) => parseFloat(b) - parseFloat(a));
} else {
// low-to-high presentation
presets.sort((a,b) => parseFloat(a) - parseFloat(b));
}

return (
Expand Down
6 changes: 3 additions & 3 deletions src/lib/queryParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ module.exports = function(queryString, locale) {
presets = currency.presets[frequency];
}

// Collaps test to a string if it happens to be an array.
if (test && test.join) {
test = test.join(" ");
// Ensure test is always an array of strings.
if (typeof test === "string") {
test = [test];
}

var parsed = {
Expand Down
17 changes: 9 additions & 8 deletions src/pages/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,19 @@ module.exports = React.createClass({
intl: React.PropTypes.object
},
getInitialState: function() {
return {
aboutCopy: null
};
},
componentDidMount: function() {
var aboutCopy = (<span><FormattedHTMLMessage id="additional_info_internet_health_bold"/></span>);
var test = this.props.test;

// Run our copy test only on English locale:
if (test && test.indexOf('nst') > -1 && this.context.intl.locale.indexOf("en") > -1) {
// New Side Text copy from ./locales/en-US/messages.properties
aboutCopy = (<span><FormattedHTMLMessage id="updated_additional_info_internet_health_bold"/></span>);
}

this.setState({
return {
aboutCopy: aboutCopy
});
};
},

renderTextAboutPage: function() {
return (
<div className="container additional-page">
Expand Down