fix: use display name for multiple linked entities warning#1217
Conversation
commit: |
auto-screenshot-update: true
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ 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: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
WalkthroughThis PR enhances the warning system for multi-value linked entity traversal by enabling human-readable field display names in toast messages. The Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
auto-screenshot-update: true
auto-screenshot-update: true
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/visual-editor/src/editor/EmbeddedFieldStringInput.test.tsx (1)
33-37: ⚡ Quick winReset mocked
toast.warningbetween tests.Please clear mocks per test to avoid cross-test leakage as this suite grows.
Proposed change
-import { describe, expect, it, vi } from "vitest"; +import { beforeEach, describe, expect, it, vi } from "vitest"; @@ vi.mock("sonner", () => ({ toast: { warning: vi.fn(), }, })); + +beforeEach(() => { + vi.clearAllMocks(); +});🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/visual-editor/src/editor/EmbeddedFieldStringInput.test.tsx` around lines 33 - 37, The test suite currently mocks toast.warning via vi.mock but does not reset that mock between tests; add a per-test cleanup (e.g., a beforeEach or afterEach) that calls vi.clearAllMocks() or explicitly clears toast.warning (toast.warning.mockClear()) so the mocked toast.warning state doesn't leak across tests in EmbeddedFieldStringInput.test.tsx; reference the existing vi.mock and the toast.warning mock when adding the cleanup.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/visual-editor/src/editor/EmbeddedFieldStringInput.test.tsx`:
- Around line 33-37: The test suite currently mocks toast.warning via vi.mock
but does not reset that mock between tests; add a per-test cleanup (e.g., a
beforeEach or afterEach) that calls vi.clearAllMocks() or explicitly clears
toast.warning (toast.warning.mockClear()) so the mocked toast.warning state
doesn't leak across tests in EmbeddedFieldStringInput.test.tsx; reference the
existing vi.mock and the toast.warning mock when adding the cleanup.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: e368633e-6a42-47dd-be52-d9d63a31c884
📒 Files selected for processing (2)
packages/visual-editor/src/editor/EmbeddedFieldStringInput.test.tsxpackages/visual-editor/src/editor/EmbeddedFieldStringInput.tsx
auto-screenshot-update: true
Updates the warning that is displayed when there are multiple linked entities for a field to use the display names instead of API names.
Shows the linked entities warning when a linked entity field is chosen by the embedded field picker.