Repository navigation
Wires the custom role creation with the api endpoint, handling loading, error and success states - #297
Wires the custom role creation with the api endpoint, handling loading, error and success states#297jacobo-dominguez-wgu wants to merge 4 commits into
Conversation
|
Thanks for the pull request, @jacobo-dominguez-wgu! 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. |
1a3e51b to
cab9518
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #297 +/- ##
==========================================
+ Coverage 99.16% 99.29% +0.12%
==========================================
Files 103 110 +7
Lines 1923 2129 +206
Branches 620 682 +62
==========================================
+ Hits 1907 2114 +207
+ Misses 16 15 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
cab9518 to
d280cd7
Compare
d280cd7 to
41b288b
Compare
rodmgwgu
left a comment
There was a problem hiding this comment.
Thanks for this, adding my initial comments.
| canRetry: boolean; | ||
| // A taken name is fixed in the name field, which takes focus in place of the alert. | ||
| isNameTaken?: boolean; | ||
| }// Why Next does nothing, so a screen reader can be told; `null` when there is nothing to fix. |
41b288b to
c84c1aa
Compare
c84c1aa to
3a2e3fa
Compare
022eb76 to
a629379
Compare
a629379 to
2bd34a4
Compare
2bd34a4 to
0db356c
Compare
0db356c to
78434ff
Compare
78434ff to
01573da
Compare
…dling loading, error and success states
24020d4 to
b959c39
Compare



Description
Connects the Create button of the create custom role wizard to the new create endpoint, on top of the permissions step from #295, handles loading, error and success states with proper feedback.
Closes openedx/openedx-authz#573.
Design figma
Requires openedx/openedx-authz#647
Approach
display_name(trimmed),scope_types(a one-item list with the role's resource type) andpermissionstoPOST /api/authz/v1/roles/. The permissions sent are every permission the role grants: the user's choices plus the ones they require. They are sent in catalog order, so the request matches the count in the summary panel.Notes for reviewers
{ message }(raised in the #647 review), so the wizard ignores the response body.aria-invalidon the name field. Paragon'sisInvalidonly styles the field, and a taken name passes the browser's own validation. Without the attribute, screen readers wouldn't announce the error.Testing
Setup
jacobo/create-role-wizard-3and runnpm run dev.1. Create a role from scratch
QA Designerand choose Libraries, then click Next.QA Designeris in the table without a reload. It shows 0 members and today's date under last updated.POST /api/authz/v1/roles/with{display_name, scope_types: ["lib"], permissions}and a 201 response.2. Create a role by cloning
QA Course Clone, choose Clone from role, pick Course Staff, then click Next.QA Designerfrom step 1 now shows in the clone picker under custom roles.3. Name taken (409)
qa designer(lowercase, with spaces), choose Libraries, then click Next.QA Designer 2and click Next.4. Network failure (Retry)
*/api/authz/v1/roles/.Demo
Screen.Recording.2026-11-26.at.10.31.49.AM.mov