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