Commit 22d2f9c5 authored by Clement Ho's avatar Clement Ho

Merge branch 'add-metadata-to-epic-list-view' into 'master'

Add note count, updated timestamp, and closed tag to epics list view

See merge request gitlab-org/gitlab-ee!14730
parents dbc3556e 5e1c64a0
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
%ul.controls %ul.controls
- if issue.closed? - if issue.closed?
%li.issuable-status %li.issuable-status
CLOSED = _('CLOSED')
- if issue.assignees.any? - if issue.assignees.any?
%li %li
= render 'shared/issuable/assignees', project: @project, issuable: issue = render 'shared/issuable/assignees', project: @project, issuable: issue
...@@ -53,4 +53,5 @@ ...@@ -53,4 +53,5 @@
= render 'shared/issuable_meta_data', issuable: issue = render 'shared/issuable_meta_data', issuable: issue
.float-right.issuable-updated-at.d-none.d-sm-inline-block .float-right.issuable-updated-at.d-none.d-sm-inline-block
%span updated #{time_ago_with_tooltip(issue.updated_at, placement: 'bottom', html_class: 'issue_update_ago')} %span
= _('updated %{time_ago}').html_safe % { time_ago: time_ago_with_tooltip(issue.updated_at, placement: 'bottom', html_class: 'issue_update_ago') }
...@@ -41,11 +41,11 @@ ...@@ -41,11 +41,11 @@
%ul.controls.d-flex.align-items-end %ul.controls.d-flex.align-items-end
- if merge_request.merged? - if merge_request.merged?
%li.issuable-status.d-none.d-sm-inline-block %li.issuable-status.d-none.d-sm-inline-block
MERGED = _('MERGED')
- elsif merge_request.closed? - elsif merge_request.closed?
%li.issuable-status.d-none.d-sm-inline-block %li.issuable-status.d-none.d-sm-inline-block
= icon('ban') = icon('ban')
CLOSED = _('CLOSED')
- if can?(current_user, :read_pipeline, merge_request.head_pipeline) - if can?(current_user, :read_pipeline, merge_request.head_pipeline)
%li.issuable-pipeline-status.d-none.d-sm-flex %li.issuable-pipeline-status.d-none.d-sm-flex
= render 'ci/status/icon', status: merge_request.head_pipeline.detailed_status(current_user), option_css_classes: 'd-flex' = render 'ci/status/icon', status: merge_request.head_pipeline.detailed_status(current_user), option_css_classes: 'd-flex'
...@@ -61,4 +61,5 @@ ...@@ -61,4 +61,5 @@
= render 'shared/issuable_meta_data', issuable: merge_request = render 'shared/issuable_meta_data', issuable: merge_request
.float-right.issuable-updated-at.d-none.d-sm-inline-block .float-right.issuable-updated-at.d-none.d-sm-inline-block
%span updated #{time_ago_with_tooltip(merge_request.updated_at, placement: 'bottom', html_class: 'merge_request_updated_ago')} %span
= _('updated %{time_ago}').html_safe % { time_ago: time_ago_with_tooltip(merge_request.updated_at, placement: 'bottom', html_class: 'merge_request_updated_ago') }
...@@ -19,3 +19,15 @@ ...@@ -19,3 +19,15 @@
   
- epic.labels.each do |label| - epic.labels.each do |label|
= render_label(label.present(issuable_subject: @group), tooltip: true, link: group_epics_path(@group, label_name:[label.name]), css: 'label-link') = render_label(label.present(issuable_subject: @group), tooltip: true, link: group_epics_path(@group, label_name:[label.name]), css: 'label-link')
.issuable-meta
%ul.controls
- if epic.closed?
%li.issuable-status
= _('CLOSED')
= render 'shared/issuable_meta_data', issuable: epic
.float-right.issuable-updated-at.d-none.d-sm-inline-block
%span
= _('updated %{time_ago}').html_safe % { time_ago: time_ago_with_tooltip(epic.updated_at, placement: 'bottom', html_class: 'issue_update_ago') }
---
title: Add note count, updated timestamp, and closed tag to epics list view
merge_request:
author:
type: changed
...@@ -37,6 +37,15 @@ describe 'epics list', :js do ...@@ -37,6 +37,15 @@ describe 'epics list', :js do
expect(first('.nav-sidebar .active a .count')).to have_content('3') expect(first('.nav-sidebar .active a .count')).to have_content('3')
end end
it 'shows epic updated date and comment count' do
page.within('.issuable-list') do
page.within('li:nth-child(1) .issuable-meta') do
expect(find('.issuable-updated-at')).to have_content('updated just now')
expect(find('.issuable-comments')).to have_content('0')
end
end
end
it 'renders the filtered search bar correctly' do it 'renders the filtered search bar correctly' do
page.within('.content-wrapper .content') do page.within('.content-wrapper .content') do
expect(page).to have_css('.epics-filters') expect(page).to have_css('.epics-filters')
...@@ -50,15 +59,15 @@ describe 'epics list', :js do ...@@ -50,15 +59,15 @@ describe 'epics list', :js do
expect(find('.top-area')).to have_content('All 3') expect(find('.top-area')).to have_content('All 3')
page.within('.issuable-list') do page.within('.issuable-list') do
page.within('li:nth-child(1)') do page.within('li:nth-child(1) .issuable-main-info') do
expect(page).to have_content(epic3.title) expect(page).to have_content(epic3.title)
end end
page.within('li:nth-child(2)') do page.within('li:nth-child(2) .issuable-main-info') do
expect(page).to have_content(epic2.title) expect(page).to have_content(epic2.title)
end end
page.within('li:nth-child(3)') do page.within('li:nth-child(3) .issuable-main-info') do
expect(page).to have_content(epic1.title) expect(page).to have_content(epic1.title)
end end
end end
...@@ -84,15 +93,15 @@ describe 'epics list', :js do ...@@ -84,15 +93,15 @@ describe 'epics list', :js do
expect(find('.top-area')).to have_content('All 3') expect(find('.top-area')).to have_content('All 3')
page.within('.issuable-list') do page.within('.issuable-list') do
page.within('li:nth-child(1)') do page.within('li:nth-child(1) .issuable-main-info') do
expect(page).to have_content(epic3.title) expect(page).to have_content(epic3.title)
end end
page.within('li:nth-child(2)') do page.within('li:nth-child(2) .issuable-main-info') do
expect(page).to have_content(epic2.title) expect(page).to have_content(epic2.title)
end end
page.within('li:nth-child(3)') do page.within('li:nth-child(3) .issuable-main-info') do
expect(page).to have_content(epic1.title) expect(page).to have_content(epic1.title)
end end
end end
...@@ -150,6 +159,28 @@ describe 'epics list', :js do ...@@ -150,6 +159,28 @@ describe 'epics list', :js do
end end
end end
context 'when closed epics exist for the group' do
let!(:epic1) { create(:epic, :closed, group: group, end_date: 10.days.ago) }
before do
visit group_epics_path(group)
end
it 'shows epic status, updated date and comment count' do
page.within('.epics-state-filters') do
click_link 'Closed'
end
page.within('.issuable-list') do
page.within('li:nth-child(1) .issuable-meta') do
expect(find('.issuable-status')).to have_content('CLOSED')
expect(find('.issuable-updated-at')).to have_content('updated just now')
expect(find('.issuable-comments')).to have_content('0')
end
end
end
end
context 'when no epics exist for the group' do context 'when no epics exist for the group' do
before do before do
visit group_epics_path(group) visit group_epics_path(group)
......
...@@ -2554,6 +2554,9 @@ msgstr "" ...@@ -2554,6 +2554,9 @@ msgstr ""
msgid "CICD|instance enabled" msgid "CICD|instance enabled"
msgstr "" msgstr ""
msgid "CLOSED"
msgstr ""
msgid "CONTRIBUTING" msgid "CONTRIBUTING"
msgstr "" msgstr ""
...@@ -8841,6 +8844,9 @@ msgstr "" ...@@ -8841,6 +8844,9 @@ msgstr ""
msgid "Logs" msgid "Logs"
msgstr "" msgstr ""
msgid "MERGED"
msgstr ""
msgid "MRApprovals|Approved by" msgid "MRApprovals|Approved by"
msgstr "" msgstr ""
...@@ -18546,6 +18552,9 @@ msgstr "" ...@@ -18546,6 +18552,9 @@ msgstr ""
msgid "updated" msgid "updated"
msgstr "" msgstr ""
msgid "updated %{time_ago}"
msgstr ""
msgid "user avatar" msgid "user avatar"
msgstr "" 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