Commit a65f9ffb authored by Tom Quirk's avatar Tom Quirk

Use gitlabWebUrl for issuable item

parent 4a1898a6
...@@ -47,17 +47,20 @@ export default { ...@@ -47,17 +47,20 @@ export default {
author() { author() {
return this.issuable.author; return this.issuable.author;
}, },
webUrl() {
return this.issuable.gitlabWebUrl || this.issuable.webUrl;
},
authorId() { authorId() {
return getIdFromGraphQLId(`${this.author.id}`); return getIdFromGraphQLId(`${this.author.id}`);
}, },
isIssuableUrlExternal() { isIssuableUrlExternal() {
// Check if URL is relative, which means it is internal. // Check if URL is relative, which means it is internal.
if (!/^https?:\/\//g.test(this.issuable.webUrl)) { if (!/^https?:\/\//g.test(this.webUrl)) {
return false; return false;
} }
// In case URL is absolute, it may or may not be internal, // In case URL is absolute, it may or may not be internal,
// hence use `gon.gitlab_url` which is current instance domain. // hence use `gon.gitlab_url` which is current instance domain.
return !this.issuable.webUrl.includes(gon.gitlab_url); return !this.webUrl.includes(gon.gitlab_url);
}, },
labels() { labels() {
return this.issuable.labels?.nodes || this.issuable.labels || []; return this.issuable.labels?.nodes || this.issuable.labels || [];
...@@ -144,7 +147,7 @@ export default { ...@@ -144,7 +147,7 @@ export default {
name="eye-slash" name="eye-slash"
:title="__('Confidential')" :title="__('Confidential')"
/> />
<gl-link :href="issuable.webUrl" v-bind="issuableTitleProps" <gl-link :href="webUrl" v-bind="issuableTitleProps"
>{{ issuable.title >{{ issuable.title
}}<gl-icon v-if="isIssuableUrlExternal" name="external-link" class="gl-ml-2" }}<gl-icon v-if="isIssuableUrlExternal" name="external-link" class="gl-ml-2"
/></gl-link> /></gl-link>
...@@ -206,7 +209,7 @@ export default { ...@@ -206,7 +209,7 @@ export default {
<gl-link <gl-link
v-gl-tooltip:tooltipcontainer.top v-gl-tooltip:tooltipcontainer.top
:title="__('Comments')" :title="__('Comments')"
:href="`${issuable.webUrl}#notes`" :href="`${webUrl}#notes`"
:class="{ 'no-comments': !issuable.userDiscussionsCount }" :class="{ 'no-comments': !issuable.userDiscussionsCount }"
class="gl-reset-color!" class="gl-reset-color!"
> >
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment