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