diff options
author | Phil Hughes <me@iamphill.com> | 2018-12-21 11:53:03 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-12-21 11:53:03 +0000 |
commit | 7f334fdfafd5ea8a1c4277dcf4b1cb56e79c529b (patch) | |
tree | 99af3de1b52bce650efe65d22413f43faa17aa54 /app | |
parent | 84655c3fd9f81b7c53b541ff920d385712125016 (diff) | |
parent | 61dd59464fca96092c8bb1b7dd9878e3c6b22a1b (diff) | |
download | gitlab-ce-7f334fdfafd5ea8a1c4277dcf4b1cb56e79c529b.tar.gz |
Merge branch '55639-releases' into 'master'
Resolve "Wrong API call on releases page"
Closes #55639
See merge request gitlab-org/gitlab-ce!23978
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/api.js | 2 | ||||
-rw-r--r-- | app/assets/javascripts/releases/components/release_block.vue | 19 | ||||
-rw-r--r-- | app/assets/javascripts/releases/index.js | 2 |
3 files changed, 15 insertions, 8 deletions
diff --git a/app/assets/javascripts/api.js b/app/assets/javascripts/api.js index a1310d18c26..d1396b6c4bc 100644 --- a/app/assets/javascripts/api.js +++ b/app/assets/javascripts/api.js @@ -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); diff --git a/app/assets/javascripts/releases/components/release_block.vue b/app/assets/javascripts/releases/components/release_block.vue index 9c2aade51fc..34b97826cdb 100644 --- a/app/assets/javascripts/releases/components/release_block.vue +++ b/app/assets/javascripts/releases/components/release_block.vue @@ -1,4 +1,5 @@ <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'; @@ -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() { @@ -40,6 +41,12 @@ export default { assets() { return this.release.assets || {}; }, + author() { + return this.release.author || {}; + }, + hasAuthor() { + return _.isEmpty(this.author); + }, }, }; </script> @@ -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> diff --git a/app/assets/javascripts/releases/index.js b/app/assets/javascripts/releases/index.js index 6fa7298ac5a..adbed3cb8e2 100644 --- a/app/assets/javascripts/releases/index.js +++ b/app/assets/javascripts/releases/index.js @@ -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, }, |