From a09983ae35713f5a2bbb100981116d31ce99826e Mon Sep 17 00:00:00 2001
From: GitLab Bot <gitlab-bot@gitlab.com>
Date: Mon, 20 Jul 2020 12:26:25 +0000
Subject: Add latest changes from gitlab-org/gitlab@13-2-stable-ee

---
 .../components/remove_cluster_confirmation.vue        | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

(limited to 'app/assets/javascripts/clusters/components/remove_cluster_confirmation.vue')

diff --git a/app/assets/javascripts/clusters/components/remove_cluster_confirmation.vue b/app/assets/javascripts/clusters/components/remove_cluster_confirmation.vue
index c5375cbfbdc..45f2dd48961 100644
--- a/app/assets/javascripts/clusters/components/remove_cluster_confirmation.vue
+++ b/app/assets/javascripts/clusters/components/remove_cluster_confirmation.vue
@@ -1,7 +1,7 @@
 <script>
 import { escape } from 'lodash';
 import SplitButton from '~/vue_shared/components/split_button.vue';
-import { GlModal, GlDeprecatedButton, GlFormInput } from '@gitlab/ui';
+import { GlModal, GlButton, GlDeprecatedButton, GlFormInput } from '@gitlab/ui';
 import { s__, sprintf } from '~/locale';
 import csrf from '~/lib/utils/csrf';
 
@@ -27,6 +27,7 @@ export default {
   components: {
     SplitButton,
     GlModal,
+    GlButton,
     GlDeprecatedButton,
     GlFormInput,
   },
@@ -39,6 +40,10 @@ export default {
       type: String,
       required: true,
     },
+    hasManagementProject: {
+      type: Boolean,
+      required: false,
+    },
   },
   data() {
     return {
@@ -90,6 +95,9 @@ export default {
     canSubmit() {
       return this.enteredClusterName === this.clusterName;
     },
+    canCleanupResources() {
+      return !this.hasManagementProject;
+    },
   },
   methods: {
     handleClickRemoveCluster(cleanup = false) {
@@ -112,12 +120,21 @@ export default {
 <template>
   <div>
     <split-button
+      v-if="canCleanupResources"
       :action-items="$options.splitButtonActionItems"
       menu-class="dropdown-menu-large"
       variant="danger"
       @remove-cluster="handleClickRemoveCluster(false)"
       @remove-cluster-and-cleanup="handleClickRemoveCluster(true)"
     />
+    <gl-button
+      v-else
+      variant="danger"
+      data-testid="btnRemove"
+      @click="handleClickRemoveCluster(false)"
+    >
+      {{ s__('ClusterIntegration|Remove integration') }}
+    </gl-button>
     <gl-modal
       ref="modal"
       size="lg"
-- 
cgit v1.2.1

