Skip to content

Geo Replicables - Add `show` action and route for a single replicable item view

What / Why

We are working to create a view that allows users to "dig into" a single replicable item's details: &16249 (closed)

This change is focused on creating the routing and action that will allow for a Javascript application to be bootstrapped and render information regarding the single registry item.

Acceptance criteria

  1. Add new get '/:replicable_id' route to the routes/admin.rb#geo
    • Ensure this forwards to replicables#show
    • This route will look something like /admin/geo/sites/${ID}/replication/${REPLICABLE_NAME_PLURAL}/${REPLICABLE_ID}
    • The :replicable_id should be the same ID that will be used to query the model record from the GraphQL API through the geo proxy asynchronously in the frontend
  2. Add feature flag geo_replicables_show_view
    • File should be config/feature_flags/wip/geo_replicables_show_view.yml
  3. Add HAML entry point for Javascript to bootstrap and protect it behind a feature flag
    • File should be geo/replicables/show.html.haml
    • This can be a simple HAML file with simplt add_to_breadcrumbs and an empty js- pre-pended div as we will hook up the JS entry point in a later issue.

Implementation details

  1. Add new route in the geo section of routes/admin.rb for the show action.
namespace :geo do
  # omitting some of the code here
  scope '/replication' do
    get '/', to: 'nodes#index'
    
    scope '/:replicable_name_plural' do
      get '/', to: 'replicables#index', as: 'site_replicables'
      get '/:replicable_id', to: 'replicables#show', as: 'site_replicable'
    end
  end
end
  1. Add feature flag config/feature_flags/wip/geo_replicables_show_view.yml
---
name: geo_replicables_show_view
feature_issue_url: https://gitlab.com/groups/gitlab-org/-/epics/16249
introduced_by_url: YOUR_MR_URL
rollout_issue_url: CREATED_ISSUE_URL
milestone: '17.9'
group: group::geo
type: wip
default_enabled: false
  1. Add new HAML file for the show action ee/app/views/admin/geo/replicables/show.html.haml
- add_to_breadcrumbs _('Geo Sites'), admin_geo_nodes_path
- add_to_breadcrumbs _('Geo Replication'), site_replicables_admin_geo_node_path

- if Feature.enabled?(:geo_replicables_show_view, current_user)
  #js-geo-replicable-item
Edited by Zack Cuddy