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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
61dd5946
Commit
61dd5946
authored
Dec 21, 2018
by
Filipa Lacerda
Committed by
Phil Hughes
Dec 21, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "Wrong API call on releases page"
parent
84655c3f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
18 deletions
+25
-18
app/assets/javascripts/api.js
app/assets/javascripts/api.js
+1
-1
app/assets/javascripts/releases/components/release_block.vue
app/assets/javascripts/releases/components/release_block.vue
+13
-6
app/assets/javascripts/releases/index.js
app/assets/javascripts/releases/index.js
+1
-1
spec/javascripts/releases/components/release_block_spec.js
spec/javascripts/releases/components/release_block_spec.js
+10
-10
No files found.
app/assets/javascripts/api.js
View file @
61dd5946
...
@@ -29,7 +29,7 @@ const Api = {
...
@@ -29,7 +29,7 @@ const Api = {
commitPipelinesPath
:
'
/:project_id/commit/:sha/pipelines
'
,
commitPipelinesPath
:
'
/:project_id/commit/:sha/pipelines
'
,
branchSinglePath
:
'
/api/:version/projects/:id/repository/branches/:branch
'
,
branchSinglePath
:
'
/api/:version/projects/:id/repository/branches/:branch
'
,
createBranchPath
:
'
/api/:version/projects/:id/repository/branches
'
,
createBranchPath
:
'
/api/:version/projects/:id/repository/branches
'
,
releasesPath
:
'
/api/:version/project/:id/releases
'
,
releasesPath
:
'
/api/:version/project
s
/:id/releases
'
,
group
(
groupId
,
callback
)
{
group
(
groupId
,
callback
)
{
const
url
=
Api
.
buildUrl
(
Api
.
groupPath
).
replace
(
'
:id
'
,
groupId
);
const
url
=
Api
.
buildUrl
(
Api
.
groupPath
).
replace
(
'
:id
'
,
groupId
);
...
...
app/assets/javascripts/releases/components/release_block.vue
View file @
61dd5946
<
script
>
<
script
>
import
_
from
'
underscore
'
;
import
{
GlTooltipDirective
,
GlLink
}
from
'
@gitlab/ui
'
;
import
{
GlTooltipDirective
,
GlLink
}
from
'
@gitlab/ui
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
UserAvatarLink
from
'
~/vue_shared/components/user_avatar/user_avatar_link.vue
'
;
import
UserAvatarLink
from
'
~/vue_shared/components/user_avatar/user_avatar_link.vue
'
;
...
@@ -30,8 +31,8 @@ export default {
...
@@ -30,8 +31,8 @@ export default {
});
});
},
},
userImageAltDescription
()
{
userImageAltDescription
()
{
return
this
.
commit
.
author
&&
this
.
commit
.
author
.
username
return
this
.
author
&&
this
.
author
.
username
?
sprintf
(
"
%{username}'s avatar
"
,
{
username
:
this
.
commit
.
author
.
username
})
?
sprintf
(
"
%{username}'s avatar
"
,
{
username
:
this
.
author
.
username
})
:
null
;
:
null
;
},
},
commit
()
{
commit
()
{
...
@@ -40,6 +41,12 @@ export default {
...
@@ -40,6 +41,12 @@ export default {
assets
()
{
assets
()
{
return
this
.
release
.
assets
||
{};
return
this
.
release
.
assets
||
{};
},
},
author
()
{
return
this
.
release
.
author
||
{};
},
hasAuthor
()
{
return
_
.
isEmpty
(
this
.
author
);
},
},
},
};
};
</
script
>
</
script
>
...
@@ -66,14 +73,14 @@ export default {
...
@@ -66,14 +73,14 @@ export default {
}}
</span>
}}
</span>
</div>
</div>
<div
v-if=
"
commit.a
uthor"
class=
"d-flex"
>
<div
v-if=
"
hasA
uthor"
class=
"d-flex"
>
by
by
<user-avatar-link
<user-avatar-link
class=
"prepend-left-4"
class=
"prepend-left-4"
:link-href=
"
commit.
author.path"
:link-href=
"author.path"
:img-src=
"
commit.
author.avatar_url"
:img-src=
"author.avatar_url"
:img-alt=
"userImageAltDescription"
:img-alt=
"userImageAltDescription"
:tooltip-text=
"
commit.
author.username"
:tooltip-text=
"author.username"
/>
/>
</div>
</div>
</div>
</div>
...
...
app/assets/javascripts/releases/index.js
View file @
61dd5946
...
@@ -14,7 +14,7 @@ export default () => {
...
@@ -14,7 +14,7 @@ export default () => {
render
(
createElement
)
{
render
(
createElement
)
{
return
createElement
(
'
app
'
,
{
return
createElement
(
'
app
'
,
{
props
:
{
props
:
{
endpoint
:
element
.
dataset
.
endpoint
,
projectId
:
element
.
dataset
.
projectId
,
documentationLink
:
element
.
dataset
.
documentationPath
,
documentationLink
:
element
.
dataset
.
documentationPath
,
illustrationPath
:
element
.
dataset
.
illustrationPath
,
illustrationPath
:
element
.
dataset
.
illustrationPath
,
},
},
...
...
spec/javascripts/releases/components/release_block_spec.js
View file @
61dd5946
...
@@ -15,6 +15,16 @@ describe('Release block', () => {
...
@@ -15,6 +15,16 @@ describe('Release block', () => {
author_name
:
'
Release bot
'
,
author_name
:
'
Release bot
'
,
author_email
:
'
release-bot@example.com
'
,
author_email
:
'
release-bot@example.com
'
,
created_at
:
'
2012-05-28T05:00:00-07:00
'
,
created_at
:
'
2012-05-28T05:00:00-07:00
'
,
author
:
{
avatar_url
:
'
uploads/-/system/user/avatar/johndoe/avatar.png
'
,
id
:
482476
,
name
:
'
John Doe
'
,
path
:
'
/johndoe
'
,
state
:
'
active
'
,
status_tooltip_html
:
null
,
username
:
'
johndoe
'
,
web_url
:
'
https://gitlab.com/johndoe
'
,
},
commit
:
{
commit
:
{
id
:
'
2695effb5807a22ff3d138d593fd856244e155e7
'
,
id
:
'
2695effb5807a22ff3d138d593fd856244e155e7
'
,
short_id
:
'
2695effb
'
,
short_id
:
'
2695effb
'
,
...
@@ -28,16 +38,6 @@ describe('Release block', () => {
...
@@ -28,16 +38,6 @@ describe('Release block', () => {
committer_name
:
'
Jack Smith
'
,
committer_name
:
'
Jack Smith
'
,
committer_email
:
'
jack@example.com
'
,
committer_email
:
'
jack@example.com
'
,
committed_date
:
'
2012-05-28T04:42:42-07:00
'
,
committed_date
:
'
2012-05-28T04:42:42-07:00
'
,
author
:
{
avatar_url
:
'
uploads/-/system/user/avatar/johndoe/avatar.png
'
,
id
:
482476
,
name
:
'
John Doe
'
,
path
:
'
/johndoe
'
,
state
:
'
active
'
,
status_tooltip_html
:
null
,
username
:
'
johndoe
'
,
web_url
:
'
https://gitlab.com/johndoe
'
,
},
},
},
assets
:
{
assets
:
{
count
:
6
,
count
:
6
,
...
...
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