-
Notifications
You must be signed in to change notification settings - Fork 13.1k
chore: add missing abacAttributes to useRoomIcon Pick type #38427
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
chore: add missing abacAttributes to useRoomIcon Pick type #38427
Conversation
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
|
WalkthroughThis PR adds Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
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.
No issues found across 2 files
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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/meteor/client/hooks/useRoomIcon.tsx (1)
8-16: Guard against empty ABAC arrays.
if (room.abacAttributes)treats[]as ABAC-enabled, which can show shield icons even when attributes are cleared. Consider gating on.lengthinstead.Proposed fix
- if (room.abacAttributes) { + if (room.abacAttributes?.length) {Based on learnings: The GET /v1/abac/rooms endpoint only returns rooms where abacAttributes exists and is not an empty array (query: { abacAttributes: { $exists: true, $ne: [] } }).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #38427 +/- ##
===========================================
- Coverage 70.37% 70.35% -0.02%
===========================================
Files 3162 3162
Lines 110650 110649 -1
Branches 19876 19868 -8
===========================================
- Hits 77869 77851 -18
- Misses 30749 30771 +22
+ Partials 2032 2027 -5
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
MartinSchoeler
left a 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.
This is a chore pr, change the title prefix to chore: and remove the changeset
|
I have updated the title and removed the changeset file . Now please re-review it @MartinSchoeler |
b6628df to
ccf7439
Compare
|
i have deleted the changeset sorry it was my mistake |
Proposed changes
Fixes an outdated
@ts-expect-errorTODO in theuseRoomIconhook by addingproper TypeScript typing for
abacAttributes.Related issue
Changes made
apps/meteor/client/hooks/useRoomIcon.tsxabacAttributesto thePick<IRoom, …>type and removed the@ts-expect-errorapps/meteor/client/hooks/useRoomIcon.spec.tsx@ts-expect-errorcomments and fixed test data typesWhy this change?
abacAttributeswas added toIRoomin PR feat: ABAC #37091, butuseRoomIconwas not updated accordingly.@ts-expect-errorare now stale.booleaninstead ofIAbacAttributeDefinition[]).Verification
Summary by CodeRabbit
Refactor
Tests
https://rocketchat.atlassian.net/browse/COMM-126