Commit ecf0b833 authored by Alan (Maciej) Paruszewski's avatar Alan (Maciej) Paruszewski Committed by Natalia Tepluhina

Enable Configure with a MR button for Container Scanning

Changelog: added
EE: true
parent d8b88f51
...@@ -217,6 +217,10 @@ export const securityFeatures = [ ...@@ -217,6 +217,10 @@ export const securityFeatures = [
helpPath: CONTAINER_SCANNING_HELP_PATH, helpPath: CONTAINER_SCANNING_HELP_PATH,
configurationHelpPath: CONTAINER_SCANNING_CONFIG_HELP_PATH, configurationHelpPath: CONTAINER_SCANNING_CONFIG_HELP_PATH,
type: REPORT_TYPE_CONTAINER_SCANNING, type: REPORT_TYPE_CONTAINER_SCANNING,
// This field will eventually come from the backend, the progress is
// tracked in https://gitlab.com/gitlab-org/gitlab/-/issues/331621
canEnableByMergeRequest: true,
}, },
{ {
name: CLUSTER_IMAGE_SCANNING_NAME, name: CLUSTER_IMAGE_SCANNING_NAME,
......
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import { featureToMutationMap as featureToMutationMapCE } from '~/security_configuration/components/constants'; import { featureToMutationMap as featureToMutationMapCE } from '~/security_configuration/components/constants';
import { REPORT_TYPE_DEPENDENCY_SCANNING } from '~/vue_shared/security_reports/constants'; import {
REPORT_TYPE_DEPENDENCY_SCANNING,
REPORT_TYPE_CONTAINER_SCANNING,
} from '~/vue_shared/security_reports/constants';
import configureDependencyScanningMutation from '../graphql/configure_dependency_scanning.mutation.graphql'; import configureDependencyScanningMutation from '../graphql/configure_dependency_scanning.mutation.graphql';
import configureContainerScanningMutation from '../graphql/configure_container_scanning.mutation.graphql';
export const SMALL = 'SMALL'; export const SMALL = 'SMALL';
export const MEDIUM = 'MEDIUM'; export const MEDIUM = 'MEDIUM';
...@@ -32,6 +36,17 @@ export const featureToMutationMap = { ...@@ -32,6 +36,17 @@ export const featureToMutationMap = {
}, },
}), }),
}, },
[REPORT_TYPE_CONTAINER_SCANNING]: {
mutationId: 'configureContainerScanning',
getMutationPayload: (projectPath) => ({
mutation: configureContainerScanningMutation,
variables: {
input: {
projectPath,
},
},
}),
},
}; };
export const CONFIGURATION_SNIPPET_MODAL_ID = 'CONFIGURATION_SNIPPET_MODAL_ID'; export const CONFIGURATION_SNIPPET_MODAL_ID = 'CONFIGURATION_SNIPPET_MODAL_ID';
mutation configureContainerScanning($input: ConfigureContainerScanningInput!) {
configureContainerScanning(input: $input) {
successPath
errors
}
}
...@@ -132,7 +132,7 @@ RSpec.describe 'User sees Security Configuration table', :js do ...@@ -132,7 +132,7 @@ RSpec.describe 'User sees Security Configuration table', :js do
within_container_scanning_card do within_container_scanning_card do
expect(page).to have_text('Container Scanning') expect(page).to have_text('Container Scanning')
expect(page).to have_text('Not enabled') expect(page).to have_text('Not enabled')
expect(page).to have_link('Configuration guide') expect(page).to have_button('Configure with a merge request')
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment