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
Hide 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
*.scss
*.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
app/assets/javascripts/authentication/webauthn/authenticate.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
)
=>
{
return
commits
.
findIndex
(
commit
=>
commit
.
short_id
===
commitShortId
);
return
commits
.
findIndex
(
(
commit
)
=>
commit
.
short_id
===
commitShortId
);
};
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
'
;
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
();
});
};
app/assets/javascripts/admin/statistics_panel/store/actions.js
View file @
b282f7dd
...
...
@@ -13,7 +13,7 @@ export const fetchStatistics = ({ dispatch }) => {
.
then
(({
data
})
=>
{
dispatch
(
'
receiveStatisticsSuccess
'
,
convertObjectPropsToCamelCase
(
data
,
{
deep
:
true
}));
})
.
catch
(
error
=>
dispatch
(
'
receiveStatisticsError
'
,
error
));
.
catch
(
(
error
)
=>
dispatch
(
'
receiveStatisticsError
'
,
error
));
};
export
const
receiveStatisticsSuccess
=
({
commit
},
statistics
)
=>
...
...
app/assets/javascripts/admin/statistics_panel/store/getters.js
View file @
b282f7dd
...
...
@@ -3,8 +3,8 @@
* and returns an array of the following form:
* [{ key: "forks", label: "Forks", value: 50 }]
*/
export
const
getStatistics
=
state
=>
labels
=>
Object
.
keys
(
labels
).
map
(
key
=>
{
export
const
getStatistics
=
(
state
)
=>
(
labels
)
=>
Object
.
keys
(
labels
).
map
(
(
key
)
=>
{
const
result
=
{
key
,
label
:
labels
[
key
],
...
...
app/assets/javascripts/admin/users/components/users_table.vue
View file @
b282f7dd
...
...
@@ -4,7 +4,7 @@ import { __ } from '~/locale';
const
DEFAULT_TH_CLASSES
=
'
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
{
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')) {
return
new
Vue
({
el
,
render
:
createElement
=>
render
:
(
createElement
)
=>
createElement
(
AdminUsersApp
,
{
props
:
{
users
:
convertObjectPropsToCamelCase
(
JSON
.
parse
(
users
),
{
deep
:
true
}),
...
...
app/assets/javascripts/alert_handler.js
View file @
b282f7dd
...
...
@@ -8,9 +8,9 @@ export default function initAlertHandler() {
const
DISMISS_LABEL
=
'
[aria-label="Dismiss"]
'
;
const
DISMISS_CLASS
=
'
.gl-alert-dismiss
'
;
DISMISSIBLE_SELECTORS
.
forEach
(
selector
=>
{
DISMISSIBLE_SELECTORS
.
forEach
(
(
selector
)
=>
{
const
elements
=
document
.
querySelectorAll
(
selector
);
elements
.
forEach
(
element
=>
{
elements
.
forEach
(
(
element
)
=>
{
const
button
=
element
.
querySelector
(
DISMISS_LABEL
)
||
element
.
querySelector
(
DISMISS_CLASS
);
if
(
!
button
)
{
return
;
...
...
app/assets/javascripts/alert_management/components/alert_details.vue
View file @
b282f7dd
...
...
@@ -140,7 +140,7 @@ export default {
},
currentTabIndex
:
{
get
()
{
return
this
.
$options
.
tabsConfig
.
findIndex
(
tab
=>
tab
.
id
===
this
.
activeTab
);
return
this
.
$options
.
tabsConfig
.
findIndex
(
(
tab
)
=>
tab
.
id
===
this
.
activeTab
);
},
set
(
tabIdx
)
{
const
tabId
=
this
.
$options
.
tabsConfig
[
tabIdx
].
id
;
...
...
@@ -208,7 +208,7 @@ export default {
}
},
)
.
catch
(
error
=>
{
.
catch
(
(
error
)
=>
{
this
.
createIncidentError
=
error
;
this
.
incidentCreationInProgress
=
false
;
});
...
...
app/assets/javascripts/alert_management/components/alert_management_table.vue
View file @
b282f7dd
...
...
@@ -138,7 +138,7 @@ export default {
data
.
project
||
{};
const
now
=
new
Date
();
const
listWithData
=
list
.
map
(
alert
=>
{
const
listWithData
=
list
.
map
(
(
alert
)
=>
{
const
then
=
new
Date
(
alert
.
startedAt
);
const
diff
=
now
-
then
;
...
...
app/assets/javascripts/alert_management/components/alert_metrics.vue
View file @
b282f7dd
...
...
@@ -33,7 +33,7 @@ export default {
});
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 {
projectPath
:
this
.
projectPath
,
},
})
.
then
(
resp
=>
{
.
then
(
(
resp
)
=>
{
this
.
trackStatusUpdate
(
status
);
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 {
},
sortedUsers
()
{
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
},
dropdownClass
()
{
...
...
app/assets/javascripts/alert_management/components/sidebar/sidebar_todo.vue
View file @
b282f7dd
...
...
@@ -115,7 +115,7 @@ export default {
variables
:
this
.
getAlertQueryVariables
,
});
const
data
=
produce
(
sourceData
,
draftData
=>
{
const
data
=
produce
(
sourceData
,
(
draftData
)
=>
{
// eslint-disable-next-line no-param-reassign
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';
Vue
.
use
(
VueApollo
);
export
default
selector
=>
{
export
default
(
selector
)
=>
{
const
domEl
=
document
.
querySelector
(
selector
);
const
{
alertId
,
projectPath
,
projectIssuesPath
,
projectId
}
=
domEl
.
dataset
;
const
router
=
createRouter
();
...
...
@@ -18,7 +18,7 @@ export default selector => {
Mutation
:
{
toggleSidebarStatus
:
(
_
,
__
,
{
cache
})
=>
{
const
sourceData
=
cache
.
readQuery
({
query
:
sidebarStatusQuery
});
const
data
=
produce
(
sourceData
,
draftData
=>
{
const
data
=
produce
(
sourceData
,
(
draftData
)
=>
{
// eslint-disable-next-line no-param-reassign
draftData
.
sidebarStatus
=
!
draftData
.
sidebarStatus
;
});
...
...
@@ -30,7 +30,7 @@ export default selector => {
const
apolloProvider
=
new
VueApollo
({
defaultClient
:
createDefaultClient
(
resolvers
,
{
cacheConfig
:
{
dataIdFromObject
:
object
=>
{
dataIdFromObject
:
(
object
)
=>
{
// eslint-disable-next-line no-underscore-dangle
if
(
object
.
__typename
===
'
AlertManagementAlert
'
)
{
return
object
.
iid
;
...
...
app/assets/javascripts/alert_management/list.js
View file @
b282f7dd
...
...
@@ -30,7 +30,7 @@ export default () => {
{},
{
cacheConfig
:
{
dataIdFromObject
:
object
=>
{
dataIdFromObject
:
(
object
)
=>
{
// eslint-disable-next-line no-underscore-dangle
if
(
object
.
__typename
===
'
AlertManagementAlert
'
)
{
return
object
.
iid
;
...
...
app/assets/javascripts/alerts_service_settings/components/alerts_service_form.vue
View file @
b282f7dd
...
...
@@ -98,7 +98,7 @@ export default {
},
methods
:
{
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
())
{
icon
.
classList
.
remove
(
'
d-none
'
);
}
else
{
...
...
@@ -109,7 +109,7 @@ export default {
resetKey
()
{
return
axios
.
put
(
this
.
formPath
,
{
service
:
{
token
:
''
}
})
.
then
(
res
=>
{
.
then
(
(
res
)
=>
{
this
.
authorizationKey
=
res
.
data
.
token
;
})
.
catch
(()
=>
{
...
...
app/assets/javascripts/alerts_service_settings/index.js
View file @
b282f7dd
...
...
@@ -2,7 +2,7 @@ import Vue from 'vue';
import
{
parseBoolean
}
from
'
~/lib/utils/common_utils
'
;
import
AlertsServiceForm
from
'
./components/alerts_service_form.vue
'
;
export
default
el
=>
{
export
default
(
el
)
=>
{
if
(
!
el
)
{
return
null
;
}
...
...
app/assets/javascripts/alerts_settings/components/alert_mapping_builder.vue
View file @
b282f7dd
...
...
@@ -64,9 +64,9 @@ export default {
},
computed
:
{
mappingData
()
{
return
this
.
gitlabFields
.
map
(
gitlabField
=>
{
return
this
.
gitlabFields
.
map
(
(
gitlabField
)
=>
{
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
(
...
...
@@ -88,26 +88,26 @@ export default {
},
methods
:
{
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
}
};
Vue
.
set
(
this
.
gitlabFields
,
fieldIndex
,
updatedField
);
},
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
}
};
Vue
.
set
(
this
.
gitlabFields
,
fieldIndex
,
updatedField
);
},
filterFields
(
searchTerm
=
''
,
fields
)
{
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
)
{
return
fieldValue
===
mapping
;
},
selectedValue
(
name
)
{
return
(
this
.
payloadFields
.
find
(
item
=>
item
.
name
===
name
)?.
label
||
this
.
payloadFields
.
find
(
(
item
)
=>
item
.
name
===
name
)?.
label
||
this
.
$options
.
i18n
.
makeSelection
);
},
...
...
app/assets/javascripts/alerts_settings/components/alerts_integrations_list.vue
View file @
b282f7dd
...
...
@@ -97,8 +97,8 @@ export default {
};
},
mounted
()
{
const
callback
=
entries
=>
{
const
isVisible
=
entries
.
some
(
entry
=>
entry
.
isIntersecting
);
const
callback
=
(
entries
)
=>
{
const
isVisible
=
entries
.
some
(
(
entry
)
=>
entry
.
isIntersecting
);
if
(
isVisible
)
{
this
.
trackPageViews
();
...
...
app/assets/javascripts/alerts_settings/components/alerts_settings_form.vue
View file @
b282f7dd
...
...
@@ -197,7 +197,7 @@ export default {
return
options
;
},
options
()
{
return
integrationTypesNew
.
map
(
el
=>
({
return
integrationTypesNew
.
map
(
(
el
)
=>
({
...
el
,
disabled
:
this
.
disabledIntegrations
.
includes
(
el
.
value
),
}));
...
...
@@ -390,10 +390,10 @@ export default {
// TODO: replace with real BE mutation when ready;
this
.
parsingPayload
=
true
;
return
new
Promise
(
resolve
=>
{
return
new
Promise
(
(
resolve
)
=>
{
setTimeout
(()
=>
resolve
(
mockedCustomMapping
),
1000
);
})
.
then
(
res
=>
{
.
then
(
(
res
)
=>
{
const
mapping
=
{
...
res
};
delete
mapping
.
storedMapping
;
this
.
customMapping
=
res
;
...
...
@@ -408,7 +408,7 @@ export default {
},
getIntegrationMapping
()
{
// TODO: replace with real BE mutation when ready;
return
Promise
.
resolve
(
mockedCustomMapping
).
then
(
res
=>
{
return
Promise
.
resolve
(
mockedCustomMapping
).
then
(
(
res
)
=>
{
this
.
customMapping
=
res
;
this
.
integrationTestPayload
.
json
=
res
?.
samplePayload
.
body
;
});
...
...
app/assets/javascripts/alerts_settings/graphql.js
View file @
b282f7dd
...
...
@@ -14,7 +14,7 @@ const resolvers = {
{
cache
},
)
=>
{
const
sourceData
=
cache
.
readQuery
({
query
:
getCurrentIntegrationQuery
});
const
data
=
produce
(
sourceData
,
draftData
=>
{
const
data
=
produce
(
sourceData
,
(
draftData
)
=>
{
if
(
id
===
null
)
{
// eslint-disable-next-line no-param-reassign
draftData
.
currentIntegration
=
null
;
...
...
app/assets/javascripts/alerts_settings/index.js
View file @
b282f7dd
...
...
@@ -11,7 +11,7 @@ apolloProvider.clients.defaultClient.cache.writeData({
});
Vue
.
use
(
GlToast
);
export
default
el
=>
{
export
default
(
el
)
=>
{
if
(
!
el
)
{
return
null
;
}
...
...
app/assets/javascripts/alerts_settings/utils/cache_updates.js
View file @
b282f7dd
...
...
@@ -14,7 +14,7 @@ const deleteIntegrationFromStore = (store, query, { httpIntegrationDestroy }, va
variables
,
});
const
data
=
produce
(
sourceData
,
draftData
=>
{
const
data
=
produce
(
sourceData
,
(
draftData
)
=>
{
// eslint-disable-next-line no-param-reassign
draftData
.
project
.
alertManagementIntegrations
.
nodes
=
draftData
.
project
.
alertManagementIntegrations
.
nodes
.
filter
(
({
id
})
=>
id
!==
integration
.
id
,
...
...
@@ -45,7 +45,7 @@ const addIntegrationToStore = (
variables
,
});
const
data
=
produce
(
sourceData
,
draftData
=>
{
const
data
=
produce
(
sourceData
,
(
draftData
)
=>
{
// eslint-disable-next-line no-param-reassign
draftData
.
project
.
alertManagementIntegrations
.
nodes
=
[
integration
,
...
...
app/assets/javascripts/analytics/instance_statistics/components/instance_statistics_count_chart.vue
View file @
b282f7dd
...
...
@@ -60,13 +60,13 @@ export default {
return
Object
.
values
(
this
.
errors
);
},
isLoading
()
{
return
some
(
this
.
$apollo
.
queries
,
query
=>
query
?.
loading
);
return
some
(
this
.
$apollo
.
queries
,
(
query
)
=>
query
?.
loading
);
},
allQueriesFailed
()
{
return
every
(
this
.
errorMessages
,
message
=>
message
.
length
);
return
every
(
this
.
errorMessages
,
(
message
)
=>
message
.
length
);
},
hasLoadingErrors
()
{
return
some
(
this
.
errorMessages
,
message
=>
message
.
length
);
return
some
(
this
.
errorMessages
,
(
message
)
=>
message
.
length
);
},
errorMessage
()
{
// show the generic loading message if all requests fail
...
...
@@ -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';
import
latestProjectsQuery
from
'
../graphql/queries/projects.query.graphql
'
;
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
averaged
=
getAverageByMonth
(
...
...
@@ -148,7 +148,7 @@ export default {
name
:
this
.
$options
.
i18n
.
xAxisTitle
,
type
:
'
category
'
,
axisLabel
:
{
formatter
:
value
=>
{
formatter
:
(
value
)
=>
{
return
formatDateAsMonth
(
value
);
},
},
...
...
@@ -189,7 +189,7 @@ export default {
.
fetchMore
({
variables
:
{
first
:
this
.
totalDataPoints
,
after
:
pageInfo
.
endCursor
},
updateQuery
:
(
previousResult
,
{
fetchMoreResult
})
=>
{
const
results
=
produce
(
fetchMoreResult
,
newData
=>
{
const
results
=
produce
(
fetchMoreResult
,
(
newData
)
=>
{
// eslint-disable-next-line no-param-reassign
newData
[
dataKey
].
nodes
=
[
...
previousResult
[
dataKey
].
nodes
,
...
...
@@ -199,7 +199,7 @@ export default {
return
results
;
},
})
.
catch
(
error
=>
{
.
catch
(
(
error
)
=>
{
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';
import
usersQuery
from
'
../graphql/queries/users.query.graphql
'
;
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
{
name
:
'
UsersChart
'
,
...
...
@@ -106,7 +106,7 @@ export default {
.
fetchMore
({
variables
:
{
first
:
this
.
totalDataPoints
,
after
:
this
.
pageInfo
.
endCursor
},
updateQuery
:
(
previousResult
,
{
fetchMoreResult
})
=>
{
return
produce
(
fetchMoreResult
,
newUsers
=>
{
return
produce
(
fetchMoreResult
,
(
newUsers
)
=>
{
// eslint-disable-next-line no-param-reassign
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 = {}) {
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
avg
=
sum
/
recordCount
;
if
(
shouldRound
)
{
...
...
app/assets/javascripts/analytics/product_analytics/activity_charts_bundle.js
View file @
b282f7dd
...
...
@@ -8,7 +8,7 @@ export default () => {
return
false
;
}
return
containers
.
forEach
(
container
=>
{
return
containers
.
forEach
(
(
container
)
=>
{
const
{
chartData
}
=
container
.
dataset
;
const
formattedData
=
JSON
.
parse
(
chartData
);
...
...
app/assets/javascripts/api.js
View file @
b282f7dd
...
...
@@ -374,8 +374,8 @@ const Api = {
.
post
(
url
,
{
label
:
data
,
})
.
then
(
res
=>
callback
(
res
.
data
))
.
catch
(
e
=>
callback
(
e
.
response
.
data
));
.
then
(
(
res
)
=>
callback
(
res
.
data
))
.
catch
(
(
e
)
=>
callback
(
e
.
response
.
data
));
},
// Return group projects list. Filtered by query
...
...
@@ -431,7 +431,7 @@ const Api = {
commitPipelines
(
projectId
,
sha
)
{
const
encodedProjectId
=
projectId
.
split
(
'
/
'
)
.
map
(
fragment
=>
encodeURIComponent
(
fragment
))
.
map
(
(
fragment
)
=>
encodeURIComponent
(
fragment
))
.
join
(
'
/
'
);
const
url
=
Api
.
buildUrl
(
Api
.
commitPipelinesPath
)
...
...
@@ -455,7 +455,7 @@ const Api = {
.
replace
(
'
:type
'
,
type
)
.
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
);
return
res
;
...
...
@@ -467,7 +467,7 @@ const Api = {
.
replace
(
'
:id
'
,
encodeURIComponent
(
id
))
.
replace
(
'
:type
'
,
type
);
return
axios
.
get
(
url
,
{
params
}).
then
(
res
=>
{
return
axios
.
get
(
url
,
{
params
}).
then
(
(
res
)
=>
{
if
(
callback
)
callback
(
res
.
data
);
return
res
;
...
...
app/assets/javascripts/authentication/u2f/authenticate.js
View file @
b282f7dd
...
...
@@ -37,7 +37,7 @@ export default class U2FAuthenticate {
// Note: The server library fixes this behaviour in (unreleased) version 1.0.0.
// This can be removed once we upgrade.
// 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
=
{
inProgress
:
'
#js-authenticate-token-2fa-in-progress
'
,
...
...
@@ -48,7 +48,7 @@ export default class U2FAuthenticate {
start
()
{
return
importU2FLibrary
()
.
then
(
utils
=>
{
.
then
(
(
utils
)
=>
{
this
.
u2fUtils
=
utils
;
this
.
renderInProgress
();
})
...
...
@@ -60,7 +60,7 @@ export default class U2FAuthenticate {
this
.
appId
,
this
.
challenge
,
this
.
signRequests
,
response
=>
{
(
response
)
=>
{
if
(
response
.
errorCode
)
{
const
error
=
new
U2FError
(
response
.
errorCode
,
'
authenticate
'
);
return
this
.
renderError
(
error
);
...
...
app/assets/javascripts/authentication/u2f/register.js
View file @
b282f7dd
...
...
@@ -34,7 +34,7 @@ export default class U2FRegister {
start
()
{
return
importU2FLibrary
()
.
then
(
utils
=>
{
.
then
(
(
utils
)
=>
{
this
.
u2fUtils
=
utils
;
this
.
renderSetup
();
})
...
...
@@ -46,7 +46,7 @@ export default class U2FRegister {
this
.
appId
,
this
.
registerRequests
,
this
.
signRequests
,
response
=>
{
(
response
)
=>
{
if
(
response
.
errorCode
)
{
const
error
=
new
U2FError
(
response
.
errorCode
,
'
register
'
);
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