Commit d13e07de authored by Andrew Fontaine's avatar Andrew Fontaine

Merge branch 'jnnkl-sast-iac-no-state-security-config-page' into 'master'

Hide state and configure Button for Sast_Iac on Security Config Page

See merge request gitlab-org/gitlab!83757
parents d8490ec6 749caf60
......@@ -2,6 +2,7 @@
import { GlButton, GlCard, GlIcon, GlLink } from '@gitlab/ui';
import { __, s__, sprintf } from '~/locale';
import ManageViaMr from '~/vue_shared/security_configuration/components/manage_via_mr.vue';
import { REPORT_TYPE_SAST_IAC } from '~/vue_shared/security_reports/constants';
export default {
components: {
......@@ -61,6 +62,12 @@ export default {
const { name, description, configurationText } = this.feature.secondary ?? {};
return Boolean(name && description && configurationText);
},
// 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
isNotSastIACTemporaryHack() {
return this.feature.type !== REPORT_TYPE_SAST_IAC;
},
},
methods: {
onError(message) {
......@@ -85,6 +92,7 @@ export default {
<h3 class="gl-font-lg gl-m-0 gl-mr-3">{{ feature.name }}</h3>
<div
v-if="isNotSastIACTemporaryHack"
:class="statusClasses"
data-testid="feature-status"
:data-qa-selector="`${feature.type}_status`"
......@@ -109,7 +117,7 @@ export default {
<gl-link :href="feature.helpPath">{{ $options.i18n.learnMore }}</gl-link>
</p>
<template v-if="available">
<template v-if="available && isNotSastIACTemporaryHack">
<gl-button
v-if="feature.configurationPath"
:href="feature.configurationPath"
......
......@@ -56,13 +56,8 @@ RSpec.describe 'User sees Security Configuration table', :js do
within_sast_iac_card do
expect(page).to have_text('Infrastructure as Code (IaC) Scanning')
expect(page).to have_text('Not enabled')
expect(page).to have_button('Configure with a merge request')
click_button 'Configure with a merge request'
wait_for_requests
expect(page).to have_current_path(project_new_merge_request_path(project), ignore_query: true)
expect(page).not_to have_text('Not enabled')
expect(page).not_to have_button('Configure with a merge request')
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