Skip to content

fix(admin): invoice amount filter units, org URL error, search focus#1676

Open
rohanchkrabrty wants to merge 1 commit into
mainfrom
fix-admin-bug
Open

fix(admin): invoice amount filter units, org URL error, search focus#1676
rohanchkrabrty wants to merge 1 commit into
mainfrom
fix-admin-bug

Conversation

@rohanchkrabrty
Copy link
Copy Markdown
Contributor

Summary

  • Convert the invoice amount filter value from dollars to cents before sending the SearchOrganizationInvoices RQL query — the backend stores amounts in cents, but the filter input was sending dollars, so number filters never matched
  • Fix misleading duplicate-org error in the create organization panel: the AlreadyExists error now says "Organization URL is already taken" instead of "name already exists", matching the field's label ("Organization URL")
  • Auto-focus the organizations list search input when it's opened

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
frontier Ready Ready Preview, Comment Jun 5, 2026 9:46am

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 5, 2026

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes

    • Fixed organization invoice amount filters to process correctly on the server
    • Corrected error message when creating duplicate organizations
  • Improvements

    • Enhanced organization search input with automatic focus on display

Walkthrough

PR updates organization administration views with three independent improvements: a helper to convert invoice amount filters from dollars to cents before server queries, corrected error messaging when organization URLs conflict during creation, and automatic focus on the organizations search field.

Changes

Organization Admin UI Improvements

Layer / File(s) Summary
Invoice amount filter conversion
web/sdk/admin/views/organizations/details/invoices/index.tsx
Added convertAmountFiltersToCents helper to detect and round amount filter inputs from dollars to cents, then integrated it into computedQuery to pass converted values to transformDataTableQueryToRQLRequest.
Organization creation error message
web/sdk/admin/views/organizations/list/create.tsx
Updated Code.AlreadyExists error handling to report the organization URL is already taken, not the organization name.
Search field auto-focus
web/sdk/admin/views/organizations/list/navbar.tsx
Added autoFocus prop to DataTable.Search to automatically focus the search input when shown.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • raystack/frontier#1549: Moves invoice search RPC wiring in the same OrganizationInvoicesView file, affecting the query construction pipeline this PR integrates with.
  • raystack/frontier#1553: Introduces the RQL query transformation pipeline that this PR's amount filter conversion feeds into for infinite-loading invoices.

Suggested reviewers

  • rsbh
  • paanSinghCoder
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7fa59d45-ef1c-42a6-842a-c0326577ded3

📥 Commits

Reviewing files that changed from the base of the PR and between bd6a145 and fb0a83f.

📒 Files selected for processing (3)
  • web/sdk/admin/views/organizations/details/invoices/index.tsx
  • web/sdk/admin/views/organizations/list/create.tsx
  • web/sdk/admin/views/organizations/list/navbar.tsx

showClearButton={true}
size="small"
onBlur={onSearchBlur}
autoFocus
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check DataTable.Search autoFocus usage patterns

# Find all DataTable.Search usages with autoFocus
rg -n -B3 -A3 'DataTable\.Search' --type=tsx --type=ts -g '!node_modules' | rg -C3 'autoFocus'

Repository: raystack/frontier

Length of output: 89


Make autoFocus conditional for DataTable.Search
In web/sdk/admin/views/organizations/list/navbar.tsx (line 82), autoFocus will steal focus whenever the search input is shown on mount (when searchQuery is already set). Keep autoFocus for the explicit user action that opens search (e.g., clicking the search icon), and avoid focus stealing on initial render.

@coveralls
Copy link
Copy Markdown

Coverage Report for CI Build 27007795918

Coverage remained the same at 43.221%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 38046
Covered Lines: 16444
Line Coverage: 43.22%
Coverage Strength: 12.14 hits per line

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants