osm-teams
osm-teams copied to clipboard
Assign badge in modal
The current page approach for badges results in a number of potential concerns/bugs:
- I can visit the URL
/organizations/:id/badges/assign/:userid
with any values for :userid, even if the userid is not a part of the org, and no error is thrown. The page renders as expected and my only indication that something is wrong is if I try to assign the badge to a user who is not part of the org - then a toast is displayed - I can visit the URL
/organizations/:id/badges/assign/:userid
with any values for :orgid, even if I am not a member of the org or if the org does not exist. No badges display, but no error is thrown until I try to assign a badge - Now that #415 enables assigning badges from the team page, there is no easy way to click "assign badge" on the team and then navigate back to that team - the badge assignment page redirects to the org. While getting the location history from the router is possible, this seems like a more brittle solution
Assigning a badge in a modal would be a more straightforward way to approach this. The individual badge page at /organizations/:orgid/badges/:badgeid
and badge-user-assignment page at /organizations/:orgid/badges/:badgeid/assign/:userid
are both likely still necessary and useful; the badgeless assignment page at /organizations/:id/badges/assign/:userid
is the one that seems most helpfully replaced by a modal.
Page refresh actions would be necessary, but this would seem to also help pave the way to team badges for teams which are not part of an organization.