Commit 02aff488 authored by Phil Hughes's avatar Phil Hughes

Merge branch 'kp-show-epic-group-path' into 'master'

Show group path in epic reference within Vue Epics list

See merge request gitlab-org/gitlab!60263
parents ad76d603 c1b4317f
...@@ -141,6 +141,13 @@ export default { ...@@ -141,6 +141,13 @@ export default {
}, },
}, },
methods: { methods: {
epicReference(epic) {
const reference = `${this.$options.epicSymbol}${epic.iid}`;
if (epic.group.fullPath !== this.groupFullPath) {
return `${epic.group.fullPath}${reference}`;
}
return reference;
},
epicTimeframe({ startDate, dueDate }) { epicTimeframe({ startDate, dueDate }) {
const start = startDate ? parsePikadayDate(startDate) : null; const start = startDate ? parsePikadayDate(startDate) : null;
const due = dueDate ? parsePikadayDate(dueDate) : null; const due = dueDate ? parsePikadayDate(dueDate) : null;
...@@ -225,6 +232,9 @@ export default { ...@@ -225,6 +232,9 @@ export default {
__('New epic') __('New epic')
}}</gl-button> }}</gl-button>
</template> </template>
<template #reference="{ issuable }">
<span class="issuable-reference">{{ epicReference(issuable) }}</span>
</template>
<template #timeframe="{ issuable }"> <template #timeframe="{ issuable }">
<gl-icon name="calendar" /> <gl-icon name="calendar" />
{{ epicTimeframe(issuable) }} {{ epicTimeframe(issuable) }}
......
...@@ -43,6 +43,9 @@ query groupEpics( ...@@ -43,6 +43,9 @@ query groupEpics(
webUrl webUrl
userDiscussionsCount userDiscussionsCount
confidential confidential
group {
fullPath
}
author { author {
...Author ...Author
} }
......
...@@ -102,6 +102,32 @@ describe('EpicsListRoot', () => { ...@@ -102,6 +102,32 @@ describe('EpicsListRoot', () => {
}); });
describe('methods', () => { describe('methods', () => {
describe('epicReference', () => {
const mockEpicWithPath = {
...mockFormattedEpic,
group: {
fullPath: 'gitlab-org/marketing',
},
};
const mockEpicWithoutPath = {
...mockFormattedEpic,
group: {
fullPath: 'gitlab-org',
},
};
it.each`
epic | reference
${mockEpicWithPath} | ${'gitlab-org/marketing&2'}
${mockEpicWithoutPath} | ${'&2'}
`(
'returns string "$reference" based on provided `epic.group.fullPath`',
({ epic, reference }) => {
expect(wrapper.vm.epicReference(epic)).toBe(reference);
},
);
});
describe('epicTimeframe', () => { describe('epicTimeframe', () => {
it.each` it.each`
startDate | dueDate | returnValue startDate | dueDate | returnValue
......
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