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
a536349d
Commit
a536349d
authored
Dec 23, 2020
by
Lukas Eipert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run prettier on 31 files - 42 of 73
Part of our prettier migration; changing the arrow-parens style.
parent
6f0bd2d8
Changes
31
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
59 additions
and
59 deletions
+59
-59
ee/app/assets/javascripts/test_case_create/components/test_case_create_root.vue
...pts/test_case_create/components/test_case_create_root.vue
+2
-2
ee/app/assets/javascripts/test_case_create/test_case_create_bundle.js
...s/javascripts/test_case_create/test_case_create_bundle.js
+1
-1
ee/app/assets/javascripts/test_case_list/components/test_case_list_root.vue
...scripts/test_case_list/components/test_case_list_root.vue
+2
-2
ee/app/assets/javascripts/test_case_list/test_case_list_bundle.js
...ssets/javascripts/test_case_list/test_case_list_bundle.js
+1
-1
ee/app/assets/javascripts/test_case_show/components/test_case_show_root.vue
...scripts/test_case_show/components/test_case_show_root.vue
+3
-3
ee/app/assets/javascripts/test_case_show/components/test_case_sidebar.vue
...vascripts/test_case_show/components/test_case_sidebar.vue
+5
-5
ee/app/assets/javascripts/test_case_show/mixins/test_case_graphql.js
...ts/javascripts/test_case_show/mixins/test_case_graphql.js
+4
-4
ee/app/assets/javascripts/test_case_show/test_case_show_bundle.js
...ssets/javascripts/test_case_show/test_case_show_bundle.js
+1
-1
ee/app/assets/javascripts/threat_monitoring/components/alerts/alerts_list.vue
...ripts/threat_monitoring/components/alerts/alerts_list.vue
+1
-1
ee/app/assets/javascripts/threat_monitoring/components/network_policy_list.vue
...ipts/threat_monitoring/components/network_policy_list.vue
+2
-2
ee/app/assets/javascripts/threat_monitoring/components/policy_editor/lib/from_yaml.js
...reat_monitoring/components/policy_editor/lib/from_yaml.js
+4
-4
ee/app/assets/javascripts/threat_monitoring/components/policy_editor/lib/humanize.js
...hreat_monitoring/components/policy_editor/lib/humanize.js
+3
-3
ee/app/assets/javascripts/threat_monitoring/components/policy_editor/lib/rules.js
...s/threat_monitoring/components/policy_editor/lib/rules.js
+1
-1
ee/app/assets/javascripts/threat_monitoring/components/policy_editor/lib/to_yaml.js
...threat_monitoring/components/policy_editor/lib/to_yaml.js
+1
-1
ee/app/assets/javascripts/threat_monitoring/components/policy_editor/lib/utils.js
...s/threat_monitoring/components/policy_editor/lib/utils.js
+1
-1
ee/app/assets/javascripts/threat_monitoring/components/policy_editor/policy_rule_entity.vue
...onitoring/components/policy_editor/policy_rule_entity.vue
+2
-2
ee/app/assets/javascripts/threat_monitoring/components/statistics_history.vue
...ripts/threat_monitoring/components/statistics_history.vue
+1
-1
ee/app/assets/javascripts/threat_monitoring/store/index.js
ee/app/assets/javascripts/threat_monitoring/store/index.js
+2
-2
ee/app/assets/javascripts/threat_monitoring/store/modules/network_policies/actions.js
...reat_monitoring/store/modules/network_policies/actions.js
+3
-3
ee/app/assets/javascripts/threat_monitoring/store/modules/network_policies/getters.js
...reat_monitoring/store/modules/network_policies/getters.js
+1
-1
ee/app/assets/javascripts/threat_monitoring/store/modules/network_policies/mutations.js
...at_monitoring/store/modules/network_policies/mutations.js
+2
-2
ee/app/assets/javascripts/threat_monitoring/store/modules/threat_monitoring/actions.js
...eat_monitoring/store/modules/threat_monitoring/actions.js
+2
-2
ee/app/assets/javascripts/threat_monitoring/store/modules/threat_monitoring_statistics/actions.js
...ing/store/modules/threat_monitoring_statistics/actions.js
+1
-1
ee/app/assets/javascripts/threat_monitoring/store/modules/threat_monitoring_statistics/index.js
...oring/store/modules/threat_monitoring_statistics/index.js
+1
-1
ee/app/assets/javascripts/threat_monitoring/store/modules/threat_monitoring_statistics/mutations.js
...g/store/modules/threat_monitoring_statistics/mutations.js
+1
-1
ee/app/assets/javascripts/threat_monitoring/store/utils.js
ee/app/assets/javascripts/threat_monitoring/store/utils.js
+1
-1
ee/app/assets/javascripts/validators/ip_address.js
ee/app/assets/javascripts/validators/ip_address.js
+1
-1
ee/app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals.vue
...e_merge_request_widget/components/approvals/approvals.vue
+2
-2
ee/app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals_list.vue
...ge_request_widget/components/approvals/approvals_list.vue
+5
-5
ee/app/assets/javascripts/vue_merge_request_widget/components/blocking_merge_requests/blocking_merge_requests_report.vue
...locking_merge_requests/blocking_merge_requests_report.vue
+1
-1
ee/app/assets/javascripts/vue_merge_request_widget/components/visual_review_app_link.vue
...erge_request_widget/components/visual_review_app_link.vue
+1
-1
No files found.
ee/app/assets/javascripts/test_case_create/components/test_case_create_root.vue
View file @
a536349d
...
...
@@ -37,7 +37,7 @@ export default {
projectPath
:
this
.
projectFullPath
,
title
:
issuableTitle
,
description
:
issuableDescription
,
labelIds
:
selectedLabels
.
map
(
label
=>
label
.
id
),
labelIds
:
selectedLabels
.
map
(
(
label
)
=>
label
.
id
),
},
},
})
...
...
@@ -48,7 +48,7 @@ export default {
}
redirectTo
(
this
.
projectTestCasesPath
);
})
.
catch
(
error
=>
{
.
catch
(
(
error
)
=>
{
createFlash
({
message
:
s__
(
'
TestCases|Something went wrong while creating a test case.
'
),
captureError
:
true
,
...
...
ee/app/assets/javascripts/test_case_create/test_case_create_bundle.js
View file @
a536349d
...
...
@@ -24,6 +24,6 @@ export function initTestCaseCreate({ mountPointSelector }) {
provide
:
{
...
mountPointEl
.
dataset
,
},
render
:
createElement
=>
createElement
(
TestCaseCreateApp
),
render
:
(
createElement
)
=>
createElement
(
TestCaseCreateApp
),
});
}
ee/app/assets/javascripts/test_case_list/components/test_case_list_root.vue
View file @
a536349d
...
...
@@ -252,7 +252,7 @@ export default {
if
(
labelName
?.
length
)
{
filteredSearchValue
.
push
(
...
labelName
.
map
(
label
=>
({
...
labelName
.
map
(
(
label
)
=>
({
type
:
'
label_name
'
,
value
:
{
data
:
label
},
})),
...
...
@@ -290,7 +290,7 @@ export default {
const
labels
=
[];
const
plainText
=
[];
filters
.
forEach
(
filter
=>
{
filters
.
forEach
(
(
filter
)
=>
{
switch
(
filter
.
type
)
{
case
'
author_username
'
:
filterParams
.
authorUsername
=
filter
.
value
.
data
;
...
...
ee/app/assets/javascripts/test_case_list/test_case_list_bundle.js
View file @
a536349d
...
...
@@ -52,7 +52,7 @@ const initTestCaseList = ({ mountPointSelector }) => {
initialState
,
initialSortBy
,
},
render
:
createElement
=>
render
:
(
createElement
)
=>
createElement
(
TestCaseListApp
,
{
props
:
{
initialFilterParams
,
...
...
ee/app/assets/javascripts/test_case_show/components/test_case_show_root.vue
View file @
a536349d
...
...
@@ -76,7 +76,7 @@ export default {
return
todos
.
length
?
todos
[
0
]
:
null
;
},
selectedLabels
()
{
return
this
.
testCase
.
labels
.
nodes
.
map
(
label
=>
({
return
this
.
testCase
.
labels
.
nodes
.
map
(
(
label
)
=>
({
...
label
,
id
:
getIdFromGraphQLId
(
label
.
id
),
}));
...
...
@@ -91,7 +91,7 @@ export default {
},
errorMessage
:
s__
(
'
TestCases|Something went wrong while updating the test case.
'
),
})
.
then
(
updatedTestCase
=>
{
.
then
(
(
updatedTestCase
)
=>
{
this
.
testCase
=
updatedTestCase
;
})
.
finally
(()
=>
{
...
...
@@ -110,7 +110,7 @@ export default {
},
errorMessage
:
s__
(
'
TestCases|Something went wrong while updating the test case.
'
),
})
.
then
(
updatedTestCase
=>
{
.
then
(
(
updatedTestCase
)
=>
{
this
.
testCase
=
updatedTestCase
;
this
.
editTestCaseFormVisible
=
false
;
IssuableEventHub
.
$emit
(
'
update.issuable
'
);
...
...
ee/app/assets/javascripts/test_case_show/components/test_case_sidebar.vue
View file @
a536349d
...
...
@@ -130,9 +130,9 @@ export default {
// either selected or removed aren't leading to same selection
// as current one, as then we don't want to make network call
// since nothing has changed.
const
anyLabelUpdated
=
labels
.
some
(
label
=>
{
const
anyLabelUpdated
=
labels
.
some
(
(
label
)
=>
{
// Find this label in existing selection.
const
existingLabel
=
this
.
selectedLabels
.
find
(
l
=>
l
.
id
===
label
.
id
);
const
existingLabel
=
this
.
selectedLabels
.
find
(
(
l
)
=>
l
.
id
===
label
.
id
);
// Check either of the two following conditions;
// 1. A label that's not currently applied is being applied.
...
...
@@ -146,12 +146,12 @@ export default {
return
this
.
updateTestCase
({
variables
:
{
addLabelIds
:
labels
.
filter
(
label
=>
label
.
set
).
map
(
label
=>
label
.
id
),
removeLabelIds
:
labels
.
filter
(
label
=>
!
label
.
set
).
map
(
label
=>
label
.
id
),
addLabelIds
:
labels
.
filter
(
(
label
)
=>
label
.
set
).
map
((
label
)
=>
label
.
id
),
removeLabelIds
:
labels
.
filter
(
(
label
)
=>
!
label
.
set
).
map
((
label
)
=>
label
.
id
),
},
errorMessage
:
s__
(
'
TestCases|Something went wrong while updating the test case labels.
'
),
})
.
then
(
updatedTestCase
=>
{
.
then
(
(
updatedTestCase
)
=>
{
this
.
$emit
(
'
test-case-updated
'
,
updatedTestCase
);
})
.
finally
(()
=>
{
...
...
ee/app/assets/javascripts/test_case_show/mixins/test_case_graphql.js
View file @
a536349d
...
...
@@ -63,7 +63,7 @@ export default {
}
return
data
.
updateIssue
?.
issue
;
})
.
catch
(
error
=>
{
.
catch
(
(
error
)
=>
{
createFlash
({
message
:
errorMessage
,
captureError
:
true
,
...
...
@@ -81,7 +81,7 @@ export default {
.
then
(()
=>
{
this
.
$apollo
.
queries
.
testCase
.
refetch
();
})
.
catch
(
error
=>
{
.
catch
(
(
error
)
=>
{
createFlash
({
message
:
s__
(
'
TestCases|Something went wrong while adding test case to Todo.
'
),
captureError
:
true
,
...
...
@@ -110,7 +110,7 @@ export default {
}
this
.
$apollo
.
queries
.
testCase
.
refetch
();
})
.
catch
(
error
=>
{
.
catch
(
(
error
)
=>
{
createFlash
({
message
:
s__
(
'
TestCases|Something went wrong while marking test case todo as done.
'
),
captureError
:
true
,
...
...
@@ -143,7 +143,7 @@ export default {
}
visitUrl
(
data
.
issueMove
?.
issue
.
webUrl
);
})
.
catch
(
error
=>
{
.
catch
(
(
error
)
=>
{
this
.
testCaseMoveInProgress
=
false
;
createFlash
({
message
:
s__
(
'
TestCases|Something went wrong while moving test case.
'
),
...
...
ee/app/assets/javascripts/test_case_show/test_case_show_bundle.js
View file @
a536349d
...
...
@@ -29,6 +29,6 @@ export default function initTestCaseShow({ mountPointSelector }) {
projectsFetchPath
:
sidebarOptions
.
projectsAutocompleteEndpoint
,
canEditTestCase
:
parseBoolean
(
el
.
dataset
.
canEditTestCase
),
},
render
:
createElement
=>
createElement
(
TestCaseShowApp
),
render
:
(
createElement
)
=>
createElement
(
TestCaseShowApp
),
});
}
ee/app/assets/javascripts/threat_monitoring/components/alerts/alerts_list.vue
View file @
a536349d
...
...
@@ -99,7 +99,7 @@ export default {
this
.
$apollo
.
queries
.
alerts
.
fetchMore
({
variables
:
{
nextPageCursor
:
this
.
pageInfo
.
endCursor
},
updateQuery
:
(
previousResult
,
{
fetchMoreResult
})
=>
{
const
results
=
produce
(
fetchMoreResult
,
draftData
=>
{
const
results
=
produce
(
fetchMoreResult
,
(
draftData
)
=>
{
// eslint-disable-next-line no-param-reassign
draftData
.
project
.
alertManagementAlerts
.
nodes
=
[
...
previousResult
.
project
.
alertManagementAlerts
.
nodes
,
...
...
ee/app/assets/javascripts/threat_monitoring/components/network_policy_list.vue
View file @
a536349d
...
...
@@ -58,7 +58,7 @@ export default {
selectedPolicy
()
{
if
(
!
this
.
hasSelectedPolicy
)
return
null
;
return
this
.
policiesWithDefaults
.
find
(
policy
=>
policy
.
name
===
this
.
selectedPolicyName
);
return
this
.
policiesWithDefaults
.
find
(
(
policy
)
=>
policy
.
name
===
this
.
selectedPolicyName
);
},
hasPolicyChanges
()
{
if
(
!
this
.
hasSelectedPolicy
)
return
false
;
...
...
@@ -69,7 +69,7 @@ export default {
);
},
hasAutoDevopsPolicy
()
{
return
this
.
policiesWithDefaults
.
some
(
policy
=>
policy
.
isAutodevops
);
return
this
.
policiesWithDefaults
.
some
(
(
policy
)
=>
policy
.
isAutodevops
);
},
hasCiliumSelectedPolicy
()
{
return
this
.
hasSelectedPolicy
...
...
ee/app/assets/javascripts/threat_monitoring/components/policy_editor/lib/from_yaml.js
View file @
a536349d
...
...
@@ -27,7 +27,7 @@ function ruleTypeEndpointFunc(items) {
const
labels
=
items
.
reduce
(
(
acc
,
{
matchLabels
})
=>
acc
.
concat
(
Object
.
keys
(
matchLabels
).
map
(
key
=>
`
${
key
}
:
${
matchLabels
[
key
]}
`
)),
acc
.
concat
(
Object
.
keys
(
matchLabels
).
map
(
(
key
)
=>
`
${
key
}
:
${
matchLabels
[
key
]}
`
)),
[],
)
.
join
(
'
'
);
...
...
@@ -125,10 +125,10 @@ export default function fromYaml(manifest) {
const
rules
=
[]
.
concat
(
ingress
.
map
(
item
=>
parseRule
(
item
,
RuleDirectionInbound
)),
egress
.
map
(
item
=>
parseRule
(
item
,
RuleDirectionOutbound
)),
ingress
.
map
(
(
item
)
=>
parseRule
(
item
,
RuleDirectionInbound
)),
egress
.
map
(
(
item
)
=>
parseRule
(
item
,
RuleDirectionOutbound
)),
)
.
filter
(
rule
=>
Boolean
(
rule
));
.
filter
(
(
rule
)
=>
Boolean
(
rule
));
return
{
name
,
...
...
ee/app/assets/javascripts/threat_monitoring/components/policy_editor/lib/humanize.js
View file @
a536349d
...
...
@@ -37,7 +37,7 @@ function humanizeNetworkPolicyRulePorts(rule) {
function
humanizeNetworkPolicyRuleEndpoint
({
matchLabels
})
{
const
matchSelector
=
labelSelector
(
matchLabels
);
const
labels
=
Object
.
keys
(
matchSelector
)
.
map
(
key
=>
`
${
key
}
:
${
matchSelector
[
key
]}
`
)
.
map
(
(
key
)
=>
`
${
key
}
:
${
matchSelector
[
key
]}
`
)
.
join
(
'
,
'
);
return
labels
.
length
===
0
?
sprintf
(
s__
(
'
NetworkPolicies|%{strongOpen}all%{strongClose} pods
'
),
strongArgs
,
false
)
...
...
@@ -104,7 +104,7 @@ function humanizeEndpointSelector({ endpointMatchMode, endpointLabels }) {
const
selector
=
labelSelector
(
endpointLabels
);
const
pods
=
Object
.
keys
(
selector
)
.
map
(
key
=>
`
${
key
}
:
${
selector
[
key
]}
`
)
.
map
(
(
key
)
=>
`
${
key
}
:
${
selector
[
key
]}
`
)
.
join
(
'
,
'
);
return
sprintf
(
s__
(
'
NetworkPolicies|pods %{pods}
'
),
...
...
@@ -124,7 +124,7 @@ export default function humanizeNetworkPolicy(policy) {
const
selector
=
humanizeEndpointSelector
(
policy
);
const
humanizedRules
=
rules
.
map
(
rule
=>
{
const
humanizedRules
=
rules
.
map
(
(
rule
)
=>
{
const
{
direction
}
=
rule
;
const
template
=
direction
===
RuleDirectionInbound
...
...
ee/app/assets/javascripts/threat_monitoring/components/policy_editor/lib/rules.js
View file @
a536349d
...
...
@@ -67,7 +67,7 @@ function ruleFQDNSpec({ direction, fqdn }) {
if
(
fqdnList
.
length
===
0
)
return
{};
return
{
toFQDNs
:
fqdnList
.
map
(
item
=>
({
matchName
:
item
})),
toFQDNs
:
fqdnList
.
map
(
(
item
)
=>
({
matchName
:
item
})),
};
}
...
...
ee/app/assets/javascripts/threat_monitoring/components/policy_editor/lib/to_yaml.js
View file @
a536349d
...
...
@@ -12,7 +12,7 @@ function spec({ rules, isEnabled, endpointMatchMode, endpointLabels }) {
const
policySpec
=
{};
policySpec
.
endpointSelector
=
Object
.
keys
(
matchLabels
).
length
>
0
?
{
matchLabels
}
:
{};
rules
.
forEach
(
rule
=>
{
rules
.
forEach
(
(
rule
)
=>
{
const
{
direction
}
=
rule
;
if
(
!
policySpec
[
direction
])
policySpec
[
direction
]
=
[];
...
...
ee/app/assets/javascripts/threat_monitoring/components/policy_editor/lib/utils.js
View file @
a536349d
...
...
@@ -36,5 +36,5 @@ export function portSelectors({ portMatchMode, ports }) {
Expects items in format "0.0.0.0/24 1.1.1.1/32"
*/
export
function
splitItems
(
items
)
{
return
items
.
split
(
/
\s
/
).
filter
(
item
=>
item
.
length
>
0
);
return
items
.
split
(
/
\s
/
).
filter
(
(
item
)
=>
item
.
length
>
0
);
}
ee/app/assets/javascripts/threat_monitoring/components/policy_editor/policy_rule_entity.vue
View file @
a536349d
...
...
@@ -40,7 +40,7 @@ export default {
const
{
value
}
=
this
;
let
entitiesList
=
[];
if
(
value
.
includes
(
entity
))
{
entitiesList
=
value
.
filter
(
e
=>
e
!==
entity
);
entitiesList
=
value
.
filter
(
(
e
)
=>
e
!==
entity
);
}
else
{
entitiesList
=
[...
value
,
entity
];
}
...
...
@@ -61,7 +61,7 @@ export default {
return
value
.
includes
(
entity
);
},
},
entities
:
Object
.
keys
(
EntityTypes
).
map
(
type
=>
({
entities
:
Object
.
keys
(
EntityTypes
).
map
(
(
type
)
=>
({
value
:
EntityTypes
[
type
],
text
:
EntityTypes
[
type
],
})),
...
...
ee/app/assets/javascripts/threat_monitoring/components/statistics_history.vue
View file @
a536349d
...
...
@@ -67,7 +67,7 @@ export default {
name
:
TIME
,
type
:
'
time
'
,
axisLabel
:
{
formatter
:
value
=>
dateFormat
(
value
,
DATE_FORMATS
.
defaultDate
),
formatter
:
(
value
)
=>
dateFormat
(
value
,
DATE_FORMATS
.
defaultDate
),
},
min
:
from
,
max
:
to
,
...
...
ee/app/assets/javascripts/threat_monitoring/store/index.js
View file @
a536349d
...
...
@@ -11,11 +11,11 @@ export default () =>
new
Vuex
.
Store
({
modules
:
{
threatMonitoring
:
threatMonitoring
(),
threatMonitoringWaf
:
threatMonitoringStatistics
(
payload
=>
{
threatMonitoringWaf
:
threatMonitoringStatistics
(
(
payload
)
=>
{
const
{
totalTraffic
,
anomalousTraffic
,
history
}
=
convertObjectPropsToCamelCase
(
payload
);
return
{
total
:
totalTraffic
,
anomalous
:
anomalousTraffic
,
history
};
}),
threatMonitoringNetworkPolicy
:
threatMonitoringStatistics
(
payload
=>
{
threatMonitoringNetworkPolicy
:
threatMonitoringStatistics
(
(
payload
)
=>
{
const
{
opsRate
,
opsTotal
:
{
total
,
drops
},
...
...
ee/app/assets/javascripts/threat_monitoring/store/modules/network_policies/actions.js
View file @
a536349d
...
...
@@ -59,7 +59,7 @@ export const createPolicy = ({ state, commit }, { environmentId, policy }) => {
FLASH_TYPES
.
SUCCESS
,
);
})
.
catch
(
error
=>
.
catch
(
(
error
)
=>
commitPolicyError
(
commit
,
types
.
RECEIVE_CREATE_POLICY_ERROR
,
error
?.
response
?.
data
),
);
};
...
...
@@ -89,7 +89,7 @@ export const updatePolicy = ({ state, commit }, { environmentId, policy }) => {
FLASH_TYPES
.
SUCCESS
,
);
})
.
catch
(
error
=>
.
catch
(
(
error
)
=>
commitPolicyError
(
commit
,
types
.
RECEIVE_UPDATE_POLICY_ERROR
,
error
?.
response
?.
data
),
);
};
...
...
@@ -113,7 +113,7 @@ export const deletePolicy = ({ state, commit }, { environmentId, policy }) => {
policy
,
});
})
.
catch
(
error
=>
.
catch
(
(
error
)
=>
commitPolicyError
(
commit
,
types
.
RECEIVE_DELETE_POLICY_ERROR
,
error
?.
response
?.
data
),
);
};
ee/app/assets/javascripts/threat_monitoring/store/modules/network_policies/getters.js
View file @
a536349d
...
...
@@ -6,7 +6,7 @@ export const policiesWithDefaults = ({ policies }) => {
// filter out enabled predefined policies and only append the ones
// that are not present in a cluster.
const
predefined
=
PREDEFINED_NETWORK_POLICIES
.
filter
(
({
name
})
=>
!
policies
.
some
(
policy
=>
name
===
policy
.
name
),
({
name
})
=>
!
policies
.
some
(
(
policy
)
=>
name
===
policy
.
name
),
);
return
[...
policies
,
...
predefined
];
};
ee/app/assets/javascripts/threat_monitoring/store/modules/network_policies/mutations.js
View file @
a536349d
...
...
@@ -2,7 +2,7 @@ import * as types from './mutation_types';
import
{
convertObjectPropsToCamelCase
}
from
'
~/lib/utils/common_utils
'
;
const
setPolicies
=
(
state
,
policies
)
=>
{
state
.
policies
=
policies
.
map
(
policy
=>
convertObjectPropsToCamelCase
(
policy
));
state
.
policies
=
policies
.
map
(
(
policy
)
=>
convertObjectPropsToCamelCase
(
policy
));
};
export
default
{
...
...
@@ -43,7 +43,7 @@ export default {
},
[
types
.
RECEIVE_UPDATE_POLICY_SUCCESS
](
state
,
{
policy
,
updatedPolicy
})
{
const
newPolicy
=
convertObjectPropsToCamelCase
(
updatedPolicy
);
state
.
policies
=
state
.
policies
.
map
(
pol
=>
(
pol
.
name
===
policy
.
name
?
newPolicy
:
pol
));
state
.
policies
=
state
.
policies
.
map
(
(
pol
)
=>
(
pol
.
name
===
policy
.
name
?
newPolicy
:
pol
));
state
.
isUpdatingPolicy
=
false
;
state
.
errorUpdatingPolicy
=
false
;
},
...
...
ee/app/assets/javascripts/threat_monitoring/store/modules/threat_monitoring/actions.js
View file @
a536349d
...
...
@@ -35,7 +35,7 @@ const getAllEnvironments = (url, page = 1) =>
const
nextPage
=
headers
&&
headers
[
'
x-next-page
'
];
return
nextPage
?
// eslint-disable-next-line promise/no-nesting
getAllEnvironments
(
url
,
nextPage
).
then
(
environments
=>
[
getAllEnvironments
(
url
,
nextPage
).
then
(
(
environments
)
=>
[
...
data
.
environments
,
...
environments
,
])
...
...
@@ -50,7 +50,7 @@ export const fetchEnvironments = ({ state, dispatch }) => {
dispatch
(
'
requestEnvironments
'
);
return
getAllEnvironments
(
state
.
environmentsEndpoint
)
.
then
(
environments
=>
dispatch
(
'
receiveEnvironmentsSuccess
'
,
environments
))
.
then
(
(
environments
)
=>
dispatch
(
'
receiveEnvironmentsSuccess
'
,
environments
))
.
catch
(()
=>
dispatch
(
'
receiveEnvironmentsError
'
));
};
...
...
ee/app/assets/javascripts/threat_monitoring/store/modules/threat_monitoring_statistics/actions.js
View file @
a536349d
...
...
@@ -33,7 +33,7 @@ export const fetchStatistics = ({ state, dispatch, rootState }) => {
},
})
.
then
(({
data
})
=>
dispatch
(
'
receiveStatisticsSuccess
'
,
data
))
.
catch
(
error
=>
{
.
catch
(
(
error
)
=>
{
// A NOT_FOUND response from the endpoint means that there is no data for
// the given parameters. There are various reasons *why* there could be
// no data, but we can't distinguish between them, yet. So, just render
...
...
ee/app/assets/javascripts/threat_monitoring/store/modules/threat_monitoring_statistics/index.js
View file @
a536349d
...
...
@@ -3,7 +3,7 @@ import * as getters from './getters';
import
mutations
from
'
./mutations
'
;
import
state
from
'
./state
'
;
export
default
transformFunc
=>
({
export
default
(
transformFunc
)
=>
({
namespaced
:
true
,
actions
,
getters
,
...
...
ee/app/assets/javascripts/threat_monitoring/store/modules/threat_monitoring_statistics/mutations.js
View file @
a536349d
import
*
as
types
from
'
./mutation_types
'
;
import
createState
from
'
./state
'
;
export
default
transformFunc
=>
({
export
default
(
transformFunc
)
=>
({
[
types
.
SET_ENDPOINT
](
state
,
endpoint
)
{
state
.
statisticsEndpoint
=
endpoint
;
},
...
...
ee/app/assets/javascripts/threat_monitoring/store/utils.js
View file @
a536349d
import
{
pick
}
from
'
lodash
'
;
import
{
getTimeWindow
,
defaultTimeRange
}
from
'
~/vue_shared/constants
'
;
export
const
getTimeWindowConfig
=
timeWindow
=>
{
export
const
getTimeWindowConfig
=
(
timeWindow
)
=>
{
const
timeWindowObj
=
pick
(
getTimeWindow
(
timeWindow
)
||
defaultTimeRange
,
'
duration
'
,
'
interval
'
);
return
{
durationInMilliseconds
:
timeWindowObj
.
duration
.
seconds
*
1000
,
...
...
ee/app/assets/javascripts/validators/ip_address.js
View file @
a536349d
import
ipaddr
from
'
ipaddr.js
'
;
export
default
address
=>
{
export
default
(
address
)
=>
{
// Reject IP addresses that are only integers to match Ruby IPAddr
// https://github.com/whitequark/ipaddr.js/issues/7#issuecomment-158545695
if
(
/^
\d
+$/
.
exec
(
address
))
{
...
...
ee/app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals.vue
View file @
a536349d
...
...
@@ -39,7 +39,7 @@ export default {
return
this
.
mr
.
approvals
||
{};
},
approvedBy
()
{
return
this
.
approvals
.
approved_by
?
this
.
approvals
.
approved_by
.
map
(
x
=>
x
.
user
)
:
[];
return
this
.
approvals
.
approved_by
?
this
.
approvals
.
approved_by
.
map
(
(
x
)
=>
x
.
user
)
:
[];
},
approvalsRequired
()
{
return
(
!
this
.
isBasic
&&
this
.
approvals
.
approvals_required
)
||
0
;
...
...
@@ -76,7 +76,7 @@ export default {
this
.
isLoadingRules
=
true
;
return
this
.
service
.
fetchApprovalSettings
().
then
(
settings
=>
{
return
this
.
service
.
fetchApprovalSettings
().
then
(
(
settings
)
=>
{
this
.
mr
.
setApprovalRules
(
settings
);
this
.
isLoadingRules
=
false
;
});
...
...
ee/app/assets/javascripts/vue_merge_request_widget/components/approvals/approvals_list.vue
View file @
a536349d
...
...
@@ -38,20 +38,20 @@ export default {
{
id
:
uniqueId
(),
title
:
''
,
rules
:
this
.
approvalRules
.
filter
(
rule
=>
rule
.
rule_type
!==
RULE_TYPE_CODE_OWNER
),
rules
:
this
.
approvalRules
.
filter
(
(
rule
)
=>
rule
.
rule_type
!==
RULE_TYPE_CODE_OWNER
),
},
{
id
:
uniqueId
(),
title
:
__
(
'
Code Owners
'
),
rules
:
orderBy
(
this
.
approvalRules
.
filter
(
rule
=>
rule
.
rule_type
===
RULE_TYPE_CODE_OWNER
)
.
map
(
rule
=>
({
...
rule
,
nameClass
:
'
gl-font-monospace gl-word-break-all
'
})),
[
o
=>
o
.
section
===
'
codeowners
'
,
'
name
'
,
'
section
'
],
.
filter
(
(
rule
)
=>
rule
.
rule_type
===
RULE_TYPE_CODE_OWNER
)
.
map
(
(
rule
)
=>
({
...
rule
,
nameClass
:
'
gl-font-monospace gl-word-break-all
'
})),
[
(
o
)
=>
o
.
section
===
'
codeowners
'
,
'
name
'
,
'
section
'
],
[
'
desc
'
,
'
asc
'
,
'
asc
'
],
),
},
].
filter
(
x
=>
x
.
rules
.
length
);
].
filter
(
(
x
)
=>
x
.
rules
.
length
);
},
},
methods
:
{
...
...
ee/app/assets/javascripts/vue_merge_request_widget/components/blocking_merge_requests/blocking_merge_requests_report.vue
View file @
a536349d
...
...
@@ -35,7 +35,7 @@ export default {
},
unmergedBlockingMergeRequests
()
{
return
Object
.
keys
(
this
.
visibleMergeRequests
)
.
filter
(
state
=>
state
!==
'
merged
'
)
.
filter
(
(
state
)
=>
state
!==
'
merged
'
)
.
reduce
(
(
unmergedBlockingMRs
,
state
)
=>
state
===
'
closed
'
...
...
ee/app/assets/javascripts/vue_merge_request_widget/components/visual_review_app_link.vue
View file @
a536349d
...
...
@@ -77,7 +77,7 @@ export default {
/* eslint-enable no-useless-escape */
},
filteredChanges
()
{
return
this
.
changes
.
filter
(
change
=>
change
.
path
.
includes
(
this
.
changesSearchTerm
));
return
this
.
changes
.
filter
(
(
change
)
=>
change
.
path
.
includes
(
this
.
changesSearchTerm
));
},
instructionText
()
{
return
{
...
...
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