Skip to content

Commit

Permalink
feat(editor): simplified script by merging single/multiple value prop…
Browse files Browse the repository at this point in the history
…erty type
  • Loading branch information
marcofra committed Dec 17, 2024
1 parent 2f8c411 commit 105e90d
Showing 1 changed file with 7 additions and 25 deletions.
32 changes: 7 additions & 25 deletions src/main/frontend/model/samples/check-hardcoded-urls.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@
"type": "each",
"expression": "node.properties",
"hops": [
{
"type": "declare",
"declarations": {
"joinedProperty": "str:join(jcr:vals(node, property.name))"
}
},
{
"type": "filterNode",
"expression": "property.type == 1 && !property.multiple && str:contains(jcr:val(node, property.name), args.phrase ) && str:contains(jcr:val(node, property.name), args.extension) ",
"expression": "str:contains(joinedProperty, args.phrase) && str:contains(joinedProperty, args.extension)",
"hops": [
{
"type": "runScript",
Expand All @@ -27,30 +33,6 @@
"putLocalsBackIntoScope": true
}
]
},
{
"type": "filterNode",
"expression": "property.type == 1 && property.multiple",
"hops": [
{
"type": "declare",
"declarations": {
"joinedProperty": "str:join(jcr:vals(node, property.name))"
}
},
{
"type": "filterNode",
"expression": "str:contains(joinedProperty, args.phrase) && str:contains(joinedProperty, args.extension)",
"hops": [
{
"type": "runScript",
"code": "log.info(property.path)",
"extension": "js",
"putLocalsBackIntoScope": true
}
]
}
]
}
],
"iterator": "property"
Expand Down

0 comments on commit 105e90d

Please sign in to comment.