Commit 619f7ec8 authored by Phil Hughes's avatar Phil Hughes

Show empty state if filter returns empty results

parent c3339b33
...@@ -138,6 +138,7 @@ ...@@ -138,6 +138,7 @@
:label-path="labelPath"> :label-path="labelPath">
</modal-header> </modal-header>
<modal-list <modal-list
:image="blankStateImage"
:issue-link-base="issueLinkBase" :issue-link-base="issueLinkBase"
:root-path="rootPath" :root-path="rootPath"
v-if="!loading && showList"></modal-list> v-if="!loading && showList"></modal-list>
......
...@@ -14,6 +14,10 @@ ...@@ -14,6 +14,10 @@
type: String, type: String,
required: true, required: true,
}, },
image: {
type: String,
required: true,
},
}, },
data() { data() {
return ModalStore.store; return ModalStore.store;
...@@ -110,6 +114,19 @@ ...@@ -110,6 +114,19 @@
<section <section
class="add-issues-list add-issues-list-columns" class="add-issues-list add-issues-list-columns"
ref="list"> ref="list">
<div
class="empty-state add-issues-empty-state-filter text-center"
v-if="issuesCount > 0 && issues.length === 0">
<div
class="svg-content"
v-html="image">
</div>
<div class="text-content">
<h4>
There are no issues to show.
</h4>
</div>
</div>
<div <div
v-for="group in groupedIssues" v-for="group in groupedIssues"
class="add-issues-list-column"> class="add-issues-list-column">
......
...@@ -389,6 +389,12 @@ ...@@ -389,6 +389,12 @@
flex: 1; flex: 1;
margin-top: 0; margin-top: 0;
&.add-issues-empty-state-filter {
-webkit-flex-direction: column;
flex-direction: column;
margin-top: 50px;
}
> .row { > .row {
width: 100%; width: 100%;
margin: auto 0; margin: auto 0;
......
...@@ -16,6 +16,18 @@ describe 'Issue Boards add issue modal filtering', :feature, :js do ...@@ -16,6 +16,18 @@ describe 'Issue Boards add issue modal filtering', :feature, :js do
login_as(user) login_as(user)
end end
it 'shows empty state when no results found' do
visit_board
page.within('.add-issues-modal') do
find('.form-control').native.send_keys('testing empty state')
wait_for_vue_resource
expect(page).to have_content('There are no issues to show.')
end
end
it 'restores filters when closing' do it 'restores filters when closing' do
visit_board visit_board
......
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