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
5ee7b315
Commit
5ee7b315
authored
Oct 15, 2019
by
Paul Gascou-Vaillancourt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert hide_dismissed to camelCase
parent
da173583
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
13 additions
and
13 deletions
+13
-13
ee/app/assets/javascripts/security_dashboard/components/filters.vue
...ets/javascripts/security_dashboard/components/filters.vue
+1
-1
ee/app/assets/javascripts/security_dashboard/store/modules/filters/actions.js
...ripts/security_dashboard/store/modules/filters/actions.js
+1
-1
ee/app/assets/javascripts/security_dashboard/store/modules/filters/getters.js
...ripts/security_dashboard/store/modules/filters/getters.js
+2
-2
ee/app/assets/javascripts/security_dashboard/store/modules/filters/mutations.js
...pts/security_dashboard/store/modules/filters/mutations.js
+1
-1
ee/app/assets/javascripts/security_dashboard/store/modules/filters/state.js
...scripts/security_dashboard/store/modules/filters/state.js
+1
-1
ee/app/assets/javascripts/security_dashboard/store/modules/vulnerabilities/actions.js
...curity_dashboard/store/modules/vulnerabilities/actions.js
+1
-1
ee/spec/frontend/security_dashboard/components/app_spec.js
ee/spec/frontend/security_dashboard/components/app_spec.js
+1
-1
ee/spec/javascripts/security_dashboard/store/filters/actions_spec.js
...ascripts/security_dashboard/store/filters/actions_spec.js
+4
-4
ee/spec/javascripts/security_dashboard/store/vulnerabilities/actions_spec.js
.../security_dashboard/store/vulnerabilities/actions_spec.js
+1
-1
No files found.
ee/app/assets/javascripts/security_dashboard/components/filters.vue
View file @
5ee7b315
...
@@ -37,7 +37,7 @@ export default {
...
@@ -37,7 +37,7 @@ export default {
<gl-toggle-vuex
<gl-toggle-vuex
class=
"d-block mt-1 js-toggle"
class=
"d-block mt-1 js-toggle"
store-module=
"filters"
store-module=
"filters"
state-property=
"hide
_d
ismissed"
state-property=
"hide
D
ismissed"
set-action=
"setToggleValue"
set-action=
"setToggleValue"
/>
/>
</div>
</div>
...
...
ee/app/assets/javascripts/security_dashboard/store/modules/filters/actions.js
View file @
5ee7b315
...
@@ -27,7 +27,7 @@ export const lockFilter = ({ commit }, payload) => {
...
@@ -27,7 +27,7 @@ export const lockFilter = ({ commit }, payload) => {
export
const
setHideDismissedToggleInitialState
=
({
commit
})
=>
{
export
const
setHideDismissedToggleInitialState
=
({
commit
})
=>
{
const
[
urlParam
]
=
getParameterValues
(
'
scope
'
);
const
[
urlParam
]
=
getParameterValues
(
'
scope
'
);
const
showDismissed
=
urlParam
===
'
all
'
;
const
showDismissed
=
urlParam
===
'
all
'
;
commit
(
types
.
SET_TOGGLE_VALUE
,
{
key
:
'
hide
_d
ismissed
'
,
value
:
!
showDismissed
});
commit
(
types
.
SET_TOGGLE_VALUE
,
{
key
:
'
hide
D
ismissed
'
,
value
:
!
showDismissed
});
};
};
export
const
setToggleValue
=
({
commit
},
{
key
,
value
})
=>
{
export
const
setToggleValue
=
({
commit
},
{
key
,
value
})
=>
{
...
...
ee/app/assets/javascripts/security_dashboard/store/modules/filters/getters.js
View file @
5ee7b315
...
@@ -32,10 +32,10 @@ export const activeFilters = state => {
...
@@ -32,10 +32,10 @@ export const activeFilters = state => {
acc
[
filter
.
id
]
=
[...
Array
.
from
(
filter
.
selection
)].
filter
(
id
=>
!
isBaseFilterOption
(
id
));
acc
[
filter
.
id
]
=
[...
Array
.
from
(
filter
.
selection
)].
filter
(
id
=>
!
isBaseFilterOption
(
id
));
return
acc
;
return
acc
;
},
{});
},
{});
// hide
_d
ismissed is hardcoded as it currently is an edge-case, more info in the MR:
// hide
D
ismissed is hardcoded as it currently is an edge-case, more info in the MR:
// https://gitlab.com/gitlab-org/gitlab/merge_requests/15333#note_208301144
// https://gitlab.com/gitlab-org/gitlab/merge_requests/15333#note_208301144
if
(
gon
.
features
&&
gon
.
features
.
hideDismissedVulnerabilities
)
{
if
(
gon
.
features
&&
gon
.
features
.
hideDismissedVulnerabilities
)
{
filters
.
scope
=
state
.
hide
_d
ismissed
?
'
dismissed
'
:
'
all
'
;
filters
.
scope
=
state
.
hide
D
ismissed
?
'
dismissed
'
:
'
all
'
;
}
}
return
filters
;
return
filters
;
};
};
...
...
ee/app/assets/javascripts/security_dashboard/store/modules/filters/mutations.js
View file @
5ee7b315
...
@@ -19,7 +19,7 @@ export default {
...
@@ -19,7 +19,7 @@ export default {
return
{
...
filter
,
selection
};
return
{
...
filter
,
selection
};
});
});
state
.
hide
_d
ismissed
=
payload
.
scope
!==
'
all
'
;
state
.
hide
D
ismissed
=
payload
.
scope
!==
'
all
'
;
},
},
[
types
.
SET_FILTER
](
state
,
payload
)
{
[
types
.
SET_FILTER
](
state
,
payload
)
{
const
{
filterId
,
optionId
}
=
payload
;
const
{
filterId
,
optionId
}
=
payload
;
...
...
ee/app/assets/javascripts/security_dashboard/store/modules/filters/state.js
View file @
5ee7b315
...
@@ -34,5 +34,5 @@ export default () => ({
...
@@ -34,5 +34,5 @@ export default () => ({
selection
:
new
Set
([
BASE_FILTERS
.
project_id
.
id
]),
selection
:
new
Set
([
BASE_FILTERS
.
project_id
.
id
]),
},
},
],
],
hide
_d
ismissed
:
true
,
hide
D
ismissed
:
true
,
});
});
ee/app/assets/javascripts/security_dashboard/store/modules/vulnerabilities/actions.js
View file @
5ee7b315
...
@@ -154,7 +154,7 @@ export const dismissVulnerability = (
...
@@ -154,7 +154,7 @@ export const dismissVulnerability = (
)
=>
{
)
=>
{
const
page
=
state
.
pageInfo
&&
state
.
pageInfo
.
page
?
state
.
pageInfo
.
page
:
1
;
const
page
=
state
.
pageInfo
&&
state
.
pageInfo
.
page
?
state
.
pageInfo
.
page
:
1
;
const
dismissedVulnerabilitiesHidden
=
Boolean
(
const
dismissedVulnerabilitiesHidden
=
Boolean
(
rootState
.
filters
&&
rootState
.
filters
.
hide
_d
ismissed
,
rootState
.
filters
&&
rootState
.
filters
.
hide
D
ismissed
,
);
);
dispatch
(
'
requestDismissVulnerability
'
);
dispatch
(
'
requestDismissVulnerability
'
);
...
...
ee/spec/frontend/security_dashboard/components/app_spec.js
View file @
5ee7b315
...
@@ -175,7 +175,7 @@ describe('Security Dashboard app', () => {
...
@@ -175,7 +175,7 @@ describe('Security Dashboard app', () => {
`
(
'
$description
'
,
({
getParameterValuesReturnValue
,
expected
})
=>
{
`
(
'
$description
'
,
({
getParameterValuesReturnValue
,
expected
})
=>
{
getParameterValues
.
mockImplementation
(()
=>
getParameterValuesReturnValue
);
getParameterValues
.
mockImplementation
(()
=>
getParameterValuesReturnValue
);
createComponent
();
createComponent
();
expect
(
wrapper
.
vm
.
$store
.
state
.
filters
.
hide
_d
ismissed
).
toBe
(
expected
);
expect
(
wrapper
.
vm
.
$store
.
state
.
filters
.
hide
D
ismissed
).
toBe
(
expected
);
});
});
});
});
});
});
ee/spec/javascripts/security_dashboard/store/filters/actions_spec.js
View file @
5ee7b315
...
@@ -75,17 +75,17 @@ describe('filters actions', () => {
...
@@ -75,17 +75,17 @@ describe('filters actions', () => {
describe
(
'
setHideDismissedToggleInitialState
'
,
()
=>
{
describe
(
'
setHideDismissedToggleInitialState
'
,
()
=>
{
[
[
{
{
description
:
'
should set hide
_d
ismissed to true if scope param is not present
'
,
description
:
'
should set hide
D
ismissed to true if scope param is not present
'
,
returnValue
:
[],
returnValue
:
[],
hideDismissedValue
:
true
,
hideDismissedValue
:
true
,
},
},
{
{
description
:
'
should set hide
_d
ismissed to false if scope param is "all"
'
,
description
:
'
should set hide
D
ismissed to false if scope param is "all"
'
,
returnValue
:
[
'
all
'
],
returnValue
:
[
'
all
'
],
hideDismissedValue
:
false
,
hideDismissedValue
:
false
,
},
},
{
{
description
:
'
should set hide
_d
ismissed to true if scope param is "dismissed"
'
,
description
:
'
should set hide
D
ismissed to true if scope param is "dismissed"
'
,
returnValue
:
[
'
dismissed
'
],
returnValue
:
[
'
dismissed
'
],
hideDismissedValue
:
true
,
hideDismissedValue
:
true
,
},
},
...
@@ -101,7 +101,7 @@ describe('filters actions', () => {
...
@@ -101,7 +101,7 @@ describe('filters actions', () => {
{
{
type
:
types
.
SET_TOGGLE_VALUE
,
type
:
types
.
SET_TOGGLE_VALUE
,
payload
:
{
payload
:
{
key
:
'
hide
_d
ismissed
'
,
key
:
'
hide
D
ismissed
'
,
value
:
testCase
.
hideDismissedValue
,
value
:
testCase
.
hideDismissedValue
,
},
},
},
},
...
...
ee/spec/javascripts/security_dashboard/store/vulnerabilities/actions_spec.js
View file @
5ee7b315
...
@@ -764,7 +764,7 @@ describe('vulnerability dismissal', () => {
...
@@ -764,7 +764,7 @@ describe('vulnerability dismissal', () => {
state
=
{
state
=
{
...
initialState
(),
...
initialState
(),
filters
:
{
filters
:
{
hide
_d
ismissed
:
true
,
hide
D
ismissed
:
true
,
},
},
};
};
mock
mock
...
...
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