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 = (
...
paginationParams
,
},
})
.
then
(
response
=>
{
.
then
(
(
response
)
=>
{
const
{
data
,
paginationInfo
:
graphQlPageInfo
}
=
convertAllReleasesGraphQLResponse
(
response
);
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';
import
*
as
actions
from
'
./actions
'
;
import
mutations
from
'
./mutations
'
;
export
default
initialState
=>
({
export
default
(
initialState
)
=>
({
namespaced
:
true
,
actions
,
mutations
,
...
...
app/assets/javascripts/releases/util.js
View file @
a4c662da
...
...
@@ -17,7 +17,7 @@ export const releaseToApiJson = (release, createFrom = null) => {
// Milestones may be either a list of milestone objects OR just a list
// 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
(
{
...
...
@@ -37,7 +37,7 @@ export const releaseToApiJson = (release, createFrom = null) => {
* into the structure this Vue application can work with.
* @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
});
release
.
milestones
=
release
.
milestones
||
[];
...
...
@@ -47,7 +47,7 @@ export const apiJsonToRelease = json => {
export
const
gqClient
=
createGqClient
({},
{
fetchPolicy
:
fetchPolicies
.
NO_CACHE
});
const
convertScalarProperties
=
graphQLRelease
=>
const
convertScalarProperties
=
(
graphQLRelease
)
=>
pick
(
graphQLRelease
,
[
'
name
'
,
'
tagName
'
,
...
...
@@ -57,29 +57,29 @@ const convertScalarProperties = graphQLRelease =>
'
upcomingRelease
'
,
]);
const
convertAssets
=
graphQLRelease
=>
({
const
convertAssets
=
(
graphQLRelease
)
=>
({
assets
:
{
count
:
graphQLRelease
.
assets
.
count
,
sources
:
[...
graphQLRelease
.
assets
.
sources
.
nodes
],
links
:
graphQLRelease
.
assets
.
links
.
nodes
.
map
(
l
=>
({
links
:
graphQLRelease
.
assets
.
links
.
nodes
.
map
(
(
l
)
=>
({
...
l
,
linkType
:
l
.
linkType
?.
toLowerCase
(),
})),
},
});
const
convertEvidences
=
graphQLRelease
=>
({
evidences
:
graphQLRelease
.
evidences
.
nodes
.
map
(
e
=>
e
),
const
convertEvidences
=
(
graphQLRelease
)
=>
({
evidences
:
graphQLRelease
.
evidences
.
nodes
.
map
(
(
e
)
=>
e
),
});
const
convertLinks
=
graphQLRelease
=>
({
const
convertLinks
=
(
graphQLRelease
)
=>
({
_links
:
{
...
graphQLRelease
.
links
,
self
:
graphQLRelease
.
links
?.
selfUrl
,
},
});
const
convertCommit
=
graphQLRelease
=>
{
const
convertCommit
=
(
graphQLRelease
)
=>
{
if
(
!
graphQLRelease
.
commit
)
{
return
{};
}
...
...
@@ -93,10 +93,10 @@ const convertCommit = graphQLRelease => {
};
};
const
convertAuthor
=
graphQLRelease
=>
({
author
:
graphQLRelease
.
author
});
const
convertAuthor
=
(
graphQLRelease
)
=>
({
author
:
graphQLRelease
.
author
});
const
convertMilestones
=
graphQLRelease
=>
({
milestones
:
graphQLRelease
.
milestones
.
nodes
.
map
(
m
=>
({
const
convertMilestones
=
(
graphQLRelease
)
=>
({
milestones
:
graphQLRelease
.
milestones
.
nodes
.
map
(
(
m
)
=>
({
...
m
,
webUrl
:
m
.
webPath
,
webPath
:
undefined
,
...
...
@@ -115,7 +115,7 @@ const convertMilestones = graphQLRelease => ({
*
* @param graphQLRelease The release object returned from a GraphQL query
*/
export
const
convertGraphQLRelease
=
graphQLRelease
=>
({
export
const
convertGraphQLRelease
=
(
graphQLRelease
)
=>
({
...
convertScalarProperties
(
graphQLRelease
),
...
convertAssets
(
graphQLRelease
),
...
convertEvidences
(
graphQLRelease
),
...
...
@@ -134,7 +134,7 @@ export const convertGraphQLRelease = graphQLRelease => ({
*
* @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
paginationInfo
=
{
...
...
@@ -153,7 +153,7 @@ export const convertAllReleasesGraphQLResponse = response => {
*
* @param response The response received from the GraphQL endpoint
*/
export
const
convertOneReleaseGraphQLResponse
=
response
=>
{
export
const
convertOneReleaseGraphQLResponse
=
(
response
)
=>
{
const
release
=
convertGraphQLRelease
(
response
.
data
.
project
.
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
{
s__
,
n__
}
from
'
~/locale
'
;
export
const
groupedSummaryText
=
state
=>
{
export
const
groupedSummaryText
=
(
state
)
=>
{
if
(
state
.
isLoading
)
{
return
s__
(
'
Reports|Accessibility scanning results are being parsed
'
);
}
...
...
@@ -22,7 +22,7 @@ export const groupedSummaryText = state => {
);
};
export
const
summaryStatus
=
state
=>
{
export
const
summaryStatus
=
(
state
)
=>
{
if
(
state
.
isLoading
)
{
return
LOADING
;
}
...
...
@@ -34,12 +34,12 @@ export const summaryStatus = state => {
return
SUCCESS
;
};
export
const
shouldRenderIssuesList
=
state
=>
Object
.
values
(
state
.
report
).
some
(
x
=>
Array
.
isArray
(
x
)
&&
x
.
length
>
0
);
export
const
shouldRenderIssuesList
=
(
state
)
=>
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
// to add notes and warnings to these issue lists, so I'm going to
// keep these as getters
export
const
unresolvedIssues
=
state
=>
state
.
report
.
existing_errors
;
export
const
resolvedIssues
=
state
=>
state
.
report
.
resolved_errors
;
export
const
newIssues
=
state
=>
state
.
report
.
new_errors
;
export
const
unresolvedIssues
=
(
state
)
=>
state
.
report
.
existing_errors
;
export
const
resolvedIssues
=
(
state
)
=>
state
.
report
.
resolved_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';
Vue
.
use
(
Vuex
);
export
const
getStoreConfig
=
initialState
=>
({
export
const
getStoreConfig
=
(
initialState
)
=>
({
actions
,
getters
,
mutations
,
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 }) => {
return
dispatch
(
'
receiveReportsError
'
);
}
return
Promise
.
all
([
axios
.
get
(
state
.
headPath
),
axios
.
get
(
state
.
basePath
)])
.
then
(
results
=>
.
then
(
(
results
)
=>
doCodeClimateComparison
(
parseCodeclimateMetrics
(
results
[
0
].
data
,
state
.
headBlobPath
),
parseCodeclimateMetrics
(
results
[
1
].
data
,
state
.
baseBlobPath
),
),
)
.
then
(
data
=>
dispatch
(
'
receiveReportsSuccess
'
,
data
))
.
then
(
(
data
)
=>
dispatch
(
'
receiveReportsSuccess
'
,
data
))
.
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';
import
{
sprintf
,
__
,
s__
,
n__
}
from
'
~/locale
'
;
import
{
spriteIcon
}
from
'
~/lib/utils/common_utils
'
;
export
const
hasCodequalityIssues
=
state
=>
export
const
hasCodequalityIssues
=
(
state
)
=>
Boolean
(
state
.
newIssues
?.
length
||
state
.
resolvedIssues
?.
length
);
export
const
codequalityStatus
=
state
=>
{
export
const
codequalityStatus
=
(
state
)
=>
{
if
(
state
.
isLoading
)
{
return
LOADING
;
}
...
...
@@ -16,7 +16,7 @@ export const codequalityStatus = state => {
return
SUCCESS
;
};
export
const
codequalityText
=
state
=>
{
export
const
codequalityText
=
(
state
)
=>
{
const
{
newIssues
,
resolvedIssues
}
=
state
;
const
text
=
[];
...
...
@@ -41,7 +41,7 @@ export const codequalityText = state => {
return
text
.
join
(
''
);
};
export
const
codequalityPopover
=
state
=>
{
export
const
codequalityPopover
=
(
state
)
=>
{
if
(
state
.
headPath
&&
!
state
.
basePath
)
{
return
{
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';
Vue
.
use
(
Vuex
);
export
const
getStoreConfig
=
initialState
=>
({
export
const
getStoreConfig
=
(
initialState
)
=>
({
actions
,
getters
,
mutations
,
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
'
;
export
const
parseCodeclimateMetrics
=
(
issues
=
[],
path
=
''
)
=>
{
return
issues
.
map
(
issue
=>
{
return
issues
.
map
(
(
issue
)
=>
{
const
parsedIssue
=
{
...
issue
,
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';
const
KEY_TO_FILTER_BY
=
'
fingerprint
'
;
// eslint-disable-next-line no-restricted-globals
self
.
addEventListener
(
'
message
'
,
e
=>
{
self
.
addEventListener
(
'
message
'
,
(
e
)
=>
{
const
{
data
}
=
e
;
if
(
data
===
undefined
)
{
...
...
app/assets/javascripts/reports/components/grouped_issues_list.vue
View file @
a4c662da
...
...
@@ -41,7 +41,7 @@ export default {
computed
:
{
groups
()
{
return
this
.
$options
.
groups
.
map
(
group
=>
({
.
map
(
(
group
)
=>
({
name
:
group
,
issues
:
this
[
`
${
group
}
Issues`
],
heading
:
this
[
`
${
group
}
Heading`
],
...
...
app/assets/javascripts/reports/components/grouped_test_reports_app.vue
View file @
a4c662da
...
...
@@ -44,8 +44,8 @@ export default {
computed
:
{
...
mapState
([
'
reports
'
,
'
isLoading
'
,
'
hasError
'
,
'
summary
'
]),
...
mapState
({
modalTitle
:
state
=>
state
.
modal
.
title
||
''
,
modalData
:
state
=>
state
.
modal
.
data
||
{},
modalTitle
:
(
state
)
=>
state
.
modal
.
title
||
''
,
modalData
:
(
state
)
=>
state
.
modal
.
data
||
{},
}),
...
mapGetters
([
'
summaryStatus
'
]),
groupedSummaryText
()
{
...
...
app/assets/javascripts/reports/components/issues_list.vue
View file @
a4c662da
...
...
@@ -3,7 +3,7 @@ import ReportItem from '~/reports/components/report_item.vue';
import
{
STATUS_FAILED
,
STATUS_NEUTRAL
,
STATUS_SUCCESS
}
from
'
~/reports/constants
'
;
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
,
isNew
,
issue
,
...
...
app/assets/javascripts/reports/components/report_item.vue
View file @
a4c662da
...
...
@@ -17,7 +17,7 @@ export default {
type
:
String
,
required
:
false
,
default
:
''
,
validator
:
value
=>
value
===
''
||
Object
.
values
(
componentNames
).
includes
(
value
),
validator
:
(
value
)
=>
value
===
''
||
Object
.
values
(
componentNames
).
includes
(
value
),
},
// failed || success
status
:
{
...
...
app/assets/javascripts/reports/store/getters.js
View file @
a4c662da
import
{
LOADING
,
ERROR
,
SUCCESS
,
STATUS_FAILED
}
from
'
../constants
'
;
export
const
summaryStatus
=
state
=>
{
export
const
summaryStatus
=
(
state
)
=>
{
if
(
state
.
isLoading
)
{
return
LOADING
;
}
...
...
app/assets/javascripts/reports/store/mutations.js
View file @
a4c662da
...
...
@@ -9,7 +9,7 @@ export default {
state
.
isLoading
=
true
;
},
[
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
;
...
...
@@ -44,7 +44,7 @@ export default {
[
types
.
SET_ISSUE_MODAL_DATA
](
state
,
payload
)
{
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
))
{
state
.
modal
.
data
[
key
]
=
{
...
state
.
modal
.
data
[
key
],
...
...
app/assets/javascripts/reports/store/utils.js
View file @
a4c662da
...
...
@@ -7,7 +7,7 @@ import {
ICON_NOTFOUND
,
}
from
'
../constants
'
;
const
textBuilder
=
results
=>
{
const
textBuilder
=
(
results
)
=>
{
const
{
failed
,
errored
,
resolved
,
total
}
=
results
;
const
failedOrErrored
=
(
failed
||
0
)
+
(
errored
||
0
);
...
...
@@ -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
const
reports
=
!
subject
.
length
?
[
subject
]
:
subject
;
return
reports
.
map
(
report
=>
{
.
map
(
(
report
)
=>
{
return
(
[
report
.
new_failures
,
report
.
existing_failures
,
report
.
resolved_failures
]
// only count tests which have failed more than once
.
map
(
failureArray
=>
failureArray
.
filter
(
failure
=>
failure
.
recent_failures
?.
count
>
1
).
length
,
(
failureArray
)
=>
failureArray
.
filter
(
(
failure
)
=>
failure
.
recent_failures
?.
count
>
1
).
length
,
)
.
reduce
((
total
,
count
)
=>
total
+
count
,
0
)
);
...
...
@@ -89,7 +89,7 @@ export const countRecentlyFailedTests = subject => {
.
reduce
((
total
,
count
)
=>
total
+
count
,
0
);
};
export
const
statusIcon
=
status
=>
{
export
const
statusIcon
=
(
status
)
=>
{
if
(
status
===
STATUS_FAILED
)
{
return
ICON_WARNING
;
}
...
...
app/assets/javascripts/repository/components/breadcrumbs.vue
View file @
a4c662da
...
...
@@ -40,7 +40,7 @@ export default {
projectPath
:
this
.
projectPath
,
};
},
update
:
data
=>
data
.
project
?.
userPermissions
,
update
:
(
data
)
=>
data
.
project
?.
userPermissions
,
error
(
error
)
{
throw
error
;
},
...
...
@@ -105,7 +105,7 @@ export default {
pathLinks
()
{
return
this
.
currentPath
.
split
(
'
/
'
)
.
filter
(
p
=>
p
!==
''
)
.
filter
(
(
p
)
=>
p
!==
''
)
.
reduce
(
(
acc
,
name
,
i
)
=>
{
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 {
},
computed
:
{
normalizedLinks
()
{
return
this
.
links
.
map
(
link
=>
({
return
this
.
links
.
map
(
(
link
)
=>
({
text
:
link
.
text
,
path
:
`
${
link
.
path
}
?path=
${
this
.
currentPath
}
`
,
}));
...
...
app/assets/javascripts/repository/components/last_commit.vue
View file @
a4c662da
...
...
@@ -39,7 +39,7 @@ export default {
path
:
this
.
currentPath
.
replace
(
/^
\/
/
,
''
),
};
},
update
:
data
=>
{
update
:
(
data
)
=>
{
const
pipelines
=
data
.
project
?.
repository
?.
tree
?.
lastCommit
?.
pipelines
?.
edges
;
return
{
...
...
app/assets/javascripts/repository/components/table/parent_row.vue
View file @
a4c662da
...
...
@@ -25,7 +25,7 @@ export default {
const
splitArray
=
this
.
path
.
split
(
'
/
'
);
splitArray
.
pop
();
return
splitArray
.
map
(
p
=>
encodeURIComponent
(
p
)).
join
(
'
/
'
);
return
splitArray
.
map
(
(
p
)
=>
encodeURIComponent
(
p
)).
join
(
'
/
'
);
},
parentRoute
()
{
return
{
path
:
`/-/tree/
${
this
.
commitRef
}
/
${
this
.
parentPath
}
`
};
...
...
app/assets/javascripts/repository/components/tree_content.vue
View file @
a4c662da
...
...
@@ -113,7 +113,7 @@ export default {
}
}
})
.
catch
(
error
=>
{
.
catch
(
(
error
)
=>
{
createFlash
(
__
(
'
An error occurred while fetching folder content.
'
));
throw
error
;
});
...
...
app/assets/javascripts/repository/graphql.js
View file @
a4c662da
...
...
@@ -18,7 +18,7 @@ const defaultClient = createDefaultClient(
{
Query
:
{
commit
(
_
,
{
path
,
fileName
,
type
})
{
return
new
Promise
(
resolve
=>
{
return
new
Promise
(
(
resolve
)
=>
{
fetchLogsTree
(
defaultClient
,
path
,
'
0
'
,
{
resolve
,
entry
:
{
...
...
@@ -38,7 +38,7 @@ const defaultClient = createDefaultClient(
{
cacheConfig
:
{
fragmentMatcher
,
dataIdFromObject
:
obj
=>
{
dataIdFromObject
:
(
obj
)
=>
{
/* eslint-disable @gitlab/require-i18n-strings */
// eslint-disable-next-line no-underscore-dangle
switch
(
obj
.
__typename
)
{
...
...
app/assets/javascripts/repository/router.js
View file @
a4c662da
...
...
@@ -10,7 +10,7 @@ Vue.use(VueRouter);
export
default
function
createRouter
(
base
,
baseRef
)
{
const
treePathRoute
=
{
component
:
TreePage
,
props
:
route
=>
({
props
:
(
route
)
=>
({
path
:
route
.
params
.
path
?.
replace
(
/^
\/
/
,
''
)
||
'
/
'
,
}),
};
...
...
app/assets/javascripts/repository/utils/commit.js
View file @
a4c662da
export
function
normalizeData
(
data
,
path
,
extra
=
()
=>
{})
{
return
data
.
map
(
d
=>
({
return
data
.
map
(
(
d
)
=>
({
sha
:
d
.
commit
.
id
,
message
:
d
.
commit
.
message
,
titleHtml
:
d
.
commit_title_html
,
...
...
app/assets/javascripts/repository/utils/readme.js
View file @
a4c662da
...
...
@@ -18,14 +18,14 @@ const MARKUP_EXTENSIONS = [
'
wiki
'
,
];
const
isRichReadme
=
file
=>
{
const
isRichReadme
=
(
file
)
=>
{
const
re
=
new
RegExp
(
`^(
${
FILENAMES
.
join
(
'
|
'
)}
)\\.(
${
MARKUP_EXTENSIONS
.
join
(
'
|
'
)}
)$`
,
'
i
'
);
return
re
.
test
(
file
.
name
);
};
const
isPlainReadme
=
file
=>
{
const
isPlainReadme
=
(
file
)
=>
{
const
re
=
new
RegExp
(
`^(
${
FILENAMES
.
join
(
'
|
'
)}
)(\\.txt)?$`
,
'
i
'
);
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 () => {
const
searchTerm
=
contentBody
.
querySelector
(
'
.js-search-input
'
).
value
.
toLowerCase
();
const
blobs
=
contentBody
.
querySelectorAll
(
'
.blob-result
'
);
blobs
.
forEach
(
blob
=>
{
blobs
.
forEach
(
(
blob
)
=>
{
const
lines
=
blob
.
querySelectorAll
(
'
.line
'
);
lines
.
forEach
(
line
=>
{
lines
.
forEach
(
(
line
)
=>
{
if
(
line
.
textContent
.
toLowerCase
().
includes
(
searchTerm
))
{
line
.
classList
.
add
(
highlightLineClass
);
}
...
...
app/assets/javascripts/search/sidebar/index.js
View file @
a4c662da
...
...
@@ -4,7 +4,7 @@ import GlobalSearchSidebar from './components/app.vue';
Vue
.
use
(
Translate
);
export
const
initSidebar
=
store
=>
{
export
const
initSidebar
=
(
store
)
=>
{
const
el
=
document
.
getElementById
(
'
js-search-sidebar
'
);
if
(
!
el
)
return
false
;
...
...
app/assets/javascripts/search/store/actions.js
View file @
a4c662da
...
...
@@ -7,7 +7,7 @@ import * as types from './mutation_types';
export
const
fetchGroups
=
({
commit
},
search
)
=>
{
commit
(
types
.
REQUEST_GROUPS
);
Api
.
groups
(
search
)
.
then
(
data
=>
{
.
then
(
(
data
)
=>
{
commit
(
types
.
RECEIVE_GROUPS_SUCCESS
,
data
);
})
.
catch
(()
=>
{
...
...
@@ -19,7 +19,7 @@ export const fetchGroups = ({ commit }, search) => {
export
const
fetchProjects
=
({
commit
,
state
},
search
)
=>
{
commit
(
types
.
REQUEST_PROJECTS
);
const
groupId
=
state
.
query
?.
group_id
;
const
callback
=
data
=>
{
const
callback
=
(
data
)
=>
{
if
(
data
)
{
commit
(
types
.
RECEIVE_PROJECTS_SUCCESS
,
data
);
}
else
{
...
...
app/assets/javascripts/search/store/index.js
View file @
a4c662da
...
...
@@ -12,5 +12,5 @@ export const getStoreConfig = ({ query }) => ({
state
:
createState
({
query
}),
});
const
createStore
=
config
=>
new
Vuex
.
Store
(
getStoreConfig
(
config
));
const
createStore
=
(
config
)
=>
new
Vuex
.
Store
(
getStoreConfig
(
config
));
export
default
createStore
;
app/assets/javascripts/search/topbar/index.js
View file @
a4c662da
...
...
@@ -40,5 +40,5 @@ const searchableDropdowns = [
},
];
export
const
initTopbar
=
store
=>
searchableDropdowns
.
map
(
dropdown
=>
mountSearchableDropdown
(
store
,
dropdown
));
export
const
initTopbar
=
(
store
)
=>
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