Skip to content

refactor: Collapse the four stylesheet endpoints into one - #331

Open
rickbutterfield wants to merge 5 commits into
v5/refactor/preview-pipeline-dedupfrom
v5/refactor/stylesheet-endpoint-collapse
Open

refactor: Collapse the four stylesheet endpoints into one#331
rickbutterfield wants to merge 5 commits into
v5/refactor/preview-pipeline-dedupfrom
v5/refactor/stylesheet-endpoint-collapse

Conversation

@rickbutterfield

Copy link
Copy Markdown
Owner

Summary

Stacked on #329 — this PR is rebased onto v5/refactor/preview-pipeline-dedup so it only shows its own diff. Once #329 merges to v5/dev, GitHub will auto-retarget this PR to v5/dev.

Collapses the four nearly-identical Get{Grid,List,Rte,SingleBlock}Stylesheets controller actions (and their four frontend counterparts) onto one parameterized implementation.

  • New GET preview/stylesheets?blockType= action holds the real logic; the four existing plural routes become one-line forwarders to it. All four legacy routes are kept — this is additive only, not a breaking change, and IBlockPreviewService.GetStylesheetPaths's signature (a documented, overridable extension point) is completely untouched.
  • The OpenAPI-generated TypeScript client was regenerated to pick up the new endpoint; all four preview elements now call it directly.
  • blockType is validated ([BindRequired] + an explicit Enum.IsDefined check) so a missing or out-of-range value returns 400 instead of silently defaulting to Block Grid — a gap caught in whole-branch review, since this is a new public route on a NuGet-distributed package.
  • Delegation tests verify not just that the right BlockType reaches the shared action, but that nodeKey/documentTypeUnique actually reach content resolution too.

Test plan

  • dotnet test — 96/96 passing (backend branch's 91 + this PR's additions)
  • npm test — 16/16 passing, tsc --noEmit clean
  • Two rounds of automated code review (task-level + whole-branch), both approved with fixes applied
  • Manual backoffice smoke test (all four block types, stylesheet loading) — not run this cycle, no browser access available; recommend running before a release tag

🤖 Generated with Claude Code

Rick Butterfield and others added 5 commits August 5, 2026 08:21
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…data source method

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…param

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant