PMCORE-2879: Cancel Case button does not work when it comes from a email link with new UI

remove debugger
This commit is contained in:
Rodrigo Quelca
2021-04-07 20:53:50 +00:00
parent 5af70bbf9b
commit 6c35cc2fdf
5 changed files with 50 additions and 56 deletions

View File

@@ -308,6 +308,12 @@ export default {
}); });
} }
}, },
/**
* update view in component
*/
updateView(){
this.$refs["vueTable"].getData();
}
}, },
}; };
</script> </script>

View File

@@ -161,6 +161,7 @@ export default {
} else { } else {
this.page = "MyCases"; this.page = "MyCases";
} }
this.lastPage = this.page;
}, },
/** /**
* Do a mapping of vue view for menus * Do a mapping of vue view for menus
@@ -212,9 +213,12 @@ export default {
this.pageId = null; this.pageId = null;
this.pageUri = item.item.href; this.pageUri = item.item.href;
this.page = item.item.id || "MyCases"; 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.$refs["component"].updateView();
} }
this.lastPage = this.page;
} }
}, },
setCounter() { setCounter() {

View File

@@ -343,6 +343,12 @@ export default {
}); });
} }
}, },
/**
* update view in component
*/
updateView(){
this.$refs["vueTable"].getData();
}
}, },
}; };
</script> </script>

View File

@@ -61,7 +61,7 @@ import api from "./../api/index";
import utils from "./../utils/utils"; import utils from "./../utils/utils";
export default { export default {
name: "Paused", name: "Unassigned",
components: { components: {
HeaderCounter, HeaderCounter,
ButtonFleft, ButtonFleft,
@@ -94,6 +94,7 @@ export default {
tableData: [], tableData: [],
options: { options: {
filterable: false, filterable: false,
sendInitialRequest: false,
headings: { headings: {
case_number: this.$i18n.t("ID_MYCASE_NUMBER"), case_number: this.$i18n.t("ID_MYCASE_NUMBER"),
case_title: this.$i18n.t("ID_CASE_TITLE"), case_title: this.$i18n.t("ID_CASE_TITLE"),
@@ -130,12 +131,8 @@ export default {
} }
}; };
}, },
created() {
this.initFilters();
},
mounted() { mounted() {
// force to open case this.initFilters();
this.openDefaultCase();
}, },
watch: {}, watch: {},
computed: { computed: {
@@ -151,57 +148,31 @@ export default {
methods: { methods: {
/** /**
* Initialize filters * Initialize filters
* updates the filters if there is an appUid parameter
*/ */
initFilters() { initFilters() {
let params; let params,
filter = {refresh: true};
if(this.defaultOption) { if(this.defaultOption) {
params = utils.getAllUrlParams(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) { if (params && params.openapplicationuid) {
this.onUpdateFilters({ filter = {
params: [ params: [
{ {
fieldId: "caseNumber", fieldId: "caseNumber",
filterVar: "caseNumber", filterVar: "caseNumber",
label: "", label: "",
options:[], options:[],
value: params.openapplicationuid, value: params.openapplicationuid,
autoShow: false autoShow: false
} }
], ],
refresh: false refresh: true
}); };
this.$emit("cleanDefaultOption");
} }
this.$emit("cleanDefaultOption");
} }
this.onUpdateFilters(filter);
}, },
/** /**
* On row click event handler * On row click event handler
@@ -236,7 +207,7 @@ export default {
paged: paged, paged: paged,
}; };
_.forIn(this.filters, function (item, key) { _.forIn(this.$parent.filters, function (item, key) {
filters[item.filterVar] = item.value; filters[item.filterVar] = item.value;
}); });
return new Promise((resolutionFunc, rejectionFunc) => { return new Promise((resolutionFunc, rejectionFunc) => {
@@ -334,13 +305,21 @@ export default {
}, },
onRemoveFilter(data) {}, onRemoveFilter(data) {},
onUpdateFilters(data) { onUpdateFilters(data) {
this.$emit("onUpdateFilters", data.params); if (data.params) {
this.$emit("onUpdateFilters", data.params);
}
if (data.refresh) { if (data.refresh) {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs["vueTable"].getData(); this.$refs["vueTable"].getData();
}); });
} }
}, },
/**
* update view in component
*/
updateView(){
this.$refs["vueTable"].getData();
}
}, },
}; };
</script> </script>

View File

@@ -90,13 +90,12 @@ if (isset($_SESSION['__OPEN_APPLICATION_UID__'])) {
exit(); exit();
} }
} }
$appNumber = Application::getCaseNumber($openAppUid);
if (count($arrayDelIndex) === 1) { if (count($arrayDelIndex) === 1) {
//We will to open the case: one thread //We will to open the case: one thread
$openCaseIE = true; $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 { } else {
$appNumber = Application::getCaseNumber($openAppUid);
//We will to show the list: more than one thread //We will to show the list: more than one thread
$defaultOption = '../cases/casesListExtJs?action=' . $action . '&openApplicationUid=' . $appNumber; $defaultOption = '../cases/casesListExtJs?action=' . $action . '&openApplicationUid=' . $appNumber;
} }