Skip to content

fix(content-manager): warn before publishing with draft relations#26736

Merged
innerdvations merged 18 commits into
developfrom
fix/content-manager-draft-relations-publish-warning
Jun 25, 2026
Merged

fix(content-manager): warn before publishing with draft relations#26736
innerdvations merged 18 commits into
developfrom
fix/content-manager-draft-relations-publish-warning

Conversation

@innerdvations

@innerdvations innerdvations commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Re-enables draft-relation counting when publishing from the edit view and shows a confirmation dialog when the entry references unpublished targets.
  • Editors can cancel or publish without relations (relations are omitted from the published version, as today).
  • Re-enables the same count for bulk publish in the list view so the warning appears there too.
  • Updates copy to clarify that draft relations will not be included in the published version.

m2m (bidirectional):
image

unidirectional:
image

Fixes #25361

Publishing related entries first is intentionally out of scope here (permissions and ordering make it a follow-up).

Test plan

Experimental version: 0.0.0-experimental.cb80fd5e9b78bde9ac2c175e5a5e1977b2bcfb33

  • yarn test:front DocumentActions.test ConfirmBulkActionDialog.test
  • yarn nx run @strapi/content-manager:lint
  • yarn test:e2e --domains content-manager --grep "warns on publish" (new E2E spec)
  • Manual: create entry with draft relation → Publish → see warning → Cancel leaves draft unchanged
  • Manual: confirm with Publish without relations → published entry has no relation; draft still has it

Re-enable draft-relation counting on publish so editors see a confirmation
dialog with cancel or publish-without-relations. Bulk publish uses the same
count API again, and the collection-type edit view e2e covers the warning.

Fixes #25361
@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
contributor-docs Ready Ready Preview, Comment Jun 24, 2026 7:00pm

Request Review

@dosubot dosubot Bot added pr: fix This PR is fixing a bug source: core:content-manager Source is core/content-manager package labels Jun 22, 2026
@innerdvations innerdvations added the flag: don't merge This PR should not be merged at the moment label Jun 22, 2026
@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Size Change: +7.37 kB (+0.22%)

Total Size: 3.31 MB

📦 View Changed
Filename Size Change
examples/getstarted/build/de.json-*********** 2.91 kB -3.86 kB (-56.98%) 🏆
examples/getstarted/build/EditViewPage-*********** 4.8 kB +2.59 kB (+117.06%) 🆘
examples/getstarted/build/en.json-*********** 6.4 kB +1.04 kB (+19.48%) ⚠️
examples/getstarted/build/es.json-*********** 1.97 kB -12.9 kB (-86.78%) 🏆
examples/getstarted/build/hi.json-*********** 11.1 kB +6.51 kB (+143.04%) 🆘
examples/getstarted/build/hu.json-*********** 11.2 kB +7.27 kB (+182.87%) 🆘
examples/getstarted/build/it.json-*********** 15.4 kB +12.4 kB (+427.19%) 🆘
examples/getstarted/build/ko.json-*********** 3.79 kB +1.69 kB (+80.82%) 🆘
examples/getstarted/build/ListPage-*********** 2.58 kB +616 B (+31.33%) 🚨
examples/getstarted/build/ms.json-*********** 3.93 kB +2.75 kB (+232.51%) 🆘
examples/getstarted/build/nl.json-*********** 7.04 kB -9.07 kB (-56.3%) 🏆
examples/getstarted/build/strapi-*********** 1.84 MB +1.52 kB (+0.08%)
examples/getstarted/build/sv.json-*********** 3.69 kB -715 B (-16.22%) 👏
examples/getstarted/build/th.json-*********** 6.16 kB +1.64 kB (+36.32%) 🚨
examples/getstarted/build/useLicenseLimitNotification-*********** 708 B -5 B (-0.7%)
examples/getstarted/build/Widgets-*********** 988 B -92 B (-8.52%)
examples/getstarted/build/zh.json-*********** 642 B -4.05 kB (-86.31%) 🏆
ℹ️ View Unchanged
Filename Size Change
examples/getstarted/build/_baseEach-*********** 225 B +1 B (+0.45%)
examples/getstarted/build/_baseMap-*********** 190 B -2 B (-1.04%)
examples/getstarted/build/AdminSeatInfo-*********** 847 B +1 B (+0.12%)
examples/getstarted/build/AIUsage-*********** 704 B +1 B (+0.14%)
examples/getstarted/build/apiTokens-*********** 621 B +1 B (+0.16%)
examples/getstarted/build/App-*********** 16.7 kB 0 B
examples/getstarted/build/ApplicationInfoPage-*********** 4.36 kB 0 B
examples/getstarted/build/ar.json-*********** 15.6 kB 0 B
examples/getstarted/build/AuthenticatedLayout-*********** 57.9 kB -1 B (0%)
examples/getstarted/build/AuthResponse-*********** 420 B 0 B
examples/getstarted/build/ca.json-*********** 9.44 kB 0 B
examples/getstarted/build/CardDragPreview-*********** 589 B 0 B
examples/getstarted/build/ColorPickerInput-*********** 4.24 kB +1 B (+0.02%)
examples/getstarted/build/ComponentConfigurationPage-*********** 1.59 kB +3 B (+0.19%)
examples/getstarted/build/ConfigureTheView-*********** 1.54 kB -1 B (-0.07%)
examples/getstarted/build/constants-*********** 718 B +2 B (+0.28%)
examples/getstarted/build/CreateActionEE-*********** 513 B -1 B (-0.19%)
examples/getstarted/build/CreatePage-*********** 1.96 kB +1 B (+0.05%)
examples/getstarted/build/CreateView-*********** 380 B +3 B (+0.8%)
examples/getstarted/build/cs-*********** 76 B 0 B
examples/getstarted/build/cs.json-*********** 16.7 kB 0 B
examples/getstarted/build/da.json-*********** 3.6 kB 0 B
examples/getstarted/build/dummy-preview-*********** 3.31 kB +2 B (+0.06%)
examples/getstarted/build/EditConfigurationPage-*********** 1.08 kB +3 B (+0.28%)
examples/getstarted/build/EditPage-*********** 4.74 kB +1 B (+0.02%)
examples/getstarted/build/EditView-*********** 2.01 kB +1 B (+0.05%)
examples/getstarted/build/en-*********** 74 B 0 B
examples/getstarted/build/en-GB-*********** 14.8 kB 0 B
examples/getstarted/build/es-*********** 74 B 0 B
examples/getstarted/build/eu.json-*********** 10.4 kB 0 B
examples/getstarted/build/EventsTable-*********** 388 B -1 B (-0.26%)
examples/getstarted/build/fi.json-*********** 15.3 kB 0 B
examples/getstarted/build/FieldTypeIcon-*********** 462 B +1 B (+0.22%)
examples/getstarted/build/Form-*********** 5.46 kB -2 B (-0.04%)
examples/getstarted/build/FormApiTokenContainer-*********** 1.03 kB +1 B (+0.1%)
examples/getstarted/build/fr.json-*********** 12.7 kB 0 B
examples/getstarted/build/getActionTypesDefaultMessages-*********** 500 B +2 B (+0.4%)
examples/getstarted/build/getTrad-*********** 381 B 0 B
examples/getstarted/build/groupBy-*********** 373 B +1 B (+0.27%)
examples/getstarted/build/gu.json-*********** 9.06 kB 0 B
examples/getstarted/build/he.json-*********** 6.11 kB 0 B
examples/getstarted/build/History-*********** 6.92 kB -1 B (-0.01%)
examples/getstarted/build/HomePage-*********** 247 kB +1 B (0%)
examples/getstarted/build/hooks-*********** 92 B 0 B
examples/getstarted/build/id-*********** 7.6 kB -3 B (-0.04%)
examples/getstarted/build/id.json-*********** 4.51 kB 0 B
examples/getstarted/build/index-*********** 226 kB +3 B (0%)
examples/getstarted/build/index.html 594 B 0 B
examples/getstarted/build/InstalledPlugins-*********** 781 B +2 B (+0.26%)
examples/getstarted/build/isNil-*********** 121 B +1 B (+0.83%)
examples/getstarted/build/ja.json-*********** 8.75 kB 0 B
examples/getstarted/build/layout-*********** 3.27 kB 0 B
examples/getstarted/build/Layout-*********** 2.19 kB +1 B (+0.05%)
examples/getstarted/build/LazyOutlet-*********** 308 B +1 B (+0.33%)
examples/getstarted/build/ListConfigurationPage-*********** 4.39 kB 0 B
examples/getstarted/build/ListView-*********** 6.83 kB +3 B (+0.04%)
examples/getstarted/build/ListViewPage-*********** 7.32 kB +2 B (+0.03%)
examples/getstarted/build/Login-*********** 464 B +1 B (+0.22%)
examples/getstarted/build/MagicLinkEE-*********** 390 B +2 B (+0.52%)
examples/getstarted/build/ml.json-*********** 11.3 kB 0 B
examples/getstarted/build/ModalForm-*********** 243 B 0 B
examples/getstarted/build/no.json-*********** 5.47 kB 0 B
examples/getstarted/build/NoContentTypePage-*********** 456 B +1 B (+0.22%)
examples/getstarted/build/NoPermissionsPage-*********** 233 B +1 B (+0.43%)
examples/getstarted/build/Permissions-*********** 10.9 kB +1 B (+0.01%)
examples/getstarted/build/pl.json-*********** 16.1 kB 0 B
examples/getstarted/build/PrivateRoute-*********** 250 B +1 B (+0.4%)
examples/getstarted/build/ProfilePage-*********** 2.48 kB +1 B (+0.04%)
examples/getstarted/build/pt-BR.json-*********** 10.5 kB 0 B
examples/getstarted/build/pt.json-*********** 4.17 kB 0 B
examples/getstarted/build/purchase-review-workflows-*********** 66.3 kB 0 B
examples/getstarted/build/PurchaseAuditLogs-*********** 70.5 kB 0 B
examples/getstarted/build/PurchaseContentHistory-*********** 80.9 kB 0 B
examples/getstarted/build/PurchaseContentReleases-*********** 55.9 kB -1 B (0%)
examples/getstarted/build/PurchaseSingleSignOn-*********** 25 kB 0 B
examples/getstarted/build/RelativeTime-*********** 397 B 0 B
examples/getstarted/build/ReleasesPage-*********** 4.1 kB +1 B (+0.02%)
examples/getstarted/build/ReleasesSettingsPage-*********** 1.52 kB +2 B (+0.13%)
examples/getstarted/build/router-*********** 389 B +1 B (+0.26%)
examples/getstarted/build/ru-*********** 91 B 0 B
examples/getstarted/build/ru.json-*********** 17.2 kB 0 B
examples/getstarted/build/sa.json-*********** 11.2 kB 0 B
examples/getstarted/build/schemas-*********** 3.14 kB -1 B (-0.03%)
examples/getstarted/build/SearchInput-*********** 647 B +2 B (+0.31%)
examples/getstarted/build/selectors-*********** 110 B 0 B
examples/getstarted/build/SelectRoles-*********** 1.03 kB +2 B (+0.19%)
examples/getstarted/build/Settings-*********** 3.6 kB 0 B
examples/getstarted/build/SettingsPage-*********** 3.02 kB 0 B
examples/getstarted/build/SingleSignOnPage-*********** 1.81 kB -1 B (-0.06%)
examples/getstarted/build/sk-*********** 76 B 0 B
examples/getstarted/build/sk.json-*********** 16.9 kB 0 B
examples/getstarted/build/sortable.esm-*********** 16.6 kB -1 B (-0.01%)
examples/getstarted/build/sortBy-*********** 694 B 0 B
examples/getstarted/build/SSOProviders-*********** 756 B +2 B (+0.27%)
examples/getstarted/build/strapi-************ 844 B 0 B
examples/getstarted/build/Table-*********** 1.44 kB -1 B (-0.07%)
examples/getstarted/build/tail-*********** 245 B +2 B (+0.82%)
examples/getstarted/build/TokenBox-*********** 122 kB -1 B (0%)
examples/getstarted/build/tr-*********** 83 B 0 B
examples/getstarted/build/tr.json-*********** 13.7 kB 0 B
examples/getstarted/build/transferTokens-*********** 505 B +2 B (+0.4%)
examples/getstarted/build/uk-*********** 91 B 0 B
examples/getstarted/build/uk.json-*********** 15.5 kB 0 B
examples/getstarted/build/useAdminRoles-*********** 242 B 0 B
examples/getstarted/build/UseCasePage-*********** 1.36 kB +1 B (+0.07%)
examples/getstarted/build/useDragLayer-*********** 180 B -1 B (-0.55%)
examples/getstarted/build/users-*********** 352 B 0 B
examples/getstarted/build/useWebhooks-*********** 646 B +2 B (+0.31%)
examples/getstarted/build/validation-*********** 535 B +1 B (+0.19%)
examples/getstarted/build/vi.json-*********** 13.7 kB 0 B
examples/getstarted/build/WidgetHelpers-*********** 462 B +2 B (+0.43%)
examples/getstarted/build/zh-Hans.json-*********** 15.4 kB 0 B

compressed-size-action

Add an E2E spec for cancel vs publish-without-relations and fix the
collection-type edit view test to use a seeded draft author.
@trunk-io

trunk-io Bot commented Jun 22, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@Bassel17

Copy link
Copy Markdown
Member

I tested this a bit, I think there are a few flaws here and there, so when we have many to many, i guess 1 to 1 and self relations as well, the pop up will appear but there is not way to resolve it because it will appear from both contenttypes both being unable to published, and the pop up seems to keep appearing regardless of if I published the related contentType or not.
another minor issue, it seems the Cmd/Ctrl+Shift+Enter shortcut does not trigger publish now when a related contentType is in draft and so it doesn't even show the pop up either

@Bassel17

Copy link
Copy Markdown
Member

actually in many to many we may not need the pop up warning at all, it seems the related entity self heals if it gets published

…feedback

Open the confirmation dialog from the publish keyboard shortcut, refetch the
server draft-relation count when the document or window focus changes, and
exclude self-referential relations from the warning (they are preserved on publish).
… helper

Fixes build:types failure where countLocalDraftRelations passed component
schemas typed as Component into a ContentType-only parameter.
Bidirectional M2M draft links are counted separately from xToOne-style
relations so publish dialogs use accurate copy and severity.
Align unit, API, and E2E tests with M2M draft-relation warnings and add a
shared publish helper for entries that trigger the confirmation dialog.
@Bassel17

Copy link
Copy Markdown
Member

The modal seems to be popping up whenever a draft relation is added, am guessing adding the modal is affecting the flow of the e2e tests as well

Passing dialogRequestId as 0 when draft relations were detected auto-opened
the publish warning via useLayoutEffect. Only forward the id after the
keyboard shortcut increments it, ignore 0 in the open effect, and align API/E2E
tests with the corrected behavior.
Replace dialogRequestId/useLayoutEffect with scoped confirm openers so the
warning modal never auto-opens when draft relations are detected. Sum local
and server counts for modified documents so incremental relation adds show
the correct total. Update E2E tests for keyboard confirm and modal publish.
Keep Publish disabled until server draft-relation counts are applied, avoid
networkidle in publish helpers, and harden edit-view, preview, and relations
on-the-fly tests for suite timing under Firefox and WebKit.
…type

Restore unidirectional warnings that relations are stripped on publish, and
keep bidirectional M2M copy about links appearing once related entries publish.
…layout

Add optional bodyIcon to DocumentActionConfirmDialog so publish warnings
use the same centered icon and typography as bulk publish confirmations.
@github-actions

Copy link
Copy Markdown
Contributor

AI-generated QA checklist

Scope / Impact

Re-enables the "count draft relations" warning when publishing content with draft relations, both from the single edit view and from the list-view bulk publish. The flow distinguishes two cases:

  • xToOne / oneToMany draft relations → danger dialog with Publish without relations (the relation is stripped on publish, as today).
  • Bidirectional manyToMany draft links only → informational dialog with Publish (link is preserved; target will appear on the live site once it is published).
  • Self-referential relations are excluded from the count on both client and server.

Affected areas:

  • Edit view publish action (packages/core/content-manager/admin/src/pages/EditView/components/DocumentActions.tsx) — new local recursive draft-relation counter over formValues, components, and dynamic zones; new publishConfirmScope opener so the Cmd/Ctrl+Shift+Enter shortcut opens the dialog instead of skipping publish; window-focus listener that refetches server counts.
  • List view bulk publish (ConfirmBulkActionDialog.tsx) — enableDraftRelationsCount = false flag removed, count is fetched again.
  • Server: API response shape changed from data: numberdata: { unpublishedRelations, draftM2mLinks } in both collection-type and single-type countDraftRelations endpoints; new util services/utils/draft-relations.ts and rewritten services/utils/draft.ts; getDeepPopulateDraftCount now skips self-referential relations.
  • Copy updates in translations/en.json (only English updated; other locales untouched).

Reviewer feedback on the open PR (@Bassel17) flagged: dialog appearing on both sides of bidirectional M2M with no way to resolve, dialog re-appearing after the related entry is published (stale fetch), and the keyboard shortcut not triggering publish. The diff appears to address all three but those flows deserve focused manual re-verification.

Manual QA

  • Create a collection-type entry with a unidirectional relation pointing to an unpublished draft → click Publish → red/danger dialog shows the draft count and "Publish without relations"; Cancel leaves the draft unchanged and the relation intact; Publish without relations publishes the entry and the published version has no relation while the draft still does.
  • Repeat with a manyToOne and oneToMany relation to a draft target — same danger dialog.
  • Create a bidirectional manyToMany relation to a draft target → publish → informational (non-danger) dialog with Publish button; after confirming, the published entry retains the join-table link and the target becomes visible on the live site once published.
  • Confirm the dialog does not re-appear after the related entry is published and the page is refocused (window focus listener should refetch counts).
  • Open the same content type on both sides of the bidirectional M2M; publish one side → check the warning text and behavior on the other side is consistent.
  • With a draft relation present, press Cmd/Ctrl + Shift + Enter → confirm the dialog opens (not silently skipped, which was the previous bug).
  • From the list view, select multiple entries with draft relations and click Publish → the bulk warning dialog now shows the count instead of being silently disabled.
  • From the preview screen, trigger publish on an entry with draft relations → dialog should open in the preview scope.
  • From a relation modal (publishing a related entry without leaving the parent edit view) → dialog should open in the relation-modal scope and not collide with the underlying edit-view dialog.
  • Single-type entry with a draft relation → publish action shows the dialog and respects the same Cancel / Publish-without-relations split.

Edge Cases

  • Self-referential relation with a draft target → dialog should NOT appear and publish proceeds normally (covered by the new attribute.target === uid skip in both draft.ts and populate.ts).
  • Entry with a draft component containing a draft relation → count rolls up correctly.
  • Entry with a dynamic zone containing a draft relation in one of the variants → count rolls up correctly.
  • Entry with mixed unidirectional + bidirectional-M2M draft relations → danger variant wins, button reads "Publish without relations", and the additional M2M sentence is appended.
  • Brand-new entry (no documentId) with draft relations in the form → only the local count is used (server fetch skipped); dialog still appears.
  • Modified existing entry → local + server counts are merged via mergeDraftRelationCounts; verify no double-counting when the same draft relation exists server-side and in unsaved form values.
  • User without read permission on the related content type — server still returns counts; verify no permission leak (the controller previously returned data: number, response shape changed).
  • i18n: entry with locale-specific draft relations → counts reflect the active locale (controller passes locale).
  • Draft & Publish disabled on the target content type → that relation must not contribute to either count.
  • Discard / unpublish actions on the same screen are unaffected by the new opener registration.
  • Confirm the response shape change does not break any external API consumer of /content-manager/.../actions/countDraftRelations (the data field is now an object, not a number).

Test Setup

  • A sandbox app (e.g. examples/getstarted) with at least:
    • One collection type with unidirectional relations (oneToOne, manyToOne, oneToMany, manyToMany without inversedBy/mappedBy) to a Draft & Publish target.
    • One collection type with a bidirectional manyToMany to another Draft & Publish target.
    • One collection type with a self-referential relation.
    • A content type containing a component with a relation field, and a dynamic zone with a relation-bearing variant.
    • A single type with a draft relation.
  • Test on SQLite (default) and at least one of PostgreSQL / MySQL to validate the changed documentManager.countDraftRelations return shape.
  • Have draft + published versions of related entries available to switch them between states during QA.

Possible QA Automation

Candidate Test Layer Priority Signal
Edit-view publish opens danger dialog with "Publish without relations" when an unidirectional draft relation exists E2E Recommended Core flow added in tests/e2e/tests/content-manager/publish-draft-relations-warning.spec.ts
Edit-view publish opens informational dialog with "Publish" when only a bidirectional M2M draft link exists E2E Recommended New variant introduced in this PR; reviewer specifically flagged this case
Cmd/Ctrl + Shift + Enter shortcut opens the publish-confirm dialog when draft relations are present E2E Recommended Regression of reviewer-reported bug; covered by publishConfirmScope map
Window-focus refetch updates the draft-relation count after the related entry is published in another tab E2E Optional Reviewer reported the dialog "keeps appearing" — the new focus listener is the fix
Bulk publish dialog shows draft-relation warning copy with correct counts Frontend / Component Recommended Re-enabled by removing the enableDraftRelationsCount flag; unblocked tests in ConfirmBulkActionDialog.test.tsx
sumDraftCounts correctly splits unpublishedRelations vs draftM2mLinks across components and dynamic zones Unit Recommended Extends new test in services/utils/__tests__/draft-relations.test.ts
getDeepPopulateDraftCount skips self-referential relations Unit Recommended Behavioural change in populate.ts; not yet directly unit-tested
API response shape for countDraftRelations returns { unpublishedRelations, draftM2mLinks } for collection + single types API Integration Recommended Contract change; new spec draft-relations-bidirectional-m2m.test.api.ts partially covers this
Self-referential draft relation does NOT trigger the publish-confirm dialog E2E Optional Explicit skip added in both client and server code paths

Assumptions / Gaps

  • The PR description's manual checklist is not yet checked off; this checklist assumes the manual flows in the description still need to be validated.
  • Only en.json translation strings were updated. Other locales will fall back to defaults — confirm whether non-English locale updates are expected as part of this PR or follow up separately.
  • The PR still carries the flag: don't merge label and CI shows failing E2E tests in i18n - Fill from another locale and a flaky preview test. Confirm whether these failures are related to the new dialog (the reviewer hinted the modal "is affecting the flow of the e2e tests").
  • The popUpwarning.warning.has-draft-relations.button-confirm key now resolves to "Publish without relations" instead of "Yes, publish" — verify any documentation or screenshots referencing the old label are updated.
  • Out of scope per the PR description: "publishing related entries first" is intentionally deferred to a follow-up.

QA Resolution

Add qa-done when completed, or qa-skipped if intentionally skipped.

Register the publish POST listener before clicking Publish and race it
against the confirmation dialog so slow CI cannot miss the response when
publish proceeds without a warning.
Ted Lasso seed data includes draft article M2M links that open the
draft-relations dialog before publish reaches review-workflow validation.
Extract draft-relation counting into a shared util with unit tests and
assert bodyIcon dialog layout in DocumentActions.
Move count resolution and dialog variant selection into tested helpers
to improve coverage on the draft-relations publish warning logic.
@innerdvations innerdvations removed the flag: don't merge This PR should not be merged at the moment label Jun 25, 2026
@Bassel17 Bassel17 added the qa-done Applied when a PR passes QA label Jun 25, 2026

@Bassel17 Bassel17 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@innerdvations innerdvations merged commit 2dcf71a into develop Jun 25, 2026
153 of 156 checks passed
@innerdvations innerdvations deleted the fix/content-manager-draft-relations-publish-warning branch June 25, 2026 13:47
innerdvations added a commit that referenced this pull request Jun 29, 2026
…6736)

* fix(content-manager): warn before publishing with draft relations

Re-enable draft-relation counting on publish so editors see a confirmation
dialog with cancel or publish-without-relations. Bulk publish uses the same
count API again, and the collection-type edit view e2e covers the warning.

Fixes #25361

* test(e2e): cover draft-relations publish warning flow

Add an E2E spec for cancel vs publish-without-relations and fix the
collection-type edit view test to use a seeded draft author.

* fix(content-manager): address draft-relations publish warning review feedback

Open the confirmation dialog from the publish keyboard shortcut, refetch the
server draft-relation count when the document or window focus changes, and
exclude self-referential relations from the warning (they are preserved on publish).

* fix(content-manager): accept Component schema in draft-relation count helper

Fixes build:types failure where countLocalDraftRelations passed component
schemas typed as Component into a ContentType-only parameter.

* fix(content-manager): split draft-relation warnings by relation type

Bidirectional M2M draft links are counted separately from xToOne-style
relations so publish dialogs use accurate copy and severity.

* test(content-manager): fix draft-relations CI failures on PR 26736

Align unit, API, and E2E tests with M2M draft-relation warnings and add a
shared publish helper for entries that trigger the confirmation dialog.

* fix(content-manager): only open draft-relations dialog on publish intent

Passing dialogRequestId as 0 when draft relations were detected auto-opened
the publish warning via useLayoutEffect. Only forward the id after the
keyboard shortcut increments it, ignore 0 in the open effect, and align API/E2E
tests with the corrected behavior.

* fix(content-manager): open draft-relations dialog only on publish intent

Replace dialogRequestId/useLayoutEffect with scoped confirm openers so the
warning modal never auto-opens when draft relations are detected. Sum local
and server counts for modified documents so incremental relation adds show
the correct total. Update E2E tests for keyboard confirm and modal publish.

* test(e2e): stabilize draft-relations publish flow and fix preview flake

Keep Publish disabled until server draft-relation counts are applied, avoid
networkidle in publish helpers, and harden edit-view, preview, and relations
on-the-fly tests for suite timing under Firefox and WebKit.

* fix(content-manager): correct draft-relations publish dialog copy by type

Restore unidirectional warnings that relations are stripped on publish, and
keep bidirectional M2M copy about links appearing once related entries publish.

* fix(content-manager): align draft-relations dialog with bulk confirm layout

Add optional bodyIcon to DocumentActionConfirmDialog so publish warnings
use the same centered icon and typography as bulk publish confirmations.

* test(e2e): fix publish helper race when no draft-relations dialog

Register the publish POST listener before clicking Publish and race it
against the confirmation dialog so slow CI cannot miss the response when
publish proceeds without a warning.

* test(e2e): clear draft relations before review-workflow publish check

Ted Lasso seed data includes draft article M2M links that open the
draft-relations dialog before publish reaches review-workflow validation.

* test(content-manager): cover draft relation count helpers

Extract draft-relation counting into a shared util with unit tests and
assert bodyIcon dialog layout in DocumentActions.

* fix(content-manager): restore DraftRelationCounts imports in DocumentActions

* test(content-manager): fix draftRelationCounts test type assertions

* test(content-manager): extract draft-relations publish state helpers

Move count resolution and dialog variant selection into tested helpers
to improve coverage on the draft-relations publish warning logic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-qa generates AI QA checklist pr: fix This PR is fixing a bug qa-done Applied when a PR passes QA source: core:content-manager Source is core/content-manager package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Relations silently lost when publishing document before its relation target

2 participants