fix(admin): unblock the saving of Content Types settings#601
Open
CacheMeOwside wants to merge 4 commits intoemdash-cms:mainfrom
Open
fix(admin): unblock the saving of Content Types settings#601CacheMeOwside wants to merge 4 commits intoemdash-cms:mainfrom
CacheMeOwside wants to merge 4 commits intoemdash-cms:mainfrom
Conversation
🦋 Changeset detectedLatest commit: aaf9794 The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@emdash-cms/admin
@emdash-cms/auth
@emdash-cms/blocks
@emdash-cms/cloudflare
emdash
create-emdash
@emdash-cms/gutenberg-to-portable-text
@emdash-cms/x402
@emdash-cms/plugin-ai-moderation
@emdash-cms/plugin-atproto
@emdash-cms/plugin-audit-log
@emdash-cms/plugin-color
@emdash-cms/plugin-embeds
@emdash-cms/plugin-forms
@emdash-cms/plugin-webhook-notifier
commit: |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a silent failure when saving Content Type settings in the admin UI by preventing an invalid legacy supports value ("seo") from being sent to the API, and by surfacing save errors to the user.
Changes:
- Strip legacy
"seo"fromsupportsinContentTypeEditorso the update payload passes API enum validation. - Add an error toast on failed Content Type updates to avoid silent failures.
- Add an E2E test that exercises toggling a setting + saving + reload persistence.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/admin/src/router.tsx | Shows an error toast when the Content Type update mutation fails. |
| packages/admin/src/components/ContentTypeEditor.tsx | Filters legacy "seo" out of supports (and out of change detection) to avoid 400s. |
| e2e/tests/content-types.spec.ts | Adds an E2E regression test for saving Content Type settings. |
| .changeset/spotty-rockets-hunt.md | Adds a patch changeset describing the fix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
What does this PR do?
Fixes the "Save Changes" button on the Content Type editor failing silently with a 400 error.
This bug affects saving any setting on the Content Type editor (label, description, URL pattern, features, SEO toggle, comments settings), and not just changes to "Enable comments" checkbox.
Closes #98
The cause
When we attempt to save the settings of a collection whose
supportsarray contains "seo" (seeded into the DB by the demo seed.json files), the API's enum rejects it, because "seo" is not in the allowed list. 400 response is returned, and the admin UI silently fails. The save button appears to do nothing.CleanShot.2026-04-16.at.17.35.46.mp4
The fix
I have stripped "seo" out of the supports array, so the Save payload no longer contains the value.
For a more permanent fix, if "seo" is no longer a supported value (since we are now using
hasSeo), we might want to "seo" from the supports column on every row of the_emdash_collections tablewith a one-time migration. Then, we can remove "seo" from the demo seed files too.I would love to get your opinion on this @MattieTK and @ascorbic.
Type of change
Checklist
pnpm typecheckpassespnpm lintpassespnpm testpasses (or targeted tests for my change)pnpm formathas been runpnpm locale:extracthas been run (if applicable)AI-generated code disclosure
Screenshots / test output
CleanShot.2026-04-16.at.18.42.09.mp4