Commit f5389328 authored by Clement Ho's avatar Clement Ho

Merge branch 'fix_assignee_url_issue_board_sidebar' into 'master'

Fix assignee url issue in board sidebar

Closes #35842

See merge request gitlab-org/gitlab!20992
parents 6373ddb6 674de354
...@@ -166,6 +166,7 @@ export default () => { ...@@ -166,6 +166,7 @@ export default () => {
humanTotalTimeSpent, humanTotalTimeSpent,
weight, weight,
epic, epic,
assignees,
} = convertObjectPropsToCamelCase(data); } = convertObjectPropsToCamelCase(data);
newIssue.setFetchingState('subscriptions', false); newIssue.setFetchingState('subscriptions', false);
...@@ -179,6 +180,7 @@ export default () => { ...@@ -179,6 +180,7 @@ export default () => {
subscribed, subscribed,
weight, weight,
epic, epic,
assignees,
}); });
}) })
.catch(() => { .catch(() => {
......
<script> <script>
import { GlTooltipDirective, GlLink } from '@gitlab/ui'; import { GlTooltipDirective, GlLink } from '@gitlab/ui';
import { __, sprintf } from '~/locale'; import { __, sprintf } from '~/locale';
import { joinPaths } from '~/lib/utils/url_utility';
import AssigneeAvatar from './assignee_avatar.vue'; import AssigneeAvatar from './assignee_avatar.vue';
export default { export default {
...@@ -60,7 +59,7 @@ export default { ...@@ -60,7 +59,7 @@ export default {
}; };
}, },
assigneeUrl() { assigneeUrl() {
return joinPaths(`${this.rootPath}`, `${this.user.username}`); return this.user.web_url;
}, },
}, },
}; };
......
---
title: Fix assignee url in issue board sidebar
merge_request: 20992
author: Lee Tickett
type: fixed
import { shallowMount } from '@vue/test-utils'; import { shallowMount } from '@vue/test-utils';
import { TEST_HOST } from 'helpers/test_constants'; import { TEST_HOST } from 'helpers/test_constants';
import { joinPaths } from '~/lib/utils/url_utility';
import AssigneeAvatarLink from '~/sidebar/components/assignees/assignee_avatar_link.vue'; import AssigneeAvatarLink from '~/sidebar/components/assignees/assignee_avatar_link.vue';
import AssigneeAvatar from '~/sidebar/components/assignees/assignee_avatar.vue'; import AssigneeAvatar from '~/sidebar/components/assignees/assignee_avatar.vue';
import userDataMock from '../../user_data_mock'; import userDataMock from '../../user_data_mock';
const TOOLTIP_PLACEMENT = 'bottom'; const TOOLTIP_PLACEMENT = 'bottom';
const { name: USER_NAME, username: USER_USERNAME } = userDataMock(); const { name: USER_NAME } = userDataMock();
const TEST_ISSUABLE_TYPE = 'merge_request'; const TEST_ISSUABLE_TYPE = 'merge_request';
describe('AssigneeAvatarLink component', () => { describe('AssigneeAvatarLink component', () => {
...@@ -38,9 +37,8 @@ describe('AssigneeAvatarLink component', () => { ...@@ -38,9 +37,8 @@ describe('AssigneeAvatarLink component', () => {
it('has the root url present in the assigneeUrl method', () => { it('has the root url present in the assigneeUrl method', () => {
createComponent(); createComponent();
const assigneeUrl = joinPaths(TEST_HOST, USER_USERNAME);
expect(wrapper.attributes().href).toEqual(assigneeUrl); expect(wrapper.attributes().href).toEqual(userDataMock().web_url);
}); });
it('renders assignee avatar', () => { it('renders assignee avatar', () => {
......
import { TEST_HOST } from 'helpers/test_constants';
export default () => ({ export default () => ({
avatar_url: 'mock_path', avatar_url: `${TEST_HOST}/avatar/root.png`,
id: 1, id: 1,
name: 'Root', name: 'Root',
state: 'active', state: 'active',
username: 'root', username: 'root',
web_url: '', web_url: `${TEST_HOST}/root`,
can_merge: true, can_merge: true,
}); });
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