diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-01 21:07:56 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-01 21:07:56 +0000 |
commit | 0e68afab211a172b862a7acc774e1eda5da8e471 (patch) | |
tree | 1eba04a16582c9183d4f479f82dd8709ae40d72f /app/assets/javascripts/releases | |
parent | 33aa02e7a38d8dfc5e470dd5d776c8d4ce5b2dd5 (diff) | |
download | gitlab-ce-0e68afab211a172b862a7acc774e1eda5da8e471.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/releases')
-rw-r--r-- | app/assets/javascripts/releases/components/app_index.vue | 2 | ||||
-rw-r--r-- | app/assets/javascripts/releases/components/release_block.vue | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/app/assets/javascripts/releases/components/app_index.vue b/app/assets/javascripts/releases/components/app_index.vue index 511b3cda9c8..215a376fc76 100644 --- a/app/assets/javascripts/releases/components/app_index.vue +++ b/app/assets/javascripts/releases/components/app_index.vue @@ -103,7 +103,7 @@ export default { <div v-else-if="shouldRenderSuccessState" class="js-success-state"> <release-block v-for="(release, index) in releases" - :key="release.tagName" + :key="index" :release="release" :class="{ 'linked-card': releases.length > 1 && index !== releases.length - 1 }" /> diff --git a/app/assets/javascripts/releases/components/release_block.vue b/app/assets/javascripts/releases/components/release_block.vue index 515aa629476..58045b57d80 100644 --- a/app/assets/javascripts/releases/components/release_block.vue +++ b/app/assets/javascripts/releases/components/release_block.vue @@ -37,7 +37,11 @@ export default { }; }, computed: { - id() { + htmlId() { + if (!this.release.tagName) { + return null; + } + return slugify(this.release.tagName); }, assets() { @@ -72,7 +76,7 @@ export default { this.renderGFM(); const hash = getLocationHash(); - if (hash && slugify(hash) === this.id) { + if (hash && slugify(hash) === this.htmlId) { this.isHighlighted = true; setTimeout(() => { this.isHighlighted = false; @@ -89,7 +93,7 @@ export default { }; </script> <template> - <div :id="id" :class="{ 'bg-line-target-blue': isHighlighted }" class="card release-block"> + <div :id="htmlId" :class="{ 'bg-line-target-blue': isHighlighted }" class="card release-block"> <release-block-header :release="release" /> <div class="card-body"> <div v-if="shouldRenderMilestoneInfo"> |