Add a new superuser ability page to admin - #4004
Merged
Merged
Conversation
/admin/superuser_abilities/new grants an ability to a user found by email, username or id, with the controller/action left blank for a universal one. Linked from a button on the index, which carries the user_id filter through so the form prefills. The model normalizes blank controller_name/action_name to nil, so a form-created universal ability matches the find_or_create_by in Admin::UsersController, and validates user_id so a typo'd address re-renders the form instead of creating an unowned universal ability. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Member
Author
application.js lazy loads Stimulus controllers, so ui--modal's module can still be in flight when Capybara clicks the trigger. The click is swallowed - the handler is wired in connect - and nothing reopens it, so the wait for "Yes, start over" times out on a dialog that never opens. open_modal clicks again, the way a rider whose click did nothing would, until the dialog reports itself open. Holding the modal_controller.js response back by 3s reproduces the swallow on a single click and confirms the retry recovers. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
sethherr
marked this pull request as ready for review
July 31, 2026 21:03
Both landing pages carry the same swallowed-click race the register flow hit - holding modal_controller.js back reproduces it on the hero and CTA triggers. open_modal now takes the trigger rather than a button label and modal id: each page has two triggers for one modal, so the id is the trigger's to name, and locating it is the caller's (first for the hero, a scoped find for the CTA). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The three text fields go through the shared group rather than hand-rolled Bootstrap label + form-control, so they pick up twlabel/twinput and the required "*" / optional badge the rest of the app's forms carry. Help text follows each field as the register steps write it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.






/admin/superuser_abilities/new— granting an ability was previously only possible from the user edit page (universal only) or the console. The index gets a button linking to it, carrying itsuser_idfilter through so the form arrives prefilled.User.friendly_find, held on auser_identifieraccessor the wayMembershipholdsuser_email. Leaving controller and action blank makes it universal;kindstays derived.set_calculated_attributesnow writes blankcontroller_name/action_nameas nil, so a form-created universal ability matches thefind_or_create_by(controller_name: nil, action_name: nil)inAdmin::UsersControllerinstead of quietly becoming a second row.user_id— a typo'd address re-renders the form rather than creating an unowned universal ability. On the column rather than the association, so an ability outliving its soft-deleted user stays editable.