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
6f0bd2d8
Commit
6f0bd2d8
authored
Dec 23, 2020
by
Lukas Eipert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run prettier on 33 files - 41 of 73
Part of our prettier migration; changing the arrow-parens style.
parent
d53974df
Changes
33
Show whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
89 additions
and
89 deletions
+89
-89
ee/app/assets/javascripts/security_dashboard/helpers.js
ee/app/assets/javascripts/security_dashboard/helpers.js
+7
-7
ee/app/assets/javascripts/security_dashboard/instance_dashboard_settings_init.js
...ts/security_dashboard/instance_dashboard_settings_init.js
+1
-1
ee/app/assets/javascripts/security_dashboard/store/modules/filters/actions.js
...ripts/security_dashboard/store/modules/filters/actions.js
+2
-2
ee/app/assets/javascripts/security_dashboard/store/modules/pipeline_jobs/actions.js
...security_dashboard/store/modules/pipeline_jobs/actions.js
+2
-2
ee/app/assets/javascripts/security_dashboard/store/modules/pipeline_jobs/getters.js
...security_dashboard/store/modules/pipeline_jobs/getters.js
+4
-4
ee/app/assets/javascripts/security_dashboard/store/modules/project_selector/actions.js
...urity_dashboard/store/modules/project_selector/actions.js
+5
-5
ee/app/assets/javascripts/security_dashboard/store/modules/project_selector/mutations.js
...ity_dashboard/store/modules/project_selector/mutations.js
+2
-2
ee/app/assets/javascripts/security_dashboard/store/modules/project_selector/utils/add_page_info.js
...ard/store/modules/project_selector/utils/add_page_info.js
+2
-2
ee/app/assets/javascripts/security_dashboard/store/modules/projects/actions.js
...ipts/security_dashboard/store/modules/projects/actions.js
+1
-1
ee/app/assets/javascripts/security_dashboard/store/modules/unscanned_projects/actions.js
...ity_dashboard/store/modules/unscanned_projects/actions.js
+1
-1
ee/app/assets/javascripts/security_dashboard/store/modules/unscanned_projects/getters.js
...ity_dashboard/store/modules/unscanned_projects/getters.js
+1
-1
ee/app/assets/javascripts/security_dashboard/store/modules/unscanned_projects/utils.js
...urity_dashboard/store/modules/unscanned_projects/utils.js
+3
-3
ee/app/assets/javascripts/security_dashboard/store/modules/vulnerabilities/actions.js
...curity_dashboard/store/modules/vulnerabilities/actions.js
+4
-4
ee/app/assets/javascripts/security_dashboard/store/modules/vulnerabilities/getters.js
...curity_dashboard/store/modules/vulnerabilities/getters.js
+5
-5
ee/app/assets/javascripts/security_dashboard/store/modules/vulnerabilities/mutations.js
...rity_dashboard/store/modules/vulnerabilities/mutations.js
+4
-4
ee/app/assets/javascripts/security_dashboard/store/modules/vulnerabilities/utils.js
...security_dashboard/store/modules/vulnerabilities/utils.js
+1
-1
ee/app/assets/javascripts/security_dashboard/store/modules/vulnerable_projects/actions.js
...ty_dashboard/store/modules/vulnerable_projects/actions.js
+1
-1
ee/app/assets/javascripts/security_dashboard/store/modules/vulnerable_projects/getters.js
...ty_dashboard/store/modules/vulnerable_projects/getters.js
+1
-1
ee/app/assets/javascripts/security_dashboard/store/modules/vulnerable_projects/utils.js
...rity_dashboard/store/modules/vulnerable_projects/utils.js
+2
-2
ee/app/assets/javascripts/security_dashboard/store/plugins/mediator.js
.../javascripts/security_dashboard/store/plugins/mediator.js
+2
-2
ee/app/assets/javascripts/security_dashboard/utils/first_class_project_manager_utils.js
...rity_dashboard/utils/first_class_project_manager_utils.js
+2
-2
ee/app/assets/javascripts/sidebar/components/status/health_status_dropdown.vue
...ipts/sidebar/components/status/health_status_dropdown.vue
+1
-1
ee/app/assets/javascripts/sidebar/components/status/status.vue
...p/assets/javascripts/sidebar/components/status/status.vue
+1
-1
ee/app/assets/javascripts/sidebar/mount_sidebar.js
ee/app/assets/javascripts/sidebar/mount_sidebar.js
+6
-6
ee/app/assets/javascripts/sidebar/sidebar_mediator.js
ee/app/assets/javascripts/sidebar/sidebar_mediator.js
+2
-2
ee/app/assets/javascripts/status_page_settings/store/actions.js
.../assets/javascripts/status_page_settings/store/actions.js
+1
-1
ee/app/assets/javascripts/status_page_settings/store/index.js
...pp/assets/javascripts/status_page_settings/store/index.js
+1
-1
ee/app/assets/javascripts/storage_counter/components/projects_table.vue
...javascripts/storage_counter/components/projects_table.vue
+1
-1
ee/app/assets/javascripts/storage_counter/components/usage_graph.vue
...ts/javascripts/storage_counter/components/usage_graph.vue
+1
-1
ee/app/assets/javascripts/storage_counter/utils.js
ee/app/assets/javascripts/storage_counter/utils.js
+4
-4
ee/app/assets/javascripts/subscriptions/new/store/actions.js
ee/app/assets/javascripts/subscriptions/new/store/actions.js
+2
-2
ee/app/assets/javascripts/subscriptions/new/store/getters.js
ee/app/assets/javascripts/subscriptions/new/store/getters.js
+10
-10
ee/app/assets/javascripts/subscriptions/new/store/state.js
ee/app/assets/javascripts/subscriptions/new/store/state.js
+6
-6
No files found.
ee/app/assets/javascripts/security_dashboard/helpers.js
View file @
6f0bd2d8
...
...
@@ -5,14 +5,14 @@ import { VULNERABILITY_STATES } from 'ee/vulnerabilities/constants';
import
{
convertObjectPropsToSnakeCase
}
from
'
~/lib/utils/common_utils
'
;
import
{
s__
,
__
}
from
'
~/locale
'
;
const
parseOptions
=
obj
=>
const
parseOptions
=
(
obj
)
=>
Object
.
entries
(
obj
).
map
(([
id
,
name
])
=>
({
id
:
id
.
toUpperCase
(),
name
}));
export
const
mapProjects
=
projects
=>
projects
.
map
(
p
=>
({
id
:
p
.
id
.
split
(
'
/
'
).
pop
(),
name
:
p
.
name
}));
export
const
mapProjects
=
(
projects
)
=>
projects
.
map
(
(
p
)
=>
({
id
:
p
.
id
.
split
(
'
/
'
).
pop
(),
name
:
p
.
name
}));
const
stateOptions
=
parseOptions
(
VULNERABILITY_STATES
);
const
defaultStateOptions
=
stateOptions
.
filter
(
x
=>
[
'
DETECTED
'
,
'
CONFIRMED
'
].
includes
(
x
.
id
));
const
defaultStateOptions
=
stateOptions
.
filter
(
(
x
)
=>
[
'
DETECTED
'
,
'
CONFIRMED
'
].
includes
(
x
.
id
));
export
const
stateFilter
=
{
name
:
s__
(
'
SecurityReports|Status
'
),
...
...
@@ -38,7 +38,7 @@ export const scannerFilter = {
defaultOptions
:
[],
};
export
const
getProjectFilter
=
projects
=>
{
export
const
getProjectFilter
=
(
projects
)
=>
{
return
{
name
:
s__
(
'
SecurityReports|Project
'
),
id
:
'
projectId
'
,
...
...
@@ -92,7 +92,7 @@ export const getFormattedSummary = (rawSummary = {}) => {
return
name
?
[
name
,
scanSummary
]
:
null
;
});
// Filter out keys that could not be matched with any translation and are thus considered invalid
return
formattedEntries
.
filter
(
entry
=>
entry
!==
null
);
return
formattedEntries
.
filter
(
(
entry
)
=>
entry
!==
null
);
};
/**
...
...
@@ -103,7 +103,7 @@ export const getFormattedSummary = (rawSummary = {}) => {
* @param {Object} pageInfo
* @returns {Object}
*/
export
const
preparePageInfo
=
pageInfo
=>
{
export
const
preparePageInfo
=
(
pageInfo
)
=>
{
return
{
...
pageInfo
,
hasNextPage
:
Boolean
(
pageInfo
?.
endCursor
)
};
};
...
...
ee/app/assets/javascripts/security_dashboard/instance_dashboard_settings_init.js
View file @
6f0bd2d8
...
...
@@ -2,7 +2,7 @@ import Vue from 'vue';
import
apolloProvider
from
'
./graphql/provider
'
;
import
InstanceSecurityDashboardSettings
from
'
./components/first_class_instance_security_dashboard_settings.vue
'
;
export
default
el
=>
{
export
default
(
el
)
=>
{
if
(
!
el
)
{
return
null
;
}
...
...
ee/app/assets/javascripts/security_dashboard/store/modules/filters/actions.js
View file @
6f0bd2d8
...
...
@@ -7,8 +7,8 @@ import { convertObjectPropsToSnakeCase } from '~/lib/utils/common_utils';
export
const
setFilter
=
({
commit
},
filter
)
=>
{
// Convert the filter key to snake case and the selected option IDs to lower case. The API
// endpoint needs them to be in this format.
const
convertedFilter
=
mapValues
(
convertObjectPropsToSnakeCase
(
filter
),
array
=>
array
.
map
(
element
=>
element
.
toLowerCase
()),
const
convertedFilter
=
mapValues
(
convertObjectPropsToSnakeCase
(
filter
),
(
array
)
=>
array
.
map
(
(
element
)
=>
element
.
toLowerCase
()),
);
commit
(
SET_FILTER
,
convertedFilter
);
...
...
ee/app/assets/javascripts/security_dashboard/store/modules/pipeline_jobs/actions.js
View file @
6f0bd2d8
...
...
@@ -29,11 +29,11 @@ export const fetchPipelineJobs = ({ commit, state }) => {
}
return
requestPromise
.
then
(
response
=>
{
.
then
(
(
response
)
=>
{
const
{
data
}
=
response
;
commit
(
types
.
RECEIVE_PIPELINE_JOBS_SUCCESS
,
data
);
})
.
catch
(
error
=>
{
.
catch
(
(
error
)
=>
{
Sentry
.
captureException
(
error
);
commit
(
types
.
RECEIVE_PIPELINE_JOBS_ERROR
);
});
...
...
ee/app/assets/javascripts/security_dashboard/store/modules/pipeline_jobs/getters.js
View file @
6f0bd2d8
import
{
FUZZING_STAGE
}
from
'
./constants
'
;
export
const
hasFuzzingArtifacts
=
state
=>
{
return
state
.
pipelineJobs
.
some
(
job
=>
{
export
const
hasFuzzingArtifacts
=
(
state
)
=>
{
return
state
.
pipelineJobs
.
some
(
(
job
)
=>
{
return
job
.
stage
===
FUZZING_STAGE
&&
job
.
artifacts
.
length
>
0
;
});
};
export
const
fuzzingJobsWithArtifact
=
state
=>
{
return
state
.
pipelineJobs
.
filter
(
job
=>
{
export
const
fuzzingJobsWithArtifact
=
(
state
)
=>
{
return
state
.
pipelineJobs
.
filter
(
(
job
)
=>
{
return
job
.
stage
===
FUZZING_STAGE
&&
job
.
artifacts
.
length
>
0
;
});
};
ee/app/assets/javascripts/security_dashboard/store/modules/project_selector/actions.js
View file @
6f0bd2d8
...
...
@@ -37,9 +37,9 @@ export const addProjects = ({ state, dispatch }) => {
return
axios
.
post
(
state
.
projectEndpoints
.
add
,
{
project_ids
:
state
.
selectedProjects
.
map
(
p
=>
p
.
id
),
project_ids
:
state
.
selectedProjects
.
map
(
(
p
)
=>
p
.
id
),
})
.
then
(
response
=>
dispatch
(
'
receiveAddProjectsSuccess
'
,
response
.
data
))
.
then
(
(
response
)
=>
dispatch
(
'
receiveAddProjectsSuccess
'
,
response
.
data
))
.
catch
(()
=>
dispatch
(
'
receiveAddProjectsError
'
))
.
finally
(()
=>
dispatch
(
'
clearSearchResults
'
));
};
...
...
@@ -55,8 +55,8 @@ export const receiveAddProjectsSuccess = ({ commit, dispatch, state }, data) =>
if
(
invalid
.
length
)
{
const
[
firstProject
,
secondProject
,
...
rest
]
=
state
.
selectedProjects
.
filter
(
project
=>
invalid
.
includes
(
project
.
id
))
.
map
(
project
=>
project
.
name
);
.
filter
(
(
project
)
=>
invalid
.
includes
(
project
.
id
))
.
map
(
(
project
)
=>
project
.
name
);
const
translationValues
=
{
firstProject
,
secondProject
,
...
...
@@ -154,7 +154,7 @@ export const fetchSearchResults = ({ state, dispatch, commit }) => {
}
return
searchProjects
(
searchQuery
)
.
then
(
payload
=>
commit
(
types
.
RECEIVE_SEARCH_RESULTS_SUCCESS
,
payload
))
.
then
(
(
payload
)
=>
commit
(
types
.
RECEIVE_SEARCH_RESULTS_SUCCESS
,
payload
))
.
catch
(()
=>
dispatch
(
'
receiveSearchResultsError
'
));
};
...
...
ee/app/assets/javascripts/security_dashboard/store/modules/project_selector/mutations.js
View file @
6f0bd2d8
...
...
@@ -9,12 +9,12 @@ export default {
state
.
searchQuery
=
query
;
},
[
types
.
SELECT_PROJECT
](
state
,
project
)
{
if
(
!
state
.
selectedProjects
.
some
(
p
=>
p
.
id
===
project
.
id
))
{
if
(
!
state
.
selectedProjects
.
some
(
(
p
)
=>
p
.
id
===
project
.
id
))
{
state
.
selectedProjects
.
push
(
project
);
}
},
[
types
.
DESELECT_PROJECT
](
state
,
project
)
{
state
.
selectedProjects
=
state
.
selectedProjects
.
filter
(
p
=>
p
.
id
!==
project
.
id
);
state
.
selectedProjects
=
state
.
selectedProjects
.
filter
(
(
p
)
=>
p
.
id
!==
project
.
id
);
},
[
types
.
REQUEST_ADD_PROJECTS
](
state
)
{
state
.
isAddingProjects
=
true
;
...
...
ee/app/assets/javascripts/security_dashboard/store/modules/project_selector/utils/add_page_info.js
View file @
6f0bd2d8
...
...
@@ -18,7 +18,7 @@ const groupPageInfo = ({ page, nextPage, total, totalPages }) => ({
* @param {{headers}} res
* @returns {*}
*/
const
getHeaders
=
res
=>
res
.
headers
;
const
getHeaders
=
(
res
)
=>
res
.
headers
;
/**
* Takes an XHR-response object and returns an object containing pagination related
...
...
@@ -36,6 +36,6 @@ const pageInfo = flow(getHeaders, normalizeHeaders, parseIntPagination, groupPag
* @param {Object} res
* @return {Object}
*/
const
addPageInfo
=
res
=>
(
res
?.
headers
?
{
...
res
,
...
pageInfo
(
res
)
}
:
res
);
const
addPageInfo
=
(
res
)
=>
(
res
?.
headers
?
{
...
res
,
...
pageInfo
(
res
)
}
:
res
);
export
default
addPageInfo
;
ee/app/assets/javascripts/security_dashboard/store/modules/projects/actions.js
View file @
6f0bd2d8
...
...
@@ -35,7 +35,7 @@ export const fetchProjects = ({ state, dispatch }) => {
dispatch
(
'
requestProjects
'
);
getAllProjects
(
state
.
projectsEndpoint
)
.
then
(
projects
=>
{
.
then
(
(
projects
)
=>
{
dispatch
(
'
receiveProjectsSuccess
'
,
{
projects
});
})
.
catch
(()
=>
{
...
...
ee/app/assets/javascripts/security_dashboard/store/modules/unscanned_projects/actions.js
View file @
6f0bd2d8
...
...
@@ -14,7 +14,7 @@ export const fetchUnscannedProjects = ({ dispatch }, endpoint) => {
return
axios
.
get
(
endpoint
)
.
then
(({
data
})
=>
data
.
map
(
convertObjectPropsToCamelCase
))
.
then
(
data
=>
{
.
then
(
(
data
)
=>
{
dispatch
(
'
receiveUnscannedProjectsSuccess
'
,
data
);
})
.
catch
(()
=>
{
...
...
ee/app/assets/javascripts/security_dashboard/store/modules/unscanned_projects/getters.js
View file @
6f0bd2d8
...
...
@@ -9,7 +9,7 @@ export const untestedProjectsCount = (state, getters) => getters.untestedProject
export
const
outdatedProjects
=
({
projects
})
=>
groupByDateRanges
({
ranges
:
UNSCANNED_PROJECTS_DATE_RANGES
,
dateFn
:
x
=>
x
.
securityTestsLastSuccessfulRun
,
dateFn
:
(
x
)
=>
x
.
securityTestsLastSuccessfulRun
,
projects
,
});
...
...
ee/app/assets/javascripts/security_dashboard/store/modules/unscanned_projects/utils.js
View file @
6f0bd2d8
...
...
@@ -6,7 +6,7 @@ import { getDayDifference, isValidDate } from '~/lib/utils/datetime_utility';
* @param daysInPast {number}
* @returns {function({fromDay: Number, toDay: Number}): boolean}
*/
const
isWithinDateRange
=
daysInPast
=>
({
fromDay
,
toDay
})
=>
const
isWithinDateRange
=
(
daysInPast
)
=>
({
fromDay
,
toDay
})
=>
daysInPast
>=
fromDay
&&
daysInPast
<
toDay
;
/**
...
...
@@ -15,7 +15,7 @@ const isWithinDateRange = daysInPast => ({ fromDay, toDay }) =>
* @param ranges {*}[]
* @returns {{projects: []}}[]
*/
const
withEmptyProjectsArray
=
ranges
=>
ranges
.
map
(
range
=>
({
...
range
,
projects
:
[]
}));
const
withEmptyProjectsArray
=
(
ranges
)
=>
ranges
.
map
((
range
)
=>
({
...
range
,
projects
:
[]
}));
/**
* Checks if a given group-object has any projects
...
...
@@ -23,7 +23,7 @@ const withEmptyProjectsArray = ranges => ranges.map(range => ({ ...range, projec
* @param group {{ projects: [] }}
* @returns {boolean}
*/
const
hasProjects
=
group
=>
group
.
projects
.
length
>
0
;
const
hasProjects
=
(
group
)
=>
group
.
projects
.
length
>
0
;
/**
* Takes an array of objects and groups them based on the given ranges
...
...
ee/app/assets/javascripts/security_dashboard/store/modules/vulnerabilities/actions.js
View file @
6f0bd2d8
...
...
@@ -47,11 +47,11 @@ export const fetchVulnerabilities = ({ state, dispatch }, params = {}) => {
url
:
state
.
vulnerabilitiesEndpoint
,
params
,
})
.
then
(
response
=>
{
.
then
(
(
response
)
=>
{
const
{
headers
,
data
}
=
response
;
dispatch
(
'
receiveVulnerabilitiesSuccess
'
,
{
headers
,
data
});
})
.
catch
(
error
=>
{
.
catch
(
(
error
)
=>
{
dispatch
(
'
receiveVulnerabilitiesError
'
,
error
?.
response
?.
status
);
});
};
...
...
@@ -65,7 +65,7 @@ export const receiveVulnerabilitiesSuccess = ({ commit }, { headers, data }) =>
const
pageInfo
=
parseIntPagination
(
normalizedHeaders
);
// Vulnerabilities on pipelines don't have IDs.
// We need to add dummy IDs here to avoid rendering issues.
const
vulnerabilities
=
data
.
map
(
vulnerability
=>
({
const
vulnerabilities
=
data
.
map
(
(
vulnerability
)
=>
({
...
vulnerability
,
id
:
vulnerability
.
id
||
_
.
uniqueId
(
'
client_
'
),
}));
...
...
@@ -147,7 +147,7 @@ export const dismissSelectedVulnerabilities = ({ dispatch, state }, { comment }
dispatch
(
'
requestDismissSelectedVulnerabilities
'
);
const
promises
=
dismissableVulnerabilties
.
map
(
vulnerability
=>
const
promises
=
dismissableVulnerabilties
.
map
(
(
vulnerability
)
=>
axios
.
post
(
vulnerability
.
create_vulnerability_feedback_dismissal_path
,
{
vulnerability_feedback
:
{
category
:
vulnerability
.
report_type
,
...
...
ee/app/assets/javascripts/security_dashboard/store/modules/vulnerabilities/getters.js
View file @
6f0bd2d8
import
{
LOADING_VULNERABILITIES_ERROR_CODES
}
from
'
./constants
'
;
export
const
dashboardError
=
state
=>
export
const
dashboardError
=
(
state
)
=>
state
.
errorLoadingVulnerabilities
&&
state
.
errorLoadingVulnerabilitiesCount
;
export
const
dashboardListError
=
state
=>
export
const
dashboardListError
=
(
state
)
=>
state
.
errorLoadingVulnerabilities
&&
!
state
.
errorLoadingVulnerabilitiesCount
;
export
const
dashboardCountError
=
state
=>
export
const
dashboardCountError
=
(
state
)
=>
!
state
.
errorLoadingVulnerabilities
&&
state
.
errorLoadingVulnerabilitiesCount
;
export
const
loadingVulnerabilitiesFailedWithRecognizedErrorCode
=
state
=>
export
const
loadingVulnerabilitiesFailedWithRecognizedErrorCode
=
(
state
)
=>
state
.
errorLoadingVulnerabilities
&&
Object
.
values
(
LOADING_VULNERABILITIES_ERROR_CODES
).
includes
(
state
.
loadingVulnerabilitiesErrorCode
,
);
export
const
selectedVulnerabilitiesCount
=
state
=>
export
const
selectedVulnerabilitiesCount
=
(
state
)
=>
Object
.
keys
(
state
.
selectedVulnerabilities
).
length
;
export
const
isSelectingVulnerabilities
=
(
state
,
getters
)
=>
...
...
ee/app/assets/javascripts/security_dashboard/store/modules/vulnerabilities/mutations.js
View file @
6f0bd2d8
...
...
@@ -76,7 +76,7 @@ export default {
Vue
.
set
(
state
.
modal
,
'
error
'
,
null
);
},
[
types
.
RECEIVE_DISMISS_VULNERABILITY_SUCCESS
](
state
,
payload
)
{
const
vulnerability
=
state
.
vulnerabilities
.
find
(
vuln
=>
const
vulnerability
=
state
.
vulnerabilities
.
find
(
(
vuln
)
=>
isSameVulnerability
(
vuln
,
payload
.
vulnerability
),
);
vulnerability
.
dismissal_feedback
=
payload
.
data
;
...
...
@@ -125,7 +125,7 @@ export default {
Vue
.
set
(
state
.
modal
,
'
error
'
,
null
);
},
[
types
.
RECEIVE_ADD_DISMISSAL_COMMENT_SUCCESS
](
state
,
payload
)
{
const
vulnerability
=
state
.
vulnerabilities
.
find
(
vuln
=>
const
vulnerability
=
state
.
vulnerabilities
.
find
(
(
vuln
)
=>
isSameVulnerability
(
vuln
,
payload
.
vulnerability
),
);
if
(
vulnerability
)
{
...
...
@@ -143,7 +143,7 @@ export default {
Vue
.
set
(
state
.
modal
,
'
error
'
,
null
);
},
[
types
.
RECEIVE_DELETE_DISMISSAL_COMMENT_SUCCESS
](
state
,
payload
)
{
const
vulnerability
=
state
.
vulnerabilities
.
find
(
vuln
=>
vuln
.
id
===
payload
.
id
);
const
vulnerability
=
state
.
vulnerabilities
.
find
(
(
vuln
)
=>
vuln
.
id
===
payload
.
id
);
if
(
vulnerability
)
{
vulnerability
.
dismissal_feedback
=
payload
.
data
;
state
.
isDismissingVulnerability
=
false
;
...
...
@@ -159,7 +159,7 @@ export default {
Vue
.
set
(
state
.
modal
,
'
error
'
,
null
);
},
[
types
.
RECEIVE_REVERT_DISMISSAL_SUCCESS
](
state
,
payload
)
{
const
vulnerability
=
state
.
vulnerabilities
.
find
(
vuln
=>
const
vulnerability
=
state
.
vulnerabilities
.
find
(
(
vuln
)
=>
isSameVulnerability
(
vuln
,
payload
.
vulnerability
),
);
vulnerability
.
dismissal_feedback
=
null
;
...
...
ee/app/assets/javascripts/security_dashboard/store/modules/vulnerabilities/utils.js
View file @
6f0bd2d8
import
{
isEqual
}
from
'
lodash
'
;
const
isVulnerabilityLike
=
object
=>
const
isVulnerabilityLike
=
(
object
)
=>
Boolean
(
object
&&
object
.
location
&&
object
.
identifiers
&&
object
.
identifiers
[
0
]);
/**
...
...
ee/app/assets/javascripts/security_dashboard/store/modules/vulnerable_projects/actions.js
View file @
6f0bd2d8
...
...
@@ -15,7 +15,7 @@ export const fetchProjects = ({ dispatch }, endpoint) => {
return
axios
.
get
(
endpoint
)
.
then
(({
data
})
=>
data
.
map
(
convertObjectPropsToCamelCase
))
.
then
(
data
=>
{
.
then
(
(
data
)
=>
{
dispatch
(
'
receiveProjectsSuccess
'
,
data
);
})
.
catch
(()
=>
{
...
...
ee/app/assets/javascripts/security_dashboard/store/modules/vulnerable_projects/getters.js
View file @
6f0bd2d8
...
...
@@ -8,7 +8,7 @@ export const severityGroups = ({ projects }) => {
);
// return an array of severity groups, each containing an array of projects match the groups criteria
return
SEVERITY_GROUPS
.
map
(
severityGroup
=>
({
return
SEVERITY_GROUPS
.
map
(
(
severityGroup
)
=>
({
...
severityGroup
,
projects
:
projectsForSeverityGroup
(
projectsWithSeverityInformation
,
severityGroup
),
}));
...
...
ee/app/assets/javascripts/security_dashboard/store/modules/vulnerable_projects/utils.js
View file @
6f0bd2d8
...
...
@@ -16,7 +16,7 @@ export const vulnerabilityCount = (project, severityLevel) =>
* @param project
* @returns {function(*=): boolean}
*/
export
const
hasVulnerabilityWithSeverityLevel
=
project
=>
severityLevel
=>
export
const
hasVulnerabilityWithSeverityLevel
=
(
project
)
=>
(
severityLevel
)
=>
vulnerabilityCount
(
project
,
severityLevel
)
>
0
;
/**
...
...
@@ -45,7 +45,7 @@ export const mostSevereVulnerability = (severityLevelsOrderedBySeverity, project
* @param severityLevelsInOrder
* @returns {function(*=): {mostSevereVulnerability: *}}
*/
export
const
addMostSevereVulnerabilityInformation
=
severityLevelsInOrder
=>
project
=>
({
export
const
addMostSevereVulnerabilityInformation
=
(
severityLevelsInOrder
)
=>
(
project
)
=>
({
...
project
,
mostSevereVulnerability
:
mostSevereVulnerability
(
severityLevelsInOrder
,
project
),
});
...
...
ee/app/assets/javascripts/security_dashboard/store/plugins/mediator.js
View file @
6f0bd2d8
...
...
@@ -2,8 +2,8 @@ import { SET_FILTER, SET_HIDE_DISMISSED } from '../modules/filters/mutation_type
const
refreshTypes
=
[
`filters/
${
SET_FILTER
}
`
,
`filters/
${
SET_HIDE_DISMISSED
}
`
];
export
default
store
=>
{
const
refreshVulnerabilities
=
payload
=>
{
export
default
(
store
)
=>
{
const
refreshVulnerabilities
=
(
payload
)
=>
{
store
.
dispatch
(
'
vulnerabilities/fetchVulnerabilities
'
,
payload
);
};
...
...
ee/app/assets/javascripts/security_dashboard/utils/first_class_project_manager_utils.js
View file @
6f0bd2d8
...
...
@@ -7,8 +7,8 @@ import { s__, sprintf } from '~/locale';
* @param {Array} invalidProjects all the projects that failed to be added
* @returns {String} the invalid projects formated in a user-friendly way
*/
export
const
createInvalidProjectMessage
=
invalidProjects
=>
{
const
[
firstProject
,
secondProject
,
...
rest
]
=
invalidProjects
.
map
(
project
=>
project
.
name
);
export
const
createInvalidProjectMessage
=
(
invalidProjects
)
=>
{
const
[
firstProject
,
secondProject
,
...
rest
]
=
invalidProjects
.
map
(
(
project
)
=>
project
.
name
);
const
translationValues
=
{
firstProject
,
secondProject
,
...
...
ee/app/assets/javascripts/sidebar/components/status/health_status_dropdown.vue
View file @
6f0bd2d8
...
...
@@ -36,7 +36,7 @@ export default {
return
{
isDropdownShowing
:
false
,
selectedStatus
:
this
.
status
,
statusOptions
:
Object
.
keys
(
healthStatusTextMap
).
map
(
key
=>
({
statusOptions
:
Object
.
keys
(
healthStatusTextMap
).
map
(
(
key
)
=>
({
key
,
value
:
healthStatusTextMap
[
key
],
})),
...
...
ee/app/assets/javascripts/sidebar/components/status/status.vue
View file @
6f0bd2d8
...
...
@@ -46,7 +46,7 @@ export default {
return
{
isDropdownShowing
:
false
,
selectedStatus
:
this
.
status
,
statusOptions
:
Object
.
keys
(
healthStatusTextMap
).
map
(
key
=>
({
statusOptions
:
Object
.
keys
(
healthStatusTextMap
).
map
(
(
key
)
=>
({
key
,
value
:
healthStatusTextMap
[
key
],
})),
...
...
ee/app/assets/javascripts/sidebar/mount_sidebar.js
View file @
6f0bd2d8
...
...
@@ -12,7 +12,7 @@ import { store } from '~/notes/stores';
Vue
.
use
(
VueApollo
);
const
mountWeightComponent
=
mediator
=>
{
const
mountWeightComponent
=
(
mediator
)
=>
{
const
el
=
document
.
querySelector
(
'
.js-sidebar-weight-entry-point
'
);
if
(
!
el
)
return
false
;
...
...
@@ -22,7 +22,7 @@ const mountWeightComponent = mediator => {
components
:
{
SidebarWeight
,
},
render
:
createElement
=>
render
:
(
createElement
)
=>
createElement
(
'
sidebar-weight
'
,
{
props
:
{
mediator
,
...
...
@@ -31,7 +31,7 @@ const mountWeightComponent = mediator => {
});
};
const
mountStatusComponent
=
mediator
=>
{
const
mountStatusComponent
=
(
mediator
)
=>
{
const
el
=
document
.
querySelector
(
'
.js-sidebar-status-entry-point
'
);
if
(
!
el
)
{
...
...
@@ -44,7 +44,7 @@ const mountStatusComponent = mediator => {
components
:
{
SidebarStatus
,
},
render
:
createElement
=>
render
:
(
createElement
)
=>
createElement
(
'
sidebar-status
'
,
{
props
:
{
mediator
,
...
...
@@ -66,7 +66,7 @@ const mountEpicsSelect = () => {
components
:
{
SidebarItemEpicsSelect
,
},
render
:
createElement
=>
render
:
(
createElement
)
=>
createElement
(
'
sidebar-item-epics-select
'
,
{
props
:
{
sidebarStore
,
...
...
@@ -97,7 +97,7 @@ function mountIterationSelect() {
components
:
{
IterationSelect
,
},
render
:
createElement
=>
render
:
(
createElement
)
=>
createElement
(
'
iteration-select
'
,
{
props
:
{
groupPath
,
...
...
ee/app/assets/javascripts/sidebar/sidebar_mediator.js
View file @
6f0bd2d8
...
...
@@ -23,7 +23,7 @@ export default class SidebarMediator extends CESidebarMediator {
this
.
store
.
setWeight
(
data
.
weight
);
this
.
store
.
setLoadingState
(
'
weight
'
,
false
);
})
.
catch
(
err
=>
{
.
catch
(
(
err
)
=>
{
this
.
store
.
setLoadingState
(
'
weight
'
,
false
);
throw
err
;
});
...
...
@@ -39,7 +39,7 @@ export default class SidebarMediator extends CESidebarMediator {
}
this
.
store
.
setStatus
(
data
?.
updateIssue
?.
issue
?.
healthStatus
);
})
.
catch
(
error
=>
{
.
catch
(
(
error
)
=>
{
throw
error
;
})
.
finally
(()
=>
this
.
store
.
setFetchingState
(
'
status
'
,
false
));
...
...
ee/app/assets/javascripts/status_page_settings/store/actions.js
View file @
6f0bd2d8
...
...
@@ -34,7 +34,7 @@ export const updateStatusPageSettings = ({ state, dispatch, commit }) => {
},
})
.
then
(()
=>
dispatch
(
'
receiveStatusPageSettingsUpdateSuccess
'
))
.
catch
(
error
=>
dispatch
(
'
receiveStatusPageSettingsUpdateError
'
,
error
))
.
catch
(
(
error
)
=>
dispatch
(
'
receiveStatusPageSettingsUpdateError
'
,
error
))
.
finally
(()
=>
commit
(
mutationTypes
.
LOADING
,
false
));
};
...
...
ee/app/assets/javascripts/status_page_settings/store/index.js
View file @
6f0bd2d8
...
...
@@ -6,7 +6,7 @@ import mutations from './mutations';
Vue
.
use
(
Vuex
);
export
default
initialState
=>
export
default
(
initialState
)
=>
new
Vuex
.
Store
({
state
:
createState
(
initialState
),
actions
,
...
...
ee/app/assets/javascripts/storage_counter/components/projects_table.vue
View file @
6f0bd2d8
...
...
@@ -64,7 +64,7 @@ export default {
<gl-search-box-by-type
:placeholder=
"__('Search by name')"
:debounce=
"$options.searchDebounceValue"
@
input=
"
input
=> this.$emit('search', input)"
@
input=
"
(input)
=> this.$emit('search', input)"
/>
</div>
</
template
>
...
...
ee/app/assets/javascripts/storage_counter/components/usage_graph.vue
View file @
6f0bd2d8
...
...
@@ -84,7 +84,7 @@ export default {
size
:
uploadsSize
,
},
]
.
filter
(
data
=>
data
.
size
!==
0
)
.
filter
(
(
data
)
=>
data
.
size
!==
0
)
.
sort
((
a
,
b
)
=>
b
.
size
-
a
.
size
);
},
},
...
...
ee/app/assets/javascripts/storage_counter/utils.js
View file @
6f0bd2d8
...
...
@@ -5,7 +5,7 @@ import { STORAGE_USAGE_THRESHOLDS } from './constants';
export
function
usageRatioToThresholdLevel
(
currentUsageRatio
)
{
let
currentLevel
=
Object
.
keys
(
STORAGE_USAGE_THRESHOLDS
)[
0
];
Object
.
keys
(
STORAGE_USAGE_THRESHOLDS
).
forEach
(
thresholdLevel
=>
{
Object
.
keys
(
STORAGE_USAGE_THRESHOLDS
).
forEach
(
(
thresholdLevel
)
=>
{
if
(
currentUsageRatio
>=
STORAGE_USAGE_THRESHOLDS
[
thresholdLevel
])
currentLevel
=
thresholdLevel
;
});
...
...
@@ -23,7 +23,7 @@ export function usageRatioToThresholdLevel(currentUsageRatio) {
* @param {Number} size size in bytes
* @returns {String}
*/
export
const
formatUsageSize
=
size
=>
{
export
const
formatUsageSize
=
(
size
)
=>
{
const
formatDecimalBytes
=
getFormatter
(
SUPPORTED_FORMATS
.
kibibytes
);
return
formatDecimalBytes
(
bytesToKiB
(
size
),
1
);
};
...
...
@@ -86,7 +86,7 @@ export const parseProjects = ({
additionalPurchasedStorageSize
-
totalRepositorySizeExcess
,
);
return
projects
.
nodes
.
map
(
project
=>
return
projects
.
nodes
.
map
(
(
project
)
=>
calculateUsedAndRemStorage
(
project
,
purchasedStorageRemaining
),
);
};
...
...
@@ -103,7 +103,7 @@ export const parseProjects = ({
* @param {Object} data graphql result
* @returns {Object}
*/
export
const
parseGetStorageResults
=
data
=>
{
export
const
parseGetStorageResults
=
(
data
)
=>
{
const
{
namespace
:
{
projects
,
...
...
ee/app/assets/javascripts/subscriptions/new/store/actions.js
View file @
6f0bd2d8
...
...
@@ -49,7 +49,7 @@ export const fetchCountries = ({ dispatch }) =>
.
catch
(()
=>
dispatch
(
'
fetchCountriesError
'
));
export
const
fetchCountriesSuccess
=
({
commit
},
data
=
[])
=>
{
const
countries
=
data
.
map
(
country
=>
({
text
:
country
[
0
],
value
:
country
[
1
]
}));
const
countries
=
data
.
map
(
(
country
)
=>
({
text
:
country
[
0
],
value
:
country
[
1
]
}));
commit
(
types
.
UPDATE_COUNTRY_OPTIONS
,
countries
);
};
...
...
@@ -71,7 +71,7 @@ export const fetchStates = ({ state, dispatch }) => {
};
export
const
fetchStatesSuccess
=
({
commit
},
data
=
{})
=>
{
const
states
=
Object
.
keys
(
data
).
map
(
state
=>
({
text
:
state
,
value
:
data
[
state
]
}));
const
states
=
Object
.
keys
(
data
).
map
(
(
state
)
=>
({
text
:
state
,
value
:
data
[
state
]
}));
commit
(
types
.
UPDATE_STATE_OPTIONS
,
states
);
};
...
...
ee/app/assets/javascripts/subscriptions/new/store/getters.js
View file @
6f0bd2d8
import
{
STEPS
,
NEW_GROUP
}
from
'
../constants
'
;
import
{
s__
}
from
'
~/locale
'
;
export
const
currentStep
=
state
=>
state
.
currentStep
;
export
const
currentStep
=
(
state
)
=>
state
.
currentStep
;
export
const
stepIndex
=
()
=>
step
=>
STEPS
.
findIndex
(
el
=>
el
===
step
);
export
const
stepIndex
=
()
=>
(
step
)
=>
STEPS
.
findIndex
((
el
)
=>
el
===
step
);
export
const
currentStepIndex
=
(
state
,
getters
)
=>
getters
.
stepIndex
(
state
.
currentStep
);
...
...
@@ -12,8 +12,8 @@ export const selectedPlanText = (state, getters) => getters.selectedPlanDetails.
export
const
selectedPlanPrice
=
(
state
,
getters
)
=>
getters
.
selectedPlanDetails
.
pricePerUserPerYear
;
export
const
selectedPlanDetails
=
state
=>
state
.
availablePlans
.
find
(
plan
=>
plan
.
value
===
state
.
selectedPlan
);
export
const
selectedPlanDetails
=
(
state
)
=>
state
.
availablePlans
.
find
(
(
plan
)
=>
plan
.
value
===
state
.
selectedPlan
);
export
const
confirmOrderParams
=
(
state
,
getters
)
=>
({
setup_for_company
:
state
.
isSetupForCompany
,
...
...
@@ -35,7 +35,7 @@ export const confirmOrderParams = (state, getters) => ({
},
});
export
const
endDate
=
state
=>
export
const
endDate
=
(
state
)
=>
new
Date
(
state
.
startDate
).
setFullYear
(
state
.
startDate
.
getFullYear
()
+
1
);
export
const
totalExVat
=
(
state
,
getters
)
=>
state
.
numberOfUsers
*
getters
.
selectedPlanPrice
;
...
...
@@ -56,14 +56,14 @@ export const name = (state, getters) => {
return
state
.
fullName
;
};
export
const
usersPresent
=
state
=>
state
.
numberOfUsers
>
0
;
export
const
usersPresent
=
(
state
)
=>
state
.
numberOfUsers
>
0
;
export
const
isGroupSelected
=
state
=>
export
const
isGroupSelected
=
(
state
)
=>
state
.
selectedGroup
!==
null
&&
state
.
selectedGroup
!==
NEW_GROUP
;
export
const
isSelectedGroupPresent
=
(
state
,
getters
)
=>
{
return
(
getters
.
isGroupSelected
&&
state
.
groupData
.
some
(
group
=>
group
.
value
===
state
.
selectedGroup
)
getters
.
isGroupSelected
&&
state
.
groupData
.
some
(
(
group
)
=>
group
.
value
===
state
.
selectedGroup
)
);
};
...
...
@@ -71,7 +71,7 @@ export const selectedGroupUsers = (state, getters) => {
if
(
!
getters
.
isGroupSelected
)
{
return
1
;
}
else
if
(
getters
.
isSelectedGroupPresent
)
{
return
state
.
groupData
.
find
(
group
=>
group
.
value
===
state
.
selectedGroup
).
numberOfUsers
;
return
state
.
groupData
.
find
(
(
group
)
=>
group
.
value
===
state
.
selectedGroup
).
numberOfUsers
;
}
return
null
;
...
...
@@ -79,7 +79,7 @@ export const selectedGroupUsers = (state, getters) => {
export
const
selectedGroupName
=
(
state
,
getters
)
=>
{
if
(
!
getters
.
isGroupSelected
)
return
null
;
return
state
.
groupData
.
find
(
group
=>
group
.
value
===
state
.
selectedGroup
).
text
;
return
state
.
groupData
.
find
(
(
group
)
=>
group
.
value
===
state
.
selectedGroup
).
text
;
};
export
const
selectedGroupId
=
(
state
,
getters
)
=>
...
...
ee/app/assets/javascripts/subscriptions/new/store/state.js
View file @
6f0bd2d8
...
...
@@ -2,22 +2,22 @@ import { capitalizeFirstCharacter } from '~/lib/utils/text_utility';
import
{
parseBoolean
}
from
'
~/lib/utils/common_utils
'
;
import
{
STEPS
,
TAX_RATE
}
from
'
../constants
'
;
const
parsePlanData
=
planData
=>
JSON
.
parse
(
planData
).
map
(
plan
=>
({
const
parsePlanData
=
(
planData
)
=>
JSON
.
parse
(
planData
).
map
(
(
plan
)
=>
({
value
:
plan
.
id
,
text
:
capitalizeFirstCharacter
(
plan
.
code
),
pricePerUserPerYear
:
plan
.
price_per_year
,
}));
const
parseGroupData
=
groupData
=>
JSON
.
parse
(
groupData
).
map
(
group
=>
({
const
parseGroupData
=
(
groupData
)
=>
JSON
.
parse
(
groupData
).
map
(
(
group
)
=>
({
value
:
group
.
id
,
text
:
group
.
name
,
numberOfUsers
:
group
.
users
,
}));
const
determineSelectedPlan
=
(
planId
,
plans
)
=>
{
if
(
planId
&&
plans
.
find
(
plan
=>
plan
.
value
===
planId
))
{
if
(
planId
&&
plans
.
find
(
(
plan
)
=>
plan
.
value
===
planId
))
{
return
planId
;
}
return
plans
[
0
]
&&
plans
[
0
].
value
;
...
...
@@ -28,7 +28,7 @@ const determineNumberOfUsers = (groupId, groups) => {
return
1
;
}
const
chosenGroup
=
groups
.
find
(
group
=>
group
.
value
===
groupId
);
const
chosenGroup
=
groups
.
find
(
(
group
)
=>
group
.
value
===
groupId
);
if
(
chosenGroup
?.
numberOfUsers
>
1
)
{
return
chosenGroup
.
numberOfUsers
;
...
...
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