From d4bd9ac3e7ce698573df1113554108aa132d9df6 Mon Sep 17 00:00:00 2001 From: Zack Cuddy Date: Mon, 9 Dec 2019 14:35:37 -0600 Subject: [PATCH] Hide New node Button Use link instead of button Linting Changelog Tests Single quotes --- ee/app/views/admin/geo/nodes/index.html.haml | 3 ++- .../views/shared/empty_states/_geo.html.haml | 8 ++++---- .../9233-update-explore-geo-page.yml | 5 +++++ .../features/admin/geo/admin_geo_nodes_spec.rb | 18 ++++++++++++++++++ 4 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 ee/changelogs/unreleased/9233-update-explore-geo-page.yml diff --git a/ee/app/views/admin/geo/nodes/index.html.haml b/ee/app/views/admin/geo/nodes/index.html.haml index 76aa55915a9460..1c765b3ff2bc08 100644 --- a/ee/app/views/admin/geo/nodes/index.html.haml +++ b/ee/app/views/admin/geo/nodes/index.html.haml @@ -6,7 +6,8 @@ .d-flex.align-items-center.border-bottom.border-default.mb-4 %h2.page-title = _("Geo Nodes") - = link_to s_("GeoNodes|New node"), new_admin_geo_node_path, class: 'btn btn-success ml-auto qa-new-node-link' + - if @nodes.any? + = link_to s_("GeoNodes|New node"), new_admin_geo_node_path, class: 'btn btn-success ml-auto qa-new-node-link' %p.page-subtitle.light = s_('GeoNodes|With %{geo} you can install a special read-only and replicated instance anywhere. Before you add nodes, follow the %{instructions} in the exact order they appear.').html_safe % { geo: link_to('GitLab Geo', help_page_path('administration/geo/replication/index.md'), target: '_blank'), instructions: link_to('setup instructions', help_page_path('administration/geo/replication/index.md', anchor: 'setup-instructions'), target: '_blank') } diff --git a/ee/app/views/shared/empty_states/_geo.html.haml b/ee/app/views/shared/empty_states/_geo.html.haml index 2f10bdaa7926f3..446647f1cc19a9 100644 --- a/ee/app/views/shared/empty_states/_geo.html.haml +++ b/ee/app/views/shared/empty_states/_geo.html.haml @@ -4,7 +4,7 @@ = image_tag 'illustrations/gitlab_geo.svg' .col-12 .text-content - %h4.text-center= _("Discover GitLab Geo") - %p= _("Make everyone on your team more productive regardless of their location. GitLab Geo creates read-only mirrors of your GitLab instance so you can reduce the time it takes to clone and fetch large repos.") - .text-center - = link_to _('Learn more'), 'https://about.gitlab.com/features/gitlab-geo/', rel: 'nofollow', class: 'btn btn-success' + %h4.text-center= _('Discover GitLab Geo') + %p + = _('Make everyone on your team more productive regardless of their location. GitLab Geo creates read-only mirrors of your GitLab instance so you can reduce the time it takes to clone and fetch large repos.') + = link_to _('More information'), 'https://about.gitlab.com/features/gitlab-geo/', rel: 'nofollow' diff --git a/ee/changelogs/unreleased/9233-update-explore-geo-page.yml b/ee/changelogs/unreleased/9233-update-explore-geo-page.yml new file mode 100644 index 00000000000000..5452eebea721cf --- /dev/null +++ b/ee/changelogs/unreleased/9233-update-explore-geo-page.yml @@ -0,0 +1,5 @@ +--- +title: Update Explore Geo Page +merge_request: 21448 +author: +type: changed diff --git a/ee/spec/features/admin/geo/admin_geo_nodes_spec.rb b/ee/spec/features/admin/geo/admin_geo_nodes_spec.rb index b1e8afb711cba5..2ebde531352bbb 100644 --- a/ee/spec/features/admin/geo/admin_geo_nodes_spec.rb +++ b/ee/spec/features/admin/geo/admin_geo_nodes_spec.rb @@ -199,4 +199,22 @@ expect(page).not_to have_css('.card') end end + + describe 'with no Geo Nodes' do + before do + geo_node.delete + visit admin_geo_nodes_path + wait_for_requests + end + + it 'hides the New Node button' do + expect(page).not_to have_link('New node', href: new_admin_geo_node_path) + end + + it 'shows Discover GitLab Geo' do + page.within(find('h4')) do + expect(page).to have_content('Discover GitLab Geo') + end + end + end end -- GitLab