Skip to content

refactor: Remove any usage and enforce strict typing in AdminUserInfoActions#39041

Merged
dionisio-bot[bot] merged 2 commits into
RocketChat:developfrom
srijnabhargav:fix/sanitize-admin-user-info-actions-type
Apr 16, 2026
Merged

refactor: Remove any usage and enforce strict typing in AdminUserInfoActions#39041
dionisio-bot[bot] merged 2 commits into
RocketChat:developfrom
srijnabhargav:fix/sanitize-admin-user-info-actions-type

Conversation

@srijnabhargav
Copy link
Copy Markdown
Contributor

@srijnabhargav srijnabhargav commented Feb 25, 2026

Fixes: #39040

What changed

  • Replaced unsafe any in AdminUserInfoActions mapAction with [string, AdminUserAction]
  • Added missing disabled?: boolean to AdminUserAction type
  • Removed obsolete TODO comment about sanitizing action type

Why

This aligns AdminUserInfoActions with strict typing and removes unsafe casts without changing behavior.

Impact

  • No runtime changes
  • Better type safety and maintainability

Summary by CodeRabbit

  • New Features

    • Admin user actions can now be marked as disabled when needed.
  • Refactor

    • Improved type safety and consistency across admin user management features to reduce potential errors.

COMM-153

@srijnabhargav srijnabhargav requested a review from a team as a code owner February 25, 2026 09:41
@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot Bot commented Feb 25, 2026

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 25, 2026

⚠️ No Changeset found

Latest commit: 6f907dc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 25, 2026

Walkthrough

The changes improve type safety in the admin user actions components by removing any type usage, replacing it with explicit [string, AdminUserAction] tuple typing, and adding a missing disabled? boolean property to the AdminUserAction type definition.

Changes

Cohort / File(s) Summary
Type Safety Improvements
apps/meteor/client/views/admin/users/AdminUserInfoActions.tsx
Replaced unsafe any type with explicit [string, AdminUserAction] tuple in mapAction parameter; added default 'kebab' icon value.
Type Extension
apps/meteor/client/views/admin/users/hooks/useAdminUserInfoActions.ts
Added optional disabled?: boolean property to AdminUserAction type to formally support disabled action state.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 With whiskers twitching at types so true,
No more any shadows in code I review,
Tuples and booleans now shine so bright,
Admin actions typed just right!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed All objectives from issue #39040 are met: replaced any with typed tuple [string, AdminUserAction], added optional disabled?: boolean to AdminUserAction type, and removed obsolete TODO comment.
Out of Scope Changes check ✅ Passed All changes are directly aligned with the linked issue #39040 objectives; no out-of-scope modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main change: removing unsafe 'any' typing and enforcing strict typing in AdminUserInfoActions, which is the primary objective of the changeset.

✏️ 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

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

@ggazzo ggazzo added this to the 8.3.0 milestone Feb 25, 2026
@ggazzo ggazzo added the stat: QA assured Means it has been tested and approved by a company insider label Feb 25, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.21%. Comparing base (f032e18) to head (6f907dc).
⚠️ Report is 3 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #39041      +/-   ##
===========================================
- Coverage    70.27%   70.21%   -0.06%     
===========================================
  Files         3284     3284              
  Lines       117118   117118              
  Branches     20736    20728       -8     
===========================================
- Hits         82308    82240      -68     
- Misses       31517    31590      +73     
+ Partials      3293     3288       -5     
Flag Coverage Δ
e2e 59.67% <100.00%> (-0.06%) ⬇️
e2e-api 46.46% <ø> (-0.84%) ⬇️
unit 71.08% <ø> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ggazzo ggazzo assigned ggazzo and unassigned ggazzo Feb 27, 2026
@scuciatto scuciatto modified the milestones: 8.3.0, 8.4.0 Mar 25, 2026
@dougfabris dougfabris changed the title refactor(admin-user-info): remove any usage and enforce strict typing in AdminUserInfoActions refactor: Remove any usage and enforce strict typing in AdminUserInfoActions Apr 16, 2026
@dionisio-bot dionisio-bot Bot enabled auto-merge April 16, 2026 13:35
@dougfabris dougfabris added stat: QA assured Means it has been tested and approved by a company insider and removed stat: QA assured Means it has been tested and approved by a company insider labels Apr 16, 2026
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label Apr 16, 2026
@dionisio-bot dionisio-bot Bot added this pull request to the merge queue Apr 16, 2026
Merged via the queue into RocketChat:develop with commit 18cf101 Apr 16, 2026
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Type-safety: remove any usage in AdminUserInfoActions

4 participants