Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
0ce447db
Commit
0ce447db
authored
Jul 08, 2021
by
Daniel Tian
Committed by
Olena Horal-Koretska
Jul 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename standard_filter.vue to simple_filter.vue
parent
8e5ebe60
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
42 additions
and
41 deletions
+42
-41
ee/app/assets/javascripts/security_dashboard/components/pipeline/filters.vue
...cripts/security_dashboard/components/pipeline/filters.vue
+5
-5
ee/app/assets/javascripts/security_dashboard/components/shared/filters/activity_filter.vue
...y_dashboard/components/shared/filters/activity_filter.vue
+2
-2
ee/app/assets/javascripts/security_dashboard/components/shared/filters/filters_layout.vue
...ty_dashboard/components/shared/filters/filters_layout.vue
+14
-13
ee/app/assets/javascripts/security_dashboard/components/shared/filters/scanner_filter.vue
...ty_dashboard/components/shared/filters/scanner_filter.vue
+2
-2
ee/app/assets/javascripts/security_dashboard/components/shared/filters/simple_filter.vue
...ity_dashboard/components/shared/filters/simple_filter.vue
+0
-0
ee/app/assets/javascripts/security_dashboard/helpers.js
ee/app/assets/javascripts/security_dashboard/helpers.js
+1
-1
ee/spec/frontend/security_dashboard/components/pipeline/filters_spec.js
...nd/security_dashboard/components/pipeline/filters_spec.js
+3
-3
ee/spec/frontend/security_dashboard/components/shared/filters/filters_layout_spec.js
...ashboard/components/shared/filters/filters_layout_spec.js
+11
-11
ee/spec/frontend/security_dashboard/components/shared/filters/simple_filter_spec.js
...dashboard/components/shared/filters/simple_filter_spec.js
+3
-3
qa/qa/ee/page/component/secure_report.rb
qa/qa/ee/page/component/secure_report.rb
+1
-1
No files found.
ee/app/assets/javascripts/security_dashboard/components/pipeline/filters.vue
View file @
0ce447db
<
script
>
import
{
GlToggle
}
from
'
@gitlab/ui
'
;
import
{
mapState
,
mapActions
}
from
'
vuex
'
;
import
{
severityFilter
,
s
tandard
ScannerFilter
}
from
'
ee/security_dashboard/helpers
'
;
import
{
severityFilter
,
s
imple
ScannerFilter
}
from
'
ee/security_dashboard/helpers
'
;
import
{
DISMISSAL_STATES
}
from
'
ee/security_dashboard/store/modules/filters/constants
'
;
import
{
s__
}
from
'
~/locale
'
;
import
S
tandardFilter
from
'
../shared/filters/standard
_filter.vue
'
;
import
S
impleFilter
from
'
../shared/filters/simple
_filter.vue
'
;
export
default
{
i18n
:
{
toggleLabel
:
s__
(
'
SecurityReports|Hide dismissed
'
),
},
components
:
{
S
tandard
Filter
,
S
imple
Filter
,
GlToggle
,
},
data
()
{
return
{
filterConfigs
:
[
severityFilter
,
s
tandard
ScannerFilter
],
filterConfigs
:
[
severityFilter
,
s
imple
ScannerFilter
],
};
},
computed
:
{
...
...
@@ -39,7 +39,7 @@ export default {
<
template
>
<div
class=
"dashboard-filters border-bottom bg-gray-light"
>
<div
class=
"row mx-0 p-2"
>
<s
tandard
-filter
<s
imple
-filter
v-for=
"filter in filterConfigs"
:key=
"filter.id"
class=
"col-sm-6 col-md-4 col-lg-2 p-2 js-filter"
...
...
ee/app/assets/javascripts/security_dashboard/components/shared/filters/activity_filter.vue
View file @
0ce447db
...
...
@@ -4,13 +4,13 @@ import { xor, remove } from 'lodash';
import
{
activityOptions
}
from
'
ee/security_dashboard/helpers
'
;
import
FilterBody
from
'
./filter_body.vue
'
;
import
FilterItem
from
'
./filter_item.vue
'
;
import
S
tandardFilter
from
'
./standard
_filter.vue
'
;
import
S
impleFilter
from
'
./simple
_filter.vue
'
;
const
{
NO_ACTIVITY
,
WITH_ISSUES
,
NO_LONGER_DETECTED
}
=
activityOptions
;
export
default
{
components
:
{
FilterBody
,
FilterItem
,
GlDropdownDivider
},
extends
:
S
tandard
Filter
,
extends
:
S
imple
Filter
,
computed
:
{
filterObject
()
{
// This is the object used to update the GraphQL query.
...
...
ee/app/assets/javascripts/security_dashboard/components/shared/filters/filters_layout.vue
View file @
0ce447db
...
...
@@ -4,17 +4,17 @@ import {
stateFilter
,
severityFilter
,
vendorScannerFilter
,
s
tandard
ScannerFilter
,
s
imple
ScannerFilter
,
activityFilter
,
getProjectFilter
,
}
from
'
ee/security_dashboard/helpers
'
;
import
{
DASHBOARD_TYPES
}
from
'
ee/security_dashboard/store/constants
'
;
import
ActivityFilter
from
'
./activity_filter.vue
'
;
import
ScannerFilter
from
'
./scanner_filter.vue
'
;
import
S
tandardFilter
from
'
./standard
_filter.vue
'
;
import
S
impleFilter
from
'
./simple
_filter.vue
'
;
export
default
{
components
:
{
S
tandard
Filter
,
ScannerFilter
,
ActivityFilter
},
components
:
{
S
imple
Filter
,
ScannerFilter
,
ActivityFilter
},
inject
:
[
'
dashboardType
'
],
props
:
{
projects
:
{
type
:
Array
,
required
:
false
,
default
:
undefined
},
...
...
@@ -22,7 +22,6 @@ export default {
data
()
{
return
{
filterQuery
:
{},
standardFilters
:
[
stateFilter
,
severityFilter
],
};
},
computed
:
{
...
...
@@ -44,14 +43,16 @@ export default {
this
.
filterQuery
=
{
...
this
.
filterQuery
,
...
query
};
this
.
emitFilterChange
();
},
// When this component is first shown, every filter will emit its own @filter-changed event at,
// which will trigger this method multiple times. We'll debounce it so that it only runs once.
// When this component is first shown, every filter will emit its own @filter-changed event at
// the same time, which will trigger this method multiple times. We'll debounce it so that it
// only runs once.
emitFilterChange
:
debounce
(
function
emit
()
{
this
.
$emit
(
'
filterChange
'
,
this
.
filterQuery
);
}),
},
simpleFilters
:
[
stateFilter
,
severityFilter
],
vendorScannerFilter
,
s
tandard
ScannerFilter
,
s
imple
ScannerFilter
,
activityFilter
,
};
</
script
>
...
...
@@ -60,8 +61,8 @@ export default {
<div
class=
"vulnerability-report-filters gl-p-5 gl-bg-gray-10 gl-border-b-1 gl-border-b-solid gl-border-b-gray-100"
>
<s
tandard
-filter
v-for=
"filter in
standard
Filters"
<s
imple
-filter
v-for=
"filter in
$options.simple
Filters"
:key=
"filter.id"
:filter=
"filter"
:data-testid=
"filter.id"
...
...
@@ -73,10 +74,10 @@ export default {
:filter=
"$options.vendorScannerFilter"
@
filter-changed=
"updateFilterQuery"
/>
<s
tandard
-filter
<s
imple
-filter
v-else
:filter=
"$options.s
tandard
ScannerFilter"
:data-testid=
"$options.s
tandard
ScannerFilter.id"
:filter=
"$options.s
imple
ScannerFilter"
:data-testid=
"$options.s
imple
ScannerFilter.id"
@
filter-changed=
"updateFilterQuery"
/>
...
...
@@ -85,7 +86,7 @@ export default {
:filter=
"$options.activityFilter"
@
filter-changed=
"updateFilterQuery"
/>
<s
tandard
-filter
<s
imple
-filter
v-if=
"shouldShowProjectFilter"
:filter=
"projectFilter"
:data-testid=
"projectFilter.id"
...
...
ee/app/assets/javascripts/security_dashboard/components/shared/filters/scanner_filter.vue
View file @
0ce447db
...
...
@@ -5,7 +5,7 @@ import { DEFAULT_SCANNER, SCANNER_ID_PREFIX } from 'ee/security_dashboard/consta
import
{
createScannerOption
}
from
'
ee/security_dashboard/helpers
'
;
import
FilterBody
from
'
./filter_body.vue
'
;
import
FilterItem
from
'
./filter_item.vue
'
;
import
S
tandardFilter
from
'
./standard
_filter.vue
'
;
import
S
impleFilter
from
'
./simple
_filter.vue
'
;
export
default
{
components
:
{
...
...
@@ -15,7 +15,7 @@ export default {
FilterBody
,
FilterItem
,
},
extends
:
S
tandard
Filter
,
extends
:
S
imple
Filter
,
inject
:
[
'
scanners
'
],
computed
:
{
options
()
{
...
...
ee/app/assets/javascripts/security_dashboard/components/shared/filters/s
tandard
_filter.vue
→
ee/app/assets/javascripts/security_dashboard/components/shared/filters/s
imple
_filter.vue
View file @
0ce447db
File moved
ee/app/assets/javascripts/security_dashboard/helpers.js
View file @
0ce447db
...
...
@@ -46,7 +46,7 @@ export const createScannerOption = (vendor, reportType) => {
// This is used on the pipeline security tab, group-level report, and instance-level report. It's
// used by the scanner filter that shows a flat list of scan types (DAST, SAST, etc) with no vendor
// grouping.
export
const
s
tandard
ScannerFilter
=
{
export
const
s
imple
ScannerFilter
=
{
name
:
s__
(
'
SecurityReports|Scanner
'
),
id
:
'
reportType
'
,
options
:
parseOptions
(
REPORT_TYPES
),
...
...
ee/spec/frontend/security_dashboard/components/pipeline/filters_spec.js
View file @
0ce447db
...
...
@@ -2,7 +2,7 @@ import { GlToggle } from '@gitlab/ui';
import
{
shallowMount
,
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vuex
from
'
vuex
'
;
import
Filters
from
'
ee/security_dashboard/components/pipeline/filters.vue
'
;
import
{
s
tandard
ScannerFilter
}
from
'
ee/security_dashboard/helpers
'
;
import
{
s
imple
ScannerFilter
}
from
'
ee/security_dashboard/helpers
'
;
import
createStore
from
'
ee/security_dashboard/store
'
;
import
state
from
'
ee/security_dashboard/store/modules/filters/state
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
...
...
@@ -75,8 +75,8 @@ describe('Filter component', () => {
// scanner filter item.
mock
.
mockClear
();
const
filterId
=
s
tandard
ScannerFilter
.
id
;
const
optionId
=
s
tandard
ScannerFilter
.
options
[
2
].
id
;
const
filterId
=
s
imple
ScannerFilter
.
id
;
const
optionId
=
s
imple
ScannerFilter
.
options
[
2
].
id
;
const
option
=
wrapper
.
findByTestId
(
`
${
filterId
}
:
${
optionId
}
`
);
option
.
vm
.
$emit
(
'
click
'
);
await
wrapper
.
vm
.
$nextTick
();
...
...
ee/spec/frontend/security_dashboard/components/shared/filters/filters_layout_spec.js
View file @
0ce447db
...
...
@@ -2,8 +2,8 @@ import { shallowMount } from '@vue/test-utils';
import
ActivityFilter
from
'
ee/security_dashboard/components/shared/filters/activity_filter.vue
'
;
import
Filters
from
'
ee/security_dashboard/components/shared/filters/filters_layout.vue
'
;
import
ScannerFilter
from
'
ee/security_dashboard/components/shared/filters/scanner_filter.vue
'
;
import
S
tandardFilter
from
'
ee/security_dashboard/components/shared/filters/standard
_filter.vue
'
;
import
{
getProjectFilter
,
s
tandard
ScannerFilter
}
from
'
ee/security_dashboard/helpers
'
;
import
S
impleFilter
from
'
ee/security_dashboard/components/shared/filters/simple
_filter.vue
'
;
import
{
getProjectFilter
,
s
imple
ScannerFilter
}
from
'
ee/security_dashboard/helpers
'
;
import
{
DASHBOARD_TYPES
}
from
'
ee/security_dashboard/store/constants
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
...
...
@@ -15,8 +15,8 @@ describe('First class vulnerability filters component', () => {
{
id
:
'
gid://gitlab/Project/12
'
,
name
:
'
GitLab Com
'
},
];
const
findS
tandardFilters
=
()
=>
wrapper
.
findAllComponents
(
Standard
Filter
);
const
findS
tandardScannerFilter
=
()
=>
wrapper
.
findByTestId
(
standard
ScannerFilter
.
id
);
const
findS
impleFilters
=
()
=>
wrapper
.
findAllComponents
(
Simple
Filter
);
const
findS
impleScannerFilter
=
()
=>
wrapper
.
findByTestId
(
simple
ScannerFilter
.
id
);
const
findVendorScannerFilter
=
()
=>
wrapper
.
findComponent
(
ScannerFilter
);
const
findActivityFilter
=
()
=>
wrapper
.
findComponent
(
ActivityFilter
);
const
findProjectFilter
=
()
=>
wrapper
.
findByTestId
(
getProjectFilter
([]).
id
);
...
...
@@ -43,7 +43,7 @@ describe('First class vulnerability filters component', () => {
});
it
(
'
should render the default filters
'
,
()
=>
{
expect
(
findS
tandard
Filters
()).
toHaveLength
(
2
);
expect
(
findS
imple
Filters
()).
toHaveLength
(
2
);
expect
(
findActivityFilter
().
exists
()).
toBe
(
true
);
expect
(
findProjectFilter
().
exists
()).
toBe
(
false
);
});
...
...
@@ -85,15 +85,15 @@ describe('First class vulnerability filters component', () => {
describe
(
'
scanner filter
'
,
()
=>
{
it
.
each
`
type
| dashboardType
${
'
vendor
'
}
|
${
DASHBOARD_TYPES
.
PROJECT
}
${
'
s
tandard
'
}
|
${
DASHBOARD_TYPES
.
GROUP
}
${
'
s
tandard
'
}
|
${
DASHBOARD_TYPES
.
INSTANCE
}
${
'
s
tandard
'
}
|
${
DASHBOARD_TYPES
.
PIPELINE
}
type | dashboardType
${
'
vendor
'
}
|
${
DASHBOARD_TYPES
.
PROJECT
}
${
'
s
imple
'
}
|
${
DASHBOARD_TYPES
.
GROUP
}
${
'
s
imple
'
}
|
${
DASHBOARD_TYPES
.
INSTANCE
}
${
'
s
imple
'
}
|
${
DASHBOARD_TYPES
.
PIPELINE
}
`
(
'
shows the $type scanner filter on the $dashboardType report
'
,
({
type
,
dashboardType
})
=>
{
wrapper
=
createComponent
({
provide
:
{
dashboardType
}
});
expect
(
findS
tandardScannerFilter
().
exists
()).
toBe
(
type
===
'
standard
'
);
expect
(
findS
impleScannerFilter
().
exists
()).
toBe
(
type
===
'
simple
'
);
expect
(
findVendorScannerFilter
().
exists
()).
toBe
(
type
===
'
vendor
'
);
});
});
...
...
ee/spec/frontend/security_dashboard/components/shared/filters/s
tandard
_filter_spec.js
→
ee/spec/frontend/security_dashboard/components/shared/filters/s
imple
_filter_spec.js
View file @
0ce447db
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
VueRouter
from
'
vue-router
'
;
import
FilterBody
from
'
ee/security_dashboard/components/shared/filters/filter_body.vue
'
;
import
S
tandardFilter
from
'
ee/security_dashboard/components/shared/filters/standard
_filter.vue
'
;
import
S
impleFilter
from
'
ee/security_dashboard/components/shared/filters/simple
_filter.vue
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
VueRouter
);
...
...
@@ -20,11 +20,11 @@ const filter = {
const
optionsAt
=
(
indexes
)
=>
filter
.
options
.
filter
((
x
)
=>
indexes
.
includes
(
x
.
index
));
const
optionIdsAt
=
(
indexes
)
=>
optionsAt
(
indexes
).
map
((
x
)
=>
x
.
id
);
describe
(
'
S
tandard
Filter component
'
,
()
=>
{
describe
(
'
S
imple
Filter component
'
,
()
=>
{
let
wrapper
;
const
createWrapper
=
(
filterOptions
,
props
)
=>
{
wrapper
=
shallowMount
(
S
tandard
Filter
,
{
wrapper
=
shallowMount
(
S
imple
Filter
,
{
localVue
,
router
,
propsData
:
{
filter
:
{
...
filter
,
...
filterOptions
},
...
props
},
...
...
qa/qa/ee/page/component/secure_report.rb
View file @
0ce447db
...
...
@@ -11,7 +11,7 @@ module QA
super
base
.
class_eval
do
view
'ee/app/assets/javascripts/security_dashboard/components/filters/s
tandard
_filter.vue'
do
view
'ee/app/assets/javascripts/security_dashboard/components/filters/s
imple
_filter.vue'
do
element
:filter_dropdown
,
':data-qa-selector="qaSelector"'
# rubocop:disable QA/ElementWithPattern
element
:filter_dropdown_content
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment