Commit f1193986 authored by Mike Greiling's avatar Mike Greiling

Merge branch '214026-fix-roadmap-date-display' into 'master'

Fix displaying roadmap for epics without dates

See merge request gitlab-org/gitlab!37093
parents 14b0dee0 a7443e42
......@@ -75,7 +75,9 @@ export default {
};
},
timeframeString(roadmapItem) {
if (roadmapItem.startDateUndefined) {
if (roadmapItem.startDateUndefined && roadmapItem.endDateUndefined) {
return sprintf(s__('GroupRoadmap|No start and end date'));
} else if (roadmapItem.startDateUndefined) {
return sprintf(s__('GroupRoadmap|No start date – %{dateWord}'), {
dateWord: dateInWords(this.endDate, true),
});
......
---
title: Display correct information on Roadmap when an epic has no start and due date
merge_request: 37093
author:
type: fixed
......@@ -103,6 +103,13 @@ describe('EpicItemComponent', () => {
expect(wrapper.vm.timeframeString(mockEpic)).toBe('Jul 10, 2017 – Jun 2, 2018');
});
it('returns timeframe string correctly when no dates are defined', () => {
const epic = { ...mockEpic, endDateUndefined: true, startDateUndefined: true };
wrapper = createComponent({ epic });
expect(wrapper.vm.timeframeString(epic)).toBe('No start and end date');
});
it('returns timeframe string correctly when only start date is defined', () => {
const epic = { ...mockEpic, endDateUndefined: true };
wrapper = createComponent({ epic });
......
......@@ -11698,6 +11698,9 @@ msgstr ""
msgid "GroupRoadmap|%{startDateInWords} – %{endDateInWords}"
msgstr ""
msgid "GroupRoadmap|No start and end date"
msgstr ""
msgid "GroupRoadmap|No start date – %{dateWord}"
msgstr ""
......
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