ux(recommendations): inline Plan button deep-links into Create Plan modal (closes #120)#845
ux(recommendations): inline Plan button deep-links into Create Plan modal (closes #120)#845cristim wants to merge 1 commit into
Conversation
|
Warning Review limit reached
More reviews will be available in 23 minutes and 31 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
…odal (closes #120) Add a per-row "Plan" button in the checkbox column of each recommendation row. Clicking it calls openCreatePlanFromBottomBox([rec]) so the Create Purchase Plan modal opens pre-seeded with that single recommendation. Permission gate mirrors the bulk Create Plan button (create:plans). The button carries data-action="plan" so the row-click selection handler skips it. Tests: button visible for admin, absent for readonly, click pre-seeds the modal.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Summary
create:plans(admin and user roles; hidden for readonly)Implementation
buildVariantRowMarkupemits a<button class="rec-plan-btn" data-rec-id="..." data-action="plan">Plan</button>inside the checkbox cell whencanAccess('create', 'plans')is true; empty string otherwise (fail-closed)renderRecommendationsListwires a click handler on.rec-plan-btnbuttons that callsopenCreatePlanFromBottomBox([rec])- the same function used by the bulk Create Plan button, scoped to one recdata-action="plan"attribute ensures the row-click selection handler skips button clicks (existingtarget.closest('[data-action]')guard)e.stopPropagation()prevents the click from bubbling to the row handlerTest plan
tsc --noEmitcleanrecommendations-permissions.test.ts(5 existing + 3 new)rec-plan-btnwhen rows are renderedrec-plan-btnbuttons (gated)openCreatePlanModalwith the correct rec pre-seeded