Commit 01df6bfd authored by Luke Duncalfe's avatar Luke Duncalfe

Merge branch '287941-geo-nodes-beta-init' into 'master'

Geo Node Status 2.0 - Init

See merge request gitlab-org/gitlab!50799
parents 89e8f0a8 d95e3b32
<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
.nav-icon-container
= sprite_icon('location-dot')
%span.nav-item-name
#{ _('Geo') }
%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
%strong.fly-out-top-item-name
#{ _('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
resources :nodes, only: [:index, :create, :new, :edit, :update]
resources :nodes_beta, only: [:index]
scope '/replication' do
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
......@@ -12680,6 +12680,9 @@ msgstr ""
msgid "Geo Nodes"
msgstr ""
msgid "Geo Nodes Beta"
msgstr ""
msgid "Geo Nodes|Cannot remove a primary node if there is a secondary node"
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