,
+} ) );
jest.mock( 'components/settings-card', () => ( {
__esModule: true,
default: ( { children } ) => children,
@@ -49,7 +52,11 @@ const buildState = ( canManageModules, searchTerm ) => ( {
const shownToggles = () => MODULES.filter( module => screen.queryByText( `${ module } toggle` ) );
const shownPointers = () =>
- MODULES.filter( module => screen.queryByText( `Features pointer: ${ NAMES[ module ] }` ) );
+ MODULES.filter(
+ module =>
+ screen.queryByText( `Features pointer: ${ NAMES[ module ] }` ) ||
+ screen.queryByText( `${ module } panel pointer` )
+ );
describe( 'Composing', () => {
afterEach( () => {
@@ -58,7 +65,7 @@ describe( 'Composing', () => {
it.each( [
[ 'every toggle while the settings flag is off', false, true, '', MODULES, [] ],
- [ 'only Markdown once Features switches the rest', true, true, '', [ 'markdown' ], [] ],
+ [ 'no toggle once the settings move out', true, true, '', [], [] ],
[
'a pointer to Features for a search once the flag is on',
true,
@@ -67,6 +74,14 @@ describe( 'Composing', () => {
[],
[ 'latex' ],
],
+ [
+ 'a pointer to the panel for a Markdown search once the flag is on',
+ true,
+ true,
+ 'markdown',
+ [],
+ [ 'markdown' ],
+ ],
[ 'every toggle to users who cannot manage modules', true, false, '', MODULES, [] ],
] )( 'shows %s', ( _label, flag, canManageModules, searchTerm, toggles, pointers ) => {
window.JetpackScriptData = {
diff --git a/projects/plugins/jetpack/_inc/lib/admin-pages/settings-redirect-map.json b/projects/plugins/jetpack/_inc/lib/admin-pages/settings-redirect-map.json
index f944033332d4..f7d69f5a5fff 100644
--- a/projects/plugins/jetpack/_inc/lib/admin-pages/settings-redirect-map.json
+++ b/projects/plugins/jetpack/_inc/lib/admin-pages/settings-redirect-map.json
@@ -2,7 +2,6 @@
"description": "Where each Jetpack Settings hash route and ?term= search goes once the Settings screen retires. Nothing reads it yet: the redirect document that page=jetpack-settings and the page=jetpack forwarder (Jetpack_React_Page) will print resolves these rules in PHP, since the server never sees the hash. It applies only while Initializer::is_settings_consolidation_enabled() is true. The Network Admin jetpack-settings page is out of scope. It is production-excluded in .gitattributes; the PR that first reads it must remove that exclusion.",
"matching": "`everySource` runs before any route or term rule. A term matches its decoded value, case-insensitively, before its route; an unmatched term falls back to its route. On page=jetpack-settings, an empty hash (the bare menu link) or an unknown route gets the /settings rules, as main.jsx does. On page=jetpack, an unknown route never reaches these rules: the forwarder (Jetpack_React_Page::get_legacy_route_redirects()) sends it to My Jetpack for admins and to Settings for everyone else, as it does today, so #/my-plan, #/dashboard and #/stats keep landing on My Jetpack. In each list, the first rule whose `when` all hold wins, and a rule without `when` is the default. A rule with `pending` keeps the source on Settings until each marker clears: `D` is an open decision, `JETPACK-` an issue that must land, `flag:` a feature flag that must retire, `error-notice-home` a new home for the Jetpack::state( 'error' ) notice, which only Settings shows today, and `monetize-page` a Monetize page that shows the Ads settings (its flag on and the `monetize` module active), without which the Ads settings stay on Settings. A `destination` next to `pending` is where the source goes once it clears. A settings panel destination (`configure=`) waits on the issue that gives the panel that module's settings, since until then the panel's fallback links back here through configure_url. Destinations are relative to wp-admin. My Jetpack `#/` links work on every My Jetpack version, since its router rewrites them to `?p=`.",
"decisions": {
- "D2": "Whether Comments' settings (with Gravatar Hovercards and Markdown for comments) get one settings panel or become Features switches, and where the Markdown option goes.",
"D7": "Where Google Analytics settings go on Atomic (the SEO page, or Stats settings).",
"D9": "Where users who cannot manage modules find Post by Email, Publicize and their own account connection, since Features needs manage_options.",
"D10": "What happens to the legacy SEO block on self-hosted sites that have not opted in to the SEO page.",
@@ -79,6 +78,7 @@
{
"source": "/performance",
"rules": [
+ { "when": { "canManageModules": false }, "pending": [ "D9" ] },
{
"destination": "admin.php?page=my-jetpack#/features?search=cdn",
"alreadyRedirects": true
@@ -97,7 +97,7 @@
"source": "/writing",
"rules": [
{ "when": { "canManageModules": false }, "pending": [ "D9" ] },
- { "pending": [ "D2" ] }
+ { "destination": "admin.php?page=my-jetpack#/features", "alreadyRedirects": true }
],
"linkedFrom": [
"plugins/jetpack Unavailable_Blocks::get_editor_data(): fixUrl for blocks the Blocks module turned off; wants admin.php?page=my-jetpack#/features?search=blocks",
@@ -133,7 +133,7 @@
},
{
"source": "/discussion",
- "rules": [ { "pending": [ "D2" ] } ],
+ "rules": [ { "pending": [ "JETPACK-3720" ] } ],
"outsideRepo": [ "wpcom: help search key" ]
},
{
@@ -302,9 +302,14 @@
{ "destination": "admin.php?page=my-jetpack&p=%2Ffeatures%3Fconfigure%3Dpost-by-email" }
]
},
- { "source": "comments", "rules": [ { "pending": [ "D2" ] } ] },
- { "source": "markdown", "rules": [ { "pending": [ "D2" ] } ] },
- { "source": "gravatar-hovercards", "rules": [ { "pending": [ "D2" ] } ] },
+ { "source": "comments", "rules": [ { "pending": [ "JETPACK-3720" ] } ] },
+ {
+ "source": "markdown",
+ "rules": [
+ { "destination": "admin.php?page=my-jetpack&p=%2Ffeatures%3Fconfigure%3Dmarkdown" }
+ ]
+ },
+ { "source": "gravatar-hovercards", "rules": [ { "pending": [ "JETPACK-3720" ] } ] },
{
"source": "custom-content-types",
"rules": [ { "destination": "options-writing.php#cpt-options" } ]
diff --git a/projects/plugins/jetpack/changelog/change-settings-markdown-panel b/projects/plugins/jetpack/changelog/change-settings-markdown-panel
new file mode 100644
index 000000000000..f9638aa49ee7
--- /dev/null
+++ b/projects/plugins/jetpack/changelog/change-settings-markdown-panel
@@ -0,0 +1,5 @@
+Significance: patch
+Type: enhancement
+Comment: Settings: Point the Markdown settings to their panel in My Jetpack, behind the settings consolidation flag.
+
+