Add name of Environment to URL instead of numerical ID
Problem
The URL for an environment contains a numerical ID which makes it hard to visually map it to the environment. Environments are named in readable text.
If we were to add the name of the environment to the URL, it would make it easier and faster for users to access the detail pages for their environments. This is especially prevalent when a users has many environments.
Technical Proposal
-
Override the named route parameter for environments to use
slug
instead ofid
. See !132074 (closed) for an example. - Add fallback logic to the controller(s) to keep any existing bookmarks working correctly, using the following rules:
- If the provided value is made up entirely of numbers, treat it as an ID and use it to find the environment. Return a status of 301 and redirect to the new route using the slug.
- Else, find the environment with the matching slug.
Edited by Tiger Watson