Commit 42b0fe20 authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch 'show-container-scan-results' into 'master'

Add container scanning to dropdown

See merge request gitlab-org/gitlab-ee!9736
parents 96930627 a9ca0760
......@@ -55,7 +55,18 @@ export default {
v-if="filterId === 'report_type'"
:dashboard-documentation="dashboardDocumentation"
/>
<gl-dropdown :text="selectedOptionText" class="d-block mt-1">
<gl-dropdown class="d-block mt-1">
<template slot="button-content">
<span class="text-truncate">
{{ selectedOptionText.firstOption }}
</span>
<span v-if="selectedOptionText.extraOptionCount" class="flex-grow-1 ml-1">
{{ selectedOptionText.extraOptionCount }}
</span>
<i class="fa fa-chevron-down" aria-hidden="true"></i>
</template>
<gl-dropdown-item
v-for="option in filter.options"
:key="option.id"
......
......@@ -22,6 +22,7 @@ export const CONFIDENCE_LEVELS = {
};
export const REPORT_TYPES = {
sast: s__('ciReport|SAST'),
container_scanning: s__('ciReport|Container Scanning'),
dependency_scanning: s__('ciReport|Dependency Scanning'),
sast: s__('ciReport|SAST'),
};
......@@ -9,15 +9,15 @@ export const getSelectedOptions = (state, getters) => filterId => {
export const getSelectedOptionNames = (state, getters) => filterId => {
const selectedOptions = getters.getSelectedOptions(filterId);
const [firstOption] = selectedOptions.map(option => option.name);
const extraOptionCount = selectedOptions.length - 1;
const firstOption = selectedOptions.map(option => option.name)[0];
return extraOptionCount
? sprintf(__('%{firstOption} +%{extraOptionCount} more'), {
firstOption,
extraOptionCount,
})
: firstOption;
return {
firstOption,
extraOptionCount: extraOptionCount
? sprintf(__('+%{extraOptionCount} more'), { extraOptionCount })
: '',
};
};
/**
......
......@@ -62,7 +62,7 @@ module EE
::Feature.disabled?(:parse_dependency_scanning_reports, default_enabled: true)
next if file_type == "container_scanning" &&
::Feature.disabled?(:parse_container_scanning_reports, default_enabled: false)
::Feature.disabled?(:parse_container_scanning_reports, default_enabled: true)
next if file_type == "dast" &&
::Feature.disabled?(:parse_dast_reports, default_enabled: false)
......
---
title: Add container scanning results to group security dashboard
merge_request: 9736
author:
type: added
......@@ -62,7 +62,7 @@ describe('filters module getters', () => {
'severity',
);
expect(selectedOptionNames).toEqual('All');
expect(selectedOptionNames).toEqual({ firstOption: 'All', extraOptionCount: '' });
});
it('should return the correct message when multiple filters are selected', () => {
......@@ -79,7 +79,7 @@ describe('filters module getters', () => {
'severity',
);
expect(selectedOptionNames).toEqual('Critical +1 more');
expect(selectedOptionNames).toEqual({ firstOption: 'Critical', extraOptionCount: '+1 more' });
});
});
......
......@@ -168,9 +168,6 @@ msgstr ""
msgid "%{firstLabel} +%{labelCount} more"
msgstr ""
msgid "%{firstOption} +%{extraOptionCount} more"
msgstr ""
msgid "%{group_docs_link_start}Groups%{group_docs_link_end} allow you to manage and collaborate across multiple projects. Members of a group have access to all of its projects."
msgstr ""
......@@ -251,6 +248,9 @@ msgstr ""
msgid "+ %{moreCount} more"
msgstr ""
msgid "+%{extraOptionCount} more"
msgstr ""
msgid ", or "
msgstr ""
......@@ -11494,6 +11494,9 @@ msgstr ""
msgid "ciReport|Confidence"
msgstr ""
msgid "ciReport|Container Scanning"
msgstr ""
msgid "ciReport|Container scanning"
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