Repository navigation
feat(cms): send pages to WordPress from Send to CMS (#1331) - #1572
Conversation
…ord and send pages to it as draft posts (ansvisor#1331) Co-Authored-By: Claude Opus 5.5 <[email protected]>
… read when the Library opens and daily (ansvisor#1331) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ons (ansvisor#1331) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ss-server # Conflicts: # server/src/lib/content-delivery.test.js # supabase/schema.sql
The Send dialog (editor, Library row, bulk) offers the brand's WordPress site beside Webflow and the webhook. A remembered CMS that isn't ready goes to the webhook, never the other CMS. The toast says when a live post got a new draft and when JSON-LD was left out. The Library marks rows sent to WordPress and asks /wordpress-status once per brand per visit. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
… has ended Since ansvisor#1589 a workspace whose plan has ended can't write, but taking back an outside account's access stays open (COST_STOPPING), as Webflow's disconnect does. WordPress's disconnect revokes the Application Password where the site allows, so it joins the list. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s-published Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ress-web Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Merged #1571's new head in (49799b3), no conflicts. Not checked on a real site: a product grid (#1607) goes to WordPress with its inline styles, and WordPress's HTML filter may strip some of them for an Author-role user. Checks: typecheck on every web tip, the server suite at #1579 (3,522 tests), and the whole web suite (4,438 tests) and |
# Conflicts: # web/src/components/content/send-to-cms-dialog.tsx
…space is read-only Connect and Change sign-in open it before anything is sent, and a connect or disconnect the API refuses for the plan opens it instead of saying WordPress couldn't be reached. Disconnect stays open, as Webflow's.
…hile the workspace is read-only
gkhngyk
left a comment
There was a problem hiding this comment.
Looks good with 1eb0b4d: your merge of main resolved send-to-cms-dialog.tsx, library/_bulk-send-dialog.tsx and library/page.tsx exactly as I had (a refused send on an ended plan opens the plan dialog and keeps its target; the Library doesn't ask WordPress for published posts while the workspace is read-only). On top of it I merged in #1571's card fix and put back the Library read-only test's WordPress row, which fails without the guard.
What I checked
- The target choice (
useCmsTarget):- A remembered CMS that's connected but not ready falls back to the webhook. It never switches to the other CMS.
- With nothing remembered, the first ready CMS is picked: Webflow, then WordPress.
- A failed read leaves that CMS out, and says so only to someone who picked it before.
- The picker shows Webflow and WordPress only when they're connected. The arrow keys skip a card that's off.
- Toasts say whether the post was made or updated, whether it was live (so a new draft was made), and whether JSON-LD was left out. The Library shows "In WordPress as a draft post", and the published check runs once per brand per visit.
- Tests on the merged tree:
send-to-cms-dialog,cms-send-client,_bulk-send-dialog, the Library page and the editor page (435 passed). Webtsc, eslint and prettier are clean.
Before merging
Summary
Send to CMS, phase 2 (#1331): WordPress, part 4. The Send dialog now sends to a brand's WordPress site, from the editor, a Library row and the Library's bulk send.
Stacked on #1571, which is stacked on #1570 and #1569. This PR's own change is its last commit, web only.
Where pages go (
components/content/cms-target.tsx):useCmsTargetreads the brand's Webflow and WordPress together. A connected WordPress is ready; one whose sign-in was refused shows, off, with what to do.smup, and stack below it.The dialog (
send-to-cms-dialog.tsx):The Library:
liveorjsonLd, so the dialog says it up front./wordpress-status(feat(cms): mark a page published once its WordPress post is put live, read when the Library opens and daily (#1331) #1570) once per brand per visit, when a listed page is in WordPress as a draft. The list is read again when it marked any published, as for Webflow.refreshWebflowPublishedandrefreshWordPressPublishedshare one helper incms-send-client.ts.Strings are in
en.json(contentEditor.editor.send,contentEditor.library.bulk,contentEditor.library.cms.wordpress).Next: part 5, the docs (
send-to-cms.mdx, a WordPress section).Related issue
Part of #1331 (phase 2, WordPress). Stacked on #1571 → #1570 → #1569.
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
cd web && yarn vitest run src/components/content/send-to-cms-dialog.test.tsx "src/app/[locale]/(dashboard)/dashboard/content/library" src/lib/content/cms-send-client.test.tsCONNECTOR_CREDENTIALS_KEYset) and a WordPress site connected in Settings › Integrations (a real site: gkhngyk), open a page in the editor and click Send to CMS.Checked in the browser (this branch's API and web, against the dev DB with 00294) at 1024 px, light and dark. The brand had two temporary connection rows, a Webflow one and a WordPress one, removed afterwards. Nothing was sent.
Screenshots follow in a comment.
Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)Also run:
yarn format,yarn lint(0 errors),yarn typecheck,yarn test(4,163 tests) andyarn buildinweb/. This was after the pre-push review's fixes:sm.Each new test for the first two fails with its fix reverted. I checked that by reverting each one.
🤖 Generated with Claude Code