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
1d995ddc
Commit
1d995ddc
authored
Mar 30, 2022
by
Alexander Turinske
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update policy type filtering
- make "All policies" option first Changelog: changed EE: true
parent
0a6ec0fe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
ee/app/assets/javascripts/threat_monitoring/components/constants.js
...ets/javascripts/threat_monitoring/components/constants.js
+4
-4
ee/spec/frontend/threat_monitoring/components/policy_type_filter_spec.js
...d/threat_monitoring/components/policy_type_filter_spec.js
+9
-0
No files found.
ee/app/assets/javascripts/threat_monitoring/components/constants.js
View file @
1d995ddc
...
...
@@ -52,6 +52,10 @@ export const POLICY_TYPE_COMPONENT_OPTIONS = {
};
export
const
POLICY_TYPE_OPTIONS
=
{
ALL
:
{
value
:
''
,
text
:
s__
(
'
SecurityOrchestration|All policies
'
),
},
POLICY_TYPE_NETWORK
:
{
value
:
'
POLICY_TYPE_NETWORK
'
,
text
:
s__
(
'
SecurityOrchestration|Network
'
),
...
...
@@ -64,10 +68,6 @@ export const POLICY_TYPE_OPTIONS = {
value
:
'
POLICY_TYPE_SCAN_RESULT
'
,
text
:
s__
(
'
SecurityOrchestration|Scan result
'
),
},
ALL
:
{
value
:
''
,
text
:
s__
(
'
SecurityOrchestration|All policies
'
),
},
};
export
const
POLICIES_LIST_CONTAINER_CLASS
=
'
.js-security-policies-container-wrapper
'
;
ee/spec/frontend/threat_monitoring/components/policy_type_filter_spec.js
View file @
1d995ddc
import
{
GlDropdownItem
}
from
'
@gitlab/ui
'
;
import
{
POLICY_TYPE_OPTIONS
}
from
'
ee/threat_monitoring/components/constants
'
;
import
PolicyTypeFilter
from
'
ee/threat_monitoring/components/policy_type_filter.vue
'
;
import
{
mountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
...
...
@@ -30,6 +31,14 @@ describe('PolicyTypeFilter component', () => {
expect
(
findToggle
().
text
()).
toBe
(
expectedToggleText
);
});
it
(
'
displays the "All policies" option first
'
,
()
=>
{
createWrapper
();
expect
(
wrapper
.
findAllComponents
(
GlDropdownItem
).
at
(
0
).
text
()).
toBe
(
POLICY_TYPE_OPTIONS
.
ALL
.
text
,
);
});
it
(
'
emits an event when an option is selected
'
,
()
=>
{
createWrapper
();
...
...
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