[8451] Studio UI doesn’t correctly display API responses when Git global configs are unset#4797
Conversation
…bal configs are unset
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
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)
📝 Coding Plan
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) } })); }
…splay, add type to error
…o bugfix/8451 # Conflicts: # ui/app/src/components/ContentTypeManagement/components/EditTypeView.tsx
craftercms/craftercms#8451
Summary by CodeRabbit