Skip to content
Snippets Groups Projects
Commit 61dd5946 authored by Filipa Lacerda's avatar Filipa Lacerda Committed by Phil Hughes
Browse files

Resolve "Wrong API call on releases page"

parent 84655c3f
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -29,7 +29,7 @@ const Api = {
commitPipelinesPath: '/:project_id/commit/:sha/pipelines',
branchSinglePath: '/api/:version/projects/:id/repository/branches/:branch',
createBranchPath: '/api/:version/projects/:id/repository/branches',
releasesPath: '/api/:version/project/:id/releases',
releasesPath: '/api/:version/projects/:id/releases',
 
group(groupId, callback) {
const url = Api.buildUrl(Api.groupPath).replace(':id', groupId);
Loading
Loading
<script>
import _ from 'underscore';
import { GlTooltipDirective, GlLink } from '@gitlab/ui';
import Icon from '~/vue_shared/components/icon.vue';
import UserAvatarLink from '~/vue_shared/components/user_avatar/user_avatar_link.vue';
Loading
Loading
@@ -30,8 +31,8 @@ export default {
});
},
userImageAltDescription() {
return this.commit.author && this.commit.author.username
? sprintf("%{username}'s avatar", { username: this.commit.author.username })
return this.author && this.author.username
? sprintf("%{username}'s avatar", { username: this.author.username })
: null;
},
commit() {
Loading
Loading
@@ -40,6 +41,12 @@ export default {
assets() {
return this.release.assets || {};
},
author() {
return this.release.author || {};
},
hasAuthor() {
return _.isEmpty(this.author);
},
},
};
</script>
Loading
Loading
@@ -66,14 +73,14 @@ export default {
}}</span>
</div>
 
<div v-if="commit.author" class="d-flex">
<div v-if="hasAuthor" class="d-flex">
by
<user-avatar-link
class="prepend-left-4"
:link-href="commit.author.path"
:img-src="commit.author.avatar_url"
:link-href="author.path"
:img-src="author.avatar_url"
:img-alt="userImageAltDescription"
:tooltip-text="commit.author.username"
:tooltip-text="author.username"
/>
</div>
</div>
Loading
Loading
Loading
Loading
@@ -14,7 +14,7 @@ export default () => {
render(createElement) {
return createElement('app', {
props: {
endpoint: element.dataset.endpoint,
projectId: element.dataset.projectId,
documentationLink: element.dataset.documentationPath,
illustrationPath: element.dataset.illustrationPath,
},
Loading
Loading
Loading
Loading
@@ -15,6 +15,16 @@ describe('Release block', () => {
author_name: 'Release bot',
author_email: 'release-bot@example.com',
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: {
id: '2695effb5807a22ff3d138d593fd856244e155e7',
short_id: '2695effb',
Loading
Loading
@@ -28,16 +38,6 @@ describe('Release block', () => {
committer_name: 'Jack Smith',
committer_email: 'jack@example.com',
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: {
count: 6,
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment