mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
#12168 filtered only for services
This commit is contained in:
parent
581d78fc33
commit
13ba9aff39
@ -1565,29 +1565,31 @@ var TreeController = {
|
|||||||
const father = [];
|
const father = [];
|
||||||
const newTree = [];
|
const newTree = [];
|
||||||
rawTree.map((raw, index) => {
|
rawTree.map((raw, index) => {
|
||||||
if (raw.servicesChildren.length !== 0) {
|
if (raw.type === "services") {
|
||||||
// search at parent level
|
if (raw.servicesChildren.length !== 0) {
|
||||||
let findedPadre = raw.description.indexOf(searched);
|
// search at parent level
|
||||||
if (findedPadre === -1) {
|
let findedPadre = raw.description.indexOf(searched);
|
||||||
// search for children
|
if (findedPadre === -1) {
|
||||||
raw.servicesChildren.map(child => {
|
// search for children
|
||||||
let finded = child.description.indexOf(searched);
|
raw.servicesChildren.map(child => {
|
||||||
if (finded === 0) {
|
let finded = child.description.indexOf(searched);
|
||||||
//we keep the father of the child that contains it
|
if (finded === 0) {
|
||||||
ancestors.push(child.ancestor);
|
//we keep the father of the child that contains it
|
||||||
} else if (findedPadre === -1 && finded === -1) {
|
ancestors.push(child.ancestor);
|
||||||
//we save the father
|
} else if (findedPadre === -1 && finded === -1) {
|
||||||
father.push(raw.id);
|
//we save the father
|
||||||
}
|
father.push(raw.id);
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
//we mark the father as found
|
||||||
|
controller.finded = 1;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
//we mark the father as found
|
let finded = raw.description.indexOf(searched);
|
||||||
controller.finded = 1;
|
if (finded === -1) {
|
||||||
}
|
delete rawTree[index];
|
||||||
} else {
|
}
|
||||||
let finded = raw.description.indexOf(searched);
|
|
||||||
if (finded === -1) {
|
|
||||||
delete rawTree[index];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user