Commit 6e14f98b authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch '349903-enable-configure-with-mr-for-cs' into 'master'

Enable Configure with a MR button for Container Scanning

See merge request gitlab-org/gitlab!79202
parents b26fb357 ecf0b833
...@@ -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