From 6b39269bc882c8b06f50dd793459aaa2cb6c23f0 Mon Sep 17 00:00:00 2001
From: Tristan Read <tread@gitlab.com>
Date: Tue, 20 Jun 2023 13:25:03 +0000
Subject: [PATCH] Delete cluster integration UI

---
 .../javascripts/clusters/forms/show/index.js     |  3 ---
 app/helpers/clusters_helper.rb                   |  6 ------
 .../clusters/clusters/_integrations.html.haml    | 16 ----------------
 .../clusters/_integrations_tab.html.haml         |  4 ----
 app/views/clusters/clusters/show.html.haml       |  1 -
 locale/gitlab.pot                                | 12 ------------
 spec/helpers/clusters_helper_spec.rb             | 15 ---------------
 7 files changed, 57 deletions(-)
 delete mode 100644 app/views/clusters/clusters/_integrations.html.haml
 delete mode 100644 app/views/clusters/clusters/_integrations_tab.html.haml

diff --git a/app/assets/javascripts/clusters/forms/show/index.js b/app/assets/javascripts/clusters/forms/show/index.js
index 102b240042fbd..3cb4376f41a57 100644
--- a/app/assets/javascripts/clusters/forms/show/index.js
+++ b/app/assets/javascripts/clusters/forms/show/index.js
@@ -1,11 +1,8 @@
 import Vue from 'vue';
-import dirtySubmitFactory from '~/dirty_submit/dirty_submit_factory';
 import IntegrationForm from '../components/integration_form.vue';
 import { createStore } from '../stores';
 
 export default () => {
-  dirtySubmitFactory(document.querySelectorAll('.js-cluster-integrations-form'));
-
   const entryPoint = document.querySelector('#js-cluster-details-form');
 
   if (!entryPoint) {
diff --git a/app/helpers/clusters_helper.rb b/app/helpers/clusters_helper.rb
index 458d81b34010d..5c410a28229af 100644
--- a/app/helpers/clusters_helper.rb
+++ b/app/helpers/clusters_helper.rb
@@ -57,12 +57,6 @@ def render_cluster_info_tab_content(tab, expanded)
       render_if_exists 'clusters/clusters/environments'
     when 'apps'
       render 'applications'
-    when 'integrations'
-      if Feature.enabled?(:remove_monitor_metrics)
-        render('details', expanded: expanded)
-      else
-        render 'integrations'
-      end
     when 'settings'
       render 'advanced_settings_container'
     else
diff --git a/app/views/clusters/clusters/_integrations.html.haml b/app/views/clusters/clusters/_integrations.html.haml
deleted file mode 100644
index 4d36c5094a30d..0000000000000
--- a/app/views/clusters/clusters/_integrations.html.haml
+++ /dev/null
@@ -1,16 +0,0 @@
-.settings.expanded.border-0.m-0
-  %p
-    = s_('ClusterIntegration|Integrations allow you to use applications installed in your cluster as part of your GitLab workflow.')
-    = link_to _('Learn more'), help_page_path('user/clusters/integrations.md'), target: '_blank', rel: 'noopener noreferrer'
-  .settings-content#integrations-settings-section
-    - if can?(current_user, :admin_cluster, @cluster)
-      .sub-section.form-group
-        = gitlab_ui_form_for @prometheus_integration, as: :integration, namespace: :prometheus, url: @cluster.integrations_path, method: :post, html: { class: 'js-cluster-integrations-form' } do |prometheus_form|
-          = prometheus_form.hidden_field :application_type, value: @prometheus_integration.application_type
-          .form-group.gl-form-group
-            - help_text = s_('ClusterIntegration|Allows GitLab to query a specifically configured in-cluster Prometheus for metrics.')
-            - help_link = link_to(_('More information.'), help_page_path("user/clusters/integrations"), target: '_blank', rel: 'noopener noreferrer')
-            = prometheus_form.gitlab_ui_checkbox_component :enabled,
-                s_('ClusterIntegration|Enable Prometheus integration'),
-                help_text: '%{help_text} %{help_link}'.html_safe % { help_text: help_text, help_link: help_link }
-          = prometheus_form.submit _('Save changes'), class: 'btn gl-button btn-confirm'
diff --git a/app/views/clusters/clusters/_integrations_tab.html.haml b/app/views/clusters/clusters/_integrations_tab.html.haml
deleted file mode 100644
index e229c1fbe1e34..0000000000000
--- a/app/views/clusters/clusters/_integrations_tab.html.haml
+++ /dev/null
@@ -1,4 +0,0 @@
-- active = params[:tab] == 'integrations'
-
-= gl_tab_link_to clusterable.cluster_path(@cluster.id, params: { tab: 'integrations' }), { item_active: active } do
-  = _('Integrations')
diff --git a/app/views/clusters/clusters/show.html.haml b/app/views/clusters/clusters/show.html.haml
index 57de6d980f875..1287f4e689f15 100644
--- a/app/views/clusters/clusters/show.html.haml
+++ b/app/views/clusters/clusters/show.html.haml
@@ -32,7 +32,6 @@
       = gl_tabs_nav do
         = render 'clusters/clusters/details_tab'
         = render_if_exists 'clusters/clusters/environments_tab'
-        = render 'clusters/clusters/integrations_tab' if !Feature.enabled?(:remove_monitor_metrics)
         = render 'clusters/clusters/advanced_settings_tab'
 
       .tab-content.py-3
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index e10cdc26da988..3cd30a587d8fe 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -10692,9 +10692,6 @@ msgstr ""
 msgid "ClusterIntegration|Allow GitLab to manage namespaces and service accounts for this cluster."
 msgstr ""
 
-msgid "ClusterIntegration|Allows GitLab to query a specifically configured in-cluster Prometheus for metrics."
-msgstr ""
-
 msgid "ClusterIntegration|Amazon EKS"
 msgstr ""
 
@@ -10779,9 +10776,6 @@ msgstr ""
 msgid "ClusterIntegration|Elastic Kubernetes Service"
 msgstr ""
 
-msgid "ClusterIntegration|Enable Prometheus integration"
-msgstr ""
-
 msgid "ClusterIntegration|Enable or disable GitLab's connection to your Kubernetes cluster."
 msgstr ""
 
@@ -10842,9 +10836,6 @@ msgstr ""
 msgid "ClusterIntegration|Integration enabled"
 msgstr ""
 
-msgid "ClusterIntegration|Integrations allow you to use applications installed in your cluster as part of your GitLab workflow."
-msgstr ""
-
 msgid "ClusterIntegration|Kubernetes cluster is being created..."
 msgstr ""
 
@@ -29594,9 +29585,6 @@ msgstr ""
 msgid "More information is available|here"
 msgstr ""
 
-msgid "More information."
-msgstr ""
-
 msgid "More options"
 msgstr ""
 
diff --git a/spec/helpers/clusters_helper_spec.rb b/spec/helpers/clusters_helper_spec.rb
index a18c82a80ed1e..a9fbdfbe3ca74 100644
--- a/spec/helpers/clusters_helper_spec.rb
+++ b/spec/helpers/clusters_helper_spec.rb
@@ -224,21 +224,6 @@
         subject
       end
     end
-
-    context 'when remove_monitor_metrics FF is disabled' do
-      before do
-        stub_feature_flags(remove_monitor_metrics: false)
-      end
-
-      context 'integrations ' do
-        let(:tab) { 'integrations' }
-
-        it 'renders integrations tab' do
-          expect(helper).to receive(:render).with('integrations')
-          subject
-        end
-      end
-    end
   end
 
   describe '#cluster_type_label' do
-- 
GitLab