[8451] Studio UI doesn’t correctly display API responses when Git global configs are unset#4797
[8451] Studio UI doesn’t correctly display API responses when Git global configs are unset#4797jvega190 wants to merge 2 commits intocraftercms:developfrom
Conversation
…bal configs are unset
WalkthroughReplace raw error handling with structured Ajax error payload extraction and display in three UI components by importing Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@ui/app/src/components/ContentTypeManagement/components/EditTypeView.tsx`:
- Around line 477-491: The error callback in EditTypeView (the error(error)
handler) should type the parameter as AjaxError and safely render a fallback
message: import AjaxError from 'rxjs/ajax', change the signature to accept
(error: AjaxError), call extractErrorPayload(error) and use its .message with a
fallback (e.g. extractErrorPayload(error).message ?? 'Unexpected error' or a
localized default) before passing to Typography so it never renders undefined.
🧹 Nitpick comments (1)
ui/app/src/components/ContentTypeManagement/components/EditTypeView.tsx (1)
782-784: Inconsistent error handling within the same file.This existing handler at Line 782 still uses the old
response.responsepattern, while the new save handler (Line 477) usesextractErrorPayload. Consider updating this handler as well for consistency.Suggested fix
- error: ({ response }) => { - dispatch(pushErrorDialog({ props: { error: response.response } })); + error: (error: AjaxError) => { + dispatch(pushErrorDialog({ props: { error: extractErrorPayload(error) } })); }
ui/app/src/components/ContentTypeManagement/components/EditTypeView.tsx
Outdated
Show resolved
Hide resolved
…splay, add type to error
|
@rart I updated to use the new |
craftercms/craftercms#8451
Summary by CodeRabbit