Repository navigation
feat(authz): build the roles filter from the catalog - #263
Conversation
|
Thanks for the pull request, @dcoa! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dcoa/catalog-1-feature #263 +/- ##
=======================================================
Coverage 98.62% 98.62%
=======================================================
Files 83 83
Lines 1452 1458 +6
Branches 456 488 +32
=======================================================
+ Hits 1432 1438 +6
Misses 19 19
Partials 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
57551de to
c089db1
Compare
c089db1 to
1db22b6
Compare
1db22b6 to
ea373ad
Compare
ea373ad to
0a89360
Compare
jacobo-dominguez-wgu
left a comment
There was a problem hiding this comment.
Tested locally and works as expected, the roles filter get correctly populated and filtering remains working!
bra-i-am
left a comment
There was a problem hiding this comment.
Works as described! I'd recommend addressing two things:
-
RolesFilter reads isLoading but ignores the catalog's error state. If the initial request fails, the menu displays zero options without explaining the failure. This looks like a successful empty catalog or a user with no viewable roles. Could be provided a visible error feedback (a toast or an alert) to distinguish a failed request?
-
MultipleChoiceFilter currently uses displayName as the checkbox
key. Display names are presentation text and are not guaranteed to be unique. Maybe, just in case, can be used the existing choice value as the key
0a89360 to
cb96f5a
Compare
The roles filter lists the catalog roles of each scope type instead of the hardcoded ones. Co-Authored-By: Claude Opus 5.5 <[email protected]>
6fa661d to
47f94f1
Compare
|
🎉 This PR is included in version 1.0.0-alpha.13 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
The Roles filter of the team members table and the user audit page now lists the roles from the AuthZ catalog (
GET /api/authz/v1/roles/) instead of a hardcoded list. This is the first screen moved to the catalog introduced in #262What changes
RolesFilterreadsuseAuthzCatalog()and builds one group per scope type (course-v1→ Courses,lib→ Libraries), with the role ids and display names sent by the backend.RolesFilterno longer callsuseViewTeamPermissions. Course roles still also require the course-authoring flag.getScopeCataloggives.getRolesFiltersOptionsand its Global group message as non of the tables return global scopes today (Django roles).User-facing impact
At the moment this screenshot is taken the Course Editor and Auditor roles are hidden therefore not returned by the API.
Testing instructions
Tests
RolesFilter.test.tsxmocks the catalog (mockAuthzCatalog) and covers: library-only and both-scope users, ordering by permission count, no viewable scope types, catalog loading, and the course-authoring flag (disabled and loading).TableControlBar.test.tsxmocks the catalog for its wiring tests.AI disclosure
Assisted by Claude