Commit d95e3b32 authored by Zack Cuddy's avatar Zack Cuddy Committed by Luke Duncalfe

Geo Node Status 2.0 - Init

This change introduces the beginning
of the new UI for Geo Nodes Status.

This change is behind the :geo_nodes_beta
feature flag.

After our full rollout these files will take
over the current Geo Node Status view.

For now we plan to roll it out on a seperate route
that will for a time exist along side the normal
route before taking it over.

More can be read about this approach on the epic:
https://gitlab.com/groups/gitlab-org/-/epics/4712
parent ab295e80
<script>
export default {
name: 'GeoNodesBetaApp',
};
</script>
<template>
<section>
<h2>{{ __('Geo Nodes Beta') }}</h2>
</section>
</template>
import Vue from 'vue';
import Translate from '~/vue_shared/translate';
import GeoNodesBetaApp from './components/app.vue';
Vue.use(Translate);
export const initGeoNodesBeta = () => {
const el = document.getElementById('js-geo-nodes-beta');
if (!el) {
return false;
}
return new Vue({
el,
render(createElement) {
return createElement(GeoNodesBetaApp);
},
});
};
import { initGeoNodesBeta } from 'ee/geo_nodes_beta';
initGeoNodesBeta();
# frozen_string_literal: true
class Admin::Geo::NodesBetaController < Admin::Geo::ApplicationController
before_action :check_license!
def index
redirect_to admin_geo_nodes_path if Feature.disabled?(:geo_nodes_beta)
end
end
- page_title _('Geo Nodes Beta')
#js-geo-nodes-beta{ }
= nav_link(controller: %w(admin/geo/nodes admin/geo/projects admin/geo/uploads admin/geo/settings admin/geo/designs admin/geo/replicables)) do = nav_link(controller: %w(admin/geo/nodes admin/geo/nodes_beta admin/geo/projects admin/geo/uploads admin/geo/settings admin/geo/designs admin/geo/replicables)) do
= link_to admin_geo_nodes_path, class: "qa-link-geo-menu" do = link_to admin_geo_nodes_path, class: "qa-link-geo-menu" do
.nav-icon-container .nav-icon-container
= sprite_icon('location-dot') = sprite_icon('location-dot')
%span.nav-item-name %span.nav-item-name
#{ _('Geo') } #{ _('Geo') }
%ul.sidebar-sub-level-items %ul.sidebar-sub-level-items
= nav_link(controller: 'admin/geo/nodes', html_options: { class: "fly-out-top-item" } ) do = nav_link(controller: '%w(admin/geo/nodes admin/geo/nodes_beta)', html_options: { class: "fly-out-top-item" } ) do
= link_to admin_geo_nodes_path do = link_to admin_geo_nodes_path do
%strong.fly-out-top-item-name %strong.fly-out-top-item-name
#{ _('Geo') } #{ _('Geo') }
......
---
name: geo_nodes_beta
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/50799
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/296986
milestone: '13.8'
type: development
group: group::geo
default_enabled: false
...@@ -48,6 +48,8 @@ namespace :admin do ...@@ -48,6 +48,8 @@ namespace :admin do
resources :nodes, only: [:index, :create, :new, :edit, :update] resources :nodes, only: [:index, :create, :new, :edit, :update]
resources :nodes_beta, only: [:index]
scope '/replication' do scope '/replication' do
get '/', to: redirect(path: 'admin/geo/replication/projects') get '/', to: redirect(path: 'admin/geo/replication/projects')
......
import { shallowMount } from '@vue/test-utils';
import GeoNodesBetaApp from 'ee/geo_nodes_beta/components/app.vue';
describe('GeoNodesBetaApp', () => {
let wrapper;
const createComponent = () => {
wrapper = shallowMount(GeoNodesBetaApp);
};
afterEach(() => {
wrapper.destroy();
wrapper = null;
});
const findGeoNodesBetaContainer = () => wrapper.find('section');
describe('template', () => {
beforeEach(() => {
createComponent();
});
it('renders the container always', () => {
expect(findGeoNodesBetaContainer().exists()).toBe(true);
});
});
});
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Admin::Geo::NodesBetaController do
include AdminModeHelper
let_it_be(:admin) { create(:admin) }
before do
enable_admin_mode!(admin)
login_as(admin)
end
describe 'GET /geo/nodes_beta' do
context 'with a valid license' do
before do
stub_licensed_features(geo: true)
end
context 'with :geo_nodes_beta feature enabled' do
before do
stub_feature_flags(geo_nodes_beta: true)
end
it 'renders the Geo Nodes Beta View', :aggregate_failures do
get admin_geo_nodes_beta_path
expect(response).to render_template(:index)
expect(response.body).to include('Geo Nodes Beta')
end
end
context 'with :geo_nodes_beta feature disabled' do
before do
stub_feature_flags(geo_nodes_beta: false)
end
it 'redirects to Geo Nodes View' do
get admin_geo_nodes_beta_path
expect(response).to redirect_to(admin_geo_nodes_path)
end
end
end
context 'without a valid license' do
before do
stub_licensed_features(geo: false)
end
it 'returns a 403' do
get admin_geo_nodes_beta_path
expect(response).to have_gitlab_http_status(:forbidden)
end
end
end
end
...@@ -12665,6 +12665,9 @@ msgstr "" ...@@ -12665,6 +12665,9 @@ msgstr ""
msgid "Geo Nodes" msgid "Geo Nodes"
msgstr "" msgstr ""
msgid "Geo Nodes Beta"
msgstr ""
msgid "Geo Nodes|Cannot remove a primary node if there is a secondary node" msgid "Geo Nodes|Cannot remove a primary node if there is a secondary node"
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