Repository navigation
Conversation
…l page Duplicate opens the create custom role wizard in clone mode with the role preselected. The name starts empty and the copy is saved with the normal create call (ADR 0036). From the detail page, the new role opens once created. Closes openedx/openedx-authz#583
|
Thanks for the pull request, @rodmgwgu! 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. 🔘 Update the status of your PRYour PR is currently marked as a draft. After completing the steps above, update its status by clicking "Ready for Review", or removing "WIP" from the title, as appropriate. Where 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 @@
## diana/permissions-tab #307 +/- ##
======================================================
Coverage 99.31% 99.32%
======================================================
Files 110 110
Lines 2197 2215 +18
Branches 705 711 +6
======================================================
+ Hits 2182 2200 +18
Misses 15 15 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Closes openedx/openedx-authz#583
Stacked on #305 (which is on #297 and #295).
Problem
The "Duplicate" item in the roles table row menu, the "Duplicate" item in the custom role detail menu, and the "Duplicate Role" button on a built-in role's detail page were not yet connected to anything.
Approach
Per ADR 0036, there is no duplicate endpoint. Duplicate opens the create custom role wizard with "Clone from role" selected and the source role preselected. The name starts empty and is required, because the role ID is derived from it and never changes (ADR 0035).
CreateCustomRoleWizardtakes an optionalinitialSourceRole, which seeds the draft in clone mode, and an optionalonCreatedcallback.RoleAssignmentContext. It is disabled for users who cannot manage roles. After create, the user stays on the table, as with Create Custom Role.Backend: uses the create and name validation endpoints from openedx-authz, which are already released.
Manual testing instructions
As a user who can manage roles:
Rollback plan
Revert this PR. Frontend only; no stored data.
Retro compatibility
DuplicateRoleButtonnow requires anonClickprop; its only caller is updated. The wizard's new props are optional.AI Usage
🤖 This change was made with assistance from Kiro, with human guidance on the decisions and validation against ADR 0035 and ADR 0036.
Merge checklist:
RoleActionsCell.tsxandRoleDetailPage.tsx.