summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/clusters
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/clusters')
-rw-r--r--app/assets/javascripts/clusters/clusters_bundle.js3
-rw-r--r--app/assets/javascripts/clusters/components/ingress_modsecurity_settings.vue8
-rw-r--r--app/assets/javascripts/clusters/components/remove_cluster_confirmation.vue19
3 files changed, 21 insertions, 9 deletions
diff --git a/app/assets/javascripts/clusters/clusters_bundle.js b/app/assets/javascripts/clusters/clusters_bundle.js
index f15efb2fdeb..83bdea15e62 100644
--- a/app/assets/javascripts/clusters/clusters_bundle.js
+++ b/app/assets/javascripts/clusters/clusters_bundle.js
@@ -222,7 +222,7 @@ export default class Clusters {
initRemoveClusterActions() {
const el = document.querySelector('#js-cluster-remove-actions');
if (el && el.dataset) {
- const { clusterName, clusterPath } = el.dataset;
+ const { clusterName, clusterPath, hasManagementProject } = el.dataset;
this.removeClusterAction = new Vue({
el,
@@ -231,6 +231,7 @@ export default class Clusters {
props: {
clusterName,
clusterPath,
+ hasManagementProject,
},
});
},
diff --git a/app/assets/javascripts/clusters/components/ingress_modsecurity_settings.vue b/app/assets/javascripts/clusters/components/ingress_modsecurity_settings.vue
index 54f5468bdd0..87c3225085f 100644
--- a/app/assets/javascripts/clusters/components/ingress_modsecurity_settings.vue
+++ b/app/assets/javascripts/clusters/components/ingress_modsecurity_settings.vue
@@ -198,13 +198,7 @@ export default {
</strong>
</p>
<div class="form-check form-check-inline mt-3">
- <gl-toggle
- v-model="modSecurityEnabled"
- :label-on="__('Enabled')"
- :label-off="__('Disabled')"
- :disabled="saveButtonDisabled"
- label-position="right"
- />
+ <gl-toggle v-model="modSecurityEnabled" :disabled="saveButtonDisabled" />
</div>
<div
v-if="ingress.modsecurity_enabled"
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"