Refactor `Project :: Infra :: Google Cloud` Routing
Disclaimer: It's smaller than it appears. Yes, yes, twss. Please read on for an explanation!
What does this MR do and why?
This is regarding the organization and setup of Project :: Infrastructure :: Google Cloud section. Zero new features are being introduced. Instead this MR refactors and fixes trivial bugs / gotchas along the way.
Half the routing happens in Rails, the other half happens in Vue. This is not desirable. This MR moves all the routing responsibilities to Rails. Let Vue components just be good ol' Vue components doing what they were built for. Let's not introduce any hacks -- rather use standard Rails views, entry point index.js files and dumb Vue components that are unaware and unburdened with routing responsibilities.
Ditto for error messages. Rails has a perfectly good Flash messaging capabilities. So why did I try to invent my own? Bad Sri. Discard gcp_error components and use standard Rails error management capabilities.
The only new code that's introduced is a google-cloud-menu component -- because, sadly, gl-tabs doesn't support tab being traditional links. Thus, keeping up with the spirit of no UI changes, introduce a tab-like component that routes the users with Real Links(tm).
Things removed
assets/javascripts/google_cloud/components/errors/gcp_error.vueassets/javascripts/google_cloud/components/errors/no_gcp_projects.vueassets/javascripts/google_cloud/components/app.vueassets/javascripts/google_cloud/components/home.vuecontrollers/projects/google_cloud_controller.rb
Things moved
assets/javascripts/google_cloud/databases/cloudsql/create_instance_form.vueassets/javascripts/google_cloud/databases/cloudsql/instance_table.vueassets/javascripts/google_cloud/databases/service_table.vueassets/javascripts/google_cloud/deployments/service_table.vueassets/javascripts/google_cloud/gcp_regions/form.vueassets/javascripts/google_cloud/gcp_regions/list.vueassets/javascripts/google_cloud/service_accounts/form.vueassets/javascripts/google_cloud/service_accounts/list.vue
Things added
assets/javascripts/google_cloud/components/google_cloud_menu.vueassets/javascripts/google_cloud/databases/index.jsassets/javascripts/google_cloud/databases/panel.vueassets/javascripts/google_cloud/deployments/index.jsassets/javascripts/google_cloud/deployments/panel.vueassets/javascripts/google_cloud/service_accounts/index.jscontrollers/projects/google_cloud/configuration_controller.rbcontrollers/projects/google_cloud/databases_controller.rb
Everything else
- Updated references
- Added namespaces for i18n
- Consistent test labels in specs
- Entry point
jsandhamlfiles
Screenshots or screen recordings
None, purely code changes. Nothing visual.
How to set up and validate locally
- Setup GDK for Google OAuth2: https://docs.gitlab.com/ee/integration/google.html
- Enable the
incubation_5mp_google_cloudfeature flag. - Visit
Project :: Infra :: Google Cloudsection. - Verify that
Configuration,DeploymentsandDatabasesare server rendered routes.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.