chore: add missing abacAttributes to useRoomIcon Pick type#38427
chore: add missing abacAttributes to useRoomIcon Pick type#38427NAME-ASHWANIYADAV wants to merge 6 commits intoRocketChat:developfrom
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.
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.40% 70.37% -0.03%
===========================================
Files 3161 3161
Lines 110639 110638 -1
Branches 19870 19901 +31
===========================================
- Hits 77895 77867 -28
- Misses 30717 30743 +26
- Partials 2027 2028 +1
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.
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
There was a problem hiding this comment.
pls remove changeset for chore prs
|
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