From 6c35cc2fdf2565839faf8fed80b4c735121bf6b9 Mon Sep 17 00:00:00 2001 From: Rodrigo Quelca Date: Wed, 7 Apr 2021 20:53:50 +0000 Subject: [PATCH] PMCORE-2879: Cancel Case button does not work when it comes from a email link with new UI remove debugger --- resources/assets/js/home/Draft.vue | 6 ++ resources/assets/js/home/Home.vue | 6 +- resources/assets/js/home/Paused.vue | 6 ++ resources/assets/js/home/Unassigned.vue | 83 ++++++++------------ workflow/engine/methods/cases/viena_init.php | 5 +- 5 files changed, 50 insertions(+), 56 deletions(-) diff --git a/resources/assets/js/home/Draft.vue b/resources/assets/js/home/Draft.vue index 67c9e885f..586e0239b 100644 --- a/resources/assets/js/home/Draft.vue +++ b/resources/assets/js/home/Draft.vue @@ -308,6 +308,12 @@ export default { }); } }, + /** + * update view in component + */ + updateView(){ + this.$refs["vueTable"].getData(); + } }, }; diff --git a/resources/assets/js/home/Home.vue b/resources/assets/js/home/Home.vue index 150e46f9c..68b3022ab 100644 --- a/resources/assets/js/home/Home.vue +++ b/resources/assets/js/home/Home.vue @@ -161,6 +161,7 @@ export default { } else { this.page = "MyCases"; } + this.lastPage = this.page; }, /** * Do a mapping of vue view for menus @@ -212,9 +213,12 @@ export default { this.pageId = null; this.pageUri = item.item.href; this.page = item.item.id || "MyCases"; - if (this.$refs["component"] && this.$refs["component"].updateView) { + if (this.page === this.lastPage + && this.$refs["component"] + && this.$refs["component"].updateView) { this.$refs["component"].updateView(); } + this.lastPage = this.page; } }, setCounter() { diff --git a/resources/assets/js/home/Paused.vue b/resources/assets/js/home/Paused.vue index 2e4cc085c..598f226f3 100644 --- a/resources/assets/js/home/Paused.vue +++ b/resources/assets/js/home/Paused.vue @@ -343,6 +343,12 @@ export default { }); } }, + /** + * update view in component + */ + updateView(){ + this.$refs["vueTable"].getData(); + } }, }; diff --git a/resources/assets/js/home/Unassigned.vue b/resources/assets/js/home/Unassigned.vue index 90a4cd5ca..cd443b580 100644 --- a/resources/assets/js/home/Unassigned.vue +++ b/resources/assets/js/home/Unassigned.vue @@ -61,7 +61,7 @@ import api from "./../api/index"; import utils from "./../utils/utils"; export default { - name: "Paused", + name: "Unassigned", components: { HeaderCounter, ButtonFleft, @@ -94,6 +94,7 @@ export default { tableData: [], options: { filterable: false, + sendInitialRequest: false, headings: { case_number: this.$i18n.t("ID_MYCASE_NUMBER"), case_title: this.$i18n.t("ID_CASE_TITLE"), @@ -130,12 +131,8 @@ export default { } }; }, - created() { - this.initFilters(); - }, mounted() { - // force to open case - this.openDefaultCase(); + this.initFilters(); }, watch: {}, computed: { @@ -151,57 +148,31 @@ export default { methods: { /** * Initialize filters + * updates the filters if there is an appUid parameter */ initFilters() { - let params; + let params, + filter = {refresh: true}; if(this.defaultOption) { params = utils.getAllUrlParams(this.defaultOption); - if (params && params.openapplicationuid) { - this.$emit("onUpdateFilters",[ - { - fieldId: "caseNumber", - filterVar: "caseNumber", - label: "", - options:[], - value: params.openapplicationuid, - autoShow: false - } - ]); - } - } - }, - /** - * Open a case when the component was mounted - */ - openDefaultCase() { - let params; - if(this.defaultOption) { - params = utils.getAllUrlParams(this.defaultOption); - if (params && params.app_uid && params.del_index) { - this.openCase({ - APP_UID: params.app_uid, - DEL_INDEX: params.del_index - }); - this.$emit("cleanDefaultOption"); - } - //force to search in the parallel tasks if (params && params.openapplicationuid) { - this.onUpdateFilters({ - params: [ - { - fieldId: "caseNumber", - filterVar: "caseNumber", - label: "", - options:[], - value: params.openapplicationuid, - autoShow: false - } - ], - refresh: false - }); - this.$emit("cleanDefaultOption"); + filter = { + params: [ + { + fieldId: "caseNumber", + filterVar: "caseNumber", + label: "", + options:[], + value: params.openapplicationuid, + autoShow: false + } + ], + refresh: true + }; } + this.$emit("cleanDefaultOption"); } + this.onUpdateFilters(filter); }, /** * On row click event handler @@ -236,7 +207,7 @@ export default { paged: paged, }; - _.forIn(this.filters, function (item, key) { + _.forIn(this.$parent.filters, function (item, key) { filters[item.filterVar] = item.value; }); return new Promise((resolutionFunc, rejectionFunc) => { @@ -334,13 +305,21 @@ export default { }, onRemoveFilter(data) {}, onUpdateFilters(data) { - this.$emit("onUpdateFilters", data.params); + if (data.params) { + this.$emit("onUpdateFilters", data.params); + } if (data.refresh) { this.$nextTick(() => { this.$refs["vueTable"].getData(); }); } }, + /** + * update view in component + */ + updateView(){ + this.$refs["vueTable"].getData(); + } }, }; diff --git a/workflow/engine/methods/cases/viena_init.php b/workflow/engine/methods/cases/viena_init.php index 229ae00b0..76822b5d0 100644 --- a/workflow/engine/methods/cases/viena_init.php +++ b/workflow/engine/methods/cases/viena_init.php @@ -90,13 +90,12 @@ if (isset($_SESSION['__OPEN_APPLICATION_UID__'])) { exit(); } } - + $appNumber = Application::getCaseNumber($openAppUid); if (count($arrayDelIndex) === 1) { //We will to open the case: one thread $openCaseIE = true; - $defaultOption = '../cases/open?APP_UID=' . $openAppUid . '&DEL_INDEX=' . $arrayDelIndex[0] . '&action=' . $action; + $defaultOption = '../cases/open?APP_UID=' . $openAppUid . '&DEL_INDEX=' . $arrayDelIndex[0] . '&action=' . $action . '&openApplicationUid=' . $appNumber; } else { - $appNumber = Application::getCaseNumber($openAppUid); //We will to show the list: more than one thread $defaultOption = '../cases/casesListExtJs?action=' . $action . '&openApplicationUid=' . $appNumber; }