Commit d79d22bb authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Merge branch '337880-hide-path-on-project-board-cards' into 'master'

Hide reference path on project board cards

See merge request gitlab-org/gitlab!67713
parents eb591fb9 74546358
......@@ -65,7 +65,7 @@ export default {
},
computed: {
...mapState(['isShowingLabels', 'issuableType', 'allowSubEpics']),
...mapGetters(['isEpicBoard']),
...mapGetters(['isEpicBoard', 'isProjectBoard']),
cappedAssignees() {
// e.g. maxRender is 4,
// Render up to all 4 assignees if there are only 4 assigness
......@@ -144,6 +144,9 @@ export default {
totalProgress() {
return Math.round((this.item.descendantWeightSum.closedIssues / this.totalWeight) * 100);
},
showReferencePath() {
return !this.isProjectBoard && this.itemReferencePath;
},
},
methods: {
...mapActions(['performSearch', 'setError']),
......@@ -247,7 +250,7 @@ export default {
:class="{ 'gl-font-base': isEpicBoard }"
>
<tooltip-on-truncate
v-if="itemReferencePath"
v-if="showReferencePath"
:title="itemReferencePath"
placement="bottom"
class="board-item-path gl-text-truncate gl-font-weight-bold"
......
......@@ -9,7 +9,7 @@ import { issuableTypes } from '~/boards/constants';
import eventHub from '~/boards/eventhub';
import defaultStore from '~/boards/stores';
import { updateHistory } from '~/lib/utils/url_utility';
import { mockLabelList, mockIssue } from './mock_data';
import { mockLabelList, mockIssue, mockIssueFullPath } from './mock_data';
jest.mock('~/lib/utils/url_utility');
jest.mock('~/boards/eventhub');
......@@ -45,7 +45,7 @@ describe('Board card component', () => {
const findEpicCountablesTotalWeight = () => wrapper.findByTestId('epic-countables-total-weight');
const findEpicProgressTooltip = () => wrapper.findByTestId('epic-progress-tooltip-content');
const createStore = ({ isEpicBoard = false } = {}) => {
const createStore = ({ isEpicBoard = false, isProjectBoard = false } = {}) => {
store = new Vuex.Store({
...defaultStore,
state: {
......@@ -55,7 +55,7 @@ describe('Board card component', () => {
getters: {
isGroupBoard: () => true,
isEpicBoard: () => isEpicBoard,
isProjectBoard: () => false,
isProjectBoard: () => isProjectBoard,
},
});
};
......@@ -134,6 +134,17 @@ describe('Board card component', () => {
expect(wrapper.findComponent(GlLoadingIcon).exists()).toBe(false);
});
it('does not render item reference path', () => {
createStore({ isProjectBoard: true });
createWrapper();
expect(wrapper.find('.board-card-number').text()).not.toContain(mockIssueFullPath);
});
it('renders item reference path', () => {
expect(wrapper.find('.board-card-number').text()).toContain(mockIssueFullPath);
});
describe('blocked', () => {
it('renders blocked icon if issue is blocked', async () => {
createWrapper({
......
......@@ -31,6 +31,7 @@ describe('Board card', () => {
actions: mockActions,
getters: {
isEpicBoard: () => false,
isProjectBoard: () => false,
},
});
};
......
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