Geo - Support Parameterized Route/Controller/View
What/Why
Related to #216969 (closed)
Follow up from !32872 (closed)
Currently, when we add a new Replicable Type to the Geo frontend we have to manually add:
- A controller
- A route
- A index.html.haml file
- A link in the https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/app/views/admin/geo/shared/_replication_nav.haml
- Index.js file for route
With Geo Self Service Framework, we want the ability to add new items to be pain-free, thus avoiding these steps would be preferred.
Proposal
- Expose list of replicable names
- Use this list to dynamically build route, view, navigation, and controller
Example solution
`Replicator.all_replicable_names` returns at the moment just ['package_file']`
`Replicator.all_replicable_names_including_legacy` returns ['project', 'upload', 'design', 'package_file', ... ]
Navigation is built via this list | Projects | Uploads | Designs | ... |
Routes are expecting the same keys: geo/replication/package_file, geo/replication/uploads, ...
Controller/Index file is built generically (GeoReplicationController), and passes key as replicableName to Vue frontend
Index.js file is add to higher level route `geo/replication` and keys off of the replicableName passed from Controller/Index file
Edited by Michael Kozono