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
9aa1f620
Commit
9aa1f620
authored
Dec 23, 2020
by
Lukas Eipert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run prettier on 32 files - 26 of 73
Part of our prettier migration; changing the arrow-parens style.
parent
66da0984
Changes
32
Show whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
78 additions
and
78 deletions
+78
-78
app/assets/javascripts/read_more.js
app/assets/javascripts/read_more.js
+2
-2
app/assets/javascripts/ref/components/ref_results_section.vue
...assets/javascripts/ref/components/ref_results_section.vue
+1
-1
app/assets/javascripts/ref/components/ref_selector.vue
app/assets/javascripts/ref/components/ref_selector.vue
+3
-3
app/assets/javascripts/ref/stores/actions.js
app/assets/javascripts/ref/stores/actions.js
+6
-6
app/assets/javascripts/ref/stores/mutations.js
app/assets/javascripts/ref/stores/mutations.js
+2
-2
app/assets/javascripts/ref_select_dropdown.js
app/assets/javascripts/ref_select_dropdown.js
+1
-1
app/assets/javascripts/registry/explorer/components/details_page/tags_list.vue
...s/registry/explorer/components/details_page/tags_list.vue
+2
-2
app/assets/javascripts/registry/explorer/components/registry_breadcrumb.vue
...ipts/registry/explorer/components/registry_breadcrumb.vue
+2
-2
app/assets/javascripts/registry/explorer/pages/details.vue
app/assets/javascripts/registry/explorer/pages/details.vue
+2
-2
app/assets/javascripts/registry/settings/components/registry_settings_app.vue
...ts/registry/settings/components/registry_settings_app.vue
+1
-1
app/assets/javascripts/registry/settings/components/settings_form.vue
...avascripts/registry/settings/components/settings_form.vue
+4
-4
app/assets/javascripts/registry/settings/graphql/utils/cache_update.js
...vascripts/registry/settings/graphql/utils/cache_update.js
+2
-2
app/assets/javascripts/registry/settings/utils.js
app/assets/javascripts/registry/settings/utils.js
+5
-5
app/assets/javascripts/related_issues/components/related_issuable_input.vue
...ipts/related_issues/components/related_issuable_input.vue
+3
-3
app/assets/javascripts/related_issues/components/related_issues_block.vue
...cripts/related_issues/components/related_issues_block.vue
+3
-3
app/assets/javascripts/related_issues/components/related_issues_root.vue
...scripts/related_issues/components/related_issues_root.vue
+3
-3
app/assets/javascripts/related_issues/index.js
app/assets/javascripts/related_issues/index.js
+1
-1
app/assets/javascripts/related_issues/stores/related_issues_store.js
...javascripts/related_issues/stores/related_issues_store.js
+1
-1
app/assets/javascripts/related_merge_requests/index.js
app/assets/javascripts/related_merge_requests/index.js
+1
-1
app/assets/javascripts/related_merge_requests/store/actions.js
...ssets/javascripts/related_merge_requests/store/actions.js
+1
-1
app/assets/javascripts/releases/components/release_block_assets.vue
.../javascripts/releases/components/release_block_assets.vue
+3
-3
app/assets/javascripts/releases/components/release_block_milestone_info.vue
...ipts/releases/components/release_block_milestone_info.vue
+3
-3
app/assets/javascripts/releases/components/releases_sort.vue
app/assets/javascripts/releases/components/releases_sort.vue
+3
-3
app/assets/javascripts/releases/mount_edit.js
app/assets/javascripts/releases/mount_edit.js
+1
-1
app/assets/javascripts/releases/mount_index.js
app/assets/javascripts/releases/mount_index.js
+1
-1
app/assets/javascripts/releases/mount_new.js
app/assets/javascripts/releases/mount_new.js
+1
-1
app/assets/javascripts/releases/mount_show.js
app/assets/javascripts/releases/mount_show.js
+1
-1
app/assets/javascripts/releases/stores/getters.js
app/assets/javascripts/releases/stores/getters.js
+1
-1
app/assets/javascripts/releases/stores/modules/detail/actions.js
...ets/javascripts/releases/stores/modules/detail/actions.js
+7
-7
app/assets/javascripts/releases/stores/modules/detail/getters.js
...ets/javascripts/releases/stores/modules/detail/getters.js
+8
-8
app/assets/javascripts/releases/stores/modules/detail/index.js
...ssets/javascripts/releases/stores/modules/detail/index.js
+1
-1
app/assets/javascripts/releases/stores/modules/detail/mutations.js
...s/javascripts/releases/stores/modules/detail/mutations.js
+2
-2
No files found.
app/assets/javascripts/read_more.js
View file @
9aa1f620
...
...
@@ -22,7 +22,7 @@ export default function initReadMore(triggerSelector = '.js-read-more-trigger')
if
(
!
triggerEls
)
return
;
triggerEls
.
forEach
(
triggerEl
=>
{
triggerEls
.
forEach
(
(
triggerEl
)
=>
{
const
targetEl
=
triggerEl
.
previousElementSibling
;
if
(
!
targetEl
)
{
...
...
@@ -31,7 +31,7 @@ export default function initReadMore(triggerSelector = '.js-read-more-trigger')
triggerEl
.
addEventListener
(
'
click
'
,
e
=>
{
(
e
)
=>
{
targetEl
.
classList
.
add
(
'
is-expanded
'
);
e
.
target
.
remove
();
},
...
...
app/assets/javascripts/ref/components/ref_results_section.vue
View file @
9aa1f620
...
...
@@ -39,7 +39,7 @@ export default {
items
:
{
type
:
Array
,
required
:
true
,
validator
:
items
=>
Array
.
isArray
(
items
)
&&
items
.
every
(
item
=>
item
.
name
),
validator
:
(
items
)
=>
Array
.
isArray
(
items
)
&&
items
.
every
((
item
)
=>
item
.
name
),
},
/**
...
...
app/assets/javascripts/ref/components/ref_selector.vue
View file @
9aa1f620
...
...
@@ -50,9 +50,9 @@ export default {
},
computed
:
{
...
mapState
({
matches
:
state
=>
state
.
matches
,
lastQuery
:
state
=>
state
.
query
,
selectedRef
:
state
=>
state
.
selectedRef
,
matches
:
(
state
)
=>
state
.
matches
,
lastQuery
:
(
state
)
=>
state
.
query
,
selectedRef
:
(
state
)
=>
state
.
selectedRef
,
}),
...
mapGetters
([
'
isLoading
'
,
'
isQueryPossiblyASha
'
]),
i18n
()
{
...
...
app/assets/javascripts/ref/stores/actions.js
View file @
9aa1f620
...
...
@@ -18,10 +18,10 @@ export const searchBranches = ({ commit, state }) => {
commit
(
types
.
REQUEST_START
);
Api
.
branches
(
state
.
projectId
,
state
.
query
)
.
then
(
response
=>
{
.
then
(
(
response
)
=>
{
commit
(
types
.
RECEIVE_BRANCHES_SUCCESS
,
response
);
})
.
catch
(
error
=>
{
.
catch
(
(
error
)
=>
{
commit
(
types
.
RECEIVE_BRANCHES_ERROR
,
error
);
})
.
finally
(()
=>
{
...
...
@@ -33,10 +33,10 @@ export const searchTags = ({ commit, state }) => {
commit
(
types
.
REQUEST_START
);
Api
.
tags
(
state
.
projectId
,
state
.
query
)
.
then
(
response
=>
{
.
then
(
(
response
)
=>
{
commit
(
types
.
RECEIVE_TAGS_SUCCESS
,
response
);
})
.
catch
(
error
=>
{
.
catch
(
(
error
)
=>
{
commit
(
types
.
RECEIVE_TAGS_ERROR
,
error
);
})
.
finally
(()
=>
{
...
...
@@ -50,10 +50,10 @@ export const searchCommits = ({ commit, state, getters }) => {
commit
(
types
.
REQUEST_START
);
Api
.
commit
(
state
.
projectId
,
state
.
query
)
.
then
(
response
=>
{
.
then
(
(
response
)
=>
{
commit
(
types
.
RECEIVE_COMMITS_SUCCESS
,
response
);
})
.
catch
(
error
=>
{
.
catch
(
(
error
)
=>
{
commit
(
types
.
RECEIVE_COMMITS_ERROR
,
error
);
})
.
finally
(()
=>
{
...
...
app/assets/javascripts/ref/stores/mutations.js
View file @
9aa1f620
...
...
@@ -23,7 +23,7 @@ export default {
[
types
.
RECEIVE_BRANCHES_SUCCESS
](
state
,
response
)
{
state
.
matches
.
branches
=
{
list
:
convertObjectPropsToCamelCase
(
response
.
data
).
map
(
b
=>
({
list
:
convertObjectPropsToCamelCase
(
response
.
data
).
map
(
(
b
)
=>
({
name
:
b
.
name
,
default
:
b
.
default
,
})),
...
...
@@ -41,7 +41,7 @@ export default {
[
types
.
RECEIVE_TAGS_SUCCESS
](
state
,
response
)
{
state
.
matches
.
tags
=
{
list
:
convertObjectPropsToCamelCase
(
response
.
data
).
map
(
b
=>
({
list
:
convertObjectPropsToCamelCase
(
response
.
data
).
map
(
(
b
)
=>
({
name
:
b
.
name
,
})),
totalCount
:
parseInt
(
response
.
headers
[
X_TOTAL_HEADER
],
10
),
...
...
app/assets/javascripts/ref_select_dropdown.js
View file @
9aa1f620
...
...
@@ -31,7 +31,7 @@ class RefSelectDropdown {
const
$fieldInput
=
$
(
`input[name="
${
$dropdownButton
.
data
(
'
fieldName
'
)}
"]`
,
$dropdownContainer
);
const
$filterInput
=
$
(
'
input[type="search"]
'
,
$dropdownContainer
);
$filterInput
.
on
(
'
keyup
'
,
e
=>
{
$filterInput
.
on
(
'
keyup
'
,
(
e
)
=>
{
const
keyCode
=
e
.
keyCode
||
e
.
which
;
if
(
keyCode
!==
13
)
return
;
...
...
app/assets/javascripts/registry/explorer/components/details_page/tags_list.vue
View file @
9aa1f620
...
...
@@ -31,10 +31,10 @@ export default {
},
computed
:
{
hasSelectedItems
()
{
return
this
.
tags
.
some
(
tag
=>
this
.
selectedItems
[
tag
.
name
]);
return
this
.
tags
.
some
(
(
tag
)
=>
this
.
selectedItems
[
tag
.
name
]);
},
showMultiDeleteButton
()
{
return
this
.
tags
.
some
(
tag
=>
tag
.
canDelete
)
&&
!
this
.
isMobile
;
return
this
.
tags
.
some
(
(
tag
)
=>
tag
.
canDelete
)
&&
!
this
.
isMobile
;
},
},
methods
:
{
...
...
app/assets/javascripts/registry/explorer/components/registry_breadcrumb.vue
View file @
9aa1f620
...
...
@@ -14,10 +14,10 @@ export default {
},
computed
:
{
parsedCrumbs
()
{
return
this
.
crumbs
.
map
(
c
=>
({
...
c
,
innerHTML
:
sanitize
(
c
.
innerHTML
)
}));
return
this
.
crumbs
.
map
(
(
c
)
=>
({
...
c
,
innerHTML
:
sanitize
(
c
.
innerHTML
)
}));
},
rootRoute
()
{
return
this
.
$router
.
options
.
routes
.
find
(
r
=>
r
.
meta
.
root
);
return
this
.
$router
.
options
.
routes
.
find
(
(
r
)
=>
r
.
meta
.
root
);
},
isRootRoute
()
{
return
this
.
$route
.
name
===
this
.
rootRoute
.
name
;
...
...
app/assets/javascripts/registry/explorer/pages/details.vue
View file @
9aa1f620
...
...
@@ -97,7 +97,7 @@ export default {
},
methods
:
{
deleteTags
(
toBeDeleted
)
{
this
.
itemsToBeDeleted
=
this
.
tags
.
filter
(
tag
=>
toBeDeleted
[
tag
.
name
]);
this
.
itemsToBeDeleted
=
this
.
tags
.
filter
(
(
tag
)
=>
toBeDeleted
[
tag
.
name
]);
this
.
track
(
'
click_button
'
);
this
.
$refs
.
deleteModal
.
show
();
},
...
...
@@ -111,7 +111,7 @@ export default {
mutation
:
deleteContainerRepositoryTagsMutation
,
variables
:
{
id
:
this
.
queryVariables
.
id
,
tagNames
:
itemsToBeDeleted
.
map
(
i
=>
i
.
name
),
tagNames
:
itemsToBeDeleted
.
map
(
(
i
)
=>
i
.
name
),
},
awaitRefetchQueries
:
true
,
refetchQueries
:
[
...
...
app/assets/javascripts/registry/settings/components/registry_settings_app.vue
View file @
9aa1f620
...
...
@@ -33,7 +33,7 @@ export default {
projectPath
:
this
.
projectPath
,
};
},
update
:
data
=>
data
.
project
?.
containerExpirationPolicy
,
update
:
(
data
)
=>
data
.
project
?.
containerExpirationPolicy
,
result
({
data
})
{
this
.
workingCopy
=
{
...
get
(
data
,
'
project.containerExpirationPolicy
'
,
{})
};
},
...
...
app/assets/javascripts/registry/settings/components/settings_form.vue
View file @
9aa1f620
...
...
@@ -96,7 +96,7 @@ export default {
return
this
.
isLoading
||
this
.
mutationLoading
;
},
fieldsAreValid
()
{
return
Object
.
values
(
this
.
localErrors
).
every
(
error
=>
error
);
return
Object
.
values
(
this
.
localErrors
).
every
(
(
error
)
=>
error
);
},
isSubmitButtonDisabled
()
{
return
!
this
.
fieldsAreValid
||
this
.
showLoadingIcon
;
...
...
@@ -121,7 +121,7 @@ export default {
},
methods
:
{
findDefaultOption
(
option
)
{
return
this
.
value
[
option
]
||
this
.
$options
.
formOptions
[
option
].
find
(
f
=>
f
.
default
)?.
key
;
return
this
.
value
[
option
]
||
this
.
$options
.
formOptions
[
option
].
find
(
(
f
)
=>
f
.
default
)?.
key
;
},
reset
()
{
this
.
track
(
'
reset_form
'
);
...
...
@@ -131,7 +131,7 @@ export default {
},
setApiErrors
(
response
)
{
this
.
apiErrors
=
response
.
graphQLErrors
.
reduce
((
acc
,
curr
)
=>
{
curr
.
extensions
.
problems
.
forEach
(
item
=>
{
curr
.
extensions
.
problems
.
forEach
(
(
item
)
=>
{
acc
[
item
.
path
[
0
]]
=
item
.
message
;
});
return
acc
;
...
...
@@ -163,7 +163,7 @@ export default {
this
.
$toast
.
show
(
UPDATE_SETTINGS_SUCCESS_MESSAGE
,
{
type
:
'
success
'
});
}
})
.
catch
(
error
=>
{
.
catch
(
(
error
)
=>
{
this
.
setApiErrors
(
error
);
this
.
$toast
.
show
(
UPDATE_SETTINGS_ERROR_MESSAGE
,
{
type
:
'
error
'
});
})
...
...
app/assets/javascripts/registry/settings/graphql/utils/cache_update.js
View file @
9aa1f620
import
{
produce
}
from
'
immer
'
;
import
expirationPolicyQuery
from
'
../queries/get_expiration_policy.query.graphql
'
;
export
const
updateContainerExpirationPolicy
=
projectPath
=>
(
client
,
{
data
:
updatedData
})
=>
{
export
const
updateContainerExpirationPolicy
=
(
projectPath
)
=>
(
client
,
{
data
:
updatedData
})
=>
{
const
queryAndParams
=
{
query
:
expirationPolicyQuery
,
variables
:
{
projectPath
},
};
const
sourceData
=
client
.
readQuery
(
queryAndParams
);
const
data
=
produce
(
sourceData
,
draftState
=>
{
const
data
=
produce
(
sourceData
,
(
draftState
)
=>
{
// eslint-disable-next-line no-param-reassign
draftState
.
project
.
containerExpirationPolicy
=
{
...
updatedData
.
updateContainerExpirationPolicy
.
containerExpirationPolicy
,
...
...
app/assets/javascripts/registry/settings/utils.js
View file @
9aa1f620
import
{
n__
}
from
'
~/locale
'
;
import
{
KEEP_N_OPTIONS
,
CADENCE_OPTIONS
,
OLDER_THAN_OPTIONS
}
from
'
./constants
'
;
export
const
findDefaultOption
=
options
=>
{
const
item
=
options
.
find
(
o
=>
o
.
default
);
export
const
findDefaultOption
=
(
options
)
=>
{
const
item
=
options
.
find
(
(
o
)
=>
o
.
default
);
return
item
?
item
.
key
:
null
;
};
export
const
olderThanTranslationGenerator
=
variable
=>
n__
(
'
%d day
'
,
'
%d days
'
,
variable
);
export
const
olderThanTranslationGenerator
=
(
variable
)
=>
n__
(
'
%d day
'
,
'
%d days
'
,
variable
);
export
const
keepNTranslationGenerator
=
variable
=>
export
const
keepNTranslationGenerator
=
(
variable
)
=>
n__
(
'
%d tag per image name
'
,
'
%d tags per image name
'
,
variable
);
export
const
optionLabelGenerator
=
(
collection
,
translationFn
)
=>
collection
.
map
(
option
=>
({
collection
.
map
(
(
option
)
=>
({
...
option
,
label
:
translationFn
(
option
.
variable
),
}));
...
...
app/assets/javascripts/related_issues/components/related_issuable_input.vue
View file @
9aa1f620
...
...
@@ -118,7 +118,7 @@ export default {
let
position
=
0
;
const
untouchedRawRefs
=
rawRefs
.
filter
(
ref
=>
{
.
filter
(
(
ref
)
=>
{
let
isTouched
=
false
;
if
(
caretPos
>=
position
&&
caretPos
<=
position
+
ref
.
length
)
{
...
...
@@ -130,7 +130,7 @@ export default {
return
!
isTouched
;
})
.
filter
(
ref
=>
ref
.
trim
().
length
>
0
);
.
filter
(
(
ref
)
=>
ref
.
trim
().
length
>
0
);
this
.
$emit
(
'
addIssuableFormInput
'
,
{
newValue
:
value
,
...
...
@@ -208,7 +208,7 @@ export default {
:path-id-separator=
"pathIdSeparator"
event-namespace=
"pendingIssuable"
@
pendingIssuableRemoveRequest=
"
params
=>
{
(params)
=>
{
$emit('pendingIssuableRemoveRequest', params);
}
"
...
...
app/assets/javascripts/related_issues/components/related_issues_block.vue
View file @
9aa1f620
...
...
@@ -90,11 +90,11 @@ export default {
categorisedIssues
()
{
if
(
this
.
showCategorizedIssues
)
{
return
Object
.
values
(
linkedIssueTypesMap
)
.
map
(
linkType
=>
({
.
map
(
(
linkType
)
=>
({
linkType
,
issues
:
this
.
relatedIssues
.
filter
(
issue
=>
issue
.
linkType
===
linkType
),
issues
:
this
.
relatedIssues
.
filter
(
(
issue
)
=>
issue
.
linkType
===
linkType
),
}))
.
filter
(
obj
=>
obj
.
issues
.
length
>
0
);
.
filter
(
(
obj
)
=>
obj
.
issues
.
length
>
0
);
}
return
[{
issues
:
this
.
relatedIssues
}];
...
...
app/assets/javascripts/related_issues/components/related_issues_root.vue
View file @
9aa1f620
...
...
@@ -110,7 +110,7 @@ export default {
},
methods
:
{
findRelatedIssueById
(
id
)
{
return
this
.
state
.
relatedIssues
.
find
(
issue
=>
issue
.
id
===
id
);
return
this
.
state
.
relatedIssues
.
find
(
(
issue
)
=>
issue
.
id
===
id
);
},
onRelatedIssueRemoveRequest
(
idToRemove
)
{
const
issueToRemove
=
this
.
findRelatedIssueById
(
idToRemove
);
...
...
@@ -120,7 +120,7 @@ export default {
.
then
(({
data
})
=>
{
this
.
store
.
setRelatedIssues
(
data
.
issuables
);
})
.
catch
(
res
=>
{
.
catch
(
(
res
)
=>
{
if
(
res
&&
res
.
status
!==
404
)
{
Flash
(
relatedIssuesRemoveErrorMap
[
this
.
issuableType
]);
}
...
...
@@ -219,7 +219,7 @@ export default {
this
.
processAllReferences
(
newValue
);
},
processAllReferences
(
value
=
''
)
{
const
rawReferences
=
value
.
split
(
/
\s
+/
).
filter
(
reference
=>
reference
.
trim
().
length
>
0
);
const
rawReferences
=
value
.
split
(
/
\s
+/
).
filter
(
(
reference
)
=>
reference
.
trim
().
length
>
0
);
this
.
store
.
addPendingReferences
(
rawReferences
);
this
.
inputValue
=
''
;
...
...
app/assets/javascripts/related_issues/index.js
View file @
9aa1f620
...
...
@@ -11,7 +11,7 @@ export default function initRelatedIssues() {
components
:
{
relatedIssuesRoot
:
RelatedIssuesRoot
,
},
render
:
createElement
=>
render
:
(
createElement
)
=>
createElement
(
'
related-issues-root
'
,
{
props
:
{
endpoint
:
relatedIssuesRootElement
.
dataset
.
endpoint
,
...
...
app/assets/javascripts/related_issues/stores/related_issues_store.js
View file @
9aa1f620
...
...
@@ -19,7 +19,7 @@ class RelatedIssuesStore {
}
removeRelatedIssue
(
issue
)
{
this
.
state
.
relatedIssues
=
this
.
state
.
relatedIssues
.
filter
(
x
=>
x
.
id
!==
issue
.
id
);
this
.
state
.
relatedIssues
=
this
.
state
.
relatedIssues
.
filter
(
(
x
)
=>
x
.
id
!==
issue
.
id
);
}
updateIssueOrder
(
oldIndex
,
newIndex
)
{
...
...
app/assets/javascripts/related_merge_requests/index.js
View file @
9aa1f620
...
...
@@ -15,7 +15,7 @@ export default function initRelatedMergeRequests() {
RelatedMergeRequests
,
},
store
:
createStore
(),
render
:
createElement
=>
render
:
(
createElement
)
=>
createElement
(
'
related-merge-requests
'
,
{
props
:
{
endpoint
,
projectNamespace
,
projectPath
},
}),
...
...
app/assets/javascripts/related_merge_requests/store/actions.js
View file @
9aa1f620
...
...
@@ -21,7 +21,7 @@ export const fetchMergeRequests = ({ state, dispatch }) => {
return
axios
.
get
(
`
${
state
.
apiEndpoint
}
?per_page=
${
REQUEST_PAGE_COUNT
}
`
)
.
then
(
res
=>
{
.
then
(
(
res
)
=>
{
const
{
headers
,
data
}
=
res
;
const
total
=
Number
(
normalizeHeaders
(
headers
)[
'
X-TOTAL
'
])
||
0
;
...
...
app/assets/javascripts/releases/components/release_block_assets.vue
View file @
9aa1f620
...
...
@@ -47,7 +47,7 @@ export default {
sections
()
{
return
[
{
links
:
get
(
this
.
assets
,
'
sources
'
,
[]).
map
(
s
=>
({
links
:
get
(
this
.
assets
,
'
sources
'
,
[]).
map
(
(
s
)
=>
({
url
:
s
.
url
,
name
:
sprintf
(
__
(
'
Source code (%{fileExtension})
'
),
{
fileExtension
:
s
.
format
}),
})),
...
...
@@ -73,7 +73,7 @@ export default {
links
:
this
.
otherLinks
,
iconName
:
'
link
'
,
},
].
filter
(
section
=>
section
.
links
.
length
>
0
);
].
filter
(
(
section
)
=>
section
.
links
.
length
>
0
);
},
},
methods
:
{
...
...
@@ -81,7 +81,7 @@ export default {
this
.
isAssetsExpanded
=
!
this
.
isAssetsExpanded
;
},
linksForType
(
type
)
{
return
this
.
assets
.
links
.
filter
(
l
=>
l
.
linkType
===
type
);
return
this
.
assets
.
links
.
filter
(
(
l
)
=>
l
.
linkType
===
type
);
},
},
externalLinkTooltipText
:
__
(
'
This link points to external content
'
),
...
...
app/assets/javascripts/releases/components/release_block_milestone_info.vue
View file @
9aa1f620
...
...
@@ -64,7 +64,7 @@ export default {
},
issueCounts
()
{
return
this
.
milestones
.
map
(
m
=>
m
.
issueStats
||
{})
.
map
(
(
m
)
=>
m
.
issueStats
||
{})
.
reduce
(
(
acc
,
current
)
=>
{
acc
.
total
+=
current
.
total
||
0
;
...
...
@@ -79,11 +79,11 @@ export default {
);
},
showMergeRequestStats
()
{
return
this
.
milestones
.
some
(
m
=>
m
.
mrStats
);
return
this
.
milestones
.
some
(
(
m
)
=>
m
.
mrStats
);
},
mergeRequestCounts
()
{
return
this
.
milestones
.
map
(
m
=>
m
.
mrStats
||
{})
.
map
(
(
m
)
=>
m
.
mrStats
||
{})
.
reduce
(
(
acc
,
current
)
=>
{
acc
.
total
+=
current
.
total
||
0
;
...
...
app/assets/javascripts/releases/components/releases_sort.vue
View file @
9aa1f620
...
...
@@ -11,14 +11,14 @@ export default {
},
computed
:
{
...
mapState
(
'
list
'
,
{
orderBy
:
state
=>
state
.
sorting
.
orderBy
,
sort
:
state
=>
state
.
sorting
.
sort
,
orderBy
:
(
state
)
=>
state
.
sorting
.
orderBy
,
sort
:
(
state
)
=>
state
.
sorting
.
sort
,
}),
sortOptions
()
{
return
SORT_OPTIONS
;
},
sortText
()
{
const
option
=
this
.
sortOptions
.
find
(
s
=>
s
.
orderBy
===
this
.
orderBy
);
const
option
=
this
.
sortOptions
.
find
(
(
s
)
=>
s
.
orderBy
===
this
.
orderBy
);
return
option
.
label
;
},
isSortAscending
()
{
...
...
app/assets/javascripts/releases/mount_edit.js
View file @
9aa1f620
...
...
@@ -18,6 +18,6 @@ export default () => {
return
new
Vue
({
el
,
store
,
render
:
h
=>
h
(
ReleaseEditNewApp
),
render
:
(
h
)
=>
h
(
ReleaseEditNewApp
),
});
};
app/assets/javascripts/releases/mount_index.js
View file @
9aa1f620
...
...
@@ -21,6 +21,6 @@ export default () => {
graphqlMilestoneStats
:
Boolean
(
gon
.
features
?.
graphqlMilestoneStats
),
},
}),
render
:
h
=>
h
(
ReleaseListApp
),
render
:
(
h
)
=>
h
(
ReleaseListApp
),
});
};
app/assets/javascripts/releases/mount_new.js
View file @
9aa1f620
...
...
@@ -18,6 +18,6 @@ export default () => {
return
new
Vue
({
el
,
store
,
render
:
h
=>
h
(
ReleaseEditNewApp
),
render
:
(
h
)
=>
h
(
ReleaseEditNewApp
),
});
};
app/assets/javascripts/releases/mount_show.js
View file @
9aa1f620
...
...
@@ -21,6 +21,6 @@ export default () => {
return
new
Vue
({
el
,
store
,
render
:
h
=>
h
(
ReleaseShowApp
),
render
:
(
h
)
=>
h
(
ReleaseShowApp
),
});
};
app/assets/javascripts/releases/stores/getters.js
View file @
9aa1f620
...
...
@@ -2,7 +2,7 @@
* @returns {Boolean} `true` if all the feature flags
* required to enable the GraphQL endpoint are enabled
*/
export
const
useGraphQLEndpoint
=
rootState
=>
{
export
const
useGraphQLEndpoint
=
(
rootState
)
=>
{
return
Boolean
(
rootState
.
featureFlags
.
graphqlReleaseData
&&
rootState
.
featureFlags
.
graphqlReleasesPage
&&
...
...
app/assets/javascripts/releases/stores/modules/detail/actions.js
View file @
9aa1f620
...
...
@@ -36,12 +36,12 @@ export const fetchRelease = ({ commit, state, rootState }) => {
tagName
:
state
.
tagName
,
},
})
.
then
(
response
=>
{
.
then
(
(
response
)
=>
{
const
{
data
:
release
}
=
convertOneReleaseGraphQLResponse
(
response
);
commit
(
types
.
RECEIVE_RELEASE_SUCCESS
,
release
);
})
.
catch
(
error
=>
{
.
catch
(
(
error
)
=>
{
commit
(
types
.
RECEIVE_RELEASE_ERROR
,
error
);
createFlash
(
s__
(
'
Release|Something went wrong while getting the release details
'
));
});
...
...
@@ -52,7 +52,7 @@ export const fetchRelease = ({ commit, state, rootState }) => {
.
then
(({
data
})
=>
{
commit
(
types
.
RECEIVE_RELEASE_SUCCESS
,
apiJsonToRelease
(
data
));
})
.
catch
(
error
=>
{
.
catch
(
(
error
)
=>
{
commit
(
types
.
RECEIVE_RELEASE_ERROR
,
error
);
createFlash
(
s__
(
'
Release|Something went wrong while getting the release details
'
));
});
...
...
@@ -121,7 +121,7 @@ export const createRelease = ({ commit, dispatch, state, getters }) => {
.
then
(({
data
})
=>
{
dispatch
(
'
receiveSaveReleaseSuccess
'
,
apiJsonToRelease
(
data
));
})
.
catch
(
error
=>
{
.
catch
(
(
error
)
=>
{
commit
(
types
.
RECEIVE_SAVE_RELEASE_ERROR
,
error
);
createFlash
(
s__
(
'
Release|Something went wrong while creating a new release
'
));
});
...
...
@@ -163,7 +163,7 @@ export const updateRelease = ({ commit, dispatch, state, getters }) => {
// Delete all links currently associated with this Release
return
Promise
.
all
(
getters
.
releaseLinksToDelete
.
map
(
l
=>
getters
.
releaseLinksToDelete
.
map
(
(
l
)
=>
api
.
deleteReleaseLink
(
state
.
projectId
,
state
.
release
.
tagName
,
l
.
id
),
),
);
...
...
@@ -171,7 +171,7 @@ export const updateRelease = ({ commit, dispatch, state, getters }) => {
.
then
(()
=>
{
// Create a new link for each link in the form
return
Promise
.
all
(
apiJson
.
assets
.
links
.
map
(
l
=>
apiJson
.
assets
.
links
.
map
(
(
l
)
=>
api
.
createReleaseLink
(
state
.
projectId
,
state
.
release
.
tagName
,
l
),
),
);
...
...
@@ -179,7 +179,7 @@ export const updateRelease = ({ commit, dispatch, state, getters }) => {
.
then
(()
=>
{
dispatch
(
'
receiveSaveReleaseSuccess
'
,
apiJsonToRelease
(
updatedRelease
));
})
.
catch
(
error
=>
{
.
catch
(
(
error
)
=>
{
commit
(
types
.
RECEIVE_SAVE_RELEASE_ERROR
,
error
);
createFlash
(
s__
(
'
Release|Something went wrong while saving the release details
'
));
})
...
...
app/assets/javascripts/releases/stores/modules/detail/getters.js
View file @
9aa1f620
...
...
@@ -5,7 +5,7 @@ import { hasContent } from '~/lib/utils/text_utility';
* @returns {Boolean} `true` if the app is editing an existing release.
* `false` if the app is creating a new release.
*/
export
const
isExistingRelease
=
state
=>
{
export
const
isExistingRelease
=
(
state
)
=>
{
return
Boolean
(
state
.
tagName
);
};
...
...
@@ -15,19 +15,19 @@ export const isExistingRelease = state => {
* empty (or whitespace-only) values for both `url` and `name`.
* Otherwise, `false`.
*/
const
isEmptyReleaseLink
=
link
=>
!
hasContent
(
link
.
url
)
&&
!
hasContent
(
link
.
name
);
const
isEmptyReleaseLink
=
(
link
)
=>
!
hasContent
(
link
.
url
)
&&
!
hasContent
(
link
.
name
);
/** Returns all release links that aren't empty */
export
const
releaseLinksToCreate
=
state
=>
{
export
const
releaseLinksToCreate
=
(
state
)
=>
{
if
(
!
state
.
release
)
{
return
[];
}
return
state
.
release
.
assets
.
links
.
filter
(
l
=>
!
isEmptyReleaseLink
(
l
));
return
state
.
release
.
assets
.
links
.
filter
(
(
l
)
=>
!
isEmptyReleaseLink
(
l
));
};
/** Returns all release links that should be deleted */
export
const
releaseLinksToDelete
=
state
=>
{
export
const
releaseLinksToDelete
=
(
state
)
=>
{
if
(
!
state
.
originalRelease
)
{
return
[];
}
...
...
@@ -36,7 +36,7 @@ export const releaseLinksToDelete = state => {
};
/** Returns all validation errors on the release object */
export
const
validationErrors
=
state
=>
{
export
const
validationErrors
=
(
state
)
=>
{
const
errors
=
{
assets
:
{
links
:
{},
...
...
@@ -56,7 +56,7 @@ export const validationErrors = state => {
// This is used for detecting duplicate URLs.
const
urlToLinksMap
=
new
Map
();
state
.
release
.
assets
.
links
.
forEach
(
link
=>
{
state
.
release
.
assets
.
links
.
forEach
(
(
link
)
=>
{
errors
.
assets
.
links
[
link
.
id
]
=
{};
// Only validate non-empty URLs
...
...
@@ -81,7 +81,7 @@ export const validationErrors = state => {
// add a validation error for each link that shares this URL
const
duplicates
=
urlToLinksMap
.
get
(
normalizedUrl
);
duplicates
.
push
(
link
);
duplicates
.
forEach
(
duplicateLink
=>
{
duplicates
.
forEach
(
(
duplicateLink
)
=>
{
errors
.
assets
.
links
[
duplicateLink
.
id
].
isDuplicate
=
true
;
});
}
else
{
...
...
app/assets/javascripts/releases/stores/modules/detail/index.js
View file @
9aa1f620
...
...
@@ -3,7 +3,7 @@ import * as getters from './getters';
import
mutations
from
'
./mutations
'
;
import
createState
from
'
./state
'
;
export
default
initialState
=>
({
export
default
(
initialState
)
=>
({
namespaced
:
true
,
actions
,
getters
,
...
...
app/assets/javascripts/releases/stores/modules/detail/mutations.js
View file @
9aa1f620
...
...
@@ -3,7 +3,7 @@ import * as types from './mutation_types';
import
{
DEFAULT_ASSET_LINK_TYPE
}
from
'
../../../constants
'
;
const
findReleaseLink
=
(
release
,
id
)
=>
{
return
release
.
assets
.
links
.
find
(
l
=>
l
.
id
===
id
);
return
release
.
assets
.
links
.
find
(
(
l
)
=>
l
.
id
===
id
);
};
export
default
{
...
...
@@ -93,6 +93,6 @@ export default {
},
[
types
.
REMOVE_ASSET_LINK
](
state
,
linkIdToRemove
)
{
state
.
release
.
assets
.
links
=
state
.
release
.
assets
.
links
.
filter
(
l
=>
l
.
id
!==
linkIdToRemove
);
state
.
release
.
assets
.
links
=
state
.
release
.
assets
.
links
.
filter
(
(
l
)
=>
l
.
id
!==
linkIdToRemove
);
},
};
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