From 25eb210e6256a8307d351460edd34de43af60d83 Mon Sep 17 00:00:00 2001 From: k2maan Date: Mon, 6 Feb 2023 16:39:05 +0530 Subject: [PATCH 1/5] Fixed: search jobs modal showing 'no jobs found' without searching any job (#85zrmar8z) --- src/locales/en.json | 1 + src/views/SelectJobsModal.vue | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/locales/en.json b/src/locales/en.json index 59f051a1..17c3cf88 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -172,6 +172,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", diff --git a/src/views/SelectJobsModal.vue b/src/views/SelectJobsModal.vue index 1a27734b..6a9d7abe 100644 --- a/src/views/SelectJobsModal.vue +++ b/src/views/SelectJobsModal.vue @@ -12,7 +12,11 @@ -
+
+

{{ $t("Searched jobs will appear here") }}

+
+ +

{{ $t("No jobs found") }}

@@ -81,6 +85,7 @@ export default defineComponent({ jobs: [] as any, isScrollable: true, jobFrequencyType: JSON.parse(process.env?.VUE_APP_JOB_FREQUENCY_TYPE as string) as any, + isJobSearched: false } }, computed: { @@ -91,6 +96,7 @@ export default defineComponent({ }, methods: { async search(event: any) { + this.isJobSearched = true; this.queryString = event.target.value.trim(); if(this.queryString.length > 0) this.getJobs(); }, From 9ecd8b0ce75d6e0eb2bd7dbef75eb20f728a7557 Mon Sep 17 00:00:00 2001 From: k2maan Date: Mon, 6 Feb 2023 16:48:15 +0530 Subject: [PATCH 2/5] Improved: code to not change the label on empty space search (#85zrmar8z) --- src/views/SelectJobsModal.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/views/SelectJobsModal.vue b/src/views/SelectJobsModal.vue index 6a9d7abe..0e23ca17 100644 --- a/src/views/SelectJobsModal.vue +++ b/src/views/SelectJobsModal.vue @@ -96,9 +96,11 @@ export default defineComponent({ }, methods: { async search(event: any) { - this.isJobSearched = true; this.queryString = event.target.value.trim(); - if(this.queryString.length > 0) this.getJobs(); + if(this.queryString.length > 0) { + this.isJobSearched = true; + this.getJobs(); + } }, async getJobs(vSize?: any, vIndex?: any) { const viewSize = vSize ? vSize : process.env.VUE_APP_VIEW_SIZE; From a20e7a7b95fe6d22ab978e5367f25001ef2ea186 Mon Sep 17 00:00:00 2001 From: k2maan Date: Tue, 7 Feb 2023 18:59:42 +0530 Subject: [PATCH 3/5] Refactored: code by removing isJobSearched variable and improving condition to show job (#85zrmekh7) --- src/views/SelectJobsModal.vue | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/views/SelectJobsModal.vue b/src/views/SelectJobsModal.vue index 0e23ca17..9e9f1998 100644 --- a/src/views/SelectJobsModal.vue +++ b/src/views/SelectJobsModal.vue @@ -10,13 +10,13 @@ - + -
+

{{ $t("Searched jobs will appear here") }}

-
+

{{ $t("No jobs found") }}

@@ -84,8 +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, - isJobSearched: false + jobFrequencyType: JSON.parse(process.env?.VUE_APP_JOB_FREQUENCY_TYPE as string) as any } }, computed: { @@ -97,10 +96,7 @@ export default defineComponent({ methods: { async search(event: any) { this.queryString = event.target.value.trim(); - if(this.queryString.length > 0) { - this.isJobSearched = true; - this.getJobs(); - } + if(this.queryString.length > 0) this.getJobs(); }, async getJobs(vSize?: any, vIndex?: any) { const viewSize = vSize ? vSize : process.env.VUE_APP_VIEW_SIZE; From f532fcee24079a615c37f7ed68286e3ded388f37 Mon Sep 17 00:00:00 2001 From: k2maan Date: Tue, 7 Feb 2023 19:06:01 +0530 Subject: [PATCH 4/5] Refactored: by removing unwanted changes (#85zrmekh7) --- src/views/SelectJobsModal.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/views/SelectJobsModal.vue b/src/views/SelectJobsModal.vue index 9e9f1998..e1728182 100644 --- a/src/views/SelectJobsModal.vue +++ b/src/views/SelectJobsModal.vue @@ -96,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) { + this.getJobs(); + } }, async getJobs(vSize?: any, vIndex?: any) { const viewSize = vSize ? vSize : process.env.VUE_APP_VIEW_SIZE; From d3bcdcbf98effd36d54258da66187c324a94b8f6 Mon Sep 17 00:00:00 2001 From: k2maan Date: Wed, 8 Feb 2023 14:21:44 +0530 Subject: [PATCH 5/5] Refactored: condition check for showing "No jobs found (#85zrmar8z) --- src/views/SelectJobsModal.vue | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/views/SelectJobsModal.vue b/src/views/SelectJobsModal.vue index e1728182..43788278 100644 --- a/src/views/SelectJobsModal.vue +++ b/src/views/SelectJobsModal.vue @@ -16,7 +16,7 @@

{{ $t("Searched jobs will appear here") }}

-
+

{{ $t("No jobs found") }}

@@ -96,9 +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;