-
Notifications
You must be signed in to change notification settings - Fork 12.6k
chore: Reorganize ABAC UI folders and files #37700
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
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 |
|
WalkthroughRenames and reorganizes ABAC admin components, hooks, types, tests, stories, and import paths across the Attributes, Rooms, Settings, and Logs tabs; introduces Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feat/abac #37700 +/- ##
=============================================
+ Coverage 54.30% 54.31% +0.01%
=============================================
Files 2630 2629 -1
Lines 50044 50040 -4
Branches 11199 11199
=============================================
+ Hits 27176 27180 +4
+ Misses 20702 20695 -7
+ Partials 2166 2165 -1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
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
🧹 Nitpick comments (2)
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.tsx (1)
7-9: Consider renaming props type to matchRoomFormAttributeFieldThe component and data dependencies are correctly wired (
RoomFormDataanduseAttributeList), and behavior is preserved. For consistency with the new naming, you might want to renameABACAttributeAutocompletePropsto something likeRoomFormAttributeFieldProps(and update usages) so the props type mirrors the component name and the rest of the ABAC room form API.Also applies to: 15-23, 99-99
apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesContextualBar.tsx (1)
26-42: Consider using the importedAttributesFormFormDatatype directly.The form type is defined inline here, duplicating the structure already exported from
AttributesForm.tsx. While functionally equivalent, using the imported type would improve maintainability and ensure consistency if the form data structure changes.- const methods = useForm<{ - name: string; - attributeValues: { value: string }[]; - lockedAttributes: { value: string }[]; - }>({ + const methods = useForm<AttributesFormFormData>({
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (5)
apps/meteor/client/views/admin/ABAC/ABACAttributesTab/__snapshots__/AttributesForm.spec.tsx.snapis excluded by!**/*.snapapps/meteor/client/views/admin/ABAC/ABACRoomsTab/__snapshots__/DeleteRoomModal.spec.tsx.snapis excluded by!**/*.snapapps/meteor/client/views/admin/ABAC/ABACRoomsTab/__snapshots__/RoomFormAttributeField.spec.tsx.snapis excluded by!**/*.snapapps/meteor/client/views/admin/ABAC/ABACRoomsTab/__snapshots__/RoomFormAutocomplete.spec.tsx.snapis excluded by!**/*.snapapps/meteor/client/views/admin/ABAC/ABACSettingTab/__snapshots__/SettingToggle.spec.tsx.snapis excluded by!**/*.snap
📒 Files selected for processing (36)
apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributeMenu.tsx(2 hunks)apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesContextualBar.tsx(5 hunks)apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesContextualBarWithData.tsx(2 hunks)apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.spec.tsx(13 hunks)apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.stories.tsx(3 hunks)apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.tsx(2 hunks)apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesPage.tsx(3 hunks)apps/meteor/client/views/admin/ABAC/ABACLogsTab/LogsPage.tsx(2 hunks)apps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.spec.tsx(5 hunks)apps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.tsx(2 hunks)apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomForm.tsx(4 hunks)apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.spec.tsx(2 hunks)apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.stories.tsx(4 hunks)apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.tsx(2 hunks)apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.spec.tsx(3 hunks)apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.stories.tsx(2 hunks)apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.tsx(3 hunks)apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocompleteDummy.tsx(1 hunks)apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomMenu.tsx(2 hunks)apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomsContextualBar.tsx(2 hunks)apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomsContextualBarWithData.tsx(1 hunks)apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomsPage.tsx(3 hunks)apps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.spec.tsx(8 hunks)apps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.stories.tsx(2 hunks)apps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.tsx(4 hunks)apps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingsPage.tsx(2 hunks)apps/meteor/client/views/admin/ABAC/ABACSettingTab/WarningModal.tsx(2 hunks)apps/meteor/client/views/admin/ABAC/AdminABACPage.tsx(2 hunks)apps/meteor/client/views/admin/ABAC/hooks/useABACDeleteRoomModal.tsx(0 hunks)apps/meteor/client/views/admin/ABAC/hooks/useAttributeList.ts(1 hunks)apps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.spec.tsx(10 hunks)apps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.tsx(1 hunks)apps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.spec.tsx(3 hunks)apps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.tsx(1 hunks)apps/meteor/client/views/admin/ABAC/hooks/useRoomItems.spec.tsx(2 hunks)apps/meteor/client/views/admin/ABAC/hooks/useRoomItems.tsx(2 hunks)
💤 Files with no reviewable changes (1)
- apps/meteor/client/views/admin/ABAC/hooks/useABACDeleteRoomModal.tsx
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}
📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation
Files:
apps/meteor/client/views/admin/ABAC/hooks/useAttributeList.tsapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomsContextualBarWithData.tsxapps/meteor/client/views/admin/ABAC/ABACSettingTab/WarningModal.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.spec.tsxapps/meteor/client/views/admin/ABAC/ABACLogsTab/LogsPage.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.spec.tsxapps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.tsxapps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.tsxapps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.stories.tsxapps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomForm.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.stories.tsxapps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.stories.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomMenu.tsxapps/meteor/client/views/admin/ABAC/AdminABACPage.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.stories.tsxapps/meteor/client/views/admin/ABAC/hooks/useRoomItems.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributeMenu.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomsPage.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.tsxapps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingsPage.tsxapps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.spec.tsxapps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomsContextualBar.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesContextualBarWithData.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesContextualBar.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesPage.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.spec.tsxapps/meteor/client/views/admin/ABAC/hooks/useRoomItems.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocompleteDummy.tsx
🧠 Learnings (17)
📚 Learning: 2025-11-27T17:56:26.050Z
Learnt from: MartinSchoeler
Repo: RocketChat/Rocket.Chat PR: 37557
File: apps/meteor/client/views/admin/ABAC/AdminABACRooms.tsx:115-116
Timestamp: 2025-11-27T17:56:26.050Z
Learning: In Rocket.Chat, the GET /v1/abac/rooms endpoint (implemented in ee/packages/abac/src/index.ts) only returns rooms where abacAttributes exists and is not an empty array (query: { abacAttributes: { $exists: true, $ne: [] } }). Therefore, in components consuming this endpoint (like AdminABACRooms.tsx), room.abacAttributes is guaranteed to be defined for all returned rooms, and optional chaining before calling array methods like .join() is sufficient without additional null coalescing.
Applied to files:
apps/meteor/client/views/admin/ABAC/hooks/useAttributeList.tsapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomsContextualBarWithData.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.spec.tsxapps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.tsxapps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.stories.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomForm.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.stories.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomMenu.tsxapps/meteor/client/views/admin/ABAC/AdminABACPage.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.tsxapps/meteor/client/views/admin/ABAC/hooks/useRoomItems.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributeMenu.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomsPage.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.tsxapps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomsContextualBar.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesContextualBarWithData.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesContextualBar.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesPage.tsxapps/meteor/client/views/admin/ABAC/hooks/useRoomItems.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocompleteDummy.tsx
📚 Learning: 2025-10-30T19:30:46.541Z
Learnt from: MartinSchoeler
Repo: RocketChat/Rocket.Chat PR: 37244
File: apps/meteor/client/views/admin/ABAC/AdminABACRoomAttributesForm.spec.tsx:125-146
Timestamp: 2025-10-30T19:30:46.541Z
Learning: In the AdminABACRoomAttributesForm component (apps/meteor/client/views/admin/ABAC/AdminABACRoomAttributesForm.tsx), the first attribute value field is mandatory and does not have a Remove button. Only additional values beyond the first have Remove buttons. This means trashButtons[0] corresponds to the second value's Remove button, not the first value's.
Applied to files:
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomsContextualBarWithData.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.spec.tsxapps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.stories.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomForm.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomMenu.tsxapps/meteor/client/views/admin/ABAC/AdminABACPage.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.stories.tsxapps/meteor/client/views/admin/ABAC/hooks/useRoomItems.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributeMenu.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomsPage.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomsContextualBar.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesContextualBarWithData.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesContextualBar.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesPage.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocompleteDummy.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Utilize Playwright fixtures (`test`, `page`, `expect`) for consistency in test files
Applied to files:
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.spec.tsxapps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.stories.tsxapps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.spec.tsxapps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.spec.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.spec.tsxapps/meteor/client/views/admin/ABAC/hooks/useRoomItems.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Group related tests in the same file
Applied to files:
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.spec.tsxapps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.spec.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/page-objects/**/*.ts : Utilize existing page objects pattern from `apps/meteor/tests/e2e/page-objects/`
Applied to files:
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.spec.tsxapps/meteor/client/views/admin/ABAC/ABACLogsTab/LogsPage.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.tsxapps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.stories.tsxapps/meteor/client/views/admin/ABAC/AdminABACPage.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomsPage.tsxapps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingsPage.tsxapps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.spec.tsxapps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.spec.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesPage.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.spec.tsxapps/meteor/client/views/admin/ABAC/hooks/useRoomItems.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.{ts,spec.ts} : Follow Page Object Model pattern consistently in Playwright tests
Applied to files:
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.spec.tsxapps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.stories.tsxapps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.spec.tsxapps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.spec.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure tests run reliably in parallel without shared state conflicts
Applied to files:
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.spec.tsxapps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.spec.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `expect` matchers for assertions (`toEqual`, `toContain`, `toBeTruthy`, `toHaveLength`, etc.) instead of `assert` statements in Playwright tests
Applied to files:
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.spec.tsxapps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.spec.tsxapps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.spec.tsxapps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.spec.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.spec.tsxapps/meteor/client/views/admin/ABAC/hooks/useRoomItems.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : All test files must be created in `apps/meteor/tests/e2e/` directory
Applied to files:
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.spec.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Maintain test isolation between test cases in Playwright tests
Applied to files:
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.spec.tsxapps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.spec.tsxapps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.spec.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.spec.tsxapps/meteor/client/views/admin/ABAC/hooks/useRoomItems.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure clean state for each test execution in Playwright tests
Applied to files:
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.spec.tsxapps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.spec.tsxapps/meteor/client/views/admin/ABAC/hooks/useRoomItems.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.{ts,spec.ts} : Store commonly used locators in variables/constants for reuse
Applied to files:
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.spec.tsxapps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Prefer web-first assertions (`toBeVisible`, `toHaveText`, etc.) in Playwright tests
Applied to files:
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.spec.tsxapps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.spec.tsxapps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.spec.tsxapps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.spec.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.spec.tsx
📚 Learning: 2025-11-07T14:50:33.544Z
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37423
File: packages/i18n/src/locales/en.i18n.json:18-18
Timestamp: 2025-11-07T14:50:33.544Z
Learning: Rocket.Chat settings: in apps/meteor/ee/server/settings/abac.ts, the Abac_Cache_Decision_Time_Seconds setting uses invalidValue: 0 as the fallback when ABAC is unlicensed. With a valid license, admins can still set the value to 0 to intentionally disable the ABAC decision cache.
Applied to files:
apps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `test.beforeAll()` and `test.afterAll()` for setup/teardown in Playwright tests
Applied to files:
apps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.spec.tsx
📚 Learning: 2025-10-27T14:38:46.994Z
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37303
File: apps/meteor/tests/end-to-end/api/abac.ts:1125-1137
Timestamp: 2025-10-27T14:38:46.994Z
Learning: In Rocket.Chat ABAC feature, when ABAC is disabled globally (ABAC_Enabled setting is false), room-level ABAC attributes are not evaluated when changing room types. This means converting a private room to public will succeed even if the room has ABAC attributes, as long as the global ABAC setting is disabled.
Applied to files:
apps/meteor/client/views/admin/ABAC/AdminABACPage.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomsPage.tsxapps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Implement proper wait strategies for dynamic content in Playwright tests
Applied to files:
apps/meteor/client/views/admin/ABAC/hooks/useRoomItems.spec.tsx
🧬 Code graph analysis (13)
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.tsx (1)
packages/core-typings/src/IRoom.ts (1)
IRoom(22-98)
apps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.tsx (1)
packages/ui-contexts/src/index.ts (1)
useSetModal(70-70)
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.stories.tsx (1)
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomForm.tsx (1)
RoomFormData(21-24)
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.stories.tsx (1)
apps/meteor/tests/mocks/data.ts (1)
createFakeRoom(46-61)
apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.stories.tsx (1)
apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.tsx (1)
AttributesFormFormData(18-22)
apps/meteor/client/views/admin/ABAC/hooks/useRoomItems.tsx (1)
apps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.tsx (1)
useDeleteRoomModal(5-11)
apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributeMenu.tsx (1)
apps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.tsx (1)
useAttributeOptions(12-101)
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.tsx (2)
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomForm.tsx (1)
RoomFormData(21-24)apps/meteor/client/views/admin/ABAC/hooks/useAttributeList.ts (1)
useAttributeList(7-39)
apps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingsPage.tsx (1)
apps/meteor/client/hooks/useHasLicenseModule.ts (1)
useHasLicenseModule(5-8)
apps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.spec.tsx (1)
apps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.tsx (1)
useAttributeOptions(12-101)
apps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.spec.tsx (1)
apps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.tsx (1)
useDeleteRoomModal(5-11)
apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesContextualBar.tsx (1)
apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.tsx (1)
AttributesFormFormData(18-22)
apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.spec.tsx (1)
apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.tsx (1)
AttributesFormFormData(18-22)
🔇 Additional comments (37)
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomsContextualBarWithData.tsx (1)
6-6: Import path update looks consistent with new folder layoutThe updated relative path for
ABACQueryKeysaligns with moving the shared query keys to a higher‑levellibfolder; usage in theuseQuerycall remains unchanged and type‑safe.apps/meteor/client/views/admin/ABAC/ABACSettingTab/WarningModal.tsx (1)
6-9: LGTM! Clean component and type rename.The renaming from
AdminABACWarningModaltoWarningModalimproves clarity by removing redundant prefixes, as the file location already provides the ABAC context.Also applies to: 11-11, 48-48
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.tsx (1)
8-9: LGTM! Consistent renaming and import path updates.The component rename from
ABACDeleteRoomModaltoDeleteRoomModalaligns with the broader refactoring pattern, and import paths are correctly adjusted for the new folder structure.Also applies to: 11-17, 48-48
apps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.spec.tsx (1)
4-5: LGTM! Test file thoroughly updated for hook rename.All references to
useRoomAttributeItemshave been consistently updated touseAttributeOptions, and import paths correctly reflect the new folder structure. Test coverage remains intact.Also applies to: 12-14, 56-56, 65-65, 86-86, 99-99, 126-126, 148-148, 171-171, 204-204, 240-240
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.spec.tsx (1)
4-4: LGTM! Test correctly updated for component rename.The test file has been updated to reflect the component rename from
ABACAttributeFieldtoRoomFormAttributeFieldand the hook rename fromuseABACAttributeListtouseAttributeList, maintaining test coverage.Also applies to: 27-33, 35-35
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocompleteDummy.tsx (1)
3-5: LGTM! Component rename consistent with refactoring pattern.The rename from
ABACRoomAutocompleteDummytoRoomFormAutocompleteDummyaligns with the broader naming improvements across the ABAC UI components.Also applies to: 7-9, 11-11
apps/meteor/client/views/admin/ABAC/hooks/useRoomItems.tsx (1)
7-7: LGTM! Hook usage updated consistently.The rename from
useABACDeleteRoomModaltouseDeleteRoomModalremoves the redundant "ABAC" prefix and is correctly applied throughout the hook.Also applies to: 13-13, 37-37
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomsContextualBar.tsx (1)
9-10: LGTM! Component import and usage updated correctly.The rename from
AdminABACRoomFormtoRoomFormsimplifies the naming, and the import path forABACQueryKeyshas been correctly adjusted for the new folder structure.Also applies to: 78-83
apps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.spec.tsx (1)
7-8: LGTM! Test suite comprehensively updated for component rename.All references to
AdminABACSettingTogglehave been consistently updated toSettingTogglethroughout the test file, and theEditableSettingsProviderimport path correctly reflects the new folder structure. Test coverage is maintained.Also applies to: 29-29, 31-31, 39-39, 60-60, 73-73, 90-90, 99-99, 111-111, 121-121, 128-128, 136-136
apps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.spec.tsx (1)
5-5: LGTM!The test file has been correctly updated to reference the renamed
useDeleteRoomModalhook. The import path, describe block name, and hook invocation are all consistent with the new naming convention.Also applies to: 17-17, 26-26
apps/meteor/client/views/admin/ABAC/AdminABACPage.tsx (2)
7-14: LGTM!The imports have been correctly updated to reference the renamed components from their new locations. The directory structure follows a clear pattern with
ABACAttributesTab,ABACLogsTab,ABACRoomsTab, andABACSettingTabsubdirectories.
70-73: LGTM!Component usage is consistent with the renamed imports. The tab rendering and contextual bar logic remain unchanged, with only the component names updated to align with the new naming convention.
Also applies to: 80-82
apps/meteor/client/views/admin/ABAC/hooks/useAttributeList.ts (1)
7-7: LGTM!The hook has been correctly renamed from
useABACAttributeListtouseAttributeList. The internal implementation remains unchanged.apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.spec.tsx (1)
7-9: LGTM!The test file has been correctly updated to reference the renamed
RoomFormAutocompletecomponent. Import paths, describe block name, and component instantiation are all consistent with the new naming convention.Also applies to: 24-24, 41-41
apps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.tsx (2)
6-10: LGTM!The imports have been correctly updated. The
WarningModalimport reflects the component rename, and the relative paths toEditableSettingsContextand settings components are correct for the new file location withinABACSettingTab.
12-16: LGTM!The component and type names have been consistently renamed from
AdminABACSettingToggle/AdminABACSettingTogglePropstoSettingToggle/SettingToggleProps. TheWarningModalusage and export are correctly updated. Component logic remains unchanged.Also applies to: 41-48, 61-68, 95-95
apps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.tsx (1)
9-12: LGTM! Clean refactoring.The hook rename from
useRoomAttributeItemstouseAttributeOptionsand updated import paths maintain all existing functionality while improving naming clarity.apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomsPage.tsx (2)
8-20: LGTM! Import paths correctly updated.All import paths have been updated to reflect the new directory structure with correct relative path depths.
22-133: LGTM! Component rename executed consistently.The rename from
AdminABACRoomstoRoomsPageis clean, maintaining all existing logic while using the updatedRoomMenucomponent reference.apps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.spec.tsx (1)
6-70: LGTM! Test file updated consistently.All references to the renamed component (
DeleteRoomModal) are updated correctly throughout the test suite, maintaining test coverage.apps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.tsx (1)
1-11: LGTM! Clean modal hook implementation.The hook follows a standard pattern for modal management, correctly using
useSetModaland providing proper cleanup viaonClose.apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributeMenu.tsx (1)
4-28: LGTM! Consistent component refactoring.The component rename from
AdminABACRoomAttributeMenutoAttributeMenuis executed cleanly, with correct hook usage (useAttributeOptions) and updated import paths.apps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingsPage.tsx (1)
4-30: LGTM! Clean settings page refactoring.The rename from
AdminABACSettingstoSettingsPageis consistent with the broader reorganization, with all references and import paths correctly updated.apps/meteor/client/views/admin/ABAC/ABACLogsTab/LogsPage.tsx (2)
11-23: LGTM! Import paths correctly reorganized.All import paths have been updated to match the new directory structure with correct relative path depths.
25-180: LGTM! Logs page renamed consistently.The rename from
AdminABACLogstoLogsPagemaintains all existing functionality while following the new simplified naming convention.apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.stories.tsx (1)
7-8: LGTM! Story file updated consistently.All type references and component names have been updated to match the refactored component (
RoomFormAttributeField) and data types (RoomFormData), maintaining story functionality.Also applies to: 31-73
apps/meteor/client/views/admin/ABAC/hooks/useRoomItems.spec.tsx (1)
8-16: Delete-room modal test mocking looks consistent with new hook APIMocking
useDeleteRoomModalto returnsetDeleteRoomModalMockand asserting it is called when the delete menu item is triggered correctly validates the integration withuseRoomItems. The changes preserve the previous behavior while aligning with the new modal hook.Also applies to: 120-122
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomMenu.tsx (1)
4-28: RoomMenu rename and hook wiring are soundThe new
RoomMenucomponent andRoomMenuPropstype correctly encapsulate theroomshape needed byuseRoomItems, and the updated import path (../hooks/useRoomItems) is consistent with the folder layout. No behavioral changes beyond the intended rename.apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.tsx (1)
8-9: RoomFormAutocomplete refactor preserves behavior and typingsThe component/type rename to
RoomFormAutocompleteand the adjustedABACQueryKeysimport path are consistent with the surrounding ABAC modules. Query usage and AutoComplete wiring remain unchanged and type-safe.Also applies to: 17-21, 59-59
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.stories.tsx (1)
5-7: RoomFormAutocomplete stories correctly aligned with new component and mocks pathStory meta, component usage, and
Storytyping now consistently referenceRoomFormAutocomplete, and the updatedcreateFakeRoomimport path to../../../../../tests/mocks/datamatches the expected directory layout.Also applies to: 11-13, 40-41
apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesContextualBarWithData.tsx (1)
5-9: Attributes contextual bar wrapper rename is clean and behavior-preservingThe wrapper now consistently uses
AttributesContextualBarandAttributesContextualBarWithDataProps, withABACQueryKeysimported from the same base path as other ABAC files. Data fetching and loading skeleton behavior remain unchanged.Also applies to: 13-13, 25-28
apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.stories.tsx (1)
6-6: AttributesForm stories correctly updated to new component and form data typeThe stories now reference
AttributesFormandAttributesFormFormDataconsistently across the meta, template, anduseFormgenerics, maintaining the existing behavior and form shape expectations.Also applies to: 9-9, 28-31, 36-37, 63-64
apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.tsx (1)
18-22: LGTM - Clean component and type renames.The renames from
AdminABACRoomAttributesForm*toAttributesForm*are consistent throughout the file. The form logic is preserved correctly, including the first-value-mandatory behavior where only additional values beyond the first have Remove buttons.Also applies to: 24-28, 30-30, 141-141
apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesPage.tsx (1)
8-20: LGTM - Import paths and component references updated correctly.The import path adjustments reflect the new folder structure, and the component rename from
AdminABACRoomAttributestoAttributesPageis applied consistently. TheAttributeMenuusage aligns with the renamed component.Also applies to: 22-22, 89-89, 110-110
apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesContextualBar.tsx (1)
8-10: LGTM - Component and type renames applied correctly.The import paths, type names, and component references are updated consistently with the broader refactoring effort.
Also applies to: 12-20, 22-22, 55-55, 89-89, 99-99
apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.spec.tsx (1)
10-11: LGTM - Test file updated to reflect component renames.The test imports, type references, and test suite description are correctly updated. The test logic remains intact and continues to verify the expected behavior, including the first-value-mandatory pattern.
Also applies to: 26-27, 40-40
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomForm.tsx (1)
10-12: LGTM - Consistent component and type renames.The refactoring from
AdminABACRoomForm*toRoomForm*naming is applied consistently across the component, its props type, form data type, and all sub-component references. The form logic for room selection and attribute management is preserved.Also applies to: 14-24, 26-26, 31-31, 85-85, 92-92, 112-112, 143-143
08aa993 to
536a8bc
Compare
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
🧹 Nitpick comments (2)
apps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.tsx (1)
6-10:SettingTogglerename andWarningModalusage preserve existing behaviorThe new
SettingTogglePropstyping and the switch fromAdminABACWarningModaltoWarningModalare consistent; the enable/disable and reset flows still gate changes behind the confirmation modal, and settings dispatch is unchanged.If you touch this again, you could extract a tiny helper that renders
WarningModalgiven anonConfirmcallback to avoid repeating the same JSX inonChangeandonReset.Also applies to: 12-16, 41-47, 61-68, 95-95
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.tsx (1)
7-8: Align prop type name with component and guardoptionsagainstundefinedTwo small cleanups would make this component a bit clearer and safer:
- The props type name no longer matches the component name. Consider renaming for consistency:
-type ABACAttributeAutocompleteProps = { +type RoomFormAttributeFieldProps = { onRemove: () => void; index: number; }; -const RoomFormAttributeField = ({ onRemove, index }: ABACAttributeAutocompleteProps) => { +const RoomFormAttributeField = ({ onRemove, index }: RoomFormAttributeFieldProps) => {
- To avoid any chance of
optionsbeingundefinedfromuseAttributeList, you can default it to an empty array when destructuring:-const { data: options, fetchNextPage, isLoading } = useAttributeList(filterDebounced || undefined); +const { data: options = [], fetchNextPage, isLoading } = useAttributeList(filterDebounced || undefined);These changes shouldn’t affect behavior but make the typing and runtime a bit more robust.
Also applies to: 15-15, 20-23, 99-99
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (5)
apps/meteor/client/views/admin/ABAC/ABACAttributesTab/__snapshots__/AttributesForm.spec.tsx.snapis excluded by!**/*.snapapps/meteor/client/views/admin/ABAC/ABACRoomsTab/__snapshots__/DeleteRoomModal.spec.tsx.snapis excluded by!**/*.snapapps/meteor/client/views/admin/ABAC/ABACRoomsTab/__snapshots__/RoomFormAttributeField.spec.tsx.snapis excluded by!**/*.snapapps/meteor/client/views/admin/ABAC/ABACRoomsTab/__snapshots__/RoomFormAutocomplete.spec.tsx.snapis excluded by!**/*.snapapps/meteor/client/views/admin/ABAC/ABACSettingTab/__snapshots__/SettingToggle.spec.tsx.snapis excluded by!**/*.snap
📒 Files selected for processing (35)
apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributeMenu.tsx(2 hunks)apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesContextualBar.tsx(5 hunks)apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesContextualBarWithData.tsx(2 hunks)apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.spec.tsx(13 hunks)apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.stories.tsx(3 hunks)apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.tsx(2 hunks)apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesPage.tsx(3 hunks)apps/meteor/client/views/admin/ABAC/ABACLogsTab/LogsPage.tsx(2 hunks)apps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.spec.tsx(5 hunks)apps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.tsx(2 hunks)apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomForm.tsx(4 hunks)apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.spec.tsx(2 hunks)apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.stories.tsx(4 hunks)apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.tsx(2 hunks)apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.spec.tsx(3 hunks)apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.stories.tsx(2 hunks)apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.tsx(3 hunks)apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocompleteDummy.tsx(1 hunks)apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomMenu.tsx(2 hunks)apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomsContextualBar.tsx(2 hunks)apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomsContextualBarWithData.tsx(1 hunks)apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomsPage.tsx(3 hunks)apps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.spec.tsx(8 hunks)apps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.stories.tsx(2 hunks)apps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.tsx(4 hunks)apps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingsPage.tsx(2 hunks)apps/meteor/client/views/admin/ABAC/ABACSettingTab/WarningModal.tsx(2 hunks)apps/meteor/client/views/admin/ABAC/AdminABACPage.tsx(2 hunks)apps/meteor/client/views/admin/ABAC/hooks/useAttributeList.ts(1 hunks)apps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.spec.tsx(10 hunks)apps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.tsx(1 hunks)apps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.spec.tsx(3 hunks)apps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.tsx(1 hunks)apps/meteor/client/views/admin/ABAC/hooks/useRoomItems.spec.tsx(2 hunks)apps/meteor/client/views/admin/ABAC/hooks/useRoomItems.tsx(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (13)
- apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.stories.tsx
- apps/meteor/client/views/admin/ABAC/ABACLogsTab/LogsPage.tsx
- apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomsContextualBar.tsx
- apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomsContextualBarWithData.tsx
- apps/meteor/client/views/admin/ABAC/hooks/useAttributeList.ts
- apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.stories.tsx
- apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesContextualBarWithData.tsx
- apps/meteor/client/views/admin/ABAC/hooks/useRoomItems.tsx
- apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.tsx
- apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.tsx
- apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesPage.tsx
- apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributeMenu.tsx
- apps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.stories.tsx
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}
📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation
Files:
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.tsxapps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingsPage.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomMenu.tsxapps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.tsxapps/meteor/client/views/admin/ABAC/hooks/useRoomItems.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomsPage.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.tsxapps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.tsxapps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.stories.tsxapps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.spec.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocompleteDummy.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesContextualBar.tsxapps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomForm.tsxapps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.tsxapps/meteor/client/views/admin/ABAC/ABACSettingTab/WarningModal.tsxapps/meteor/client/views/admin/ABAC/AdminABACPage.tsx
🧠 Learnings (18)
📓 Common learnings
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37303
File: apps/meteor/tests/end-to-end/api/abac.ts:1125-1137
Timestamp: 2025-10-27T14:38:46.994Z
Learning: In Rocket.Chat ABAC feature, when ABAC is disabled globally (ABAC_Enabled setting is false), room-level ABAC attributes are not evaluated when changing room types. This means converting a private room to public will succeed even if the room has ABAC attributes, as long as the global ABAC setting is disabled.
Learnt from: MartinSchoeler
Repo: RocketChat/Rocket.Chat PR: 37557
File: apps/meteor/client/views/admin/ABAC/AdminABACRooms.tsx:115-116
Timestamp: 2025-11-27T17:56:26.050Z
Learning: In Rocket.Chat, the GET /v1/abac/rooms endpoint (implemented in ee/packages/abac/src/index.ts) only returns rooms where abacAttributes exists and is not an empty array (query: { abacAttributes: { $exists: true, $ne: [] } }). Therefore, in components consuming this endpoint (like AdminABACRooms.tsx), room.abacAttributes is guaranteed to be defined for all returned rooms, and optional chaining before calling array methods like .join() is sufficient without additional null coalescing.
Learnt from: MartinSchoeler
Repo: RocketChat/Rocket.Chat PR: 37244
File: apps/meteor/client/views/admin/ABAC/AdminABACRoomAttributesForm.spec.tsx:125-146
Timestamp: 2025-10-30T19:30:46.541Z
Learning: In the AdminABACRoomAttributesForm component (apps/meteor/client/views/admin/ABAC/AdminABACRoomAttributesForm.tsx), the first attribute value field is mandatory and does not have a Remove button. Only additional values beyond the first have Remove buttons. This means trashButtons[0] corresponds to the second value's Remove button, not the first value's.
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37299
File: apps/meteor/ee/server/lib/ldap/Manager.ts:438-454
Timestamp: 2025-10-24T17:32:05.348Z
Learning: In Rocket.Chat, ABAC attributes can only be set on private rooms and teams (type 'p'), not on public rooms (type 'c'). Therefore, when checking for ABAC-protected rooms/teams during LDAP sync or similar operations, it's sufficient to query only private rooms using methods like `findPrivateRoomsByIdsWithAbacAttributes`.
📚 Learning: 2025-11-27T17:56:26.050Z
Learnt from: MartinSchoeler
Repo: RocketChat/Rocket.Chat PR: 37557
File: apps/meteor/client/views/admin/ABAC/AdminABACRooms.tsx:115-116
Timestamp: 2025-11-27T17:56:26.050Z
Learning: In Rocket.Chat, the GET /v1/abac/rooms endpoint (implemented in ee/packages/abac/src/index.ts) only returns rooms where abacAttributes exists and is not an empty array (query: { abacAttributes: { $exists: true, $ne: [] } }). Therefore, in components consuming this endpoint (like AdminABACRooms.tsx), room.abacAttributes is guaranteed to be defined for all returned rooms, and optional chaining before calling array methods like .join() is sufficient without additional null coalescing.
Applied to files:
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomMenu.tsxapps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.tsxapps/meteor/client/views/admin/ABAC/hooks/useRoomItems.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomsPage.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.tsxapps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.tsxapps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.stories.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocompleteDummy.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesContextualBar.tsxapps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomForm.tsxapps/meteor/client/views/admin/ABAC/AdminABACPage.tsx
📚 Learning: 2025-10-30T19:30:46.541Z
Learnt from: MartinSchoeler
Repo: RocketChat/Rocket.Chat PR: 37244
File: apps/meteor/client/views/admin/ABAC/AdminABACRoomAttributesForm.spec.tsx:125-146
Timestamp: 2025-10-30T19:30:46.541Z
Learning: In the AdminABACRoomAttributesForm component (apps/meteor/client/views/admin/ABAC/AdminABACRoomAttributesForm.tsx), the first attribute value field is mandatory and does not have a Remove button. Only additional values beyond the first have Remove buttons. This means trashButtons[0] corresponds to the second value's Remove button, not the first value's.
Applied to files:
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomMenu.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomsPage.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.tsxapps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocompleteDummy.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesContextualBar.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomForm.tsxapps/meteor/client/views/admin/ABAC/AdminABACPage.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/page-objects/**/*.ts : Utilize existing page objects pattern from `apps/meteor/tests/e2e/page-objects/`
Applied to files:
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.tsxapps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingsPage.tsxapps/meteor/client/views/admin/ABAC/hooks/useRoomItems.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomsPage.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.spec.tsxapps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.stories.tsxapps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.spec.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.spec.tsxapps/meteor/client/views/admin/ABAC/AdminABACPage.tsx
📚 Learning: 2025-10-28T16:53:42.761Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 37205
File: ee/packages/federation-matrix/src/FederationMatrix.ts:296-301
Timestamp: 2025-10-28T16:53:42.761Z
Learning: In the Rocket.Chat federation-matrix integration (ee/packages/federation-matrix/), the createRoom method from rocket.chat/federation-sdk will support a 4-argument signature (userId, roomName, visibility, displayName) in newer versions. Code using this 4-argument call is forward-compatible with planned library updates and should not be flagged as an error.
Applied to files:
apps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Utilize Playwright fixtures (`test`, `page`, `expect`) for consistency in test files
Applied to files:
apps/meteor/client/views/admin/ABAC/hooks/useRoomItems.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.spec.tsxapps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.spec.tsxapps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.spec.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.spec.tsxapps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `expect` matchers for assertions (`toEqual`, `toContain`, `toBeTruthy`, `toHaveLength`, etc.) instead of `assert` statements in Playwright tests
Applied to files:
apps/meteor/client/views/admin/ABAC/hooks/useRoomItems.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.spec.tsxapps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.spec.tsxapps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.spec.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.spec.tsxapps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure clean state for each test execution in Playwright tests
Applied to files:
apps/meteor/client/views/admin/ABAC/hooks/useRoomItems.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.spec.tsxapps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Maintain test isolation between test cases in Playwright tests
Applied to files:
apps/meteor/client/views/admin/ABAC/hooks/useRoomItems.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.spec.tsxapps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.spec.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.spec.tsxapps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Implement proper wait strategies for dynamic content in Playwright tests
Applied to files:
apps/meteor/client/views/admin/ABAC/hooks/useRoomItems.spec.tsx
📚 Learning: 2025-10-27T14:38:46.994Z
Learnt from: KevLehman
Repo: RocketChat/Rocket.Chat PR: 37303
File: apps/meteor/tests/end-to-end/api/abac.ts:1125-1137
Timestamp: 2025-10-27T14:38:46.994Z
Learning: In Rocket.Chat ABAC feature, when ABAC is disabled globally (ABAC_Enabled setting is false), room-level ABAC attributes are not evaluated when changing room types. This means converting a private room to public will succeed even if the room has ABAC attributes, as long as the global ABAC setting is disabled.
Applied to files:
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomsPage.tsxapps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.spec.tsxapps/meteor/client/views/admin/ABAC/AdminABACPage.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Group related tests in the same file
Applied to files:
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.spec.tsxapps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.spec.tsxapps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.spec.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.{ts,spec.ts} : Follow Page Object Model pattern consistently in Playwright tests
Applied to files:
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.spec.tsxapps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.spec.tsxapps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.spec.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure tests run reliably in parallel without shared state conflicts
Applied to files:
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.spec.tsxapps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.spec.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.{ts,spec.ts} : Store commonly used locators in variables/constants for reuse
Applied to files:
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.spec.tsxapps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Prefer web-first assertions (`toBeVisible`, `toHaveText`, etc.) in Playwright tests
Applied to files:
apps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.spec.tsxapps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.spec.tsxapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.spec.tsxapps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `test.step()` for complex test scenarios to improve organization in Playwright tests
Applied to files:
apps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : All test files must be created in `apps/meteor/tests/e2e/` directory
Applied to files:
apps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.spec.tsxapps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.spec.tsx
🧬 Code graph analysis (10)
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.tsx (1)
packages/core-typings/src/IRoom.ts (1)
IRoom(22-98)
apps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingsPage.tsx (1)
apps/meteor/client/hooks/useHasLicenseModule.ts (1)
useHasLicenseModule(5-8)
apps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.tsx (1)
packages/ui-contexts/src/index.ts (1)
useSetModal(70-70)
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.tsx (2)
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomForm.tsx (1)
RoomFormData(21-24)apps/meteor/client/views/admin/ABAC/hooks/useAttributeList.ts (1)
useAttributeList(7-39)
apps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.spec.tsx (1)
apps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.tsx (1)
useDeleteRoomModal(5-11)
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.stories.tsx (1)
apps/meteor/tests/mocks/data.ts (1)
createFakeRoom(46-61)
apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.spec.tsx (1)
apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.tsx (1)
AttributesFormFormData(18-22)
apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesContextualBar.tsx (1)
apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.tsx (1)
AttributesFormFormData(18-22)
apps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.spec.tsx (1)
apps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.tsx (1)
useAttributeOptions(12-101)
apps/meteor/client/views/admin/ABAC/AdminABACPage.tsx (1)
packages/ui-client/src/components/Contextualbar/index.ts (1)
ContextualbarDialog(22-22)
🔇 Additional comments (20)
apps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingToggle.spec.tsx (1)
7-8: LGTM! Clean refactoring of component and import paths.The test file has been successfully updated to reflect the renamed component (AdminABACSettingToggle → SettingToggle) and adjusted import paths for the reorganized directory structure. All test logic remains intact.
Also applies to: 29-142
apps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.spec.tsx (1)
5-52: LGTM! Hook rename applied consistently.The test has been updated to reference the renamed hook (useABACDeleteRoomModal → useDeleteRoomModal) throughout. All test assertions remain unchanged.
apps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.tsx (1)
9-12: LGTM! Hook renamed with updated import paths.The public hook has been renamed from
useRoomAttributeItemstouseAttributeOptions, and import paths have been adjusted to reflect the new directory structure. Internal logic remains unchanged.apps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.spec.tsx (1)
6-71: LGTM! Modal component rename applied consistently.The test file has been updated to reflect the renamed component (ABACDeleteRoomModal → DeleteRoomModal) across imports, describe block, and all render calls. Test logic remains unchanged.
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomsPage.tsx (1)
8-20: LGTM! Page component renamed with updated dependencies.The component has been renamed from
AdminABACRoomstoRoomsPage, with all imports adjusted to reflect the new directory structure. TheRoomMenucomponent reference (formerlyAdminABACRoomMenu) has also been updated. All component logic remains intact.Also applies to: 22-133
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomMenu.tsx (1)
4-28: LGTM! Menu component and type renamed consistently.The component has been renamed from
AdminABACRoomMenutoRoomMenu, with the corresponding type renamed fromAdminABACRoomMenuPropstoRoomMenuProps. Import path foruseRoomItemshas been updated to reflect the new hook location.apps/meteor/client/views/admin/ABAC/hooks/useAttributeOptions.spec.tsx (1)
4-5: LGTM! Test suite updated for renamed hook.The test file has been comprehensively updated to reference the renamed hook (useRoomAttributeItems → useAttributeOptions), with all import paths adjusted for the new directory structure. All test cases and assertions remain unchanged.
Also applies to: 12-267
apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.spec.tsx (1)
10-11: LGTM! Form component and types renamed consistently across the test suite.The test file has been thoroughly updated to reflect the renamed component (AdminABACRoomAttributesForm → AttributesForm) and type (AdminABACRoomAttributesFormFormData → AttributesFormFormData). All imports, type annotations, and component usages have been updated consistently. Test logic remains intact.
Also applies to: 26-27, 40-253
apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesContextualBar.tsx (1)
1-99: LGTM! Clean refactoring with consistent renames.All component, type, and import renames are consistent throughout the file. The import paths are correctly updated to reflect the new directory structure.
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAttributeField.spec.tsx (1)
1-43: LGTM! Test imports and mocks correctly updated.The test file has been properly updated to reflect the renamed component and hook, with correct import paths and mock references.
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.spec.tsx (1)
1-60: LGTM! Test suite properly updated.All references to the component have been correctly updated from ABACRoomAutocomplete to RoomFormAutocomplete, including imports, test suite name, and component usage.
apps/meteor/client/views/admin/ABAC/ABACSettingTab/SettingsPage.tsx (1)
1-30: LGTM! Component rename and import paths correctly updated.The component has been successfully renamed from AdminABACSettings to SettingsPage, with all internal references and import paths properly adjusted.
apps/meteor/client/views/admin/ABAC/hooks/useDeleteRoomModal.tsx (1)
1-11: LGTM! Clean modal hook implementation.The hook follows the standard pattern for opening modals with
useSetModal, properly passing the required props and handling cleanup withsetModal(null)on close.apps/meteor/client/views/admin/ABAC/ABACRoomsTab/DeleteRoomModal.tsx (1)
1-48: LGTM! Modal component properly renamed.The component and its props type have been successfully renamed from ABACDeleteRoomModal to DeleteRoomModal, with import paths correctly adjusted.
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocompleteDummy.tsx (1)
1-11: LGTM! Component and type properly renamed.The component has been successfully renamed from ABACRoomAutocompleteDummy to RoomFormAutocompleteDummy, with the props type consistently updated.
apps/meteor/client/views/admin/ABAC/hooks/useRoomItems.spec.tsx (1)
1-124: LGTM! Test updated to use renamed hook.The test has been properly updated to mock and test the new
useDeleteRoomModalhook, with all variable names and assertions correctly aligned.apps/meteor/client/views/admin/ABAC/ABACSettingTab/WarningModal.tsx (1)
6-9: Rename toWarningModaland props look consistentType and component renames are coherent, and the navigation/modal behavior remains unchanged. No issues spotted.
Also applies to: 11-11, 48-48
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomFormAutocomplete.stories.tsx (1)
5-7: Story now correctly targetsRoomFormAutocompleteThe component/type renames and the updated
createFakeRoomimport path line up withapps/meteor/tests/mocks/data. Story metadata and args remain valid.Also applies to: 11-13, 40-40
apps/meteor/client/views/admin/ABAC/AdminABACPage.tsx (1)
7-14: ABAC admin tab pages/contextual bars correctly point to renamed componentsThe switch from the older monolithic components to
SettingsPage/AttributesPage/RoomsPage/LogsPageand the correspondingAttributesContextualBar*imports preserves the existing tab keys and contextual-bar gating (isABACAvailable,_id,context). No behavioral regressions evident.Also applies to: 70-73, 80-83
apps/meteor/client/views/admin/ABAC/ABACRoomsTab/RoomForm.tsx (1)
10-12:RoomFormdata typing and child component wiring are consistent
RoomFormDatais correctly shared between the form (useFormContext<RoomFormData>()) andRoomFormAttributeField, and the switch toRoomFormAutocomplete/RoomFormAutocompleteDummypreserves the previous “existing room vs. selectable room” behavior. Attribute field array handling (names, remove/append) still matches the declared data shape.Also applies to: 14-24, 26-32, 85-86, 92-93, 112-117, 143-143
Proposed changes (including videos or screenshots)
Issue(s)
Steps to test or reproduce
Further comments
Summary by CodeRabbit
Refactor
Chores
Tests
✏️ Tip: You can customize this high-level summary in your review settings.