Skip to content

Commit

Permalink
Fix mozilla#3231 Properly localize the Notes featured experiment term…
Browse files Browse the repository at this point in the history
…s and privacy notice. (mozilla#3286)

* Fix mozilla#3231 Properly localize the Notes featured experiment terms and privacy notice.

* Re-enable skipped tests.

* Switch to a much simpler LocalizedHtml implementation.
  • Loading branch information
fzzzy authored and Dave Justice committed Jan 24, 2018
1 parent 95e64b5 commit e21e15c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 19 deletions.
3 changes: 2 additions & 1 deletion content-src/experiments/notes.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
id: 15
title: 'Notes'
slug: notes
is_featured: false
is_featured: true
platforms: ['addon']
min_release: 54
thumbnail: /static/images/experiments/notes/experiments_experiment/thumbnail.png
Expand All @@ -17,6 +17,7 @@ changelog_url: 'https://github.com/mozilla/notes/releases'
contribute_url: 'https://github.com/mozilla/notes'
bug_report_url: 'https://github.com/mozilla/notes/issues'
discourse_url: 'https://discourse.mozilla-community.org/c/test-pilot/notes'
legal_notice: By proceeding, you agree to the <a>terms</a> and <a>privacy</a> policies of Test Pilot and the <a>Notes privacy policy</a>.
privacy_notice_url: 'https://github.com/mozilla/notes/blob/master/docs/metrics.md'
measurements:
- >
Expand Down
22 changes: 9 additions & 13 deletions frontend/src/app/components/FeaturedExperiment/FeaturedButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import React from "react";
import { Localized } from "fluent-react/compat";
import LocalizedHtml from "../LocalizedHtml";
import { buildSurveyURL, experimentL10nId } from "../../lib/utils";

import Modal from "../Modal";
Expand Down Expand Up @@ -41,26 +42,21 @@ export default class FeaturedButton extends React.Component {
};

renderLegalLink() {
const { title } = this.props.experiment;

const terms = <Localized id="landingLegalNoticeTermsOfUse">
<a href="/terms">terms</a>
</Localized>;
const privacy = <Localized id="landingLegalNoticePrivacyNotice">
<a href="/privacy">privacy</a>
</Localized>;

const launchLegalModal = (ev) => {
ev.preventDefault();
this.setState({ showLegalDialog: true });
};

return (<Localized id={this.l10nId("legal-link")}>
const { title } = this.props.experiment;

return (<LocalizedHtml id={this.l10nId("legal-notice")}
$title={title}>
<p className="main-install__legal">
By proceeding, you agree to the {terms} and {privacy} of Test Pilot
and <a href="#" onClick={launchLegalModal}>{title}</a>.
By proceeding, you agree to the <a href="/terms">terms</a>
and <a href="/privacy">privacy</a> policies of Test Pilot and the
<a href="#" onClick={launchLegalModal}>{title} privacy policy</a>.
</p>
</Localized>);
</LocalizedHtml>);
}

renderLegalModal() {
Expand Down
3 changes: 2 additions & 1 deletion frontend/tasks/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ const LOCALIZABLE_FIELDS = [
"details.copy",
"tour_steps.copy",
"contributors.title",
"contributors_extra"
"contributors_extra",
"legal_notice"
];

function isLocalizableField(pieces) {
Expand Down
4 changes: 0 additions & 4 deletions frontend/test/ui/test_homepage.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ def test_install_button_loads(base_url, selenium):
assert True


@pytest.mark.skipif(
True, reason='Skip featured experiment tests.')
@pytest.mark.nondestructive
def test_featured_experiment_actions(base_url, selenium):
"""Test if featured experiment action buttons exists"""
Expand All @@ -39,8 +37,6 @@ def test_featured_experiment_actions(base_url, selenium):
assert True


@pytest.mark.skipif(
True, reason='Skip featured experiment tests.')
@pytest.mark.nondestructive
def test_featured_experiment(base_url, selenium):
"""Test if featured experiment video exists"""
Expand Down
1 change: 1 addition & 0 deletions locales/en-US/experiments.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ nomore404sContributors2Title = Director, Wayback Machine, The Internet Archive
nomore404sContributors3Title = Senior Crawl Engineer, The Internet Archive
notesDescription = A simple notepad built into Firefox. Ever need to jot something down while you browse the web? This is the experiment for you.
notesIntroduction = Notes adds a simple, one-page notepad to your browser’s sidebar. We’ve added a few basic formatting options to start, but we want your feedback to tell us what features you’d like to see us add.
notesLegalnotice = By proceeding, you agree to the <a>terms</a> and <a>privacy</a> policies of Test Pilot and the <a>Notes privacy policy</a>.
notesMeasurements0 = Notes will collect information about your use of the feature, such as how often you create notes and how long you spend editing them, the number of characters you save in your notes, and whether you use any editing features (e.g., bold or stylized text).
notesMeasurements1 = Notes will also collect information about your interaction with the add-on, such as how you access the feature, and what buttons you may click.
notesDetails0Copy = It’s a notepad. Why didn’t we think of this earlier?
Expand Down

0 comments on commit e21e15c

Please sign in to comment.