diff options
Diffstat (limited to 'app/assets/javascripts/security_configuration/components/manage_sast.vue')
-rw-r--r-- | app/assets/javascripts/security_configuration/components/manage_sast.vue | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/app/assets/javascripts/security_configuration/components/manage_sast.vue b/app/assets/javascripts/security_configuration/components/manage_sast.vue deleted file mode 100644 index 8a8827b41cd..00000000000 --- a/app/assets/javascripts/security_configuration/components/manage_sast.vue +++ /dev/null @@ -1,59 +0,0 @@ -<script> -import { GlButton } from '@gitlab/ui'; -import { redirectTo } from '~/lib/utils/url_utility'; -import { s__ } from '~/locale'; -import configureSastMutation from '~/security_configuration/graphql/configure_sast.mutation.graphql'; - -export default { - components: { - GlButton, - }, - inject: { - projectPath: { - from: 'projectPath', - default: '', - }, - }, - data() { - return { - isLoading: false, - }; - }, - methods: { - async mutate() { - this.isLoading = true; - try { - const { data } = await this.$apollo.mutate({ - mutation: configureSastMutation, - variables: { - input: { - projectPath: this.projectPath, - configuration: { global: [], pipeline: [], analyzers: [] }, - }, - }, - }); - const { errors, successPath } = data.configureSast; - - if (errors.length > 0) { - throw new Error(errors[0]); - } - - if (!successPath) { - throw new Error(s__('SecurityConfiguration|SAST merge request creation mutation failed')); - } - - redirectTo(successPath); - } catch (e) { - this.$emit('error', e.message); - this.isLoading = false; - } - }, - }, -}; -</script> - -<template> - <gl-button :loading="isLoading" variant="success" category="secondary" @click="mutate">{{ - s__('SecurityConfiguration|Configure via merge request') - }}</gl-button> -</template> |