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

@@ -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",
@@ -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,17 +170,21 @@ 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) {
element.autoShow = self.showProcessName;
initialFilters =[...new Set([...initialFilters,...this.prepareFilterItems(element, item, true)])];
}
});
@@ -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
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">