-
Notifications
You must be signed in to change notification settings - Fork 32
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
Changes from 6 commits
25eb210
9ecd8b0
2f12a23
a20e7a7
6f229db
f532fce
d3bcdcb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 && queryString.length != 0" class="ion-text-center"> | ||
<p>{{ $t("No jobs found") }}</p> | ||
</div> | ||
|
||
|
@@ -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: { | ||
|
@@ -92,7 +96,9 @@ export default defineComponent({ | |
methods: { | ||
async search(event: any) { | ||
this.queryString = event.target.value.trim(); | ||
if(this.queryString.length > 0) this.getJobs(); | ||
if(this.queryString.length > 0) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need the length check at all? "That is, all values are truthy except false, 0, -0, 0n, "", null, undefined, and NaN." There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, sir. The empty queryString itself is a false value. |
||
this.getJobs(); | ||
} | ||
}, | ||
async getJobs(vSize?: any, vIndex?: any) { | ||
const viewSize = vSize ? vSize : process.env.VUE_APP_VIEW_SIZE; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the condition
queryString.length != 0"
might not be needed, else-if will execute only whenqueryString.length === 0
fails.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improved.