From 085302f5a6b0eb96f84dd35dfc37e72e60527113 Mon Sep 17 00:00:00 2001 From: fabio Date: Mon, 18 Oct 2021 12:39:34 -0400 Subject: [PATCH] PMCORE-3429:Popup for "By send By" and "By Process Name" are not displaying --- .../js/components/search/CasesFilter.vue | 119 +++++++++--------- .../js/components/search/CustomFilter.vue | 10 +- .../js/components/search/MyCasesFilter.vue | 11 +- .../search/popovers/CurrentUser.vue | 7 +- 4 files changed, 85 insertions(+), 62 deletions(-) diff --git a/resources/assets/js/components/search/CasesFilter.vue b/resources/assets/js/components/search/CasesFilter.vue index b98cc50b5..d1aa87f64 100644 --- a/resources/assets/js/components/search/CasesFilter.vue +++ b/resources/assets/js/components/search/CasesFilter.vue @@ -108,46 +108,46 @@ export default { dataLoaded: false, filterItems: [ { - type: "CaseNumber", - id: "caseNumber", - title: `${this.$i18n.t("ID_FILTER")}: ${this.$i18n.t( - "ID_BY_CASE_NUMBER" - )}`, - optionLabel: this.$i18n.t("ID_BY_CASE_NUMBER"), - detail: this.$i18n.t("ID_PLEASE_SET_THE_CASE_NUMBER_TO_BE_SEARCHED"), - tagText: "", - tagPrefix: this.$i18n.t("ID_SEARCH_BY_CASE_NUMBER"), - items: [ - { - id: "filterCases", - value: "", + type: "CaseNumber", + id: "caseNumber", + title: `${this.$i18n.t("ID_FILTER")}: ${this.$i18n.t( + "ID_BY_CASE_NUMBER" + )}`, + optionLabel: this.$i18n.t("ID_BY_CASE_NUMBER"), + detail: this.$i18n.t("ID_PLEASE_SET_THE_CASE_NUMBER_TO_BE_SEARCHED"), + tagText: "", + tagPrefix: this.$i18n.t("ID_SEARCH_BY_CASE_NUMBER"), + items: [ + { + id: "filterCases", + value: "", + }, + ], + autoShow: true, + makeTagText: function (params, data) { + return `${params.tagPrefix}: ${data[0].value}`; }, - ], - autoShow: true, - makeTagText: function (params, data) { - return `${params.tagPrefix}: ${data[0].value}`; - }, }, { - type: "CaseTitle", - id: "caseTitle", - title: `${this.$i18n.t("ID_FILTER")}: ${this.$i18n.t( - "ID_BY_CASE_THREAD_TITLE" - )}`, - optionLabel: this.$i18n.t("ID_BY_CASE_THREAD_TITLE"), - tagPrefix: this.$i18n.t("ID_SEARCH_BY_CASE_THREAD_TITLE"), - detail: "", - tagText: "", - items: [ - { + type: "CaseTitle", id: "caseTitle", - value: "", + title: `${this.$i18n.t("ID_FILTER")}: ${this.$i18n.t( + "ID_BY_CASE_THREAD_TITLE" + )}`, + optionLabel: this.$i18n.t("ID_BY_CASE_THREAD_TITLE"), + tagPrefix: this.$i18n.t("ID_SEARCH_BY_CASE_THREAD_TITLE"), + detail: "", + tagText: "", + items: [ + { + id: "caseTitle", + value: "", + }, + ], + autoShow: true, + makeTagText: function (params, data) { + return `${this.tagPrefix} ${data[0].value}`; }, - ], - autoShow: true, - makeTagText: function (params, data) { - return `${this.tagPrefix} ${data[0].value}`; - }, }, { type: "DateFilter", @@ -182,6 +182,7 @@ export default { placeholder: this.$i18n.t('ID_USER_NAME'), tagText: "", tagPrefix: this.$i18n.t('ID_SEARCH_BY_SEND_BY'), + autoShow: true, items:[ { id: "sendBy", @@ -195,27 +196,27 @@ export default { } }, { - type: "TaskTitle", - id: "taskTitle", - title: `${this.$i18n.t("ID_FILTER")}: ${this.$i18n.t( - "ID_TASK_NAME" - )}`, - optionLabel: this.$i18n.t("ID_BY_TASK"), - detail: "", - tagText: "", - tagPrefix: this.$i18n.t("ID_SEARCH_BY_TASK_NAME"), - autoShow: true, - items: [ - { - id: "task", - value: "", - options: [], - placeholder: this.$i18n.t("ID_TASK_NAME"), + type: "TaskTitle", + id: "taskTitle", + title: `${this.$i18n.t("ID_FILTER")}: ${this.$i18n.t( + "ID_TASK_NAME" + )}`, + optionLabel: this.$i18n.t("ID_BY_TASK"), + detail: "", + tagText: "", + tagPrefix: this.$i18n.t("ID_SEARCH_BY_TASK_NAME"), + autoShow: true, + items: [ + { + id: "task", + value: "", + options: [], + placeholder: this.$i18n.t("ID_TASK_NAME"), + }, + ], + makeTagText: function (params, data) { + return `${this.tagPrefix}: ${data[0].label || ""}`; }, - ], - makeTagText: function (params, data) { - return `${this.tagPrefix}: ${data[0].label || ""}`; - }, }, ], processName: { @@ -226,7 +227,7 @@ export default { detail: "", tagText: "", tagPrefix: this.$i18n.t('ID_SEARCH_BY_PROCESS_NAME'), - autoShow: false, + autoShow: true, items:[ { id: "process", @@ -236,7 +237,6 @@ export default { } ], makeTagText: function (params, data) { - return `${this.tagPrefix} ${data[0].options && data[0].options.label || ''}`; } }, @@ -297,6 +297,11 @@ export default { } //adding process name filter if (self.byProcessName !== "") { + if (element !== undefined) { + this.processName.autoShow = false; + } else { + this.processName.autoShow = true; + } initialFilters =[...new Set([...initialFilters,...this.prepareFilterItems(this.processName.items, self.byProcessName, true)])]; } this.$emit("onUpdateFilters", {params: initialFilters, refresh: false}); diff --git a/resources/assets/js/components/search/CustomFilter.vue b/resources/assets/js/components/search/CustomFilter.vue index a637a8244..73f846031 100644 --- a/resources/assets/js/components/search/CustomFilter.vue +++ b/resources/assets/js/components/search/CustomFilter.vue @@ -115,6 +115,7 @@ export default { byProcessName: "", criteriaItemsRadio: [], criteriaItemsCheckbox: [], + showProcessName: true, }; }, watch: { @@ -169,18 +170,22 @@ export default { return o.id === self.selectedRadio; }); if (element) { + this.showProcessName = false; initialFilters = this.prepareFilterItems( element, this.selectedRadio, true ); + } else { + this.showProcessName = true; } self.selectedCheckbox.forEach((item) => { element = _.find(this.filterItems, function(o) { return o.id === item; }); if (element) { - initialFilters =[...new Set([...initialFilters,...this.prepareFilterItems(element, item, true)])]; + element.autoShow = self.showProcessName; + initialFilters =[...new Set([...initialFilters,...this.prepareFilterItems(element, item, true)])]; } }); this.$emit("onUpdateFilters", { @@ -213,7 +218,7 @@ export default { value: "", label: "", options: [], - autoShow: true, + autoShow: element.autoShow, }; initialFilters.push(item); } @@ -310,6 +315,7 @@ export default { }); if (tag === "processName") { this.byProcessName = ""; + this.selectedCheckbox = []; } this.$emit("onUpdateFilters", { params: temp, refresh: true }); }, diff --git a/resources/assets/js/components/search/MyCasesFilter.vue b/resources/assets/js/components/search/MyCasesFilter.vue index f35c4e4c5..3d55fa4ef 100644 --- a/resources/assets/js/components/search/MyCasesFilter.vue +++ b/resources/assets/js/components/search/MyCasesFilter.vue @@ -221,7 +221,7 @@ export default { detail: "", tagText: "", tagPrefix: this.$i18n.t('ID_SEARCH_BY_PROCESS_NAME'), - autoShow: false, + autoShow: true, items:[ { id: "process", @@ -276,7 +276,14 @@ export default { initialFilters = this.prepareFilterItems(element.items, this.selected, true); } //adding process name filter - initialFilters =[...new Set([...initialFilters,...this.prepareFilterItems(this.processName.items, self.byProcessName, true)])]; + if (self.byProcessName !== "") { + if (element !== undefined) { + this.processName.autoShow = false; + } else { + this.processName.autoShow = true; + } + initialFilters =[...new Set([...initialFilters,...this.prepareFilterItems(this.processName.items, self.byProcessName, true)])]; + } this.$emit("onUpdateFilters", {params: initialFilters, refresh: false}); }, /** diff --git a/resources/assets/js/components/search/popovers/CurrentUser.vue b/resources/assets/js/components/search/popovers/CurrentUser.vue index a0ee33dab..c5fa308f2 100644 --- a/resources/assets/js/components/search/popovers/CurrentUser.vue +++ b/resources/assets/js/components/search/popovers/CurrentUser.vue @@ -1,6 +1,11 @@