Commit 826ed46f authored by Neil McCorrison's avatar Neil McCorrison Committed by Natalia Tepluhina

Moved secure config documentation links

Updating security configuration documentation
parent 0d076e5e
......@@ -19,8 +19,9 @@ then in the left sidebar go to **Security & Compliance > Configuration**.
For each security control the page displays:
- **Status** - Status of the security control: enabled, not enabled, or available.
- **Manage** - A management option or a link to the documentation.
- **Security Control:** Name, description, and a documentation link.
- **Status:** The security control's status (enabled, not enabled, or available).
- **Manage:** A management option or a documentation link.
## Status
......
<script>
import { GlAlert, GlLink, GlSprintf, GlTable } from '@gitlab/ui';
import { parseBoolean } from '~/lib/utils/common_utils';
import { s__, __ } from '~/locale';
import { sprintf, s__, __ } from '~/locale';
import LocalStorageSync from '~/vue_shared/components/local_storage_sync.vue';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import AutoFixSettings from './auto_fix_settings.vue';
......@@ -124,6 +124,11 @@ export default {
dismissAutoDevopsAlert() {
this.autoDevopsAlertDismissed = 'true';
},
getFeatureDocumentationLinkLabel(item) {
return sprintf(s__('SecurityConfiguration|Feature documentation for %{featureName}'), {
featureName: item.name,
});
},
},
autoDevopsAlertMessage: s__(`
SecurityConfiguration|You can quickly enable all security scanning tools by
......@@ -171,6 +176,14 @@ export default {
<div class="gl-text-gray-900">{{ item.name }}</div>
<div>
{{ item.description }}
<gl-link
target="_blank"
:href="item.link"
:aria-label="getFeatureDocumentationLinkLabel(item)"
data-testid="docsLink"
>
{{ s__('SecurityConfiguration|More information') }}
</gl-link>
</div>
</template>
......
<script>
import { GlButton, GlLink } from '@gitlab/ui';
import { sprintf, s__ } from '~/locale';
import { GlButton } from '@gitlab/ui';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import CreateMergeRequestButton from './create_merge_request_button.vue';
export default {
components: {
GlButton,
GlLink,
CreateMergeRequestButton,
},
mixins: [glFeatureFlagsMixin()],
......@@ -36,11 +34,6 @@ export default {
canManageProfiles() {
return this.feature.type === 'dast_profiles';
},
getFeatureDocumentationLinkLabel() {
return sprintf(s__('SecurityConfiguration|Feature documentation for %{featureName}'), {
featureName: this.feature.name,
});
},
},
};
</script>
......@@ -77,14 +70,4 @@ export default {
:auto-devops-enabled="autoDevopsEnabled"
:endpoint="createSastMergeRequestPath"
/>
<gl-link
v-else
target="_blank"
:href="feature.link"
:aria-label="getFeatureDocumentationLinkLabel"
data-testid="docsLink"
>
{{ s__('SecurityConfiguration|See documentation') }}
</gl-link>
</template>
......@@ -31,7 +31,7 @@ module Projects
license_scanning: _('Search your project dependencies for their licenses and apply policies.'),
sast: _('Analyze your source code for known vulnerabilities.'),
secret_detection: _('Analyze your source code and git history for secrets.'),
coverage_fuzzing: _('Find bugs in your code with coverage-guided fuzzing')
coverage_fuzzing: _('Find bugs in your code with coverage-guided fuzzing.')
}.freeze
end
......
---
title: Security configuration page documentation links are now always available
merge_request: 42765
author:
type: changed
......@@ -185,6 +185,7 @@ describe('Security Configuration App', () => {
autoDevopsEnabled: propsData.autoDevopsEnabled,
createSastMergeRequestPath: propsData.createSastMergeRequestPath,
});
expect(feature.find(GlLink).props('href')).toBe(features[i].href);
}
});
});
......
......@@ -101,21 +101,4 @@ describe('ManageFeature component', () => {
expect(button.attributes('href')).toBe(feature.configuration_path);
});
});
describe('given a feature type that is not "sast"', () => {
beforeEach(() => {
[feature] = generateFeatures(1, { type: 'something_that_is_not_sast' });
createComponent({
propsData: { feature },
});
});
it('shows docs link for feature', () => {
const link = findTestId('docsLink');
expect(link.exists()).toBe(true);
expect(link.attributes('aria-label')).toContain(feature.name);
expect(link.attributes('href')).toBe(feature.link);
});
});
});
......@@ -11171,7 +11171,7 @@ msgstr ""
msgid "Find File"
msgstr ""
msgid "Find bugs in your code with coverage-guided fuzzing"
msgid "Find bugs in your code with coverage-guided fuzzing."
msgstr ""
msgid "Find by path"
......@@ -22451,6 +22451,9 @@ msgstr ""
msgid "SecurityConfiguration|Manage"
msgstr ""
msgid "SecurityConfiguration|More information"
msgstr ""
msgid "SecurityConfiguration|Not enabled"
msgstr ""
......@@ -22463,9 +22466,6 @@ msgstr ""
msgid "SecurityConfiguration|Security Control"
msgstr ""
msgid "SecurityConfiguration|See documentation"
msgstr ""
msgid "SecurityConfiguration|Status"
msgstr ""
......
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