Skip to content

Fixed controlled values for Stripe and Mailgun inputs - #29387

Merged
9larsons merged 1 commit into
mainfrom
codex/fix-controlled-settings-inputs
Jul 16, 2026
Merged

Fixed controlled values for Stripe and Mailgun inputs#29387
9larsons merged 1 commit into
mainfrom
codex/fix-controlled-settings-inputs

Conversation

@9larsons

Copy link
Copy Markdown
Contributor

What changed

  • Default missing Stripe Direct keys to empty strings.
  • Default missing Mailgun domain and API key values to empty strings.

Why

The settings API can return undefined or null for unset values. Passing those values to the text fields made the underlying inputs uncontrolled on their first render, then controlled after the acceptance tests populated them. This removes all three controlled-input diagnostics found in the current full Admin acceptance-test log.

Testing

  • pnpm nx run @tryghost/admin:test:acceptance -- src/settings/membership/stripe.acceptance.test.tsx src/settings/email/mailgun.acceptance.test.tsx
  • pnpm nx run @tryghost/admin-x-settings:lint
  • pnpm nx run @tryghost/admin-x-settings:test:unit

no ref

These settings can be absent from the API response, causing React warnings when acceptance tests populate the fields. Keep the inputs controlled from their initial render by using empty-string fallbacks.
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f4e610a2-5c64-43d9-84b1-8bf41c26f3c2

📥 Commits

Reviewing files that changed from the base of the PR and between 6682543 and 0947024.

📒 Files selected for processing (2)
  • apps/admin-x-settings/src/components/settings/email/mailgun.tsx
  • apps/admin-x-settings/src/components/settings/membership/stripe/stripe-connect-modal.tsx

Walkthrough

Updated Mailgun domain and private API key fields, along with Stripe Direct connection key fields, to pass empty strings instead of nullish values to controlled TextField components.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: keeping Stripe and Mailgun inputs controlled.
Description check ✅ Passed The description matches the changeset and explains the empty-string defaults, motivation, and testing.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-controlled-settings-inputs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Jul 16, 2026

Copy link
Copy Markdown

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 0947024

Command Status Duration Result
nx run @tryghost/admin:test:acceptance ✅ Succeeded 4m 18s View ↗
nx run @tryghost/admin-x-settings:test:acceptance ✅ Succeeded 3m 30s View ↗
nx run-many -t test:unit -p @tryghost/admin-x-s... ✅ Succeeded 2m 47s View ↗
nx run ghost-monorepo:lint:boundaries ✅ Succeeded 22s View ↗
nx run-many -t lint -p @tryghost/admin-x-settin... ✅ Succeeded 1m 10s View ↗
nx run @tryghost/admin:build ✅ Succeeded 38s View ↗
nx run-many --target=build --projects=tag:publi... ✅ Succeeded <1s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-07-16 14:27:56 UTC

@9larsons
9larsons marked this pull request as ready for review July 16, 2026 14:24
@9larsons
9larsons enabled auto-merge (squash) July 16, 2026 14:30
@9larsons
9larsons merged commit 123ed9c into main Jul 16, 2026
43 checks passed
@9larsons
9larsons deleted the codex/fix-controlled-settings-inputs branch July 16, 2026 14:34
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