[CSM Portal] Scope time-card approver search to the approver role - #1491
Conversation
The Log Time dialog's "Approver (team lead)" search matched any internal WSO2 account (INTERNAL_USER_ROLES), letting a submitter pick literally anyone at the company, including people with no CS involvement at all. Filters by TIMECARD_APPROVER_GROUP instead, the role already used elsewhere to identify actual eligible approvers.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan includes up to 1 review per rolling hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe timecard dialog now searches for approvers by the dedicated ChangesTimecard approver filtering
Estimated code review effort: 2 (Simple) | ~5 minutes Merge Risk: ⚪ Minimal · up to The change narrowly limits approver search results to accounts with the time-card approver role, with no actionable merge-blocking risk remaining after normal checks and review. Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
Purpose
The Log Time dialog's "Approver (team lead)" search let a submitter pick literally anyone at WSO2 as their approver — including people with no CS involvement at all — because it filtered by
INTERNAL_USER_ROLES(any internal/agent/admin account), not by anything approver-specific.Goals
Only accounts that actually hold the timecard-approver role should show up as approver candidates.
Approach
Swapped the search filter from
roleIds: INTERNAL_USER_ROLEStoroleIds: [TIMECARD_APPROVER_GROUP]inLogTimeCardDialog.tsx— the same role keyuseTimecardRole.tsalready uses elsewhere to identify eligible approvers, so this reuses an existing, correct concept rather than inventing a new one.User stories
Release note
The time-card "Approver (team lead)" search now only returns accounts with the approver role, instead of any internal WSO2 account.
Documentation
No API contract change — this only narrows an existing
roleIdssearch filter value on the client.Automation tests
Full
csm-timecardssuite (11 files / 86 tests) passes;tsc -b --noEmitclean on the touched file.Security checks
No new data exposure — this narrows, rather than widens, what the search returns.
Test environment
Verified via
tsc/vitestlocally. Live verification (searching for a non-approver by name and confirming they no longer appear) pending.Summary by CodeRabbit