Bug 1632818 - Create page for CFR Simple template in Firefox source docs r=k88hudson

Differential Revision: https://phabricator.services.mozilla.com/D80838
This commit is contained in:
Andrei Oprea 2020-07-21 20:36:10 +00:00
Родитель 07fbe5426b
Коммит 1d790b65af
11 изменённых файлов: 47 добавлений и 8 удалений

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 252 KiB

Просмотреть файл

@ -96,6 +96,7 @@ Detailed Docs
.. toctree::
:maxdepth: 2
simple-cfr-template
debugging-docs
experiment-guide
first-run

Просмотреть файл

@ -0,0 +1,37 @@
Simple CFR Template
--------------------
The “Simple CFR Template” is a two-stage UI (a chiclet notification and a door-hanger)
that shows up on a configurable `trigger condition`__, such as when the user visits a
particular web page.
.. __: /toolkit/components/messaging-system/docs/TriggerActionSchemas
Warning! Before reading, you should consider whether a `Messaging Experiment is relevant for your needs`__.
.. __: https://docs.google.com/document/d/1S45a_nFn8QRM8gvsxCM6HHROrIQlQQl6fUlJ2j63PGI/edit
.. image:: ./cfr_doorhanger_screenshot.png
:align: center
:alt: Simple CFR Template 2 stage
Doorhanger Configuration
=========================
Stage 1 – Chiclet
++++++++++++++++++
* **chiclet_label**: The text that shows up in the chiclet. 20 characters max.
* **chiclet_color**: The background color of the chiclet as a HEX code.
Stage 2 – Door-hanger
++++++++++++++++++++++
* **title**: Title text at the top of the door hanger.
* **body**: A longer paragraph of text.
* **icon**: An image (please provide a URL or the image file up to 96x96px).
* **primary_button_label**: The label of the button.
* **primary_button_action**: The special action triggered by clicking on the button. Choose any of the available `button actions`__. Common examples include opening a section of about:preferences, or opening a URL.
.. __: /toolkit/components/messaging-system/docs/SpecialMessageActionSchemas

Просмотреть файл

@ -3,7 +3,7 @@ prefs =
identity.fxaccounts.remote.root=https://example.com/
support-files =
head.js
../../SpecialMessageActionSchemas.md
../../index.md
[browser_sma_open_about_page.js]
[browser_sma_open_awesome_bar.js]

Просмотреть файл

@ -1,5 +1,5 @@
const TEST_URL =
"https://example.com/browser/toolkit/components/messaging-system/schemas/SpecialMessageActionSchemas/test/browser/SpecialMessageActionSchemas.md";
"https://example.com/browser/toolkit/components/messaging-system/schemas/SpecialMessageActionSchemas/test/browser/index.md";
function getHeadingsFromDocs(docs) {
const re = /### `(\w+)`/g;
@ -24,7 +24,7 @@ add_task(async function test_sma_docs() {
for (let schemaType of schemaTypes) {
Assert.ok(
headings.includes(schemaType),
`${schemaType} not found in SpecialMessageActionSchemas.md`
`${schemaType} not found in SpecialMessageActionSchemas/index.md`
);
}
});

Просмотреть файл

@ -1,6 +1,6 @@
[DEFAULT]
support-files =
../../TriggerActionSchemas.md
../../index.md
[browser_asrouter_trigger_listeners.js]
[browser_asrouter_trigger_docs.js]

Просмотреть файл

@ -1,5 +1,5 @@
const TEST_URL =
"https://example.com/browser/toolkit/components/messaging-system/schemas/TriggerActionSchemas/test/browser/TriggerActionSchemas.md";
"https://example.com/browser/toolkit/components/messaging-system/schemas/TriggerActionSchemas/test/browser/index.md";
const { ASRouterTriggerListeners } = ChromeUtils.import(
"resource://activity-stream/lib/ASRouterTriggerListeners.jsm"
@ -53,7 +53,7 @@ add_task(async function test_trigger_docs() {
for (let triggerName of ASRouterTriggerListeners.keys()) {
Assert.ok(
headings.includes(triggerName),
`${triggerName} not found in TriggerActionSchemas.md`
`${triggerName} not found in TriggerActionSchemas/index.md`
);
}
});

Просмотреть файл

@ -14,5 +14,5 @@ Triggers and actions
.. toctree::
:maxdepth: 2
SpecialMessageActionSchemas/SpecialMessageActionSchemas.md
TriggerActionSchemas/TriggerActionSchemas.md
SpecialMessageActionSchemas/index
TriggerActionSchemas/index

Просмотреть файл

@ -13,6 +13,7 @@ This is the nascent documentation of the Toolkit code that is shared across Fire
components/featuregates/featuregates/index
search/index
components/normandy/normandy/index
components/messaging-system/docs/index
components/prompts/prompts/index
modules/subprocess/toolkit_modules/subprocess/index
components/telemetry/index