-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Expensify - new action list-policies #18434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
WalkthroughAdds a new Expensify action to list policies with optional admin-only and userEmail filters, returning an array and setting a summary. Updates the Expensify package version from 0.2.0 to 0.3.0. Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant Action as List Policies Action
participant ExpApp as Expensify App Client
participant API as Expensify API
User->>Action: Invoke with adminOnly, userEmail
Action->>ExpApp: getPolicyList({ $, userEmail, adminOnly })
ExpApp->>API: Request policyList
API-->>ExpApp: policyList response
ExpApp-->>Action: { policyList }
Note right of Action: Set $summary with count
Action-->>User: Return policyList (or [])
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
components/expensify/actions/list-policies/list-policies.ts (2)
10-24
: Optional: set a default for adminOnly to document intent.Declaring a default avoids “undefined” being sent and clarifies UX.
adminOnly: { type: "boolean", label: "Admin Only", description: "Whether or not to only get policies for which the user is an admin", optional: true, + default: false, },
32-34
: Optional: richer summary for better run visibility.Include filters in the summary for quick context in runs.
- $.export("$summary", `Successfully retrieved ${response?.policyList?.length || 0} policies`); + const count = Array.isArray(response?.policyList) ? response.policyList.length : 0; + $.export("$summary", `Retrieved ${count} policies${this.userEmail ? ` for ${this.userEmail}` : ""}${this.adminOnly ? " (admin only)" : ""}`);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
components/expensify/actions/list-policies/list-policies.ts
(1 hunks)components/expensify/package.json
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: pnpm publish
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
- GitHub Check: Lint Code Base
🔇 Additional comments (5)
components/expensify/actions/list-policies/list-policies.ts (4)
4-10
: Good action metadata and docs link.Key/name/description/version/type are consistent and clear.
4-9
: Scope check —list-reports
missing; confirm or splitSearch shows existing combinedReportData usage in components/expensify/app/expensify.app.ts and components/expensify/actions/export-report/export-report.ts; no dedicated
list-reports
action detected. Issue #18421 also requested "list reports" via combinedReportData — if intentionally out of scope, split or open a follow‑up. Should I scaffold alist-reports
action (filters: policyIDList, startDate, endDate, reportState)?
25-30
: Confirmed: getPolicyList signature and response shape match usage. getPolicyList is implemented in components/expensify/app/expensify.app.ts as async getPolicyList({ $, userEmail, adminOnly = true }) and callers destructure { policyList }, so returning { policyList: any[] } is correct.
4-9
: No change required — keys consistently use the "expensify-" prefix.
All actions in components/expensify/actions use keys prefixed with "expensify-" (expensify-create-expense, expensify-create-report, expensify-export-report, expensify-export-report-to-pdf, expensify-list-policies).components/expensify/package.json (1)
3-3
: Version bump looks good — confirm release notes and semver intent.components/expensify/package.json now "version": "0.3.0". No component-level CHANGELOG/release-notes found and no "breaking"/"deprecated" matches under components/expensify. Add/update release notes to document the new action and confirm this is intended as a minor (non‑breaking) bump.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Resolves #18421
list-policies
Summary by CodeRabbit
New Features
Chores