Merged in bugfix/PMCORE-3429 (pull request #8223)

PMCORE-3429

Approved-by: Rodrigo Quelca
This commit is contained in:
Fabio Guachalla
2021-10-18 19:50:38 +00:00
committed by Julio Cesar Laura Avendaño
4 changed files with 85 additions and 62 deletions

View File

@@ -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});

View File

@@ -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 });
},

View File

@@ -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});
},
/**

View File

@@ -1,6 +1,11 @@
<template>
<div>
<SearchPopover :target="tag" @savePopover="onOk" :title="info.title">
<SearchPopover
:target="tag"
@savePopover="onOk"
:title="info.title"
:autoShow="info.autoShow || false"
>
<template v-slot:body>
<p>{{ info.detail }}</p>
<form ref="form" @submit.stop.prevent="handleSubmit">