Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: search jobs modal showing 'no jobs found' without searching any job (#85zrmar8z) #364

Merged
merged 7 commits into from
Feb 8, 2023
1 change: 1 addition & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@
"Schedule product sync": "Schedule product sync",
"Select run time": "Select run time",
"Search jobs": "Search jobs",
"Searched jobs will appear here": "Searched jobs will appear here",
"Select jobs": "Select jobs",
"select jobs": "select jobs",
"Services have been scheduled in bulk": "Services have been scheduled in bulk",
Expand Down
12 changes: 8 additions & 4 deletions src/views/SelectJobsModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@
</ion-toolbar>
</ion-header>
<ion-content>
<ion-searchbar v-model="queryString" :placeholder="$t('Search jobs')" @keyup.enter="search($event)" />
<ion-searchbar :placeholder="$t('Search jobs')" @keyup.enter="search($event)" />

<div v-if="jobs.length === 0" class="ion-text-center">
<div v-if="queryString.length === 0" class="ion-text-center">
<p>{{ $t("Searched jobs will appear here") }}</p>
</div>

<div v-else-if="jobs.length === 0" class="ion-text-center">
<p>{{ $t("No jobs found") }}</p>
</div>

Expand Down Expand Up @@ -80,7 +84,7 @@ export default defineComponent({
queryString: '',
jobs: [] as any,
isScrollable: true,
jobFrequencyType: JSON.parse(process.env?.VUE_APP_JOB_FREQUENCY_TYPE as string) as any,
jobFrequencyType: JSON.parse(process.env?.VUE_APP_JOB_FREQUENCY_TYPE as string) as any
}
},
computed: {
Expand All @@ -92,7 +96,7 @@ export default defineComponent({
methods: {
async search(event: any) {
this.queryString = event.target.value.trim();
if(this.queryString.length > 0) this.getJobs();
if(this.queryString) this.getJobs();
},
async getJobs(vSize?: any, vIndex?: any) {
const viewSize = vSize ? vSize : process.env.VUE_APP_VIEW_SIZE;
Expand Down