diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-06 12:12:47 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-06 12:12:47 +0300 |
commit | 08608c8e9e9821858dd2f452a3c9ebfb945ab69f (patch) | |
tree | c3450c88bef3c68d70c4f814858913aafce5a59f /app/assets/javascripts | |
parent | 50b6f6a78828c6a455887b1ba2bdc049b1b1eff2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts')
4 files changed, 0 insertions, 144 deletions
diff --git a/app/assets/javascripts/security_configuration/components/constants.js b/app/assets/javascripts/security_configuration/components/constants.js index da213b0ed43..fd713a7a504 100644 --- a/app/assets/javascripts/security_configuration/components/constants.js +++ b/app/assets/javascripts/security_configuration/components/constants.js @@ -1,6 +1,5 @@ import { helpPagePath } from '~/helpers/help_page_helper'; import { __, s__ } from '~/locale'; -import ContinuousVulnerabilityScan from '~/security_configuration/components/continuous_vulnerability_scan.vue'; import { REPORT_TYPE_SAST, @@ -211,7 +210,6 @@ export const securityFeatures = [ configurationHelpPath: DEPENDENCY_SCANNING_CONFIG_HELP_PATH, type: REPORT_TYPE_DEPENDENCY_SCANNING, anchor: 'dependency-scanning', - slotComponent: ContinuousVulnerabilityScan, }, { name: CONTAINER_SCANNING_NAME, diff --git a/app/assets/javascripts/security_configuration/components/continuous_vulnerability_scan.vue b/app/assets/javascripts/security_configuration/components/continuous_vulnerability_scan.vue deleted file mode 100644 index df648f665c7..00000000000 --- a/app/assets/javascripts/security_configuration/components/continuous_vulnerability_scan.vue +++ /dev/null @@ -1,133 +0,0 @@ -<script> -import { GlBadge, GlIcon, GlToggle, GlLink, GlSprintf, GlAlert } from '@gitlab/ui'; -import ProjectSetContinuousVulnerabilityScanning from '~/security_configuration/graphql/project_set_continuous_vulnerability_scanning.graphql'; -import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; -import { __, s__ } from '~/locale'; -import { helpPagePath } from '~/helpers/help_page_helper'; - -export default { - name: 'ContinuousVulnerabilityscan', - components: { GlBadge, GlIcon, GlToggle, GlLink, GlSprintf, GlAlert }, - mixins: [glFeatureFlagsMixin()], - inject: ['continuousVulnerabilityScansEnabled', 'projectFullPath'], - i18n: { - badgeLabel: __('Experiment'), - title: s__('CVS|Continuous Vulnerability Scan'), - description: s__( - 'CVS|Detect vulnerabilities outside a pipeline as new data is added to the GitLab Advisory Database.', - ), - learnMore: __('Learn more'), - testingAgreementMessage: s__( - 'CVS|By enabling this feature, you accept the %{linkStart}Testing Terms of Use%{linkEnd}', - ), - }, - props: { - feature: { - type: Object, - required: true, - }, - }, - data() { - return { - toggleValue: this.continuousVulnerabilityScansEnabled, - errorMessage: '', - isAlertDismissed: false, - }; - }, - computed: { - isFeatureConfigured() { - return this.feature.available && this.feature.configured; - }, - shouldShowAlert() { - return this.errorMessage && !this.isAlertDismissed; - }, - hasCvsSection() { - return ( - this.glFeatures.dependencyScanningOnAdvisoryIngestion && - !this.glFeatures.globalDependencyScanningOnAdvisoryIngestion - ); - }, - }, - methods: { - reportError(error) { - this.errorMessage = error; - this.isAlertDismissed = false; - }, - async toggleCVS(checked) { - try { - const { data } = await this.$apollo.mutate({ - mutation: ProjectSetContinuousVulnerabilityScanning, - variables: { - input: { - projectPath: this.projectFullPath, - enable: checked, - }, - }, - }); - - const { errors } = data.projectSetContinuousVulnerabilityScanning; - - if (errors.length > 0) { - this.reportError(errors[0].message); - } - if (data.projectSetContinuousVulnerabilityScanning !== null) { - this.toggleValue = checked; - } - } catch (error) { - this.reportError(error); - } - }, - }, - CVSHelpPagePath: helpPagePath( - 'user/application_security/continuous_vulnerability_scanning/index', - ), - experimentHelpPagePath: helpPagePath('policy/experiment-beta-support', { anchor: 'experiment' }), -}; -</script> - -<template> - <div v-if="hasCvsSection"> - <h4 class="gl-font-base gl-m-0 gl-mt-6"> - {{ $options.i18n.title }} - <gl-badge - ref="badge" - :href="$options.experimentHelpPagePath" - target="_blank" - size="sm" - variant="neutral" - class="gl-cursor-pointer" - >{{ $options.i18n.badgeLabel }}</gl-badge - > - </h4> - <gl-alert - v-if="shouldShowAlert" - class="gl-mb-5 gl-mt-2" - variant="danger" - @dismiss="isAlertDismissed = true" - >{{ errorMessage }}</gl-alert - > - <gl-toggle - class="gl-mt-5" - :disabled="!isFeatureConfigured" - :value="toggleValue" - :label="s__('CVS|Toggle CVS')" - label-position="hidden" - @change="toggleCVS" - /> - - <p class="gl-mb-0 gl-mt-5"> - {{ $options.i18n.description }} - <gl-link :href="$options.CVSHelpPagePath" target="_blank">{{ - $options.i18n.learnMore - }}</gl-link> - <br /> - <gl-sprintf :message="$options.i18n.testingAgreementMessage"> - <template #link="{ content }"> - <gl-link href="https://about.gitlab.com/handbook/legal/testing-agreement" target="_blank"> - {{ content }} <gl-icon name="external-link" /> - </gl-link> - </template> - </gl-sprintf> - </p> - </div> -</template> diff --git a/app/assets/javascripts/security_configuration/components/feature_card.vue b/app/assets/javascripts/security_configuration/components/feature_card.vue index 395bdad5dcc..2100da78219 100644 --- a/app/assets/javascripts/security_configuration/components/feature_card.vue +++ b/app/assets/javascripts/security_configuration/components/feature_card.vue @@ -73,9 +73,6 @@ export default { hasSecondary() { return Boolean(this.feature.secondary); }, - hasSlotComponent() { - return Boolean(this.feature.slotComponent); - }, // This condition is a temporary hack to not display any wrong information // until this BE Bug is fixed: https://gitlab.com/gitlab-org/gitlab/-/issues/350307. // More Information: https://gitlab.com/gitlab-org/gitlab/-/issues/350307#note_825447417 @@ -221,9 +218,5 @@ export default { {{ $options.i18n.configurationGuide }} </gl-button> </div> - - <div v-if="hasSlotComponent"> - <component :is="feature.slotComponent" :feature="feature" /> - </div> </gl-card> </template> diff --git a/app/assets/javascripts/security_configuration/index.js b/app/assets/javascripts/security_configuration/index.js index 4b498091134..aa3c9c87622 100644 --- a/app/assets/javascripts/security_configuration/index.js +++ b/app/assets/javascripts/security_configuration/index.js @@ -26,7 +26,6 @@ export const initSecurityConfiguration = (el) => { autoDevopsHelpPagePath, autoDevopsPath, vulnerabilityTrainingDocsPath, - continuousVulnerabilityScansEnabled, } = el.dataset; const { augmentedSecurityFeatures } = augmentFeatures( @@ -44,7 +43,6 @@ export const initSecurityConfiguration = (el) => { autoDevopsHelpPagePath, autoDevopsPath, vulnerabilityTrainingDocsPath, - continuousVulnerabilityScansEnabled, }, render(createElement) { return createElement(SecurityConfigurationApp, { |