Skip to content

Commit cccfa9c

Browse files
ClaraMullerFluf22
andauthored
feat(specs): add sortBy trigger on Composition Rules (#5707)
Co-authored-by: Thomas Raffray <Fluf22@users.noreply.github.com>
1 parent 30c2d35 commit cccfa9c

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

specs/composition/common/schemas/components/CompositionRule.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@ condition:
7070
You can add add filters using the syntax `facet:value` so that the rule is triggered, when the specific filter is selected.
7171
You can use `filters` on its own or combine it with the `pattern` parameter.
7272
example: 'genre:comedy'
73+
sortBy:
74+
type: string
75+
description: |
76+
Sort criteria that trigger the rule.
77+
78+
You can trigger composition rules based on the selected sorting strategy set by the parameter `sortBy`.
79+
The rule will trigger if the value passed to `sortBy` matches the one defined in the condition.
80+
example: 'price-low-to-high'
7381

7482
anchoring:
7583
type: string

tests/CTS/requests/composition/saveRules.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,9 @@
334334
{
335335
"anchoring": "contains",
336336
"pattern": "harry"
337+
},
338+
{
339+
"sortBy": "price-low-to-high"
337340
}
338341
],
339342
"consequence": {
@@ -384,6 +387,9 @@
384387
{
385388
"anchoring": "contains",
386389
"pattern": "harry"
390+
},
391+
{
392+
"sortBy": "price-low-to-high"
387393
}
388394
],
389395
"consequence": {

0 commit comments

Comments
 (0)