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
b282f7dd
Commit
b282f7dd
authored
Dec 23, 2020
by
Lukas Eipert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run prettier on 31 files - 5 of 73
Part of our prettier migration; changing the arrow-parens style.
parent
81e82875
Changes
32
Show whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
61 additions
and
94 deletions
+61
-94
.prettierignore
.prettierignore
+0
-33
app/assets/javascripts/add_context_commits_modal/utils.js
app/assets/javascripts/add_context_commits_modal/utils.js
+1
-1
app/assets/javascripts/admin/application_settings/setup_metrics_and_profiling.js
...admin/application_settings/setup_metrics_and_profiling.js
+1
-1
app/assets/javascripts/admin/statistics_panel/store/actions.js
...ssets/javascripts/admin/statistics_panel/store/actions.js
+1
-1
app/assets/javascripts/admin/statistics_panel/store/getters.js
...ssets/javascripts/admin/statistics_panel/store/getters.js
+2
-2
app/assets/javascripts/admin/users/components/users_table.vue
...assets/javascripts/admin/users/components/users_table.vue
+1
-1
app/assets/javascripts/admin/users/index.js
app/assets/javascripts/admin/users/index.js
+1
-1
app/assets/javascripts/alert_handler.js
app/assets/javascripts/alert_handler.js
+2
-2
app/assets/javascripts/alert_management/components/alert_details.vue
...javascripts/alert_management/components/alert_details.vue
+2
-2
app/assets/javascripts/alert_management/components/alert_management_table.vue
...ts/alert_management/components/alert_management_table.vue
+1
-1
app/assets/javascripts/alert_management/components/alert_metrics.vue
...javascripts/alert_management/components/alert_metrics.vue
+1
-1
app/assets/javascripts/alert_management/components/alert_status.vue
.../javascripts/alert_management/components/alert_status.vue
+1
-1
app/assets/javascripts/alert_management/components/sidebar/sidebar_assignees.vue
...alert_management/components/sidebar/sidebar_assignees.vue
+1
-1
app/assets/javascripts/alert_management/components/sidebar/sidebar_todo.vue
...ipts/alert_management/components/sidebar/sidebar_todo.vue
+1
-1
app/assets/javascripts/alert_management/details.js
app/assets/javascripts/alert_management/details.js
+3
-3
app/assets/javascripts/alert_management/list.js
app/assets/javascripts/alert_management/list.js
+1
-1
app/assets/javascripts/alerts_service_settings/components/alerts_service_form.vue
...lerts_service_settings/components/alerts_service_form.vue
+2
-2
app/assets/javascripts/alerts_service_settings/index.js
app/assets/javascripts/alerts_service_settings/index.js
+1
-1
app/assets/javascripts/alerts_settings/components/alert_mapping_builder.vue
...ipts/alerts_settings/components/alert_mapping_builder.vue
+6
-6
app/assets/javascripts/alerts_settings/components/alerts_integrations_list.vue
...s/alerts_settings/components/alerts_integrations_list.vue
+2
-2
app/assets/javascripts/alerts_settings/components/alerts_settings_form.vue
...ripts/alerts_settings/components/alerts_settings_form.vue
+4
-4
app/assets/javascripts/alerts_settings/graphql.js
app/assets/javascripts/alerts_settings/graphql.js
+1
-1
app/assets/javascripts/alerts_settings/index.js
app/assets/javascripts/alerts_settings/index.js
+1
-1
app/assets/javascripts/alerts_settings/utils/cache_updates.js
...assets/javascripts/alerts_settings/utils/cache_updates.js
+2
-2
app/assets/javascripts/analytics/instance_statistics/components/instance_statistics_count_chart.vue
...statistics/components/instance_statistics_count_chart.vue
+4
-4
app/assets/javascripts/analytics/instance_statistics/components/projects_and_groups_chart.vue
...tance_statistics/components/projects_and_groups_chart.vue
+4
-4
app/assets/javascripts/analytics/instance_statistics/components/users_chart.vue
.../analytics/instance_statistics/components/users_chart.vue
+2
-2
app/assets/javascripts/analytics/instance_statistics/utils.js
...assets/javascripts/analytics/instance_statistics/utils.js
+1
-1
app/assets/javascripts/analytics/product_analytics/activity_charts_bundle.js
...pts/analytics/product_analytics/activity_charts_bundle.js
+1
-1
app/assets/javascripts/api.js
app/assets/javascripts/api.js
+5
-5
app/assets/javascripts/authentication/u2f/authenticate.js
app/assets/javascripts/authentication/u2f/authenticate.js
+3
-3
app/assets/javascripts/authentication/u2f/register.js
app/assets/javascripts/authentication/u2f/register.js
+2
-2
No files found.
.prettierignore
View file @
b282f7dd
...
@@ -10,39 +10,6 @@ doc/api/graphql/reference/gitlab_schema.graphql
...
@@ -10,39 +10,6 @@ doc/api/graphql/reference/gitlab_schema.graphql
*.scss
*.scss
*.md
*.md
## interesting-kepler
app/assets/javascripts/add_context_commits_modal/utils.js
app/assets/javascripts/admin/application_settings/setup_metrics_and_profiling.js
app/assets/javascripts/admin/statistics_panel/store/actions.js
app/assets/javascripts/admin/statistics_panel/store/getters.js
app/assets/javascripts/admin/users/components/users_table.vue
app/assets/javascripts/admin/users/index.js
app/assets/javascripts/alert_handler.js
app/assets/javascripts/alert_management/components/alert_details.vue
app/assets/javascripts/alert_management/components/alert_management_table.vue
app/assets/javascripts/alert_management/components/alert_metrics.vue
app/assets/javascripts/alert_management/components/alert_status.vue
app/assets/javascripts/alert_management/components/sidebar/sidebar_assignees.vue
app/assets/javascripts/alert_management/components/sidebar/sidebar_todo.vue
app/assets/javascripts/alert_management/details.js
app/assets/javascripts/alert_management/list.js
app/assets/javascripts/alerts_service_settings/components/alerts_service_form.vue
app/assets/javascripts/alerts_service_settings/index.js
app/assets/javascripts/alerts_settings/components/alert_mapping_builder.vue
app/assets/javascripts/alerts_settings/components/alerts_integrations_list.vue
app/assets/javascripts/alerts_settings/components/alerts_settings_form.vue
app/assets/javascripts/alerts_settings/graphql.js
app/assets/javascripts/alerts_settings/index.js
app/assets/javascripts/alerts_settings/utils/cache_updates.js
app/assets/javascripts/analytics/instance_statistics/components/instance_statistics_count_chart.vue
app/assets/javascripts/analytics/instance_statistics/components/projects_and_groups_chart.vue
app/assets/javascripts/analytics/instance_statistics/components/users_chart.vue
app/assets/javascripts/analytics/instance_statistics/utils.js
app/assets/javascripts/analytics/product_analytics/activity_charts_bundle.js
app/assets/javascripts/api.js
app/assets/javascripts/authentication/u2f/authenticate.js
app/assets/javascripts/authentication/u2f/register.js
## reverent-lovelace
## reverent-lovelace
app/assets/javascripts/authentication/webauthn/authenticate.js
app/assets/javascripts/authentication/webauthn/authenticate.js
app/assets/javascripts/authentication/webauthn/register.js
app/assets/javascripts/authentication/webauthn/register.js
...
...
app/assets/javascripts/add_context_commits_modal/utils.js
View file @
b282f7dd
export
const
findCommitIndex
=
(
commits
,
commitShortId
)
=>
{
export
const
findCommitIndex
=
(
commits
,
commitShortId
)
=>
{
return
commits
.
findIndex
(
commit
=>
commit
.
short_id
===
commitShortId
);
return
commits
.
findIndex
(
(
commit
)
=>
commit
.
short_id
===
commitShortId
);
};
};
export
const
setCommitStatus
=
(
commits
,
commitIndex
,
selected
)
=>
{
export
const
setCommitStatus
=
(
commits
,
commitIndex
,
selected
)
=>
{
...
...
app/assets/javascripts/admin/application_settings/setup_metrics_and_profiling.js
View file @
b282f7dd
import
PayloadPreviewer
from
'
~/pages/admin/application_settings/payload_previewer
'
;
import
PayloadPreviewer
from
'
~/pages/admin/application_settings/payload_previewer
'
;
export
default
()
=>
{
export
default
()
=>
{
Array
.
from
(
document
.
querySelectorAll
(
'
.js-payload-preview-trigger
'
)).
forEach
(
trigger
=>
{
Array
.
from
(
document
.
querySelectorAll
(
'
.js-payload-preview-trigger
'
)).
forEach
(
(
trigger
)
=>
{
new
PayloadPreviewer
(
trigger
).
init
();
new
PayloadPreviewer
(
trigger
).
init
();
});
});
};
};
app/assets/javascripts/admin/statistics_panel/store/actions.js
View file @
b282f7dd
...
@@ -13,7 +13,7 @@ export const fetchStatistics = ({ dispatch }) => {
...
@@ -13,7 +13,7 @@ export const fetchStatistics = ({ dispatch }) => {
.
then
(({
data
})
=>
{
.
then
(({
data
})
=>
{
dispatch
(
'
receiveStatisticsSuccess
'
,
convertObjectPropsToCamelCase
(
data
,
{
deep
:
true
}));
dispatch
(
'
receiveStatisticsSuccess
'
,
convertObjectPropsToCamelCase
(
data
,
{
deep
:
true
}));
})
})
.
catch
(
error
=>
dispatch
(
'
receiveStatisticsError
'
,
error
));
.
catch
(
(
error
)
=>
dispatch
(
'
receiveStatisticsError
'
,
error
));
};
};
export
const
receiveStatisticsSuccess
=
({
commit
},
statistics
)
=>
export
const
receiveStatisticsSuccess
=
({
commit
},
statistics
)
=>
...
...
app/assets/javascripts/admin/statistics_panel/store/getters.js
View file @
b282f7dd
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
* and returns an array of the following form:
* and returns an array of the following form:
* [{ key: "forks", label: "Forks", value: 50 }]
* [{ key: "forks", label: "Forks", value: 50 }]
*/
*/
export
const
getStatistics
=
state
=>
labels
=>
export
const
getStatistics
=
(
state
)
=>
(
labels
)
=>
Object
.
keys
(
labels
).
map
(
key
=>
{
Object
.
keys
(
labels
).
map
(
(
key
)
=>
{
const
result
=
{
const
result
=
{
key
,
key
,
label
:
labels
[
key
],
label
:
labels
[
key
],
...
...
app/assets/javascripts/admin/users/components/users_table.vue
View file @
b282f7dd
...
@@ -4,7 +4,7 @@ import { __ } from '~/locale';
...
@@ -4,7 +4,7 @@ import { __ } from '~/locale';
const
DEFAULT_TH_CLASSES
=
const
DEFAULT_TH_CLASSES
=
'
gl-bg-transparent! gl-border-b-solid! gl-border-b-gray-100! gl-p-5! gl-border-b-1!
'
;
'
gl-bg-transparent! gl-border-b-solid! gl-border-b-gray-100! gl-p-5! gl-border-b-1!
'
;
const
thWidthClass
=
width
=>
`gl-w-
${
width
}
p
${
DEFAULT_TH_CLASSES
}
`
;
const
thWidthClass
=
(
width
)
=>
`gl-w-
${
width
}
p
${
DEFAULT_TH_CLASSES
}
`
;
export
default
{
export
default
{
components
:
{
components
:
{
...
...
app/assets/javascripts/admin/users/index.js
View file @
b282f7dd
...
@@ -11,7 +11,7 @@ export default function (el = document.querySelector('#js-admin-users-app')) {
...
@@ -11,7 +11,7 @@ export default function (el = document.querySelector('#js-admin-users-app')) {
return
new
Vue
({
return
new
Vue
({
el
,
el
,
render
:
createElement
=>
render
:
(
createElement
)
=>
createElement
(
AdminUsersApp
,
{
createElement
(
AdminUsersApp
,
{
props
:
{
props
:
{
users
:
convertObjectPropsToCamelCase
(
JSON
.
parse
(
users
),
{
deep
:
true
}),
users
:
convertObjectPropsToCamelCase
(
JSON
.
parse
(
users
),
{
deep
:
true
}),
...
...
app/assets/javascripts/alert_handler.js
View file @
b282f7dd
...
@@ -8,9 +8,9 @@ export default function initAlertHandler() {
...
@@ -8,9 +8,9 @@ export default function initAlertHandler() {
const
DISMISS_LABEL
=
'
[aria-label="Dismiss"]
'
;
const
DISMISS_LABEL
=
'
[aria-label="Dismiss"]
'
;
const
DISMISS_CLASS
=
'
.gl-alert-dismiss
'
;
const
DISMISS_CLASS
=
'
.gl-alert-dismiss
'
;
DISMISSIBLE_SELECTORS
.
forEach
(
selector
=>
{
DISMISSIBLE_SELECTORS
.
forEach
(
(
selector
)
=>
{
const
elements
=
document
.
querySelectorAll
(
selector
);
const
elements
=
document
.
querySelectorAll
(
selector
);
elements
.
forEach
(
element
=>
{
elements
.
forEach
(
(
element
)
=>
{
const
button
=
element
.
querySelector
(
DISMISS_LABEL
)
||
element
.
querySelector
(
DISMISS_CLASS
);
const
button
=
element
.
querySelector
(
DISMISS_LABEL
)
||
element
.
querySelector
(
DISMISS_CLASS
);
if
(
!
button
)
{
if
(
!
button
)
{
return
;
return
;
...
...
app/assets/javascripts/alert_management/components/alert_details.vue
View file @
b282f7dd
...
@@ -140,7 +140,7 @@ export default {
...
@@ -140,7 +140,7 @@ export default {
},
},
currentTabIndex
:
{
currentTabIndex
:
{
get
()
{
get
()
{
return
this
.
$options
.
tabsConfig
.
findIndex
(
tab
=>
tab
.
id
===
this
.
activeTab
);
return
this
.
$options
.
tabsConfig
.
findIndex
(
(
tab
)
=>
tab
.
id
===
this
.
activeTab
);
},
},
set
(
tabIdx
)
{
set
(
tabIdx
)
{
const
tabId
=
this
.
$options
.
tabsConfig
[
tabIdx
].
id
;
const
tabId
=
this
.
$options
.
tabsConfig
[
tabIdx
].
id
;
...
@@ -208,7 +208,7 @@ export default {
...
@@ -208,7 +208,7 @@ export default {
}
}
},
},
)
)
.
catch
(
error
=>
{
.
catch
(
(
error
)
=>
{
this
.
createIncidentError
=
error
;
this
.
createIncidentError
=
error
;
this
.
incidentCreationInProgress
=
false
;
this
.
incidentCreationInProgress
=
false
;
});
});
...
...
app/assets/javascripts/alert_management/components/alert_management_table.vue
View file @
b282f7dd
...
@@ -138,7 +138,7 @@ export default {
...
@@ -138,7 +138,7 @@ export default {
data
.
project
||
{};
data
.
project
||
{};
const
now
=
new
Date
();
const
now
=
new
Date
();
const
listWithData
=
list
.
map
(
alert
=>
{
const
listWithData
=
list
.
map
(
(
alert
)
=>
{
const
then
=
new
Date
(
alert
.
startedAt
);
const
then
=
new
Date
(
alert
.
startedAt
);
const
diff
=
now
-
then
;
const
diff
=
now
-
then
;
...
...
app/assets/javascripts/alert_management/components/alert_metrics.vue
View file @
b282f7dd
...
@@ -33,7 +33,7 @@ export default {
...
@@ -33,7 +33,7 @@ export default {
});
});
this
.
metricEmbedComponent
=
MetricEmbed
;
this
.
metricEmbedComponent
=
MetricEmbed
;
})
})
.
catch
(
e
=>
Sentry
.
captureException
(
e
));
.
catch
(
(
e
)
=>
Sentry
.
captureException
(
e
));
}
}
},
},
};
};
...
...
app/assets/javascripts/alert_management/components/alert_status.vue
View file @
b282f7dd
...
@@ -57,7 +57,7 @@ export default {
...
@@ -57,7 +57,7 @@ export default {
projectPath
:
this
.
projectPath
,
projectPath
:
this
.
projectPath
,
},
},
})
})
.
then
(
resp
=>
{
.
then
(
(
resp
)
=>
{
this
.
trackStatusUpdate
(
status
);
this
.
trackStatusUpdate
(
status
);
const
errors
=
resp
.
data
?.
updateAlertStatus
?.
errors
||
[];
const
errors
=
resp
.
data
?.
updateAlertStatus
?.
errors
||
[];
...
...
app/assets/javascripts/alert_management/components/sidebar/sidebar_assignees.vue
View file @
b282f7dd
...
@@ -92,7 +92,7 @@ export default {
...
@@ -92,7 +92,7 @@ export default {
},
},
sortedUsers
()
{
sortedUsers
()
{
return
this
.
users
return
this
.
users
.
map
(
user
=>
({
...
user
,
active
:
this
.
isActive
(
user
.
username
)
}))
.
map
(
(
user
)
=>
({
...
user
,
active
:
this
.
isActive
(
user
.
username
)
}))
.
sort
((
a
,
b
)
=>
(
a
.
active
===
b
.
active
?
0
:
a
.
active
?
-
1
:
1
));
// eslint-disable-line no-nested-ternary
.
sort
((
a
,
b
)
=>
(
a
.
active
===
b
.
active
?
0
:
a
.
active
?
-
1
:
1
));
// eslint-disable-line no-nested-ternary
},
},
dropdownClass
()
{
dropdownClass
()
{
...
...
app/assets/javascripts/alert_management/components/sidebar/sidebar_todo.vue
View file @
b282f7dd
...
@@ -115,7 +115,7 @@ export default {
...
@@ -115,7 +115,7 @@ export default {
variables
:
this
.
getAlertQueryVariables
,
variables
:
this
.
getAlertQueryVariables
,
});
});
const
data
=
produce
(
sourceData
,
draftData
=>
{
const
data
=
produce
(
sourceData
,
(
draftData
)
=>
{
// eslint-disable-next-line no-param-reassign
// eslint-disable-next-line no-param-reassign
draftData
.
project
.
alertManagementAlerts
.
nodes
[
0
].
todos
.
nodes
=
[];
draftData
.
project
.
alertManagementAlerts
.
nodes
[
0
].
todos
.
nodes
=
[];
});
});
...
...
app/assets/javascripts/alert_management/details.js
View file @
b282f7dd
...
@@ -9,7 +9,7 @@ import createRouter from './router';
...
@@ -9,7 +9,7 @@ import createRouter from './router';
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
export
default
selector
=>
{
export
default
(
selector
)
=>
{
const
domEl
=
document
.
querySelector
(
selector
);
const
domEl
=
document
.
querySelector
(
selector
);
const
{
alertId
,
projectPath
,
projectIssuesPath
,
projectId
}
=
domEl
.
dataset
;
const
{
alertId
,
projectPath
,
projectIssuesPath
,
projectId
}
=
domEl
.
dataset
;
const
router
=
createRouter
();
const
router
=
createRouter
();
...
@@ -18,7 +18,7 @@ export default selector => {
...
@@ -18,7 +18,7 @@ export default selector => {
Mutation
:
{
Mutation
:
{
toggleSidebarStatus
:
(
_
,
__
,
{
cache
})
=>
{
toggleSidebarStatus
:
(
_
,
__
,
{
cache
})
=>
{
const
sourceData
=
cache
.
readQuery
({
query
:
sidebarStatusQuery
});
const
sourceData
=
cache
.
readQuery
({
query
:
sidebarStatusQuery
});
const
data
=
produce
(
sourceData
,
draftData
=>
{
const
data
=
produce
(
sourceData
,
(
draftData
)
=>
{
// eslint-disable-next-line no-param-reassign
// eslint-disable-next-line no-param-reassign
draftData
.
sidebarStatus
=
!
draftData
.
sidebarStatus
;
draftData
.
sidebarStatus
=
!
draftData
.
sidebarStatus
;
});
});
...
@@ -30,7 +30,7 @@ export default selector => {
...
@@ -30,7 +30,7 @@ export default selector => {
const
apolloProvider
=
new
VueApollo
({
const
apolloProvider
=
new
VueApollo
({
defaultClient
:
createDefaultClient
(
resolvers
,
{
defaultClient
:
createDefaultClient
(
resolvers
,
{
cacheConfig
:
{
cacheConfig
:
{
dataIdFromObject
:
object
=>
{
dataIdFromObject
:
(
object
)
=>
{
// eslint-disable-next-line no-underscore-dangle
// eslint-disable-next-line no-underscore-dangle
if
(
object
.
__typename
===
'
AlertManagementAlert
'
)
{
if
(
object
.
__typename
===
'
AlertManagementAlert
'
)
{
return
object
.
iid
;
return
object
.
iid
;
...
...
app/assets/javascripts/alert_management/list.js
View file @
b282f7dd
...
@@ -30,7 +30,7 @@ export default () => {
...
@@ -30,7 +30,7 @@ export default () => {
{},
{},
{
{
cacheConfig
:
{
cacheConfig
:
{
dataIdFromObject
:
object
=>
{
dataIdFromObject
:
(
object
)
=>
{
// eslint-disable-next-line no-underscore-dangle
// eslint-disable-next-line no-underscore-dangle
if
(
object
.
__typename
===
'
AlertManagementAlert
'
)
{
if
(
object
.
__typename
===
'
AlertManagementAlert
'
)
{
return
object
.
iid
;
return
object
.
iid
;
...
...
app/assets/javascripts/alerts_service_settings/components/alerts_service_form.vue
View file @
b282f7dd
...
@@ -98,7 +98,7 @@ export default {
...
@@ -98,7 +98,7 @@ export default {
},
},
methods
:
{
methods
:
{
updateIcon
()
{
updateIcon
()
{
return
document
.
querySelectorAll
(
'
.js-service-active-status
'
).
forEach
(
icon
=>
{
return
document
.
querySelectorAll
(
'
.js-service-active-status
'
).
forEach
(
(
icon
)
=>
{
if
(
icon
.
dataset
.
value
===
this
.
activated
.
toString
())
{
if
(
icon
.
dataset
.
value
===
this
.
activated
.
toString
())
{
icon
.
classList
.
remove
(
'
d-none
'
);
icon
.
classList
.
remove
(
'
d-none
'
);
}
else
{
}
else
{
...
@@ -109,7 +109,7 @@ export default {
...
@@ -109,7 +109,7 @@ export default {
resetKey
()
{
resetKey
()
{
return
axios
return
axios
.
put
(
this
.
formPath
,
{
service
:
{
token
:
''
}
})
.
put
(
this
.
formPath
,
{
service
:
{
token
:
''
}
})
.
then
(
res
=>
{
.
then
(
(
res
)
=>
{
this
.
authorizationKey
=
res
.
data
.
token
;
this
.
authorizationKey
=
res
.
data
.
token
;
})
})
.
catch
(()
=>
{
.
catch
(()
=>
{
...
...
app/assets/javascripts/alerts_service_settings/index.js
View file @
b282f7dd
...
@@ -2,7 +2,7 @@ import Vue from 'vue';
...
@@ -2,7 +2,7 @@ import Vue from 'vue';
import
{
parseBoolean
}
from
'
~/lib/utils/common_utils
'
;
import
{
parseBoolean
}
from
'
~/lib/utils/common_utils
'
;
import
AlertsServiceForm
from
'
./components/alerts_service_form.vue
'
;
import
AlertsServiceForm
from
'
./components/alerts_service_form.vue
'
;
export
default
el
=>
{
export
default
(
el
)
=>
{
if
(
!
el
)
{
if
(
!
el
)
{
return
null
;
return
null
;
}
}
...
...
app/assets/javascripts/alerts_settings/components/alert_mapping_builder.vue
View file @
b282f7dd
...
@@ -64,9 +64,9 @@ export default {
...
@@ -64,9 +64,9 @@ export default {
},
},
computed
:
{
computed
:
{
mappingData
()
{
mappingData
()
{
return
this
.
gitlabFields
.
map
(
gitlabField
=>
{
return
this
.
gitlabFields
.
map
(
(
gitlabField
)
=>
{
const
mappingFields
=
this
.
payloadFields
.
filter
(({
type
})
=>
const
mappingFields
=
this
.
payloadFields
.
filter
(({
type
})
=>
type
.
some
(
t
=>
gitlabField
.
compatibleTypes
.
includes
(
t
)),
type
.
some
(
(
t
)
=>
gitlabField
.
compatibleTypes
.
includes
(
t
)),
);
);
const
foundMapping
=
this
.
mapping
.
find
(
const
foundMapping
=
this
.
mapping
.
find
(
...
@@ -88,26 +88,26 @@ export default {
...
@@ -88,26 +88,26 @@ export default {
},
},
methods
:
{
methods
:
{
setMapping
(
gitlabKey
,
mappingKey
,
valueKey
)
{
setMapping
(
gitlabKey
,
mappingKey
,
valueKey
)
{
const
fieldIndex
=
this
.
gitlabFields
.
findIndex
(
field
=>
field
.
name
===
gitlabKey
);
const
fieldIndex
=
this
.
gitlabFields
.
findIndex
(
(
field
)
=>
field
.
name
===
gitlabKey
);
const
updatedField
=
{
...
this
.
gitlabFields
[
fieldIndex
],
...{
[
valueKey
]:
mappingKey
}
};
const
updatedField
=
{
...
this
.
gitlabFields
[
fieldIndex
],
...{
[
valueKey
]:
mappingKey
}
};
Vue
.
set
(
this
.
gitlabFields
,
fieldIndex
,
updatedField
);
Vue
.
set
(
this
.
gitlabFields
,
fieldIndex
,
updatedField
);
},
},
setSearchTerm
(
search
=
''
,
searchFieldKey
,
gitlabKey
)
{
setSearchTerm
(
search
=
''
,
searchFieldKey
,
gitlabKey
)
{
const
fieldIndex
=
this
.
gitlabFields
.
findIndex
(
field
=>
field
.
name
===
gitlabKey
);
const
fieldIndex
=
this
.
gitlabFields
.
findIndex
(
(
field
)
=>
field
.
name
===
gitlabKey
);
const
updatedField
=
{
...
this
.
gitlabFields
[
fieldIndex
],
...{
[
searchFieldKey
]:
search
}
};
const
updatedField
=
{
...
this
.
gitlabFields
[
fieldIndex
],
...{
[
searchFieldKey
]:
search
}
};
Vue
.
set
(
this
.
gitlabFields
,
fieldIndex
,
updatedField
);
Vue
.
set
(
this
.
gitlabFields
,
fieldIndex
,
updatedField
);
},
},
filterFields
(
searchTerm
=
''
,
fields
)
{
filterFields
(
searchTerm
=
''
,
fields
)
{
const
search
=
searchTerm
.
toLowerCase
();
const
search
=
searchTerm
.
toLowerCase
();
return
fields
.
filter
(
field
=>
field
.
label
.
toLowerCase
().
includes
(
search
));
return
fields
.
filter
(
(
field
)
=>
field
.
label
.
toLowerCase
().
includes
(
search
));
},
},
isSelected
(
fieldValue
,
mapping
)
{
isSelected
(
fieldValue
,
mapping
)
{
return
fieldValue
===
mapping
;
return
fieldValue
===
mapping
;
},
},
selectedValue
(
name
)
{
selectedValue
(
name
)
{
return
(
return
(
this
.
payloadFields
.
find
(
item
=>
item
.
name
===
name
)?.
label
||
this
.
payloadFields
.
find
(
(
item
)
=>
item
.
name
===
name
)?.
label
||
this
.
$options
.
i18n
.
makeSelection
this
.
$options
.
i18n
.
makeSelection
);
);
},
},
...
...
app/assets/javascripts/alerts_settings/components/alerts_integrations_list.vue
View file @
b282f7dd
...
@@ -97,8 +97,8 @@ export default {
...
@@ -97,8 +97,8 @@ export default {
};
};
},
},
mounted
()
{
mounted
()
{
const
callback
=
entries
=>
{
const
callback
=
(
entries
)
=>
{
const
isVisible
=
entries
.
some
(
entry
=>
entry
.
isIntersecting
);
const
isVisible
=
entries
.
some
(
(
entry
)
=>
entry
.
isIntersecting
);
if
(
isVisible
)
{
if
(
isVisible
)
{
this
.
trackPageViews
();
this
.
trackPageViews
();
...
...
app/assets/javascripts/alerts_settings/components/alerts_settings_form.vue
View file @
b282f7dd
...
@@ -197,7 +197,7 @@ export default {
...
@@ -197,7 +197,7 @@ export default {
return
options
;
return
options
;
},
},
options
()
{
options
()
{
return
integrationTypesNew
.
map
(
el
=>
({
return
integrationTypesNew
.
map
(
(
el
)
=>
({
...
el
,
...
el
,
disabled
:
this
.
disabledIntegrations
.
includes
(
el
.
value
),
disabled
:
this
.
disabledIntegrations
.
includes
(
el
.
value
),
}));
}));
...
@@ -390,10 +390,10 @@ export default {
...
@@ -390,10 +390,10 @@ export default {
// TODO: replace with real BE mutation when ready;
// TODO: replace with real BE mutation when ready;
this
.
parsingPayload
=
true
;
this
.
parsingPayload
=
true
;
return
new
Promise
(
resolve
=>
{
return
new
Promise
(
(
resolve
)
=>
{
setTimeout
(()
=>
resolve
(
mockedCustomMapping
),
1000
);
setTimeout
(()
=>
resolve
(
mockedCustomMapping
),
1000
);
})
})
.
then
(
res
=>
{
.
then
(
(
res
)
=>
{
const
mapping
=
{
...
res
};
const
mapping
=
{
...
res
};
delete
mapping
.
storedMapping
;
delete
mapping
.
storedMapping
;
this
.
customMapping
=
res
;
this
.
customMapping
=
res
;
...
@@ -408,7 +408,7 @@ export default {
...
@@ -408,7 +408,7 @@ export default {
},
},
getIntegrationMapping
()
{
getIntegrationMapping
()
{
// TODO: replace with real BE mutation when ready;
// TODO: replace with real BE mutation when ready;
return
Promise
.
resolve
(
mockedCustomMapping
).
then
(
res
=>
{
return
Promise
.
resolve
(
mockedCustomMapping
).
then
(
(
res
)
=>
{
this
.
customMapping
=
res
;
this
.
customMapping
=
res
;
this
.
integrationTestPayload
.
json
=
res
?.
samplePayload
.
body
;
this
.
integrationTestPayload
.
json
=
res
?.
samplePayload
.
body
;
});
});
...
...
app/assets/javascripts/alerts_settings/graphql.js
View file @
b282f7dd
...
@@ -14,7 +14,7 @@ const resolvers = {
...
@@ -14,7 +14,7 @@ const resolvers = {
{
cache
},
{
cache
},
)
=>
{
)
=>
{
const
sourceData
=
cache
.
readQuery
({
query
:
getCurrentIntegrationQuery
});
const
sourceData
=
cache
.
readQuery
({
query
:
getCurrentIntegrationQuery
});
const
data
=
produce
(
sourceData
,
draftData
=>
{
const
data
=
produce
(
sourceData
,
(
draftData
)
=>
{
if
(
id
===
null
)
{
if
(
id
===
null
)
{
// eslint-disable-next-line no-param-reassign
// eslint-disable-next-line no-param-reassign
draftData
.
currentIntegration
=
null
;
draftData
.
currentIntegration
=
null
;
...
...
app/assets/javascripts/alerts_settings/index.js
View file @
b282f7dd
...
@@ -11,7 +11,7 @@ apolloProvider.clients.defaultClient.cache.writeData({
...
@@ -11,7 +11,7 @@ apolloProvider.clients.defaultClient.cache.writeData({
});
});
Vue
.
use
(
GlToast
);
Vue
.
use
(
GlToast
);
export
default
el
=>
{
export
default
(
el
)
=>
{
if
(
!
el
)
{
if
(
!
el
)
{
return
null
;
return
null
;
}
}
...
...
app/assets/javascripts/alerts_settings/utils/cache_updates.js
View file @
b282f7dd
...
@@ -14,7 +14,7 @@ const deleteIntegrationFromStore = (store, query, { httpIntegrationDestroy }, va
...
@@ -14,7 +14,7 @@ const deleteIntegrationFromStore = (store, query, { httpIntegrationDestroy }, va
variables
,
variables
,
});
});
const
data
=
produce
(
sourceData
,
draftData
=>
{
const
data
=
produce
(
sourceData
,
(
draftData
)
=>
{
// eslint-disable-next-line no-param-reassign
// eslint-disable-next-line no-param-reassign
draftData
.
project
.
alertManagementIntegrations
.
nodes
=
draftData
.
project
.
alertManagementIntegrations
.
nodes
.
filter
(
draftData
.
project
.
alertManagementIntegrations
.
nodes
=
draftData
.
project
.
alertManagementIntegrations
.
nodes
.
filter
(
({
id
})
=>
id
!==
integration
.
id
,
({
id
})
=>
id
!==
integration
.
id
,
...
@@ -45,7 +45,7 @@ const addIntegrationToStore = (
...
@@ -45,7 +45,7 @@ const addIntegrationToStore = (
variables
,
variables
,
});
});
const
data
=
produce
(
sourceData
,
draftData
=>
{
const
data
=
produce
(
sourceData
,
(
draftData
)
=>
{
// eslint-disable-next-line no-param-reassign
// eslint-disable-next-line no-param-reassign
draftData
.
project
.
alertManagementIntegrations
.
nodes
=
[
draftData
.
project
.
alertManagementIntegrations
.
nodes
=
[
integration
,
integration
,
...
...
app/assets/javascripts/analytics/instance_statistics/components/instance_statistics_count_chart.vue
View file @
b282f7dd
...
@@ -60,13 +60,13 @@ export default {
...
@@ -60,13 +60,13 @@ export default {
return
Object
.
values
(
this
.
errors
);
return
Object
.
values
(
this
.
errors
);
},
},
isLoading
()
{
isLoading
()
{
return
some
(
this
.
$apollo
.
queries
,
query
=>
query
?.
loading
);
return
some
(
this
.
$apollo
.
queries
,
(
query
)
=>
query
?.
loading
);
},
},
allQueriesFailed
()
{
allQueriesFailed
()
{
return
every
(
this
.
errorMessages
,
message
=>
message
.
length
);
return
every
(
this
.
errorMessages
,
(
message
)
=>
message
.
length
);
},
},
hasLoadingErrors
()
{
hasLoadingErrors
()
{
return
some
(
this
.
errorMessages
,
message
=>
message
.
length
);
return
some
(
this
.
errorMessages
,
(
message
)
=>
message
.
length
);
},
},
errorMessage
()
{
errorMessage
()
{
// show the generic loading message if all requests fail
// show the generic loading message if all requests fail
...
@@ -179,7 +179,7 @@ export default {
...
@@ -179,7 +179,7 @@ export default {
};
};
},
},
})
})
.
catch
(
error
=>
this
.
handleError
({
identifier
,
error
,
message
:
errorMessage
}));
.
catch
(
(
error
)
=>
this
.
handleError
({
identifier
,
error
,
message
:
errorMessage
}));
},
},
},
},
};
};
...
...
app/assets/javascripts/analytics/instance_statistics/components/projects_and_groups_chart.vue
View file @
b282f7dd
...
@@ -11,7 +11,7 @@ import latestGroupsQuery from '../graphql/queries/groups.query.graphql';
...
@@ -11,7 +11,7 @@ import latestGroupsQuery from '../graphql/queries/groups.query.graphql';
import
latestProjectsQuery
from
'
../graphql/queries/projects.query.graphql
'
;
import
latestProjectsQuery
from
'
../graphql/queries/projects.query.graphql
'
;
import
{
getAverageByMonth
}
from
'
../utils
'
;
import
{
getAverageByMonth
}
from
'
../utils
'
;
const
sortByDate
=
data
=>
sortBy
(
data
,
item
=>
new
Date
(
item
[
0
]).
getTime
());
const
sortByDate
=
(
data
)
=>
sortBy
(
data
,
(
item
)
=>
new
Date
(
item
[
0
]).
getTime
());
const
averageAndSortData
=
(
data
=
[],
maxDataPoints
)
=>
{
const
averageAndSortData
=
(
data
=
[],
maxDataPoints
)
=>
{
const
averaged
=
getAverageByMonth
(
const
averaged
=
getAverageByMonth
(
...
@@ -148,7 +148,7 @@ export default {
...
@@ -148,7 +148,7 @@ export default {
name
:
this
.
$options
.
i18n
.
xAxisTitle
,
name
:
this
.
$options
.
i18n
.
xAxisTitle
,
type
:
'
category
'
,
type
:
'
category
'
,
axisLabel
:
{
axisLabel
:
{
formatter
:
value
=>
{
formatter
:
(
value
)
=>
{
return
formatDateAsMonth
(
value
);
return
formatDateAsMonth
(
value
);
},
},
},
},
...
@@ -189,7 +189,7 @@ export default {
...
@@ -189,7 +189,7 @@ export default {
.
fetchMore
({
.
fetchMore
({
variables
:
{
first
:
this
.
totalDataPoints
,
after
:
pageInfo
.
endCursor
},
variables
:
{
first
:
this
.
totalDataPoints
,
after
:
pageInfo
.
endCursor
},
updateQuery
:
(
previousResult
,
{
fetchMoreResult
})
=>
{
updateQuery
:
(
previousResult
,
{
fetchMoreResult
})
=>
{
const
results
=
produce
(
fetchMoreResult
,
newData
=>
{
const
results
=
produce
(
fetchMoreResult
,
(
newData
)
=>
{
// eslint-disable-next-line no-param-reassign
// eslint-disable-next-line no-param-reassign
newData
[
dataKey
].
nodes
=
[
newData
[
dataKey
].
nodes
=
[
...
previousResult
[
dataKey
].
nodes
,
...
previousResult
[
dataKey
].
nodes
,
...
@@ -199,7 +199,7 @@ export default {
...
@@ -199,7 +199,7 @@ export default {
return
results
;
return
results
;
},
},
})
})
.
catch
(
error
=>
{
.
catch
(
(
error
)
=>
{
this
.
handleError
({
error
,
message
:
errorMessage
,
dataKey
});
this
.
handleError
({
error
,
message
:
errorMessage
,
dataKey
});
});
});
}
}
...
...
app/assets/javascripts/analytics/instance_statistics/components/users_chart.vue
View file @
b282f7dd
...
@@ -10,7 +10,7 @@ import { formatDateAsMonth } from '~/lib/utils/datetime_utility';
...
@@ -10,7 +10,7 @@ import { formatDateAsMonth } from '~/lib/utils/datetime_utility';
import
usersQuery
from
'
../graphql/queries/users.query.graphql
'
;
import
usersQuery
from
'
../graphql/queries/users.query.graphql
'
;
import
{
getAverageByMonth
}
from
'
../utils
'
;
import
{
getAverageByMonth
}
from
'
../utils
'
;
const
sortByDate
=
data
=>
sortBy
(
data
,
item
=>
new
Date
(
item
[
0
]).
getTime
());
const
sortByDate
=
(
data
)
=>
sortBy
(
data
,
(
item
)
=>
new
Date
(
item
[
0
]).
getTime
());
export
default
{
export
default
{
name
:
'
UsersChart
'
,
name
:
'
UsersChart
'
,
...
@@ -106,7 +106,7 @@ export default {
...
@@ -106,7 +106,7 @@ export default {
.
fetchMore
({
.
fetchMore
({
variables
:
{
first
:
this
.
totalDataPoints
,
after
:
this
.
pageInfo
.
endCursor
},
variables
:
{
first
:
this
.
totalDataPoints
,
after
:
this
.
pageInfo
.
endCursor
},
updateQuery
:
(
previousResult
,
{
fetchMoreResult
})
=>
{
updateQuery
:
(
previousResult
,
{
fetchMoreResult
})
=>
{
return
produce
(
fetchMoreResult
,
newUsers
=>
{
return
produce
(
fetchMoreResult
,
(
newUsers
)
=>
{
// eslint-disable-next-line no-param-reassign
// eslint-disable-next-line no-param-reassign
newUsers
.
users
.
nodes
=
[...
previousResult
.
users
.
nodes
,
...
newUsers
.
users
.
nodes
];
newUsers
.
users
.
nodes
=
[...
previousResult
.
users
.
nodes
,
...
newUsers
.
users
.
nodes
];
});
});
...
...
app/assets/javascripts/analytics/instance_statistics/utils.js
View file @
b282f7dd
...
@@ -29,7 +29,7 @@ export function getAverageByMonth(items = [], options = {}) {
...
@@ -29,7 +29,7 @@ export function getAverageByMonth(items = [], options = {}) {
return
{
...
memo
,
[
month
]:
{
sum
:
count
,
recordCount
:
1
}
};
return
{
...
memo
,
[
month
]:
{
sum
:
count
,
recordCount
:
1
}
};
},
{});
},
{});
return
Object
.
keys
(
itemsMap
).
map
(
month
=>
{
return
Object
.
keys
(
itemsMap
).
map
(
(
month
)
=>
{
const
{
sum
,
recordCount
}
=
itemsMap
[
month
];
const
{
sum
,
recordCount
}
=
itemsMap
[
month
];
const
avg
=
sum
/
recordCount
;
const
avg
=
sum
/
recordCount
;
if
(
shouldRound
)
{
if
(
shouldRound
)
{
...
...
app/assets/javascripts/analytics/product_analytics/activity_charts_bundle.js
View file @
b282f7dd
...
@@ -8,7 +8,7 @@ export default () => {
...
@@ -8,7 +8,7 @@ export default () => {
return
false
;
return
false
;
}
}
return
containers
.
forEach
(
container
=>
{
return
containers
.
forEach
(
(
container
)
=>
{
const
{
chartData
}
=
container
.
dataset
;
const
{
chartData
}
=
container
.
dataset
;
const
formattedData
=
JSON
.
parse
(
chartData
);
const
formattedData
=
JSON
.
parse
(
chartData
);
...
...
app/assets/javascripts/api.js
View file @
b282f7dd
...
@@ -374,8 +374,8 @@ const Api = {
...
@@ -374,8 +374,8 @@ const Api = {
.
post
(
url
,
{
.
post
(
url
,
{
label
:
data
,
label
:
data
,
})
})
.
then
(
res
=>
callback
(
res
.
data
))
.
then
(
(
res
)
=>
callback
(
res
.
data
))
.
catch
(
e
=>
callback
(
e
.
response
.
data
));
.
catch
(
(
e
)
=>
callback
(
e
.
response
.
data
));
},
},
// Return group projects list. Filtered by query
// Return group projects list. Filtered by query
...
@@ -431,7 +431,7 @@ const Api = {
...
@@ -431,7 +431,7 @@ const Api = {
commitPipelines
(
projectId
,
sha
)
{
commitPipelines
(
projectId
,
sha
)
{
const
encodedProjectId
=
projectId
const
encodedProjectId
=
projectId
.
split
(
'
/
'
)
.
split
(
'
/
'
)
.
map
(
fragment
=>
encodeURIComponent
(
fragment
))
.
map
(
(
fragment
)
=>
encodeURIComponent
(
fragment
))
.
join
(
'
/
'
);
.
join
(
'
/
'
);
const
url
=
Api
.
buildUrl
(
Api
.
commitPipelinesPath
)
const
url
=
Api
.
buildUrl
(
Api
.
commitPipelinesPath
)
...
@@ -455,7 +455,7 @@ const Api = {
...
@@ -455,7 +455,7 @@ const Api = {
.
replace
(
'
:type
'
,
type
)
.
replace
(
'
:type
'
,
type
)
.
replace
(
'
:key
'
,
encodeURIComponent
(
key
));
.
replace
(
'
:key
'
,
encodeURIComponent
(
key
));
return
axios
.
get
(
url
,
{
params
:
options
}).
then
(
res
=>
{
return
axios
.
get
(
url
,
{
params
:
options
}).
then
(
(
res
)
=>
{
if
(
callback
)
callback
(
res
.
data
);
if
(
callback
)
callback
(
res
.
data
);
return
res
;
return
res
;
...
@@ -467,7 +467,7 @@ const Api = {
...
@@ -467,7 +467,7 @@ const Api = {
.
replace
(
'
:id
'
,
encodeURIComponent
(
id
))
.
replace
(
'
:id
'
,
encodeURIComponent
(
id
))
.
replace
(
'
:type
'
,
type
);
.
replace
(
'
:type
'
,
type
);
return
axios
.
get
(
url
,
{
params
}).
then
(
res
=>
{
return
axios
.
get
(
url
,
{
params
}).
then
(
(
res
)
=>
{
if
(
callback
)
callback
(
res
.
data
);
if
(
callback
)
callback
(
res
.
data
);
return
res
;
return
res
;
...
...
app/assets/javascripts/authentication/u2f/authenticate.js
View file @
b282f7dd
...
@@ -37,7 +37,7 @@ export default class U2FAuthenticate {
...
@@ -37,7 +37,7 @@ export default class U2FAuthenticate {
// Note: The server library fixes this behaviour in (unreleased) version 1.0.0.
// Note: The server library fixes this behaviour in (unreleased) version 1.0.0.
// This can be removed once we upgrade.
// This can be removed once we upgrade.
// https://github.com/castle/ruby-u2f/commit/103f428071a81cd3d5f80c2e77d522d5029946a4
// https://github.com/castle/ruby-u2f/commit/103f428071a81cd3d5f80c2e77d522d5029946a4
this
.
signRequests
=
u2fParams
.
sign_requests
.
map
(
request
=>
omit
(
request
,
'
challenge
'
));
this
.
signRequests
=
u2fParams
.
sign_requests
.
map
(
(
request
)
=>
omit
(
request
,
'
challenge
'
));
this
.
templates
=
{
this
.
templates
=
{
inProgress
:
'
#js-authenticate-token-2fa-in-progress
'
,
inProgress
:
'
#js-authenticate-token-2fa-in-progress
'
,
...
@@ -48,7 +48,7 @@ export default class U2FAuthenticate {
...
@@ -48,7 +48,7 @@ export default class U2FAuthenticate {
start
()
{
start
()
{
return
importU2FLibrary
()
return
importU2FLibrary
()
.
then
(
utils
=>
{
.
then
(
(
utils
)
=>
{
this
.
u2fUtils
=
utils
;
this
.
u2fUtils
=
utils
;
this
.
renderInProgress
();
this
.
renderInProgress
();
})
})
...
@@ -60,7 +60,7 @@ export default class U2FAuthenticate {
...
@@ -60,7 +60,7 @@ export default class U2FAuthenticate {
this
.
appId
,
this
.
appId
,
this
.
challenge
,
this
.
challenge
,
this
.
signRequests
,
this
.
signRequests
,
response
=>
{
(
response
)
=>
{
if
(
response
.
errorCode
)
{
if
(
response
.
errorCode
)
{
const
error
=
new
U2FError
(
response
.
errorCode
,
'
authenticate
'
);
const
error
=
new
U2FError
(
response
.
errorCode
,
'
authenticate
'
);
return
this
.
renderError
(
error
);
return
this
.
renderError
(
error
);
...
...
app/assets/javascripts/authentication/u2f/register.js
View file @
b282f7dd
...
@@ -34,7 +34,7 @@ export default class U2FRegister {
...
@@ -34,7 +34,7 @@ export default class U2FRegister {
start
()
{
start
()
{
return
importU2FLibrary
()
return
importU2FLibrary
()
.
then
(
utils
=>
{
.
then
(
(
utils
)
=>
{
this
.
u2fUtils
=
utils
;
this
.
u2fUtils
=
utils
;
this
.
renderSetup
();
this
.
renderSetup
();
})
})
...
@@ -46,7 +46,7 @@ export default class U2FRegister {
...
@@ -46,7 +46,7 @@ export default class U2FRegister {
this
.
appId
,
this
.
appId
,
this
.
registerRequests
,
this
.
registerRequests
,
this
.
signRequests
,
this
.
signRequests
,
response
=>
{
(
response
)
=>
{
if
(
response
.
errorCode
)
{
if
(
response
.
errorCode
)
{
const
error
=
new
U2FError
(
response
.
errorCode
,
'
register
'
);
const
error
=
new
U2FError
(
response
.
errorCode
,
'
register
'
);
return
this
.
renderError
(
error
);
return
this
.
renderError
(
error
);
...
...
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