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
a4c662da
Commit
a4c662da
authored
Dec 23, 2020
by
Lukas Eipert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run prettier on 31 files - 27 of 73
Part of our prettier migration; changing the arrow-parens style.
parent
9aa1f620
Changes
31
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
71 additions
and
71 deletions
+71
-71
app/assets/javascripts/releases/stores/modules/list/actions.js
...ssets/javascripts/releases/stores/modules/list/actions.js
+1
-1
app/assets/javascripts/releases/stores/modules/list/index.js
app/assets/javascripts/releases/stores/modules/list/index.js
+1
-1
app/assets/javascripts/releases/util.js
app/assets/javascripts/releases/util.js
+15
-15
app/assets/javascripts/reports/accessibility_report/store/getters.js
...javascripts/reports/accessibility_report/store/getters.js
+7
-7
app/assets/javascripts/reports/accessibility_report/store/index.js
...s/javascripts/reports/accessibility_report/store/index.js
+2
-2
app/assets/javascripts/reports/codequality_report/store/actions.js
...s/javascripts/reports/codequality_report/store/actions.js
+2
-2
app/assets/javascripts/reports/codequality_report/store/getters.js
...s/javascripts/reports/codequality_report/store/getters.js
+4
-4
app/assets/javascripts/reports/codequality_report/store/index.js
...ets/javascripts/reports/codequality_report/store/index.js
+2
-2
app/assets/javascripts/reports/codequality_report/store/utils/codequality_comparison.js
.../codequality_report/store/utils/codequality_comparison.js
+1
-1
app/assets/javascripts/reports/codequality_report/workers/codequality_comparison_worker.js
...dequality_report/workers/codequality_comparison_worker.js
+1
-1
app/assets/javascripts/reports/components/grouped_issues_list.vue
...ts/javascripts/reports/components/grouped_issues_list.vue
+1
-1
app/assets/javascripts/reports/components/grouped_test_reports_app.vue
...vascripts/reports/components/grouped_test_reports_app.vue
+2
-2
app/assets/javascripts/reports/components/issues_list.vue
app/assets/javascripts/reports/components/issues_list.vue
+1
-1
app/assets/javascripts/reports/components/report_item.vue
app/assets/javascripts/reports/components/report_item.vue
+1
-1
app/assets/javascripts/reports/store/getters.js
app/assets/javascripts/reports/store/getters.js
+1
-1
app/assets/javascripts/reports/store/mutations.js
app/assets/javascripts/reports/store/mutations.js
+2
-2
app/assets/javascripts/reports/store/utils.js
app/assets/javascripts/reports/store/utils.js
+6
-6
app/assets/javascripts/repository/components/breadcrumbs.vue
app/assets/javascripts/repository/components/breadcrumbs.vue
+2
-2
app/assets/javascripts/repository/components/directory_download_links.vue
...cripts/repository/components/directory_download_links.vue
+1
-1
app/assets/javascripts/repository/components/last_commit.vue
app/assets/javascripts/repository/components/last_commit.vue
+1
-1
app/assets/javascripts/repository/components/table/parent_row.vue
...ts/javascripts/repository/components/table/parent_row.vue
+1
-1
app/assets/javascripts/repository/components/tree_content.vue
...assets/javascripts/repository/components/tree_content.vue
+1
-1
app/assets/javascripts/repository/graphql.js
app/assets/javascripts/repository/graphql.js
+2
-2
app/assets/javascripts/repository/router.js
app/assets/javascripts/repository/router.js
+1
-1
app/assets/javascripts/repository/utils/commit.js
app/assets/javascripts/repository/utils/commit.js
+1
-1
app/assets/javascripts/repository/utils/readme.js
app/assets/javascripts/repository/utils/readme.js
+3
-3
app/assets/javascripts/search/highlight_blob_search_result.js
...assets/javascripts/search/highlight_blob_search_result.js
+2
-2
app/assets/javascripts/search/sidebar/index.js
app/assets/javascripts/search/sidebar/index.js
+1
-1
app/assets/javascripts/search/store/actions.js
app/assets/javascripts/search/store/actions.js
+2
-2
app/assets/javascripts/search/store/index.js
app/assets/javascripts/search/store/index.js
+1
-1
app/assets/javascripts/search/topbar/index.js
app/assets/javascripts/search/topbar/index.js
+2
-2
No files found.
app/assets/javascripts/releases/stores/modules/list/actions.js
View file @
a4c662da
...
@@ -68,7 +68,7 @@ export const fetchReleasesGraphQl = (
...
@@ -68,7 +68,7 @@ export const fetchReleasesGraphQl = (
...
paginationParams
,
...
paginationParams
,
},
},
})
})
.
then
(
response
=>
{
.
then
(
(
response
)
=>
{
const
{
data
,
paginationInfo
:
graphQlPageInfo
}
=
convertAllReleasesGraphQLResponse
(
response
);
const
{
data
,
paginationInfo
:
graphQlPageInfo
}
=
convertAllReleasesGraphQLResponse
(
response
);
commit
(
types
.
RECEIVE_RELEASES_SUCCESS
,
{
commit
(
types
.
RECEIVE_RELEASES_SUCCESS
,
{
...
...
app/assets/javascripts/releases/stores/modules/list/index.js
View file @
a4c662da
...
@@ -2,7 +2,7 @@ import createState from './state';
...
@@ -2,7 +2,7 @@ import createState from './state';
import
*
as
actions
from
'
./actions
'
;
import
*
as
actions
from
'
./actions
'
;
import
mutations
from
'
./mutations
'
;
import
mutations
from
'
./mutations
'
;
export
default
initialState
=>
({
export
default
(
initialState
)
=>
({
namespaced
:
true
,
namespaced
:
true
,
actions
,
actions
,
mutations
,
mutations
,
...
...
app/assets/javascripts/releases/util.js
View file @
a4c662da
...
@@ -17,7 +17,7 @@ export const releaseToApiJson = (release, createFrom = null) => {
...
@@ -17,7 +17,7 @@ export const releaseToApiJson = (release, createFrom = null) => {
// Milestones may be either a list of milestone objects OR just a list
// Milestones may be either a list of milestone objects OR just a list
// of milestone titles. The API requires only the titles be sent.
// of milestone titles. The API requires only the titles be sent.
const
milestones
=
(
release
.
milestones
||
[]).
map
(
m
=>
m
.
title
||
m
);
const
milestones
=
(
release
.
milestones
||
[]).
map
(
(
m
)
=>
m
.
title
||
m
);
return
convertObjectPropsToSnakeCase
(
return
convertObjectPropsToSnakeCase
(
{
{
...
@@ -37,7 +37,7 @@ export const releaseToApiJson = (release, createFrom = null) => {
...
@@ -37,7 +37,7 @@ export const releaseToApiJson = (release, createFrom = null) => {
* into the structure this Vue application can work with.
* into the structure this Vue application can work with.
* @param {Object} json The JSON object received from the release API
* @param {Object} json The JSON object received from the release API
*/
*/
export
const
apiJsonToRelease
=
json
=>
{
export
const
apiJsonToRelease
=
(
json
)
=>
{
const
release
=
convertObjectPropsToCamelCase
(
json
,
{
deep
:
true
});
const
release
=
convertObjectPropsToCamelCase
(
json
,
{
deep
:
true
});
release
.
milestones
=
release
.
milestones
||
[];
release
.
milestones
=
release
.
milestones
||
[];
...
@@ -47,7 +47,7 @@ export const apiJsonToRelease = json => {
...
@@ -47,7 +47,7 @@ export const apiJsonToRelease = json => {
export
const
gqClient
=
createGqClient
({},
{
fetchPolicy
:
fetchPolicies
.
NO_CACHE
});
export
const
gqClient
=
createGqClient
({},
{
fetchPolicy
:
fetchPolicies
.
NO_CACHE
});
const
convertScalarProperties
=
graphQLRelease
=>
const
convertScalarProperties
=
(
graphQLRelease
)
=>
pick
(
graphQLRelease
,
[
pick
(
graphQLRelease
,
[
'
name
'
,
'
name
'
,
'
tagName
'
,
'
tagName
'
,
...
@@ -57,29 +57,29 @@ const convertScalarProperties = graphQLRelease =>
...
@@ -57,29 +57,29 @@ const convertScalarProperties = graphQLRelease =>
'
upcomingRelease
'
,
'
upcomingRelease
'
,
]);
]);
const
convertAssets
=
graphQLRelease
=>
({
const
convertAssets
=
(
graphQLRelease
)
=>
({
assets
:
{
assets
:
{
count
:
graphQLRelease
.
assets
.
count
,
count
:
graphQLRelease
.
assets
.
count
,
sources
:
[...
graphQLRelease
.
assets
.
sources
.
nodes
],
sources
:
[...
graphQLRelease
.
assets
.
sources
.
nodes
],
links
:
graphQLRelease
.
assets
.
links
.
nodes
.
map
(
l
=>
({
links
:
graphQLRelease
.
assets
.
links
.
nodes
.
map
(
(
l
)
=>
({
...
l
,
...
l
,
linkType
:
l
.
linkType
?.
toLowerCase
(),
linkType
:
l
.
linkType
?.
toLowerCase
(),
})),
})),
},
},
});
});
const
convertEvidences
=
graphQLRelease
=>
({
const
convertEvidences
=
(
graphQLRelease
)
=>
({
evidences
:
graphQLRelease
.
evidences
.
nodes
.
map
(
e
=>
e
),
evidences
:
graphQLRelease
.
evidences
.
nodes
.
map
(
(
e
)
=>
e
),
});
});
const
convertLinks
=
graphQLRelease
=>
({
const
convertLinks
=
(
graphQLRelease
)
=>
({
_links
:
{
_links
:
{
...
graphQLRelease
.
links
,
...
graphQLRelease
.
links
,
self
:
graphQLRelease
.
links
?.
selfUrl
,
self
:
graphQLRelease
.
links
?.
selfUrl
,
},
},
});
});
const
convertCommit
=
graphQLRelease
=>
{
const
convertCommit
=
(
graphQLRelease
)
=>
{
if
(
!
graphQLRelease
.
commit
)
{
if
(
!
graphQLRelease
.
commit
)
{
return
{};
return
{};
}
}
...
@@ -93,10 +93,10 @@ const convertCommit = graphQLRelease => {
...
@@ -93,10 +93,10 @@ const convertCommit = graphQLRelease => {
};
};
};
};
const
convertAuthor
=
graphQLRelease
=>
({
author
:
graphQLRelease
.
author
});
const
convertAuthor
=
(
graphQLRelease
)
=>
({
author
:
graphQLRelease
.
author
});
const
convertMilestones
=
graphQLRelease
=>
({
const
convertMilestones
=
(
graphQLRelease
)
=>
({
milestones
:
graphQLRelease
.
milestones
.
nodes
.
map
(
m
=>
({
milestones
:
graphQLRelease
.
milestones
.
nodes
.
map
(
(
m
)
=>
({
...
m
,
...
m
,
webUrl
:
m
.
webPath
,
webUrl
:
m
.
webPath
,
webPath
:
undefined
,
webPath
:
undefined
,
...
@@ -115,7 +115,7 @@ const convertMilestones = graphQLRelease => ({
...
@@ -115,7 +115,7 @@ const convertMilestones = graphQLRelease => ({
*
*
* @param graphQLRelease The release object returned from a GraphQL query
* @param graphQLRelease The release object returned from a GraphQL query
*/
*/
export
const
convertGraphQLRelease
=
graphQLRelease
=>
({
export
const
convertGraphQLRelease
=
(
graphQLRelease
)
=>
({
...
convertScalarProperties
(
graphQLRelease
),
...
convertScalarProperties
(
graphQLRelease
),
...
convertAssets
(
graphQLRelease
),
...
convertAssets
(
graphQLRelease
),
...
convertEvidences
(
graphQLRelease
),
...
convertEvidences
(
graphQLRelease
),
...
@@ -134,7 +134,7 @@ export const convertGraphQLRelease = graphQLRelease => ({
...
@@ -134,7 +134,7 @@ export const convertGraphQLRelease = graphQLRelease => ({
*
*
* @param response The response received from the GraphQL endpoint
* @param response The response received from the GraphQL endpoint
*/
*/
export
const
convertAllReleasesGraphQLResponse
=
response
=>
{
export
const
convertAllReleasesGraphQLResponse
=
(
response
)
=>
{
const
releases
=
response
.
data
.
project
.
releases
.
nodes
.
map
(
convertGraphQLRelease
);
const
releases
=
response
.
data
.
project
.
releases
.
nodes
.
map
(
convertGraphQLRelease
);
const
paginationInfo
=
{
const
paginationInfo
=
{
...
@@ -153,7 +153,7 @@ export const convertAllReleasesGraphQLResponse = response => {
...
@@ -153,7 +153,7 @@ export const convertAllReleasesGraphQLResponse = response => {
*
*
* @param response The response received from the GraphQL endpoint
* @param response The response received from the GraphQL endpoint
*/
*/
export
const
convertOneReleaseGraphQLResponse
=
response
=>
{
export
const
convertOneReleaseGraphQLResponse
=
(
response
)
=>
{
const
release
=
convertGraphQLRelease
(
response
.
data
.
project
.
release
);
const
release
=
convertGraphQLRelease
(
response
.
data
.
project
.
release
);
return
{
data
:
release
};
return
{
data
:
release
};
...
...
app/assets/javascripts/reports/accessibility_report/store/getters.js
View file @
a4c662da
import
{
LOADING
,
ERROR
,
SUCCESS
,
STATUS_FAILED
}
from
'
../../constants
'
;
import
{
LOADING
,
ERROR
,
SUCCESS
,
STATUS_FAILED
}
from
'
../../constants
'
;
import
{
s__
,
n__
}
from
'
~/locale
'
;
import
{
s__
,
n__
}
from
'
~/locale
'
;
export
const
groupedSummaryText
=
state
=>
{
export
const
groupedSummaryText
=
(
state
)
=>
{
if
(
state
.
isLoading
)
{
if
(
state
.
isLoading
)
{
return
s__
(
'
Reports|Accessibility scanning results are being parsed
'
);
return
s__
(
'
Reports|Accessibility scanning results are being parsed
'
);
}
}
...
@@ -22,7 +22,7 @@ export const groupedSummaryText = state => {
...
@@ -22,7 +22,7 @@ export const groupedSummaryText = state => {
);
);
};
};
export
const
summaryStatus
=
state
=>
{
export
const
summaryStatus
=
(
state
)
=>
{
if
(
state
.
isLoading
)
{
if
(
state
.
isLoading
)
{
return
LOADING
;
return
LOADING
;
}
}
...
@@ -34,12 +34,12 @@ export const summaryStatus = state => {
...
@@ -34,12 +34,12 @@ export const summaryStatus = state => {
return
SUCCESS
;
return
SUCCESS
;
};
};
export
const
shouldRenderIssuesList
=
state
=>
export
const
shouldRenderIssuesList
=
(
state
)
=>
Object
.
values
(
state
.
report
).
some
(
x
=>
Array
.
isArray
(
x
)
&&
x
.
length
>
0
);
Object
.
values
(
state
.
report
).
some
(
(
x
)
=>
Array
.
isArray
(
x
)
&&
x
.
length
>
0
);
// We could just map state, but we're going to iterate in the future
// We could just map state, but we're going to iterate in the future
// to add notes and warnings to these issue lists, so I'm going to
// to add notes and warnings to these issue lists, so I'm going to
// keep these as getters
// keep these as getters
export
const
unresolvedIssues
=
state
=>
state
.
report
.
existing_errors
;
export
const
unresolvedIssues
=
(
state
)
=>
state
.
report
.
existing_errors
;
export
const
resolvedIssues
=
state
=>
state
.
report
.
resolved_errors
;
export
const
resolvedIssues
=
(
state
)
=>
state
.
report
.
resolved_errors
;
export
const
newIssues
=
state
=>
state
.
report
.
new_errors
;
export
const
newIssues
=
(
state
)
=>
state
.
report
.
new_errors
;
app/assets/javascripts/reports/accessibility_report/store/index.js
View file @
a4c662da
...
@@ -7,11 +7,11 @@ import state from './state';
...
@@ -7,11 +7,11 @@ import state from './state';
Vue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
export
const
getStoreConfig
=
initialState
=>
({
export
const
getStoreConfig
=
(
initialState
)
=>
({
actions
,
actions
,
getters
,
getters
,
mutations
,
mutations
,
state
:
state
(
initialState
),
state
:
state
(
initialState
),
});
});
export
default
initialState
=>
new
Vuex
.
Store
(
getStoreConfig
(
initialState
));
export
default
(
initialState
)
=>
new
Vuex
.
Store
(
getStoreConfig
(
initialState
));
app/assets/javascripts/reports/codequality_report/store/actions.js
View file @
a4c662da
...
@@ -11,13 +11,13 @@ export const fetchReports = ({ state, dispatch, commit }) => {
...
@@ -11,13 +11,13 @@ export const fetchReports = ({ state, dispatch, commit }) => {
return
dispatch
(
'
receiveReportsError
'
);
return
dispatch
(
'
receiveReportsError
'
);
}
}
return
Promise
.
all
([
axios
.
get
(
state
.
headPath
),
axios
.
get
(
state
.
basePath
)])
return
Promise
.
all
([
axios
.
get
(
state
.
headPath
),
axios
.
get
(
state
.
basePath
)])
.
then
(
results
=>
.
then
(
(
results
)
=>
doCodeClimateComparison
(
doCodeClimateComparison
(
parseCodeclimateMetrics
(
results
[
0
].
data
,
state
.
headBlobPath
),
parseCodeclimateMetrics
(
results
[
0
].
data
,
state
.
headBlobPath
),
parseCodeclimateMetrics
(
results
[
1
].
data
,
state
.
baseBlobPath
),
parseCodeclimateMetrics
(
results
[
1
].
data
,
state
.
baseBlobPath
),
),
),
)
)
.
then
(
data
=>
dispatch
(
'
receiveReportsSuccess
'
,
data
))
.
then
(
(
data
)
=>
dispatch
(
'
receiveReportsSuccess
'
,
data
))
.
catch
(()
=>
dispatch
(
'
receiveReportsError
'
));
.
catch
(()
=>
dispatch
(
'
receiveReportsError
'
));
};
};
...
...
app/assets/javascripts/reports/codequality_report/store/getters.js
View file @
a4c662da
...
@@ -2,10 +2,10 @@ import { LOADING, ERROR, SUCCESS } from '../../constants';
...
@@ -2,10 +2,10 @@ import { LOADING, ERROR, SUCCESS } from '../../constants';
import
{
sprintf
,
__
,
s__
,
n__
}
from
'
~/locale
'
;
import
{
sprintf
,
__
,
s__
,
n__
}
from
'
~/locale
'
;
import
{
spriteIcon
}
from
'
~/lib/utils/common_utils
'
;
import
{
spriteIcon
}
from
'
~/lib/utils/common_utils
'
;
export
const
hasCodequalityIssues
=
state
=>
export
const
hasCodequalityIssues
=
(
state
)
=>
Boolean
(
state
.
newIssues
?.
length
||
state
.
resolvedIssues
?.
length
);
Boolean
(
state
.
newIssues
?.
length
||
state
.
resolvedIssues
?.
length
);
export
const
codequalityStatus
=
state
=>
{
export
const
codequalityStatus
=
(
state
)
=>
{
if
(
state
.
isLoading
)
{
if
(
state
.
isLoading
)
{
return
LOADING
;
return
LOADING
;
}
}
...
@@ -16,7 +16,7 @@ export const codequalityStatus = state => {
...
@@ -16,7 +16,7 @@ export const codequalityStatus = state => {
return
SUCCESS
;
return
SUCCESS
;
};
};
export
const
codequalityText
=
state
=>
{
export
const
codequalityText
=
(
state
)
=>
{
const
{
newIssues
,
resolvedIssues
}
=
state
;
const
{
newIssues
,
resolvedIssues
}
=
state
;
const
text
=
[];
const
text
=
[];
...
@@ -41,7 +41,7 @@ export const codequalityText = state => {
...
@@ -41,7 +41,7 @@ export const codequalityText = state => {
return
text
.
join
(
''
);
return
text
.
join
(
''
);
};
};
export
const
codequalityPopover
=
state
=>
{
export
const
codequalityPopover
=
(
state
)
=>
{
if
(
state
.
headPath
&&
!
state
.
basePath
)
{
if
(
state
.
headPath
&&
!
state
.
basePath
)
{
return
{
return
{
title
:
s__
(
'
ciReport|Base pipeline codequality artifact not found
'
),
title
:
s__
(
'
ciReport|Base pipeline codequality artifact not found
'
),
...
...
app/assets/javascripts/reports/codequality_report/store/index.js
View file @
a4c662da
...
@@ -7,11 +7,11 @@ import state from './state';
...
@@ -7,11 +7,11 @@ import state from './state';
Vue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
export
const
getStoreConfig
=
initialState
=>
({
export
const
getStoreConfig
=
(
initialState
)
=>
({
actions
,
actions
,
getters
,
getters
,
mutations
,
mutations
,
state
:
state
(
initialState
),
state
:
state
(
initialState
),
});
});
export
default
initialState
=>
new
Vuex
.
Store
(
getStoreConfig
(
initialState
));
export
default
(
initialState
)
=>
new
Vuex
.
Store
(
getStoreConfig
(
initialState
));
app/assets/javascripts/reports/codequality_report/store/utils/codequality_comparison.js
View file @
a4c662da
import
CodeQualityComparisonWorker
from
'
../../workers/codequality_comparison_worker
'
;
import
CodeQualityComparisonWorker
from
'
../../workers/codequality_comparison_worker
'
;
export
const
parseCodeclimateMetrics
=
(
issues
=
[],
path
=
''
)
=>
{
export
const
parseCodeclimateMetrics
=
(
issues
=
[],
path
=
''
)
=>
{
return
issues
.
map
(
issue
=>
{
return
issues
.
map
(
(
issue
)
=>
{
const
parsedIssue
=
{
const
parsedIssue
=
{
...
issue
,
...
issue
,
name
:
issue
.
description
,
name
:
issue
.
description
,
...
...
app/assets/javascripts/reports/codequality_report/workers/codequality_comparison_worker.js
View file @
a4c662da
...
@@ -3,7 +3,7 @@ import { differenceBy } from 'lodash';
...
@@ -3,7 +3,7 @@ import { differenceBy } from 'lodash';
const
KEY_TO_FILTER_BY
=
'
fingerprint
'
;
const
KEY_TO_FILTER_BY
=
'
fingerprint
'
;
// eslint-disable-next-line no-restricted-globals
// eslint-disable-next-line no-restricted-globals
self
.
addEventListener
(
'
message
'
,
e
=>
{
self
.
addEventListener
(
'
message
'
,
(
e
)
=>
{
const
{
data
}
=
e
;
const
{
data
}
=
e
;
if
(
data
===
undefined
)
{
if
(
data
===
undefined
)
{
...
...
app/assets/javascripts/reports/components/grouped_issues_list.vue
View file @
a4c662da
...
@@ -41,7 +41,7 @@ export default {
...
@@ -41,7 +41,7 @@ export default {
computed
:
{
computed
:
{
groups
()
{
groups
()
{
return
this
.
$options
.
groups
return
this
.
$options
.
groups
.
map
(
group
=>
({
.
map
(
(
group
)
=>
({
name
:
group
,
name
:
group
,
issues
:
this
[
`
${
group
}
Issues`
],
issues
:
this
[
`
${
group
}
Issues`
],
heading
:
this
[
`
${
group
}
Heading`
],
heading
:
this
[
`
${
group
}
Heading`
],
...
...
app/assets/javascripts/reports/components/grouped_test_reports_app.vue
View file @
a4c662da
...
@@ -44,8 +44,8 @@ export default {
...
@@ -44,8 +44,8 @@ export default {
computed
:
{
computed
:
{
...
mapState
([
'
reports
'
,
'
isLoading
'
,
'
hasError
'
,
'
summary
'
]),
...
mapState
([
'
reports
'
,
'
isLoading
'
,
'
hasError
'
,
'
summary
'
]),
...
mapState
({
...
mapState
({
modalTitle
:
state
=>
state
.
modal
.
title
||
''
,
modalTitle
:
(
state
)
=>
state
.
modal
.
title
||
''
,
modalData
:
state
=>
state
.
modal
.
data
||
{},
modalData
:
(
state
)
=>
state
.
modal
.
data
||
{},
}),
}),
...
mapGetters
([
'
summaryStatus
'
]),
...
mapGetters
([
'
summaryStatus
'
]),
groupedSummaryText
()
{
groupedSummaryText
()
{
...
...
app/assets/javascripts/reports/components/issues_list.vue
View file @
a4c662da
...
@@ -3,7 +3,7 @@ import ReportItem from '~/reports/components/report_item.vue';
...
@@ -3,7 +3,7 @@ import ReportItem from '~/reports/components/report_item.vue';
import
{
STATUS_FAILED
,
STATUS_NEUTRAL
,
STATUS_SUCCESS
}
from
'
~/reports/constants
'
;
import
{
STATUS_FAILED
,
STATUS_NEUTRAL
,
STATUS_SUCCESS
}
from
'
~/reports/constants
'
;
import
SmartVirtualList
from
'
~/vue_shared/components/smart_virtual_list.vue
'
;
import
SmartVirtualList
from
'
~/vue_shared/components/smart_virtual_list.vue
'
;
const
wrapIssueWithState
=
(
status
,
isNew
=
false
)
=>
issue
=>
({
const
wrapIssueWithState
=
(
status
,
isNew
=
false
)
=>
(
issue
)
=>
({
status
:
issue
.
status
||
status
,
status
:
issue
.
status
||
status
,
isNew
,
isNew
,
issue
,
issue
,
...
...
app/assets/javascripts/reports/components/report_item.vue
View file @
a4c662da
...
@@ -17,7 +17,7 @@ export default {
...
@@ -17,7 +17,7 @@ export default {
type
:
String
,
type
:
String
,
required
:
false
,
required
:
false
,
default
:
''
,
default
:
''
,
validator
:
value
=>
value
===
''
||
Object
.
values
(
componentNames
).
includes
(
value
),
validator
:
(
value
)
=>
value
===
''
||
Object
.
values
(
componentNames
).
includes
(
value
),
},
},
// failed || success
// failed || success
status
:
{
status
:
{
...
...
app/assets/javascripts/reports/store/getters.js
View file @
a4c662da
import
{
LOADING
,
ERROR
,
SUCCESS
,
STATUS_FAILED
}
from
'
../constants
'
;
import
{
LOADING
,
ERROR
,
SUCCESS
,
STATUS_FAILED
}
from
'
../constants
'
;
export
const
summaryStatus
=
state
=>
{
export
const
summaryStatus
=
(
state
)
=>
{
if
(
state
.
isLoading
)
{
if
(
state
.
isLoading
)
{
return
LOADING
;
return
LOADING
;
}
}
...
...
app/assets/javascripts/reports/store/mutations.js
View file @
a4c662da
...
@@ -9,7 +9,7 @@ export default {
...
@@ -9,7 +9,7 @@ export default {
state
.
isLoading
=
true
;
state
.
isLoading
=
true
;
},
},
[
types
.
RECEIVE_REPORTS_SUCCESS
](
state
,
response
)
{
[
types
.
RECEIVE_REPORTS_SUCCESS
](
state
,
response
)
{
state
.
hasError
=
response
.
suites
.
some
(
suite
=>
suite
.
status
===
'
error
'
);
state
.
hasError
=
response
.
suites
.
some
(
(
suite
)
=>
suite
.
status
===
'
error
'
);
state
.
isLoading
=
false
;
state
.
isLoading
=
false
;
...
@@ -44,7 +44,7 @@ export default {
...
@@ -44,7 +44,7 @@ export default {
[
types
.
SET_ISSUE_MODAL_DATA
](
state
,
payload
)
{
[
types
.
SET_ISSUE_MODAL_DATA
](
state
,
payload
)
{
state
.
modal
.
title
=
payload
.
issue
.
name
;
state
.
modal
.
title
=
payload
.
issue
.
name
;
Object
.
keys
(
payload
.
issue
).
forEach
(
key
=>
{
Object
.
keys
(
payload
.
issue
).
forEach
(
(
key
)
=>
{
if
(
Object
.
prototype
.
hasOwnProperty
.
call
(
state
.
modal
.
data
,
key
))
{
if
(
Object
.
prototype
.
hasOwnProperty
.
call
(
state
.
modal
.
data
,
key
))
{
state
.
modal
.
data
[
key
]
=
{
state
.
modal
.
data
[
key
]
=
{
...
state
.
modal
.
data
[
key
],
...
state
.
modal
.
data
[
key
],
...
...
app/assets/javascripts/reports/store/utils.js
View file @
a4c662da
...
@@ -7,7 +7,7 @@ import {
...
@@ -7,7 +7,7 @@ import {
ICON_NOTFOUND
,
ICON_NOTFOUND
,
}
from
'
../constants
'
;
}
from
'
../constants
'
;
const
textBuilder
=
results
=>
{
const
textBuilder
=
(
results
)
=>
{
const
{
failed
,
errored
,
resolved
,
total
}
=
results
;
const
{
failed
,
errored
,
resolved
,
total
}
=
results
;
const
failedOrErrored
=
(
failed
||
0
)
+
(
errored
||
0
);
const
failedOrErrored
=
(
failed
||
0
)
+
(
errored
||
0
);
...
@@ -70,18 +70,18 @@ export const recentFailuresTextBuilder = (summary = {}) => {
...
@@ -70,18 +70,18 @@ export const recentFailuresTextBuilder = (summary = {}) => {
);
);
};
};
export
const
countRecentlyFailedTests
=
subject
=>
{
export
const
countRecentlyFailedTests
=
(
subject
)
=>
{
// handle either a single report or an array of reports
// handle either a single report or an array of reports
const
reports
=
!
subject
.
length
?
[
subject
]
:
subject
;
const
reports
=
!
subject
.
length
?
[
subject
]
:
subject
;
return
reports
return
reports
.
map
(
report
=>
{
.
map
(
(
report
)
=>
{
return
(
return
(
[
report
.
new_failures
,
report
.
existing_failures
,
report
.
resolved_failures
]
[
report
.
new_failures
,
report
.
existing_failures
,
report
.
resolved_failures
]
// only count tests which have failed more than once
// only count tests which have failed more than once
.
map
(
.
map
(
failureArray
=>
(
failureArray
)
=>
failureArray
.
filter
(
failure
=>
failure
.
recent_failures
?.
count
>
1
).
length
,
failureArray
.
filter
(
(
failure
)
=>
failure
.
recent_failures
?.
count
>
1
).
length
,
)
)
.
reduce
((
total
,
count
)
=>
total
+
count
,
0
)
.
reduce
((
total
,
count
)
=>
total
+
count
,
0
)
);
);
...
@@ -89,7 +89,7 @@ export const countRecentlyFailedTests = subject => {
...
@@ -89,7 +89,7 @@ export const countRecentlyFailedTests = subject => {
.
reduce
((
total
,
count
)
=>
total
+
count
,
0
);
.
reduce
((
total
,
count
)
=>
total
+
count
,
0
);
};
};
export
const
statusIcon
=
status
=>
{
export
const
statusIcon
=
(
status
)
=>
{
if
(
status
===
STATUS_FAILED
)
{
if
(
status
===
STATUS_FAILED
)
{
return
ICON_WARNING
;
return
ICON_WARNING
;
}
}
...
...
app/assets/javascripts/repository/components/breadcrumbs.vue
View file @
a4c662da
...
@@ -40,7 +40,7 @@ export default {
...
@@ -40,7 +40,7 @@ export default {
projectPath
:
this
.
projectPath
,
projectPath
:
this
.
projectPath
,
};
};
},
},
update
:
data
=>
data
.
project
?.
userPermissions
,
update
:
(
data
)
=>
data
.
project
?.
userPermissions
,
error
(
error
)
{
error
(
error
)
{
throw
error
;
throw
error
;
},
},
...
@@ -105,7 +105,7 @@ export default {
...
@@ -105,7 +105,7 @@ export default {
pathLinks
()
{
pathLinks
()
{
return
this
.
currentPath
return
this
.
currentPath
.
split
(
'
/
'
)
.
split
(
'
/
'
)
.
filter
(
p
=>
p
!==
''
)
.
filter
(
(
p
)
=>
p
!==
''
)
.
reduce
(
.
reduce
(
(
acc
,
name
,
i
)
=>
{
(
acc
,
name
,
i
)
=>
{
const
path
=
joinPaths
(
i
>
0
?
acc
[
i
].
path
:
''
,
escapeFileUrl
(
name
));
const
path
=
joinPaths
(
i
>
0
?
acc
[
i
].
path
:
''
,
escapeFileUrl
(
name
));
...
...
app/assets/javascripts/repository/components/directory_download_links.vue
View file @
a4c662da
...
@@ -18,7 +18,7 @@ export default {
...
@@ -18,7 +18,7 @@ export default {
},
},
computed
:
{
computed
:
{
normalizedLinks
()
{
normalizedLinks
()
{
return
this
.
links
.
map
(
link
=>
({
return
this
.
links
.
map
(
(
link
)
=>
({
text
:
link
.
text
,
text
:
link
.
text
,
path
:
`
${
link
.
path
}
?path=
${
this
.
currentPath
}
`
,
path
:
`
${
link
.
path
}
?path=
${
this
.
currentPath
}
`
,
}));
}));
...
...
app/assets/javascripts/repository/components/last_commit.vue
View file @
a4c662da
...
@@ -39,7 +39,7 @@ export default {
...
@@ -39,7 +39,7 @@ export default {
path
:
this
.
currentPath
.
replace
(
/^
\/
/
,
''
),
path
:
this
.
currentPath
.
replace
(
/^
\/
/
,
''
),
};
};
},
},
update
:
data
=>
{
update
:
(
data
)
=>
{
const
pipelines
=
data
.
project
?.
repository
?.
tree
?.
lastCommit
?.
pipelines
?.
edges
;
const
pipelines
=
data
.
project
?.
repository
?.
tree
?.
lastCommit
?.
pipelines
?.
edges
;
return
{
return
{
...
...
app/assets/javascripts/repository/components/table/parent_row.vue
View file @
a4c662da
...
@@ -25,7 +25,7 @@ export default {
...
@@ -25,7 +25,7 @@ export default {
const
splitArray
=
this
.
path
.
split
(
'
/
'
);
const
splitArray
=
this
.
path
.
split
(
'
/
'
);
splitArray
.
pop
();
splitArray
.
pop
();
return
splitArray
.
map
(
p
=>
encodeURIComponent
(
p
)).
join
(
'
/
'
);
return
splitArray
.
map
(
(
p
)
=>
encodeURIComponent
(
p
)).
join
(
'
/
'
);
},
},
parentRoute
()
{
parentRoute
()
{
return
{
path
:
`/-/tree/
${
this
.
commitRef
}
/
${
this
.
parentPath
}
`
};
return
{
path
:
`/-/tree/
${
this
.
commitRef
}
/
${
this
.
parentPath
}
`
};
...
...
app/assets/javascripts/repository/components/tree_content.vue
View file @
a4c662da
...
@@ -113,7 +113,7 @@ export default {
...
@@ -113,7 +113,7 @@ export default {
}
}
}
}
})
})
.
catch
(
error
=>
{
.
catch
(
(
error
)
=>
{
createFlash
(
__
(
'
An error occurred while fetching folder content.
'
));
createFlash
(
__
(
'
An error occurred while fetching folder content.
'
));
throw
error
;
throw
error
;
});
});
...
...
app/assets/javascripts/repository/graphql.js
View file @
a4c662da
...
@@ -18,7 +18,7 @@ const defaultClient = createDefaultClient(
...
@@ -18,7 +18,7 @@ const defaultClient = createDefaultClient(
{
{
Query
:
{
Query
:
{
commit
(
_
,
{
path
,
fileName
,
type
})
{
commit
(
_
,
{
path
,
fileName
,
type
})
{
return
new
Promise
(
resolve
=>
{
return
new
Promise
(
(
resolve
)
=>
{
fetchLogsTree
(
defaultClient
,
path
,
'
0
'
,
{
fetchLogsTree
(
defaultClient
,
path
,
'
0
'
,
{
resolve
,
resolve
,
entry
:
{
entry
:
{
...
@@ -38,7 +38,7 @@ const defaultClient = createDefaultClient(
...
@@ -38,7 +38,7 @@ const defaultClient = createDefaultClient(
{
{
cacheConfig
:
{
cacheConfig
:
{
fragmentMatcher
,
fragmentMatcher
,
dataIdFromObject
:
obj
=>
{
dataIdFromObject
:
(
obj
)
=>
{
/* eslint-disable @gitlab/require-i18n-strings */
/* eslint-disable @gitlab/require-i18n-strings */
// eslint-disable-next-line no-underscore-dangle
// eslint-disable-next-line no-underscore-dangle
switch
(
obj
.
__typename
)
{
switch
(
obj
.
__typename
)
{
...
...
app/assets/javascripts/repository/router.js
View file @
a4c662da
...
@@ -10,7 +10,7 @@ Vue.use(VueRouter);
...
@@ -10,7 +10,7 @@ Vue.use(VueRouter);
export
default
function
createRouter
(
base
,
baseRef
)
{
export
default
function
createRouter
(
base
,
baseRef
)
{
const
treePathRoute
=
{
const
treePathRoute
=
{
component
:
TreePage
,
component
:
TreePage
,
props
:
route
=>
({
props
:
(
route
)
=>
({
path
:
route
.
params
.
path
?.
replace
(
/^
\/
/
,
''
)
||
'
/
'
,
path
:
route
.
params
.
path
?.
replace
(
/^
\/
/
,
''
)
||
'
/
'
,
}),
}),
};
};
...
...
app/assets/javascripts/repository/utils/commit.js
View file @
a4c662da
export
function
normalizeData
(
data
,
path
,
extra
=
()
=>
{})
{
export
function
normalizeData
(
data
,
path
,
extra
=
()
=>
{})
{
return
data
.
map
(
d
=>
({
return
data
.
map
(
(
d
)
=>
({
sha
:
d
.
commit
.
id
,
sha
:
d
.
commit
.
id
,
message
:
d
.
commit
.
message
,
message
:
d
.
commit
.
message
,
titleHtml
:
d
.
commit_title_html
,
titleHtml
:
d
.
commit_title_html
,
...
...
app/assets/javascripts/repository/utils/readme.js
View file @
a4c662da
...
@@ -18,14 +18,14 @@ const MARKUP_EXTENSIONS = [
...
@@ -18,14 +18,14 @@ const MARKUP_EXTENSIONS = [
'
wiki
'
,
'
wiki
'
,
];
];
const
isRichReadme
=
file
=>
{
const
isRichReadme
=
(
file
)
=>
{
const
re
=
new
RegExp
(
`^(
${
FILENAMES
.
join
(
'
|
'
)}
)\\.(
${
MARKUP_EXTENSIONS
.
join
(
'
|
'
)}
)$`
,
'
i
'
);
const
re
=
new
RegExp
(
`^(
${
FILENAMES
.
join
(
'
|
'
)}
)\\.(
${
MARKUP_EXTENSIONS
.
join
(
'
|
'
)}
)$`
,
'
i
'
);
return
re
.
test
(
file
.
name
);
return
re
.
test
(
file
.
name
);
};
};
const
isPlainReadme
=
file
=>
{
const
isPlainReadme
=
(
file
)
=>
{
const
re
=
new
RegExp
(
`^(
${
FILENAMES
.
join
(
'
|
'
)}
)(\\.txt)?$`
,
'
i
'
);
const
re
=
new
RegExp
(
`^(
${
FILENAMES
.
join
(
'
|
'
)}
)(\\.txt)?$`
,
'
i
'
);
return
re
.
test
(
file
.
name
);
return
re
.
test
(
file
.
name
);
};
};
export
const
readmeFile
=
blobs
=>
blobs
.
find
(
isRichReadme
)
||
blobs
.
find
(
isPlainReadme
);
export
const
readmeFile
=
(
blobs
)
=>
blobs
.
find
(
isRichReadme
)
||
blobs
.
find
(
isPlainReadme
);
app/assets/javascripts/search/highlight_blob_search_result.js
View file @
a4c662da
...
@@ -4,9 +4,9 @@ export default () => {
...
@@ -4,9 +4,9 @@ export default () => {
const
searchTerm
=
contentBody
.
querySelector
(
'
.js-search-input
'
).
value
.
toLowerCase
();
const
searchTerm
=
contentBody
.
querySelector
(
'
.js-search-input
'
).
value
.
toLowerCase
();
const
blobs
=
contentBody
.
querySelectorAll
(
'
.blob-result
'
);
const
blobs
=
contentBody
.
querySelectorAll
(
'
.blob-result
'
);
blobs
.
forEach
(
blob
=>
{
blobs
.
forEach
(
(
blob
)
=>
{
const
lines
=
blob
.
querySelectorAll
(
'
.line
'
);
const
lines
=
blob
.
querySelectorAll
(
'
.line
'
);
lines
.
forEach
(
line
=>
{
lines
.
forEach
(
(
line
)
=>
{
if
(
line
.
textContent
.
toLowerCase
().
includes
(
searchTerm
))
{
if
(
line
.
textContent
.
toLowerCase
().
includes
(
searchTerm
))
{
line
.
classList
.
add
(
highlightLineClass
);
line
.
classList
.
add
(
highlightLineClass
);
}
}
...
...
app/assets/javascripts/search/sidebar/index.js
View file @
a4c662da
...
@@ -4,7 +4,7 @@ import GlobalSearchSidebar from './components/app.vue';
...
@@ -4,7 +4,7 @@ import GlobalSearchSidebar from './components/app.vue';
Vue
.
use
(
Translate
);
Vue
.
use
(
Translate
);
export
const
initSidebar
=
store
=>
{
export
const
initSidebar
=
(
store
)
=>
{
const
el
=
document
.
getElementById
(
'
js-search-sidebar
'
);
const
el
=
document
.
getElementById
(
'
js-search-sidebar
'
);
if
(
!
el
)
return
false
;
if
(
!
el
)
return
false
;
...
...
app/assets/javascripts/search/store/actions.js
View file @
a4c662da
...
@@ -7,7 +7,7 @@ import * as types from './mutation_types';
...
@@ -7,7 +7,7 @@ import * as types from './mutation_types';
export
const
fetchGroups
=
({
commit
},
search
)
=>
{
export
const
fetchGroups
=
({
commit
},
search
)
=>
{
commit
(
types
.
REQUEST_GROUPS
);
commit
(
types
.
REQUEST_GROUPS
);
Api
.
groups
(
search
)
Api
.
groups
(
search
)
.
then
(
data
=>
{
.
then
(
(
data
)
=>
{
commit
(
types
.
RECEIVE_GROUPS_SUCCESS
,
data
);
commit
(
types
.
RECEIVE_GROUPS_SUCCESS
,
data
);
})
})
.
catch
(()
=>
{
.
catch
(()
=>
{
...
@@ -19,7 +19,7 @@ export const fetchGroups = ({ commit }, search) => {
...
@@ -19,7 +19,7 @@ export const fetchGroups = ({ commit }, search) => {
export
const
fetchProjects
=
({
commit
,
state
},
search
)
=>
{
export
const
fetchProjects
=
({
commit
,
state
},
search
)
=>
{
commit
(
types
.
REQUEST_PROJECTS
);
commit
(
types
.
REQUEST_PROJECTS
);
const
groupId
=
state
.
query
?.
group_id
;
const
groupId
=
state
.
query
?.
group_id
;
const
callback
=
data
=>
{
const
callback
=
(
data
)
=>
{
if
(
data
)
{
if
(
data
)
{
commit
(
types
.
RECEIVE_PROJECTS_SUCCESS
,
data
);
commit
(
types
.
RECEIVE_PROJECTS_SUCCESS
,
data
);
}
else
{
}
else
{
...
...
app/assets/javascripts/search/store/index.js
View file @
a4c662da
...
@@ -12,5 +12,5 @@ export const getStoreConfig = ({ query }) => ({
...
@@ -12,5 +12,5 @@ export const getStoreConfig = ({ query }) => ({
state
:
createState
({
query
}),
state
:
createState
({
query
}),
});
});
const
createStore
=
config
=>
new
Vuex
.
Store
(
getStoreConfig
(
config
));
const
createStore
=
(
config
)
=>
new
Vuex
.
Store
(
getStoreConfig
(
config
));
export
default
createStore
;
export
default
createStore
;
app/assets/javascripts/search/topbar/index.js
View file @
a4c662da
...
@@ -40,5 +40,5 @@ const searchableDropdowns = [
...
@@ -40,5 +40,5 @@ const searchableDropdowns = [
},
},
];
];
export
const
initTopbar
=
store
=>
export
const
initTopbar
=
(
store
)
=>
searchableDropdowns
.
map
(
dropdown
=>
mountSearchableDropdown
(
store
,
dropdown
));
searchableDropdowns
.
map
(
(
dropdown
)
=>
mountSearchableDropdown
(
store
,
dropdown
));
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