Commit cf65abd8 authored by Dennis Tang's avatar Dennis Tang

no search results state

parent 53e27b8c
...@@ -73,6 +73,9 @@ export default { ...@@ -73,6 +73,9 @@ export default {
searchPlaceholderText() { searchPlaceholderText() {
return s__('ClusterIntegration|Search machine types'); return s__('ClusterIntegration|Search machine types');
}, },
noSearchResultsText() {
return s__('ClusterIntegration|No machine types matched your search');
},
}, },
created() { created() {
eventHub.$on('zoneSelected', this.fetchMachineTypes); eventHub.$on('zoneSelected', this.fetchMachineTypes);
...@@ -135,6 +138,9 @@ export default { ...@@ -135,6 +138,9 @@ export default {
/> />
<div class="dropdown-content"> <div class="dropdown-content">
<ul> <ul>
<li v-show="!results.length">
<span class="menu-item">{{ noSearchResultsText }}</span>
</li>
<li <li
v-for="result in results" v-for="result in results"
:key="result.id" :key="result.id"
......
...@@ -57,6 +57,9 @@ export default { ...@@ -57,6 +57,9 @@ export default {
results() { results() {
return this.projects.filter(item => item.name.toLowerCase().indexOf(this.searchQuery) > -1); return this.projects.filter(item => item.name.toLowerCase().indexOf(this.searchQuery) > -1);
}, },
noSearchResultsText() {
return s__('ClusterIntegration|No projects matched your search');
},
toggleText() { toggleText() {
if (this.isLoading) { if (this.isLoading) {
return s__('ClusterIntegration|Fetching projects'); return s__('ClusterIntegration|Fetching projects');
...@@ -155,6 +158,9 @@ export default { ...@@ -155,6 +158,9 @@ export default {
/> />
<div class="dropdown-content"> <div class="dropdown-content">
<ul> <ul>
<li v-show="!results.length">
<span class="menu-item">{{ noSearchResultsText }}</span>
</li>
<li <li
v-for="result in results" v-for="result in results"
:key="result.project_number" :key="result.project_number"
......
...@@ -67,6 +67,9 @@ export default { ...@@ -67,6 +67,9 @@ export default {
searchPlaceholderText() { searchPlaceholderText() {
return s__('ClusterIntegration|Search zones'); return s__('ClusterIntegration|Search zones');
}, },
noSearchResultsText() {
return s__('ClusterIntegration|No zones matched your search');
},
}, },
created() { created() {
eventHub.$on('projectSelected', this.fetchZones); eventHub.$on('projectSelected', this.fetchZones);
...@@ -120,6 +123,9 @@ export default { ...@@ -120,6 +123,9 @@ export default {
/> />
<div class="dropdown-content"> <div class="dropdown-content">
<ul> <ul>
<li v-show="!results.length">
<span class="menu-item">{{ noSearchResultsText }}</span>
</li>
<li <li
v-for="result in results" v-for="result in results"
:key="result.id" :key="result.id"
......
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