Commit 72121e71 authored by Tom Quirk's avatar Tom Quirk

Address frontend maintainer feedback

parent 4296c365
......@@ -4,6 +4,7 @@ import { GlLink, GlIcon, GlLabel, GlFormCheckbox, GlTooltipDirective } from '@gi
import { getIdFromGraphQLId } from '~/graphql_shared/utils';
import { isScopedLabel } from '~/lib/utils/common_utils';
import { getTimeago } from '~/lib/utils/datetime_utility';
import { isExternal, setUrlFragment } from '~/lib/utils/url_utility';
import { __, sprintf } from '~/locale';
import IssuableAssignees from '~/vue_shared/components/issue/issue_assignees.vue';
import timeagoMixin from '~/vue_shared/mixins/timeago';
......@@ -54,13 +55,7 @@ export default {
return getIdFromGraphQLId(`${this.author.id}`);
},
isIssuableUrlExternal() {
// Check if URL is relative, which means it is internal.
if (!/^https?:\/\//g.test(this.webUrl)) {
return false;
}
// In case URL is absolute, it may or may not be internal,
// hence use `gon.gitlab_url` which is current instance domain.
return !this.webUrl.includes(gon.gitlab_url);
return isExternal(this.webUrl);
},
labels() {
return this.issuable.labels?.nodes || this.issuable.labels || [];
......@@ -94,6 +89,9 @@ export default {
this.hasSlotContents('status') || this.showDiscussions || this.issuable.assignees,
);
},
issuableNotesLink() {
return setUrlFragment(this.webUrl, 'notes');
},
},
methods: {
hasSlotContents(slotName) {
......@@ -209,7 +207,7 @@ export default {
<gl-link
v-gl-tooltip:tooltipcontainer.top
:title="__('Comments')"
:href="`${webUrl}#notes`"
:href="issuableNotesLink"
:class="{ 'no-comments': !issuable.userDiscussionsCount }"
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