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 ...@@ -4,6 +4,7 @@ import { GlLink, GlIcon, GlLabel, GlFormCheckbox, GlTooltipDirective } from '@gi
import { getIdFromGraphQLId } from '~/graphql_shared/utils'; import { getIdFromGraphQLId } from '~/graphql_shared/utils';
import { isScopedLabel } from '~/lib/utils/common_utils'; import { isScopedLabel } from '~/lib/utils/common_utils';
import { getTimeago } from '~/lib/utils/datetime_utility'; import { getTimeago } from '~/lib/utils/datetime_utility';
import { isExternal, setUrlFragment } from '~/lib/utils/url_utility';
import { __, sprintf } from '~/locale'; import { __, sprintf } from '~/locale';
import IssuableAssignees from '~/vue_shared/components/issue/issue_assignees.vue'; import IssuableAssignees from '~/vue_shared/components/issue/issue_assignees.vue';
import timeagoMixin from '~/vue_shared/mixins/timeago'; import timeagoMixin from '~/vue_shared/mixins/timeago';
...@@ -54,13 +55,7 @@ export default { ...@@ -54,13 +55,7 @@ export default {
return getIdFromGraphQLId(`${this.author.id}`); return getIdFromGraphQLId(`${this.author.id}`);
}, },
isIssuableUrlExternal() { isIssuableUrlExternal() {
// Check if URL is relative, which means it is internal. return isExternal(this.webUrl);
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);
}, },
labels() { labels() {
return this.issuable.labels?.nodes || this.issuable.labels || []; return this.issuable.labels?.nodes || this.issuable.labels || [];
...@@ -94,6 +89,9 @@ export default { ...@@ -94,6 +89,9 @@ export default {
this.hasSlotContents('status') || this.showDiscussions || this.issuable.assignees, this.hasSlotContents('status') || this.showDiscussions || this.issuable.assignees,
); );
}, },
issuableNotesLink() {
return setUrlFragment(this.webUrl, 'notes');
},
}, },
methods: { methods: {
hasSlotContents(slotName) { hasSlotContents(slotName) {
...@@ -209,7 +207,7 @@ export default { ...@@ -209,7 +207,7 @@ export default {
<gl-link <gl-link
v-gl-tooltip:tooltipcontainer.top v-gl-tooltip:tooltipcontainer.top
:title="__('Comments')" :title="__('Comments')"
:href="`${webUrl}#notes`" :href="issuableNotesLink"
: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