Commit 7e9d16fa authored by Zack Cuddy's avatar Zack Cuddy

Geo - Rename routes from Nodes to Sites

This change renames the Geo
View Routes from Nodes
to Sites.

This change also adds
redirects to the user facing
nodes routes to redirect
to Sites.

Changelog: changed
EE: true
parent b59b523f
...@@ -62,7 +62,7 @@ Example response: ...@@ -62,7 +62,7 @@ Example response:
"container_repositories_max_capacity": 10, "container_repositories_max_capacity": 10,
"sync_object_storage": false, "sync_object_storage": false,
"clone_protocol": "http", "clone_protocol": "http",
"web_edit_url": "https://primary.example.com/admin/geo/nodes/3/edit", "web_edit_url": "https://primary.example.com/admin/geo/sites/3/edit",
"web_geo_projects_url": "http://secondary.example.com/admin/geo/projects", "web_geo_projects_url": "http://secondary.example.com/admin/geo/projects",
"_links": { "_links": {
"self": "https://primary.example.com/api/v4/geo_nodes/3", "self": "https://primary.example.com/api/v4/geo_nodes/3",
...@@ -103,7 +103,7 @@ Example response: ...@@ -103,7 +103,7 @@ Example response:
"selective_sync_namespace_ids": [1, 25], "selective_sync_namespace_ids": [1, 25],
"minimum_reverification_interval": 7, "minimum_reverification_interval": 7,
"clone_protocol": "http", "clone_protocol": "http",
"web_edit_url": "https://primary.example.com/admin/geo/nodes/1/edit", "web_edit_url": "https://primary.example.com/admin/geo/sites/1/edit",
"_links": { "_links": {
"self": "https://primary.example.com/api/v4/geo_nodes/1", "self": "https://primary.example.com/api/v4/geo_nodes/1",
"status":"https://primary.example.com/api/v4/geo_nodes/1/status", "status":"https://primary.example.com/api/v4/geo_nodes/1/status",
...@@ -128,7 +128,7 @@ Example response: ...@@ -128,7 +128,7 @@ Example response:
"minimum_reverification_interval": 7, "minimum_reverification_interval": 7,
"sync_object_storage": true, "sync_object_storage": true,
"clone_protocol": "http", "clone_protocol": "http",
"web_edit_url": "https://primary.example.com/admin/geo/nodes/2/edit", "web_edit_url": "https://primary.example.com/admin/geo/sites/2/edit",
"web_geo_projects_url": "https://secondary.example.com/admin/geo/projects", "web_geo_projects_url": "https://secondary.example.com/admin/geo/projects",
"_links": { "_links": {
"self":"https://primary.example.com/api/v4/geo_nodes/2", "self":"https://primary.example.com/api/v4/geo_nodes/2",
...@@ -169,7 +169,7 @@ Example response: ...@@ -169,7 +169,7 @@ Example response:
"selective_sync_namespace_ids": [1, 25], "selective_sync_namespace_ids": [1, 25],
"minimum_reverification_interval": 7, "minimum_reverification_interval": 7,
"clone_protocol": "http", "clone_protocol": "http",
"web_edit_url": "https://primary.example.com/admin/geo/nodes/1/edit", "web_edit_url": "https://primary.example.com/admin/geo/sites/1/edit",
"_links": { "_links": {
"self": "https://primary.example.com/api/v4/geo_nodes/1", "self": "https://primary.example.com/api/v4/geo_nodes/1",
"status":"https://primary.example.com/api/v4/geo_nodes/1/status", "status":"https://primary.example.com/api/v4/geo_nodes/1/status",
...@@ -226,7 +226,7 @@ Example response: ...@@ -226,7 +226,7 @@ Example response:
"minimum_reverification_interval": 7, "minimum_reverification_interval": 7,
"sync_object_storage": true, "sync_object_storage": true,
"clone_protocol": "http", "clone_protocol": "http",
"web_edit_url": "https://primary.example.com/admin/geo/nodes/2/edit", "web_edit_url": "https://primary.example.com/admin/geo/sites/2/edit",
"web_geo_projects_url": "https://secondary.example.com/admin/geo/projects", "web_geo_projects_url": "https://secondary.example.com/admin/geo/projects",
"_links": { "_links": {
"self":"https://primary.example.com/api/v4/geo_nodes/2", "self":"https://primary.example.com/api/v4/geo_nodes/2",
...@@ -277,7 +277,7 @@ Example response: ...@@ -277,7 +277,7 @@ Example response:
"container_repositories_max_capacity": 10, "container_repositories_max_capacity": 10,
"verification_max_capacity": 100, "verification_max_capacity": 100,
"clone_protocol": "http", "clone_protocol": "http",
"web_edit_url": "https://primary.example.com/admin/geo/nodes/1/edit", "web_edit_url": "https://primary.example.com/admin/geo/sites/1/edit",
"_links": { "_links": {
"self": "https://primary.example.com/api/v4/geo_nodes/1", "self": "https://primary.example.com/api/v4/geo_nodes/1",
"status":"https://primary.example.com/api/v4/geo_nodes/1/status", "status":"https://primary.example.com/api/v4/geo_nodes/1/status",
......
...@@ -29,7 +29,7 @@ export default { ...@@ -29,7 +29,7 @@ export default {
return this.node && this.node.primary; return this.node && this.node.primary;
}, },
pageTitle() { pageTitle() {
return this.node ? __('Edit Geo Node') : __('Add New Node'); return this.node ? __('Edit Geo Site') : __('Add New Site');
}, },
pillDetails() { pillDetails() {
return { return {
......
...@@ -18,12 +18,12 @@ class Admin::Geo::NodesController < Admin::Geo::ApplicationController ...@@ -18,12 +18,12 @@ class Admin::Geo::NodesController < Admin::Geo::ApplicationController
end end
def new def new
@form_title = _('Add New Node') @form_title = _('Add New Site')
render :form render :form
end end
def edit def edit
@form_title = _('Edit Geo Node') @form_title = _('Edit Geo Site')
render :form render :form
end end
......
- add_to_breadcrumbs _('Geo Nodes'), admin_geo_nodes_path - add_to_breadcrumbs _('Geo Sites'), admin_geo_nodes_path
- page_title @form_title - page_title @form_title
#js-geo-node-form{ data: { "selective-sync-types" => selective_sync_types_json, #js-geo-node-form{ data: { "selective-sync-types" => selective_sync_types_json,
......
...@@ -50,7 +50,12 @@ namespace :admin do ...@@ -50,7 +50,12 @@ namespace :admin do
get '/projects', to: redirect(path: 'admin/geo/replication/projects') get '/projects', to: redirect(path: 'admin/geo/replication/projects')
get '/designs', to: redirect(path: 'admin/geo/replication/designs') get '/designs', to: redirect(path: 'admin/geo/replication/designs')
resources :nodes, only: [:index, :create, :new, :edit, :update] resources :nodes, path: 'sites', only: [:index, :create, :new, :edit, :update]
# Old Route Replaced in 14.7
get '/nodes', to: redirect(path: 'admin/geo/sites')
get '/nodes/new', to: redirect(path: 'admin/geo/sites/new')
get '/nodes/:id/edit', to: redirect(path: 'admin/geo/sites/%{id}/edit')
scope '/replication' do scope '/replication' do
get '/', to: redirect(path: 'admin/geo/replication/projects') get '/', to: redirect(path: 'admin/geo/replication/projects')
......
...@@ -21,7 +21,7 @@ RSpec.describe 'admin Geo Nodes', :js, :geo do ...@@ -21,7 +21,7 @@ RSpec.describe 'admin Geo Nodes', :js, :geo do
breadcrumbs = page.all(:css, '.breadcrumbs-list>li') breadcrumbs = page.all(:css, '.breadcrumbs-list>li')
expect(breadcrumbs.length).to eq(3) expect(breadcrumbs.length).to eq(3)
expect(breadcrumbs[0].text).to eq('Admin Area') expect(breadcrumbs[0].text).to eq('Admin Area')
expect(breadcrumbs[1].text).to eq('Geo Nodes') expect(breadcrumbs[1].text).to eq('Geo Sites')
expect(breadcrumbs[2].text).to eq(text) expect(breadcrumbs[2].text).to eq(text)
end end
...@@ -136,7 +136,7 @@ RSpec.describe 'admin Geo Nodes', :js, :geo do ...@@ -136,7 +136,7 @@ RSpec.describe 'admin Geo Nodes', :js, :geo do
end end
it 'includes Geo Nodes in breadcrumbs' do it 'includes Geo Nodes in breadcrumbs' do
expect_breadcrumb('Add New Node') expect_breadcrumb('Add New Site')
end end
end end
...@@ -161,7 +161,7 @@ RSpec.describe 'admin Geo Nodes', :js, :geo do ...@@ -161,7 +161,7 @@ RSpec.describe 'admin Geo Nodes', :js, :geo do
end end
it 'includes Geo Nodes in breadcrumbs' do it 'includes Geo Nodes in breadcrumbs' do
expect_breadcrumb('Edit Geo Node') expect_breadcrumb('Edit Geo Site')
end end
end end
......
...@@ -34,9 +34,9 @@ describe('GeoNodeFormApp', () => { ...@@ -34,9 +34,9 @@ describe('GeoNodeFormApp', () => {
describe.each` describe.each`
formType | node | title | pillTitle | variant formType | node | title | pillTitle | variant
${'create a secondary node'} | ${null} | ${'Add New Node'} | ${'Secondary'} | ${'muted'} ${'create a secondary node'} | ${null} | ${'Add New Site'} | ${'Secondary'} | ${'muted'}
${'update a secondary node'} | ${{ primary: false }} | ${'Edit Geo Node'} | ${'Secondary'} | ${'muted'} ${'update a secondary node'} | ${{ primary: false }} | ${'Edit Geo Site'} | ${'Secondary'} | ${'muted'}
${'update a primary node'} | ${{ primary: true }} | ${'Edit Geo Node'} | ${'Primary'} | ${'info'} ${'update a primary node'} | ${{ primary: true }} | ${'Edit Geo Site'} | ${'Primary'} | ${'info'}
`(`form header`, ({ formType, node, title, pillTitle, variant }) => { `(`form header`, ({ formType, node, title, pillTitle, variant }) => {
describe(`when node form is to ${formType}`, () => { describe(`when node form is to ${formType}`, () => {
beforeEach(() => { beforeEach(() => {
......
...@@ -68,4 +68,4 @@ export const MOCK_ERROR_MESSAGE = { ...@@ -68,4 +68,4 @@ export const MOCK_ERROR_MESSAGE = {
url: ["can't be blank", 'must be a valid URL'], url: ["can't be blank", 'must be a valid URL'],
}; };
export const MOCK_NODES_PATH = 'gitlab/admin/geo/nodes'; export const MOCK_NODES_PATH = 'gitlab/admin/geo/sites';
export const MOCK_NEW_NODE_URL = 'http://localhost:3000/admin/geo/nodes/new'; export const MOCK_NEW_NODE_URL = 'http://localhost:3000/admin/geo/sites/new';
export const MOCK_EMPTY_STATE_SVG = 'illustrations/empty-state/geo-empty.svg'; export const MOCK_EMPTY_STATE_SVG = 'illustrations/empty-state/geo-empty.svg';
...@@ -140,7 +140,7 @@ export const MOCK_NODES = [ ...@@ -140,7 +140,7 @@ export const MOCK_NODES = [
replicationSlotsUsedCount: 0, replicationSlotsUsedCount: 0,
version: '10.4.0-pre', version: '10.4.0-pre',
revision: 'b93c51849b', revision: 'b93c51849b',
webEditUrl: 'http://127.0.0.1:3001/admin/geo/nodes/1', webEditUrl: 'http://127.0.0.1:3001/admin/geo/sites/1',
}, },
{ {
id: 2, id: 2,
...@@ -210,7 +210,7 @@ export const MOCK_NODE_STATUSES_RES = [ ...@@ -210,7 +210,7 @@ export const MOCK_NODE_STATUSES_RES = [
replication_slots_used_count: 0, replication_slots_used_count: 0,
version: '10.4.0-pre', version: '10.4.0-pre',
revision: 'b93c51849b', revision: 'b93c51849b',
web_edit_url: 'http://127.0.0.1:3001/admin/geo/nodes/1', web_edit_url: 'http://127.0.0.1:3001/admin/geo/sites/1',
}, },
{ {
geo_node_id: 2, geo_node_id: 2,
......
...@@ -10,4 +10,4 @@ export const MOCK_BASIC_SETTINGS_DATA = { ...@@ -10,4 +10,4 @@ export const MOCK_BASIC_SETTINGS_DATA = {
export const STRING_OVER_255 = new Array(257).join('a'); export const STRING_OVER_255 = new Array(257).join('a');
export const MOCK_NODES_PATH = 'gitlab/admin/geo/nodes'; export const MOCK_NODES_PATH = 'gitlab/admin/geo/sites';
...@@ -63,7 +63,7 @@ RSpec.describe API::GeoNodes, :request_store, :geo, :prometheus, api: true do ...@@ -63,7 +63,7 @@ RSpec.describe API::GeoNodes, :request_store, :geo, :prometheus, api: true do
expect(response).to have_gitlab_http_status(:ok) expect(response).to have_gitlab_http_status(:ok)
expect(response).to match_response_schema('public_api/v4/geo_node', dir: 'ee') expect(response).to match_response_schema('public_api/v4/geo_node', dir: 'ee')
expect(json_response['web_edit_url']).to end_with("/admin/geo/nodes/#{primary.id}/edit") expect(json_response['web_edit_url']).to end_with("/admin/geo/sites/#{primary.id}/edit")
links = json_response['_links'] links = json_response['_links']
expect(links['self']).to end_with("/api/v4/geo_nodes/#{primary.id}") expect(links['self']).to end_with("/api/v4/geo_nodes/#{primary.id}")
......
...@@ -44,23 +44,39 @@ RSpec.describe 'EE-specific admin routing' do ...@@ -44,23 +44,39 @@ RSpec.describe 'EE-specific admin routing' do
let(:geo_node) { create(:geo_node) } let(:geo_node) { create(:geo_node) }
it 'routes / to #index' do it 'routes / to #index' do
expect(get('/admin/geo/nodes')).to route_to('admin/geo/nodes#index') expect(get('/admin/geo')).to route_to('admin/geo/nodes#index')
end
it 'routes /sites to #index' do
expect(get('/admin/geo/sites')).to route_to('admin/geo/nodes#index')
end end
it 'routes /new to #new' do it 'routes /new to #new' do
expect(get('/admin/geo/nodes/new')).to route_to('admin/geo/nodes#new') expect(get('/admin/geo/sites/new')).to route_to('admin/geo/nodes#new')
end end
it 'routes /edit to #edit' do it 'routes /edit to #edit' do
expect(get("/admin/geo/nodes/#{geo_node.id}/edit")).to route_to('admin/geo/nodes#edit', id: geo_node.to_param) expect(get("/admin/geo/sites/#{geo_node.id}/edit")).to route_to('admin/geo/nodes#edit', id: geo_node.to_param)
end end
it 'routes post / to #create' do it 'routes post / to #create' do
expect(post('/admin/geo/nodes/')).to route_to('admin/geo/nodes#create') expect(post('/admin/geo/sites/')).to route_to('admin/geo/nodes#create')
end end
it 'routes patch /:id to #update' do it 'routes patch /:id to #update' do
expect(patch("/admin/geo/nodes/#{geo_node.id}")).to route_to('admin/geo/nodes#update', id: geo_node.to_param) expect(patch("/admin/geo/sites/#{geo_node.id}")).to route_to('admin/geo/nodes#update', id: geo_node.to_param)
end
it 'redirects /nodes to /sites', type: :request do
expect(get('/admin/geo/nodes')).to redirect_to('/admin/geo/sites')
end
it 'redirects /nodes/new to /sites/new', type: :request do
expect(get('/admin/geo/nodes/new')).to redirect_to('/admin/geo/sites/new')
end
it 'redirects /nodes/:id/edit to /sites/:id/new', type: :request do
expect(get("/admin/geo/nodes/#{geo_node.id}/edit")).to redirect_to("/admin/geo/sites/#{geo_node.id}/edit")
end end
end end
......
...@@ -11,7 +11,7 @@ RSpec.shared_examples 'allowlisted /admin/geo requests' do ...@@ -11,7 +11,7 @@ RSpec.shared_examples 'allowlisted /admin/geo requests' do
end end
context 'allowlisted requests' do context 'allowlisted requests' do
it_behaves_like 'allowlisted request', :patch, '/admin/geo/nodes/1' it_behaves_like 'allowlisted request', :patch, '/admin/geo/sites/1'
it_behaves_like 'allowlisted request', :delete, '/admin/geo/replication/projects/1' it_behaves_like 'allowlisted request', :delete, '/admin/geo/replication/projects/1'
......
...@@ -1982,7 +1982,7 @@ msgstr "" ...@@ -1982,7 +1982,7 @@ msgstr ""
msgid "Add LICENSE" msgid "Add LICENSE"
msgstr "" msgstr ""
msgid "Add New Node" msgid "Add New Site"
msgstr "" msgstr ""
msgid "Add README" msgid "Add README"
...@@ -12802,7 +12802,7 @@ msgstr "" ...@@ -12802,7 +12802,7 @@ msgstr ""
msgid "Edit Deploy Key" msgid "Edit Deploy Key"
msgstr "" msgstr ""
msgid "Edit Geo Node" msgid "Edit Geo Site"
msgstr "" msgstr ""
msgid "Edit Group Hook" msgid "Edit Group Hook"
...@@ -15617,15 +15617,15 @@ msgstr "" ...@@ -15617,15 +15617,15 @@ msgstr ""
msgid "Geo" msgid "Geo"
msgstr "" msgstr ""
msgid "Geo Nodes"
msgstr ""
msgid "Geo Replication" msgid "Geo Replication"
msgstr "" msgstr ""
msgid "Geo Settings" msgid "Geo Settings"
msgstr "" msgstr ""
msgid "Geo Sites"
msgstr ""
msgid "Geo sites" msgid "Geo sites"
msgstr "" msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment