From cd3e2c7b9355f8990ab294b34b5e4add4f3985fa Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 19 Feb 2020 12:09:13 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- app/assets/javascripts/clusters/clusters_bundle.js | 7 ++ .../clusters/components/applications.vue | 41 ++------ .../components/ingress_modsecurity_settings.vue | 116 +++++++++++++++++++++ .../javascripts/clusters/stores/clusters_store.js | 9 +- 4 files changed, 140 insertions(+), 33 deletions(-) create mode 100644 app/assets/javascripts/clusters/components/ingress_modsecurity_settings.vue (limited to 'app/assets/javascripts/clusters') diff --git a/app/assets/javascripts/clusters/clusters_bundle.js b/app/assets/javascripts/clusters/clusters_bundle.js index b764348eb3c..d35dca7b939 100644 --- a/app/assets/javascripts/clusters/clusters_bundle.js +++ b/app/assets/javascripts/clusters/clusters_bundle.js @@ -255,6 +255,7 @@ export default class Clusters { eventHub.$on('setKnativeHostname', data => this.setKnativeHostname(data)); eventHub.$on('uninstallApplication', data => this.uninstallApplication(data)); eventHub.$on('setCrossplaneProviderStack', data => this.setCrossplaneProviderStack(data)); + eventHub.$on('setIngressModSecurityEnabled', data => this.setIngressModSecurityEnabled(data)); // Add event listener to all the banner close buttons this.addBannerCloseHandler(this.unreachableContainer, 'unreachable'); this.addBannerCloseHandler(this.authenticationFailureContainer, 'authentication_failure'); @@ -268,6 +269,7 @@ export default class Clusters { eventHub.$off('setKnativeHostname'); eventHub.$off('setCrossplaneProviderStack'); eventHub.$off('uninstallApplication'); + eventHub.$off('setIngressModSecurityEnabled'); } initPolling(method, successCallback, errorCallback) { @@ -513,6 +515,11 @@ export default class Clusters { this.store.updateAppProperty(appId, 'validationError', null); } + setIngressModSecurityEnabled({ id, modSecurityEnabled }) { + this.store.updateAppProperty(id, 'isEditingModSecurityEnabled', true); + this.store.updateAppProperty(id, 'modsecurity_enabled', modSecurityEnabled); + } + destroy() { this.destroyed = true; diff --git a/app/assets/javascripts/clusters/components/applications.vue b/app/assets/javascripts/clusters/components/applications.vue index fe2ad562ad5..9429e10e6ed 100644 --- a/app/assets/javascripts/clusters/components/applications.vue +++ b/app/assets/javascripts/clusters/components/applications.vue @@ -21,6 +21,7 @@ import KnativeDomainEditor from './knative_domain_editor.vue'; import { CLUSTER_TYPE, PROVIDER_TYPE, APPLICATION_STATUS, INGRESS } from '../constants'; import eventHub from '~/clusters/event_hub'; import CrossplaneProviderStack from './crossplane_provider_stack.vue'; +import IngressModsecuritySettings from './ingress_modsecurity_settings.vue'; export default { components: { @@ -29,6 +30,7 @@ export default { GlLoadingIcon, KnativeDomainEditor, CrossplaneProviderStack, + IngressModsecuritySettings, }, props: { type: { @@ -129,18 +131,6 @@ export default { crossplaneInstalled() { return this.applications.crossplane.status === APPLICATION_STATUS.INSTALLED; }, - ingressModSecurityDescription() { - const escapedUrl = _.escape(this.ingressModSecurityHelpPath); - - return sprintf( - s__('ClusterIntegration|Learn more about %{startLink}ModSecurity%{endLink}'), - { - startLink: ``, - endLink: '', - }, - false, - ); - }, ingressDescription() { return sprintf( _.escape( @@ -241,6 +231,9 @@ Crossplane runs inside your Kubernetes cluster and supports secure connectivity } return null; }, + ingress() { + return this.applications.ingress; + }, }, created() { this.helmInstallIllustration = helmInstallIllustration; @@ -329,6 +322,7 @@ Crossplane runs inside your Kubernetes cluster and supports secure connectivity :uninstall-successful="applications.ingress.uninstallSuccessful" :uninstall-failed="applications.ingress.uninstallFailed" :disabled="!helmInstalled" + :updateable="false" title-link="https://kubernetes.io/docs/concepts/services-networking/ingress/" >
@@ -340,25 +334,10 @@ Crossplane runs inside your Kubernetes cluster and supports secure connectivity }}

- +