Commit c9608bda authored by Martin Wortschack's avatar Martin Wortschack

Merge branch 'kp-issue-board-due-date-text' into 'master'

Closed Issue with past due dates should show it in gray text

See merge request gitlab-org/gitlab!25507
parents 00ae2c88 273bd345
......@@ -177,9 +177,9 @@ export default {
class="confidential-icon append-right-4"
:aria-label="__('Confidential')"
/>
<a :href="issue.path" :title="issue.title" class="js-no-trigger" @mousemove.stop>
{{ issue.title }}
</a>
<a :href="issue.path" :title="issue.title" class="js-no-trigger" @mousemove.stop>{{
issue.title
}}</a>
</h4>
</div>
<div v-if="showLabelFooter" class="board-card-labels prepend-top-4 d-flex flex-wrap">
......@@ -225,7 +225,7 @@ export default {
#{{ issue.iid }}
</span>
<span class="board-info-items prepend-top-8 d-inline-block">
<issue-due-date v-if="issue.dueDate" :date="issue.dueDate" />
<issue-due-date v-if="issue.dueDate" :date="issue.dueDate" :closed="issue.closed" />
<issue-time-estimate v-if="issue.timeEstimate" :estimate="issue.timeEstimate" />
<issue-card-weight
v-if="validIssueWeight"
......
......@@ -16,6 +16,11 @@ export default {
GlTooltip,
},
props: {
closed: {
type: Boolean,
required: false,
default: false,
},
date: {
type: String,
required: true,
......@@ -66,7 +71,7 @@ export default {
return getDayDifference(today, this.issueDueDate);
},
isPastDue() {
if (this.timeDifference >= 0) return false;
if (this.timeDifference >= 0 || this.closed) return false;
return true;
},
standardDateFormat() {
......@@ -92,7 +97,8 @@ export default {
}}</time>
</span>
<gl-tooltip :target="() => $refs.issueDueDate" :placement="tooltipPlacement">
<span class="bold">{{ __('Due date') }}</span> <br />
<span class="bold">{{ __('Due date') }}</span>
<br />
<span :class="{ 'text-danger-muted': isPastDue }">{{ title }}</span>
</gl-tooltip>
</span>
......
......@@ -19,6 +19,7 @@ class ListIssue {
this.isFetching = {
subscriptions: true,
};
this.closed = obj.closed;
this.isLoading = {};
this.refreshData(obj, defaultAvatar);
......
......@@ -12,6 +12,9 @@ class IssueBoardEntity < Grape::Entity
expose :project_id
expose :relative_position
expose :time_estimate
expose :closed do |issue|
issue.closed?
end
expose :project do |issue|
API::Entities::Project.represent issue.project, only: [:id, :path]
......
---
title: Board issue due dates appear grey for closed past-due issues
merge_request: 25507
author: rachelfox
type: fixed
......@@ -5,6 +5,7 @@
"iid": { "type": "integer" },
"title": { "type": "string" },
"confidential": { "type": "boolean" },
"closed": { "type": "boolean" },
"due_date": { "type": "date" },
"project_id": { "type": "integer" },
"relative_position": { "type": ["integer", "null"] },
......
......@@ -7,8 +7,8 @@ describe('Issue Due Date component', () => {
let vm;
let date;
const Component = Vue.extend(IssueDueDate);
const createComponent = (dueDate = new Date()) =>
mountComponent(Component, { date: dateFormat(dueDate, 'yyyy-mm-dd', true) });
const createComponent = (dueDate = new Date(), closed = false) =>
mountComponent(Component, { closed, date: dateFormat(dueDate, 'yyyy-mm-dd', true) });
beforeEach(() => {
date = new Date();
......@@ -56,10 +56,17 @@ describe('Issue Due Date component', () => {
expect(vm.$el.querySelector('time').textContent.trim()).toEqual(dateFormat(date, format));
});
it('should contain the correct `.text-danger` css class for overdue issue', () => {
it('should contain the correct `.text-danger` css class for overdue issue that is open', () => {
date.setDate(date.getDate() - 17);
vm = createComponent(date);
expect(vm.$el.querySelector('time').classList.contains('text-danger')).toEqual(true);
});
it('should not contain the `.text-danger` css class for overdue issue that is closed', () => {
date.setDate(date.getDate() - 17);
vm = createComponent(date, true);
expect(vm.$el.querySelector('time').classList.contains('text-danger')).toEqual(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