feat(sdk): add sorting + RQL infinite loading to views-new invoices#1553
feat(sdk): add sorting + RQL infinite loading to views-new invoices#1553paanSinghCoder merged 13 commits intomainfrom
Conversation
Move the RPC from AdminService to FrontierService so org admins (not only platform superusers) can list their own org's invoices. Matches the gate pattern already used by FrontierService/ListInvoices (UpdatePermission on the org namespace). Superusers still pass via the standard interceptor bypass. - Bump PROTON_COMMIT to pick up the proto move (raystack/proton#476). - Regenerate proto/v1beta1 via `make proto`. - Swap authorization.go entry from IsSuperUser to IsAuthorized(org, UpdatePermission). - Switch the admin dashboard frontend from AdminServiceQueries to FrontierServiceQueries; request/response shape is unchanged. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughSummary by CodeRabbit
WalkthroughUpdates Proton commit in Makefile, adds RQL React utilities for pagination and query transformation, extends invoice state constants, and refactors the Invoices component to internally perform server-backed infinite loading via useInfiniteQuery (BillingView stops passing invoices/isLoading). Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches⚔️ Resolve merge conflicts
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 |
Coverage Report for CI Build 24770144522Coverage remained the same at 42.228%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
…c0931e4ca9b087de8cd in package.json and pnpm-lock.yaml
…feat/add-sorting-and-pagination-invoices
…931e4ca9b087de8cd in package.json and pnpm-lock.yaml
…feat/add-sorting-and-pagination-invoices
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 822a8b82-d707-4637-b968-776c4e14c15c
📒 Files selected for processing (6)
Makefileweb/sdk/react/utils/connect-pagination.tsweb/sdk/react/utils/constants.tsweb/sdk/react/utils/transform-query.tsweb/sdk/react/views-new/billing/billing-view.tsxweb/sdk/react/views-new/billing/components/invoices.tsx
There was a problem hiding this comment.
♻️ Duplicate comments (2)
web/sdk/react/views-new/billing/components/invoices.tsx (2)
38-41:⚠️ Potential issue | 🟠 MajorSeed
INITIAL_QUERYwithDEFAULT_SORT.
defaultSortonly configures the UI; the initial RQL request built fromINITIAL_QUERYhas nosort, so the first page loads unsorted until the user interacts with the table. Includingsort: [DEFAULT_SORT]here ensures the first request is deterministicallycreated_at desc.Proposed fix
const INITIAL_QUERY: DataTableQuery = { offset: 0, - limit: DEFAULT_PAGE_SIZE + limit: DEFAULT_PAGE_SIZE, + sort: [DEFAULT_SORT] };
168-181:⚠️ Potential issue | 🟠 MajorZero-amount invoices are no longer filtered out.
The previous
listInvoicescall usednonzeroAmountOnly: true, butSearchOrganizationInvoiceshas no equivalent parameter and this RQL query does not include anamountfilter. Either add a filter clause foramount != 0to the initial query or extend the proto/handler to supportnonzero_amount_only.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 3a4d5199-4d41-4911-bae1-2ad0b06e2f24
📒 Files selected for processing (1)
web/sdk/react/views-new/billing/components/invoices.tsx
…pagination-invoices # Conflicts: # Makefile
Summary
Screen.Recording.2026-04-20.at.1.14.52.PM.mov
Field mapping
The RQL response (`OrganizationInvoice`) has a trimmed projection vs the full `Invoice`:
Other fields (`state`, `amount`, `currency`) map 1:1.
Depends on
Test plan
🤖 Generated with Claude Code