Skip to content

fix(backendJsonFormAdapter): Convert disabledReason to disabled string#114847

Merged
TkDodo merged 5 commits intomasterfrom
tkdodo/fix/disabled-reason-map-to-new-form-system
May 6, 2026
Merged

fix(backendJsonFormAdapter): Convert disabledReason to disabled string#114847
TkDodo merged 5 commits intomasterfrom
tkdodo/fix/disabled-reason-map-to-new-form-system

Conversation

@TkDodo
Copy link
Copy Markdown
Collaborator

@TkDodo TkDodo commented May 5, 2026

Summary

  • The backend JSON form adapter type defined disabledReason but never passed it through to the new form system's field components
  • Added getDisabledProp() helper that converts disabledReason into disabled: string, which the new form field components render as a lock icon with a tooltip
  • Sub-adapters (table, project mapper, choice mapper) coerce to boolean since they use native components that don't support string disabled

Test plan

  • Added test for BackendJsonAutoSaveForm verifying disabledReason renders lock icon + tooltip
  • Added test for BackendJsonSubmitForm verifying disabledReason renders lock icon + tooltip
  • All 36 tests pass
  • TypeScript typecheck passes

…g for new form system

The backend can send a disabledReason string explaining why a field is
disabled, but the new form adapter was silently dropping it. Map
disabledReason to the disabled: string prop that the new form field
components understand, rendering a lock icon with tooltip.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@TkDodo TkDodo requested a review from a team as a code owner May 5, 2026 11:42
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label May 5, 2026
@TkDodo
Copy link
Copy Markdown
Collaborator Author

TkDodo commented May 5, 2026

bugbot run

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

📊 Type Coverage Diff

✅ No new type safety issues introduced. Coverage: 93.40%

Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 59ed334. Configure here.

@TkDodo TkDodo requested a review from evanpurkhiser May 5, 2026 12:05
Comment thread static/app/components/backendJsonFormAdapter/utils.ts Outdated
TkDodo and others added 2 commits May 6, 2026 08:16
…disabled

Require both disabled: true and disabledReason to be set before
converting to a disabled string. A field with disabledReason but
disabled: false should remain enabled.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@TkDodo TkDodo merged commit ffda0ea into master May 6, 2026
71 of 72 checks passed
@TkDodo TkDodo deleted the tkdodo/fix/disabled-reason-map-to-new-form-system branch May 6, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants