feat(msm): bring Multi-site Manager to main - #1341
Open
keepthebyte wants to merge 5 commits into
Open
keepthebyte wants to merge 5 commits into
keepthebyte wants to merge 5 commits into
Conversation
* msm implementation * Satellite site can control the sync features and inheritance * renamed global publish to msm * read msm mapping from Org config and preview/publish the page from base site to the satellite upon resume inheritance action * Show a link to edit the page on custom sites * readme added * moved the shared file inside msm as the da-title is not using it anymore * moved the utils methods to helpers folder * msm unit tests
MSM is registered in blocks/edit/da-prepare/da-prepare.js only. The canvas keeps its own OOTB_ACTIONS, so a prepare config row with 'Multi-site Manager' creates a menu entry whose OOTB lookup misses; path stays undefined and the dialog renders an iframe pointing at the page base: iframeOrigin https://<host>, iframePath /canvas, no query, body length 0 Since /edit now redirects to /canvas, this is the only reachable entry point. msm.js reads org, site and path off details, all of which the canvas supplies, and every other action here is already imported from ../../edit/da-prepare/actions/.
The MSM suite was written before `fetchDaConfigs` moved from a direct
`daFetch` of `${DA_ORIGIN}/config…` to the nx2 config API. Its `window.fetch`
mock already answers `/config/` correctly, but `getNx2Api()` had no fixture to
resolve, so every test that loaded an org config failed — 17 of 73, all of them
downstream of `getSatellites`.
The fix is the harness every other da-prepare test already uses:
`setNx('/test/fixtures/nx', { hostname: 'example.com' })`. No production code
changed, which is the point — the runtime was never broken, only the mock.
Also brings the test file up to the current eslint config, which has tightened
since the branch was written: two multi-statement arrow bodies expanded, and
one object literal inlined then split to stay under max-len.
73 MSM tests pass; full suite 2307 passed, 0 failed, 4 skipped; `npm run lint`
clean.
Contributor
|
Fix: fold the preview/publish result into the error check instead of only gating on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings the Multi-site Manager panel to
main, so it stops living on a branch.MSM has been on the
msmbranchsince #871, which merged into that branch rather than into
main. Everythingin it 404s on production today, so the feature is unreachable: the
prepareconfig row that should open it finds no OOTB entry,
pathstaysundefined,and the dialog renders an iframe pointing at the page base — the right title
over an empty body.
What this adds
blocks/edit/da-prepare/actions/msm/msm.js…/msm/helpers/config.jsmsmsheet…/msm/helpers/utils.js…/msm/msm.css,…/msm/README.mdblocks/edit/da-prepare/da-prepare.jsblocks/canvas/editor-utils/prepare-menu.jsThe canvas registration is the part #871 never had — it predates the canvas
entirely, and the canvas keeps its own
OOTB_ACTIONS. Since/editnowredirects to
/canvas, without it the panel would still be unreachable onmain. Both menus use the sameOOTB_ACTIONS+rendershape and the canvasalready imports every other action from
../../edit/da-prepare/actions/, soit is the same one-entry wiring.
optional: true, so it only appears for orgsthat opt in through their
prepareconfig, exactly as in the classic menu.Tests
test/unit/…/msm/— 73 tests across the panel, its config resolver and itsaction helpers.
They needed one harness fix, which is the only change here to code that came
off the branch. The suite predates
fetchDaConfigsmoving from a directdaFetchof${DA_ORIGIN}/config…to the nx2 config API. Itswindow.fetchmock already answers
/config/correctly, butgetNx2Api()had no fixture toresolve, so all 17 tests downstream of
getSatellitesfailed. Fixed by usingthe harness every other da-prepare test already uses:
No production code changed for that — the runtime was never broken, only
the mock. The test file also picked up the current eslint config, which has
tightened since the branch was written.
Verified against real content
Exercised on the branch preview with production IMS and production DA, on an
org with a real five-tier
msmsheet(
keepthebyte: global → eu → {ie, gb, de, ch}, global → apac → sg):Custom sites as the docs describe;
picked up a newly added one without a reload;
resolveConfigwas run against that org's sheet for all eight sites — eachresolves to the expected base/satellite role.
Note for reviewers
resolveConfigdecides between thebase/satelliteshape and the legacysingle-column shape with
rows[0].base !== undefined— row 0 only. That makesthe first row of an org's
msmsheet load-bearing in a way nothing in thesheet signals; a blank in that cell silently switches the whole sheet to the
other shape. Left as-is here since it is existing behaviour and out of scope,
but it might deserve a follow-up.