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
0af419d3
Commit
0af419d3
authored
Jan 03, 2019
by
samdbeckham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes a bug with watched getters in the filters
parent
1d1e95c8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
ee/app/assets/javascripts/security_dashboard/store/modules/filters/mutations.js
...pts/security_dashboard/store/modules/filters/mutations.js
+6
-2
ee/spec/javascripts/security_dashboard/store/filters/mutations_spec.js
...cripts/security_dashboard/store/filters/mutations_spec.js
+3
-4
No files found.
ee/app/assets/javascripts/security_dashboard/store/modules/filters/mutations.js
View file @
0af419d3
...
...
@@ -5,8 +5,12 @@ export default {
const
{
filterId
,
optionId
}
=
payload
;
const
activeFilter
=
state
.
filters
.
find
(
filter
=>
filter
.
id
===
filterId
);
if
(
activeFilter
)
{
activeFilter
.
options
.
find
(
option
=>
option
.
selected
).
selected
=
false
;
activeFilter
.
options
.
find
(
option
=>
option
.
id
===
optionId
).
selected
=
true
;
activeFilter
.
options
=
[
...
activeFilter
.
options
.
map
(
option
=>
({
...
option
,
selected
:
option
.
id
===
optionId
,
})),
];
}
},
};
ee/spec/javascripts/security_dashboard/store/filters/mutations_spec.js
View file @
0af419d3
...
...
@@ -7,12 +7,11 @@ describe('filters module mutations', () => {
let
state
;
let
typeFilter
;
let
sastOption
;
let
allOption
;
beforeEach
(()
=>
{
state
=
createState
();
[
typeFilter
]
=
state
.
filters
;
[
allOption
,
sastOption
]
=
typeFilter
.
options
;
[,
sastOption
]
=
typeFilter
.
options
;
mutations
[
types
.
SET_FILTER
](
state
,
{
filterId
:
typeFilter
.
id
,
...
...
@@ -21,11 +20,11 @@ describe('filters module mutations', () => {
});
it
(
'
should make SAST the selected option
'
,
()
=>
{
expect
(
s
astOption
.
selected
).
toEqual
(
true
);
expect
(
s
tate
.
filters
[
0
].
options
[
1
]
.
selected
).
toEqual
(
true
);
});
it
(
'
should remove ALL as the selected option
'
,
()
=>
{
expect
(
allOption
.
selected
).
toEqual
(
false
);
expect
(
state
.
filters
[
0
].
options
[
0
]
.
selected
).
toEqual
(
false
);
});
});
});
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