Loading
Drive create-token ranch dropdown from the user's ranches
Problem
The ranch dropdown in the create-token dialog hardcoded public and redhat. Ranches added later — nvidia and fedora-amd — never showed up as options, even when the user's token granted them. There was no way to create a token on those ranches from the UI.
Change
Build the dropdown options from authorized_user.ranch instead of hardcoding them:
allowed_ranchesmaps each granted ranch to a select option, using a newRANCH_LABELSmap for friendly labels (public→ Public,redhat→ Red Hat,nvidia→ NVIDIA,fedora-amd→ Fedora AMD) and falling back to a capitalized value for unknown ranches.default_ranchselects the user's first ranch as the dropdown default.- The dialog renders the options with
rx.foreachoverallowed_ranches. - Removes the per-ranch
ranch_public_allowed/ranch_redhat_allowedvars.
A future ranch granted in the token now appears automatically, without a code change. A TODO marks that the ranch list should eventually come from the Testing Farm API rather than the hardcoded map.
The token listing was never filtered by ranch, so only the create dialog needed this fix.
Edited by Miroslav Vadkerti