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