Skip to content

refactor(admin-user-info): remove any usage and enforce strict typing in AdminUserInfoActions#39041

Open
srijnabhargav wants to merge 1 commit intoRocketChat:developfrom
srijnabhargav:fix/sanitize-admin-user-info-actions-type
Open

refactor(admin-user-info): remove any usage and enforce strict typing in AdminUserInfoActions#39041
srijnabhargav wants to merge 1 commit intoRocketChat:developfrom
srijnabhargav:fix/sanitize-admin-user-info-actions-type

Conversation

@srijnabhargav
Copy link
Copy Markdown

@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-144

@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 not ready to merge, because of the following issues:

  • This PR is targeting the wrong base branch. It should target 8.4.0, but it targets 8.1.0

Please fix the issues and try again

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: 92715df

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
Title check ✅ Passed The title accurately describes the main change: removing unsafe any typing and enforcing strict typing in AdminUserInfoActions component.
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.

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

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 70.64%. Comparing base (c7966fa) to head (92715df).
⚠️ Report is 324 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #39041      +/-   ##
===========================================
- Coverage    70.66%   70.64%   -0.03%     
===========================================
  Files         3136     3190      +54     
  Lines       108599   112740    +4141     
  Branches     19538    20685    +1147     
===========================================
+ Hits         76742    79640    +2898     
- Misses       29856    31053    +1197     
- Partials      2001     2047      +46     
Flag Coverage Δ
e2e 60.36% <0.00%> (+0.02%) ⬆️
e2e-api 47.83% <ø> (-0.21%) ⬇️
unit 71.25% <ø> (-0.46%) ⬇️

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Type-safety: remove any usage in AdminUserInfoActions

3 participants