Commit 61930db9 authored by Emily Ring's avatar Emily Ring Committed by Kushal Pandya

Remove feature flag clusters_list_redesign

Remove feature flag
Remove haml files no longer being used
Updated associated tests
parent 92116078
...@@ -42,14 +42,6 @@ module ClustersHelper ...@@ -42,14 +42,6 @@ module ClustersHelper
} }
end end
# This method is depreciated and will be removed when associated HAML files are moved to JavaScript
def provider_icon(provider = nil)
img_data = js_clusters_list_data.dig(:img_tags, provider&.to_sym) ||
js_clusters_list_data.dig(:img_tags, :default)
image_tag img_data[:path], alt: img_data[:text], class: 'gl-h-full'
end
def render_gcp_signup_offer def render_gcp_signup_offer
return if Gitlab::CurrentSettings.current_application_settings.hide_third_party_offers? return if Gitlab::CurrentSettings.current_application_settings.hide_third_party_offers?
return unless show_gcp_signup_offer? return unless show_gcp_signup_offer?
......
.nav-controls
- if clusterable.can_add_cluster?
= link_to s_('ClusterIntegration|Add Kubernetes cluster'), clusterable.new_path, class: 'btn btn-success js-add-cluster'
- else
%span.btn.btn-add-cluster.disabled.js-add-cluster
= s_("ClusterIntegration|Add Kubernetes cluster")
.card
.card-body.gl-responsive-table-row
.table-section.section-60
.table-mobile-header{ role: "rowheader" }= s_("ClusterIntegration|Kubernetes cluster")
.table-mobile-content.gl-display-flex.gl-align-items-center.gl-justify-content-end.gl-justify-content-md-start
.gl-w-6.gl-h-6.gl-mr-3.gl-display-flex.gl-align-items-center= provider_icon(cluster.provider_type)
= cluster.item_link(clusterable, html_options: { data: { qa_selector: 'cluster', qa_cluster_name: cluster.name } })
- if cluster.status_name == :creating
.spinner.ml-2.align-middle.has-tooltip{ title: s_("ClusterIntegration|Cluster being created") }
- unless cluster.enabled?
%span.badge.badge-danger Connection disabled
.table-section.section-25
.table-mobile-header{ role: "rowheader" }= s_("ClusterIntegration|Environment scope")
.table-mobile-content= cluster.environment_scope
.table-section.section-15.text-right
.table-mobile-header{ role: "rowheader" }
.table-mobile-content
%span.badge.badge-light
= cluster.cluster_type_description
...@@ -10,23 +10,11 @@ ...@@ -10,23 +10,11 @@
.top-area.adjust .top-area.adjust
.nav-text .nav-text
= s_('ClusterIntegration|Kubernetes clusters can be used to deploy applications and to provide Review Apps for this project') = s_('ClusterIntegration|Kubernetes clusters can be used to deploy applications and to provide Review Apps for this project')
= render 'clusters/clusters/buttons' .nav-controls
- if clusterable.can_add_cluster?
= link_to s_('ClusterIntegration|Add Kubernetes cluster'), clusterable.new_path, class: 'btn gl-button btn-success js-add-cluster'
- else
%span.btn.gl-button.btn-success.js-add-cluster.disabled
= s_("ClusterIntegration|Add Kubernetes cluster")
- if Feature.enabled?(:clusters_list_redesign, default_enabled: true) #js-clusters-list-app{ data: js_clusters_list_data(clusterable.index_path(format: :json)) }
#js-clusters-list-app{ data: js_clusters_list_data(clusterable.index_path(format: :json)) }
- else
- if @has_ancestor_clusters
.bs-callout.bs-callout-info
= s_('ClusterIntegration|Clusters are utilized by selecting the nearest ancestor with a matching environment scope. For example, project clusters will override group clusters.')
%strong
= link_to _('More information'), help_page_path('user/group/clusters/index', anchor: 'cluster-precedence')
.clusters-table.js-clusters-list{ data: { testid: 'cluster_list_table' } }
.gl-responsive-table-row.table-row-header{ role: "row" }
.table-section.section-60{ role: "rowheader" }
= s_("ClusterIntegration|Kubernetes cluster")
.table-section.section-30{ role: "rowheader" }
= s_("ClusterIntegration|Environment scope")
.table-section.section-10{ role: "rowheader" }
- @clusters.each do |cluster|
= render "cluster", cluster: cluster.present(current_user: current_user)
= paginate @clusters, theme: "gitlab"
---
name: clusters_list_redesign
introduced_by_url:
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/220182
group: Configure
type: development
default_enabled: true
...@@ -5472,9 +5472,6 @@ msgstr "" ...@@ -5472,9 +5472,6 @@ msgstr ""
msgid "ClusterIntegration|Clear the local cache of namespace and service accounts. This is necessary if your integration has become out of sync. The cache is repopulated during the next CI job that requires namespace and service accounts." msgid "ClusterIntegration|Clear the local cache of namespace and service accounts. This is necessary if your integration has become out of sync. The cache is repopulated during the next CI job that requires namespace and service accounts."
msgstr "" msgstr ""
msgid "ClusterIntegration|Cluster being created"
msgstr ""
msgid "ClusterIntegration|Cluster management project (alpha)" msgid "ClusterIntegration|Cluster management project (alpha)"
msgstr "" msgstr ""
...@@ -5484,9 +5481,6 @@ msgstr "" ...@@ -5484,9 +5481,6 @@ msgstr ""
msgid "ClusterIntegration|Cluster_applications artifact too big. Maximum allowable size: %{human_size}" msgid "ClusterIntegration|Cluster_applications artifact too big. Maximum allowable size: %{human_size}"
msgstr "" msgstr ""
msgid "ClusterIntegration|Clusters are utilized by selecting the nearest ancestor with a matching environment scope. For example, project clusters will override group clusters."
msgstr ""
msgid "ClusterIntegration|Clusters are utilized by selecting the nearest ancestor with a matching environment scope. For example, project clusters will override group clusters. %{linkStart}More information%{linkEnd}" msgid "ClusterIntegration|Clusters are utilized by selecting the nearest ancestor with a matching environment scope. For example, project clusters will override group clusters. %{linkStart}More information%{linkEnd}"
msgstr "" msgstr ""
...@@ -5751,9 +5745,6 @@ msgstr "" ...@@ -5751,9 +5745,6 @@ msgstr ""
msgid "ClusterIntegration|Knative extends Kubernetes to provide a set of middleware components that are essential to build modern, source-centric, and container-based applications that can run anywhere: on premises, in the cloud, or even in a third-party data center." msgid "ClusterIntegration|Knative extends Kubernetes to provide a set of middleware components that are essential to build modern, source-centric, and container-based applications that can run anywhere: on premises, in the cloud, or even in a third-party data center."
msgstr "" msgstr ""
msgid "ClusterIntegration|Kubernetes cluster"
msgstr ""
msgid "ClusterIntegration|Kubernetes cluster is being created..." msgid "ClusterIntegration|Kubernetes cluster is being created..."
msgstr "" msgstr ""
......
...@@ -13,36 +13,6 @@ RSpec.describe 'Clusters', :js do ...@@ -13,36 +13,6 @@ RSpec.describe 'Clusters', :js do
gitlab_sign_in(user) gitlab_sign_in(user)
end end
context 'when clusters_list_redesign feature flag is disabled' do
before do
stub_feature_flags(clusters_list_redesign: false)
end
context 'when user does not have a cluster and visits cluster index page' do
before do
visit project_clusters_path(project)
end
it 'sees empty state' do
expect(page).to have_link('Add Kubernetes cluster')
expect(page).to have_selector('.empty-state')
end
end
context 'when user has a cluster and visits cluster index page' do
let!(:cluster) { create(:cluster, :project, :provided_by_gcp) }
let(:project) { cluster.project }
before do
visit project_clusters_path(project)
end
it 'user sees a table with one cluster' do
expect(page).to have_selector('[data-testid="cluster_list_table"] .card-body', count: 1)
end
end
end
context 'when user does not have a cluster and visits cluster index page' do context 'when user does not have a cluster and visits cluster index page' do
before do before do
visit project_clusters_path(project) visit project_clusters_path(project)
......
...@@ -89,32 +89,6 @@ RSpec.describe ClustersHelper do ...@@ -89,32 +89,6 @@ RSpec.describe ClustersHelper do
end end
end end
describe '#provider_icon' do
it 'will return GCP logo with gcp argument' do
logo = helper.provider_icon('gcp')
expect(logo).to match(%r(img alt="Google GKE" data-src="|/illustrations/logos/google_gke|svg))
end
it 'will return AWS logo with aws argument' do
logo = helper.provider_icon('aws')
expect(logo).to match(%r(img alt="Amazon EKS" data-src="|/illustrations/logos/amazon_eks|svg))
end
it 'will return default logo with unknown provider' do
logo = helper.provider_icon('unknown')
expect(logo).to match(%r(img alt="Kubernetes Cluster" data-src="|/illustrations/logos/kubernetes|svg))
end
it 'will return default logo when provider is empty' do
logo = helper.provider_icon
expect(logo).to match(%r(img alt="Kubernetes Cluster" data-src="|/illustrations/logos/kubernetes|svg))
end
end
describe '#cluster_type_label' do describe '#cluster_type_label' do
subject { helper.cluster_type_label(cluster_type) } subject { helper.cluster_type_label(cluster_type) }
......
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