From 0c3945b46d39a9c7a964bfae58021e569f5d95b0 Mon Sep 17 00:00:00 2001 From: josefdev Date: Thu, 6 Feb 2020 15:24:39 +0100 Subject: [PATCH 01/11] schema adapted --- example/response.json | 2 +- resources/schema.json | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/example/response.json b/example/response.json index e0a36bf..8ec75fc 100644 --- a/example/response.json +++ b/example/response.json @@ -80,7 +80,7 @@ } } ], - "availableFilters": { + "filters": { "main": [ { "name": "cat", diff --git a/resources/schema.json b/resources/schema.json index ba047dc..116b717 100644 --- a/resources/schema.json +++ b/resources/schema.json @@ -52,7 +52,7 @@ }, "additionalProperties": false }, - "availableFilter": { + "filters": { "description": "A selected value, with limited metadata as compared to available filters.", "type": "object", "properties": { @@ -83,7 +83,7 @@ "single", "multiple" ], - "description": "Whether one or more filter values can be selected at the same time. Only applies to a subset of available filter types." + "description": "Whether one or more filter values can be selected at the same time. Only applies to a subset of available filter types. Filters of select-type single have just one value to select, unless 'cat'-filter and range-filter. Filters of select-type multiple with 'combinationOperation' of type 'or' can have more than one value, each values are OR-combined. Filters of select-type multiple with 'combinationOperation' of type 'and' can have more than one value, each values are AND-combined." }, "cssClass": { "type": "string", @@ -434,7 +434,7 @@ ] } }, - "availableFilters": { + "filters": { "description": "Filters available based on the query, and as configured in the filter configuration. Does not include inactive filters.", "type": "object", "properties": { @@ -465,7 +465,7 @@ "metadata", "variant", "items", - "availableFilters" + "filters" ] } }, From a208e16268e9211c7b0262db9ffc4dfb55551d68 Mon Sep 17 00:00:00 2001 From: josefdev Date: Thu, 6 Feb 2020 15:50:28 +0100 Subject: [PATCH 02/11] schema adapted --- resources/schema.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/resources/schema.json b/resources/schema.json index 116b717..c117335 100644 --- a/resources/schema.json +++ b/resources/schema.json @@ -104,6 +104,14 @@ "pinnedFilterValueCount": { "type": "integer", "description": "This is the number of filter values that should always be shown, and any more values than that should be hidden, e.g. by putting them in a dropdown." + }, + "combinationOperation": { + "type": "string", + "enum": [ + "or", + "and" + ], + "description": "This indicates whether multiple-filters are applied in a OR- or AND-condition." } }, "additionalProperties": false, From 13bba816ef423c587f738678c15794c58edf491f Mon Sep 17 00:00:00 2001 From: josefdev Date: Thu, 6 Feb 2020 16:37:39 +0100 Subject: [PATCH 03/11] schema adapted --- example/response.json | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/example/response.json b/example/response.json index 8ec75fc..4881f42 100644 --- a/example/response.json +++ b/example/response.json @@ -117,6 +117,7 @@ "name": "color", "displayName": "Color", "type": "color", + "selectMode": "multiple", "cssClass": "my-colors", "values": [ { @@ -124,6 +125,24 @@ "colorCode": "#00FF00" } ] + }, + { + "name": "price", + "displayName": "max. Price", + "type": "range-slider", + "selectMode": "single", + "values": [ + { + "value": 3, + "weight": 0, + "frequency": null + }, + { + "value": 158221, + "weight": 0, + "frequency": null + } + ] } ] } From 15ebeb9f9d86881c594ca0e8d7bfad12d4594db9 Mon Sep 17 00:00:00 2001 From: josefdev Date: Fri, 7 Feb 2020 10:23:52 +0100 Subject: [PATCH 04/11] schema adapted --- example/response.json | 3 ++- resources/schema.json | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/example/response.json b/example/response.json index 4881f42..4a53112 100644 --- a/example/response.json +++ b/example/response.json @@ -107,7 +107,8 @@ "value": "Blubbergurken International Inc.", "weight": 0.8, "frequency": 5, - "selected": true + "selected": true, + "frequencyType" : "additive" } ] } diff --git a/resources/schema.json b/resources/schema.json index c117335..ea5aa0d 100644 --- a/resources/schema.json +++ b/resources/schema.json @@ -36,6 +36,13 @@ "description": "The number of products matching a filter. Not supported in all configuration constellations.", "type": ["number", "null"] }, + "frequencyType": { + "type": "string", + "enum": [ + "additive" + ], + "description": "In case of an selected-filter, this attribute indicates that no more products can come from this filter." + }, "colorCode": { "description": "For color filters, the hexadecimal code corresponding to the color. The filter's value is the configured color name in such a case.", "type": "string", From 5e8620ccdc63acf51c3d75efb2219275e58b458a Mon Sep 17 00:00:00 2001 From: josefdev Date: Fri, 7 Feb 2020 10:36:10 +0100 Subject: [PATCH 05/11] schema adapted --- resources/schema.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/schema.json b/resources/schema.json index ea5aa0d..f02f589 100644 --- a/resources/schema.json +++ b/resources/schema.json @@ -59,7 +59,7 @@ }, "additionalProperties": false }, - "filters": { + "filter": { "description": "A selected value, with limited metadata as compared to available filters.", "type": "object", "properties": { @@ -457,14 +457,14 @@ "description": "Filters configured for primary visibility.", "type": "array", "items": { - "$ref": "#/definitions/availableFilter" + "$ref": "#/definitions/filter" } }, "other": { "description": "Filters configured for secondary visibility. Should be initially hidden or collapsed.", "type": "array", "items": { - "$ref": "#/definitions/availableFilter" + "$ref": "#/definitions/filter" } } }, From 0471a86c958a62df505081663fa6eea0e99207ec Mon Sep 17 00:00:00 2001 From: josefdev Date: Fri, 7 Feb 2020 10:40:58 +0100 Subject: [PATCH 06/11] schema adapted --- example/response.json | 24 +++--------------------- resources/schema.json | 15 +-------------- 2 files changed, 4 insertions(+), 35 deletions(-) diff --git a/example/response.json b/example/response.json index 4a53112..b82c626 100644 --- a/example/response.json +++ b/example/response.json @@ -10,24 +10,6 @@ "field": "salesfrequency", "relevanceBased": true, "direction": "DESC" - }, - "selectedFilters": { - "cat": [ - { - "value": "Gardening" - } - ], - "price": [ - { - "min": 0.0, - "max": 15 - } - ], - "vendor": [ - { - "value": "Blubbergurken International Inc." - } - ] } }, "result": { @@ -130,16 +112,16 @@ { "name": "price", "displayName": "max. Price", - "type": "range-slider", + "type": "rangeSlider", "selectMode": "single", "values": [ { - "value": 3, + "value": "3", "weight": 0, "frequency": null }, { - "value": 158221, + "value": "158221", "weight": 0, "frequency": null } diff --git a/resources/schema.json b/resources/schema.json index f02f589..633ace0 100644 --- a/resources/schema.json +++ b/resources/schema.json @@ -201,18 +201,6 @@ "relevanceBased", "direction" ] - }, - "selectedFilters": { - "description": "Filters that have previously been selected.", - "type": "object", - "patternProperties": { - "^.*$": { - "type": "array", - "items": { - "$ref": "#/definitions/filterMetadata" - } - } - } } }, "additionalProperties": false, @@ -223,8 +211,7 @@ "serviceId", "usergroup", "userId", - "order", - "selectedFilters" + "order" ] }, "result": { From 8e57eb027aa260ef31a5b7fec2dcca2e2a731617 Mon Sep 17 00:00:00 2001 From: Wladislaw Koschemako Date: Tue, 18 Feb 2020 13:45:39 +0100 Subject: [PATCH 07/11] Fix range-slider --- resources/schema.json | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/resources/schema.json b/resources/schema.json index ba047dc..5588cc3 100644 --- a/resources/schema.json +++ b/resources/schema.json @@ -71,7 +71,7 @@ "type": "string", "enum": [ "select", - "rangeSlider", + "range-slider", "color", "label", "image" @@ -104,6 +104,36 @@ "pinnedFilterValueCount": { "type": "integer", "description": "This is the number of filter values that should always be shown, and any more values than that should be hidden, e.g. by putting them in a dropdown." + }, + "totalRange": { + "description": "The usable range of a range slider", + "properties": { + "min": { + "type": "number", + "description": "The minimum of the possible range" + }, + "max": { + "type": "number", + "description": "The maximum of the possible range" + } + } + }, + "selectedRange": { + "description": "The currently selected range of a range slider", + "properties": { + "min": { + "type": "number", + "description": "The minimum of the selected range" + }, + "max": { + "type": "number", + "description": "The maximum of the selected range" + } + } + }, + "stepSize": { + "type": "number", + "description": "The step size for range filters" } }, "additionalProperties": false, From 5b2f91ce8ffe92572f4e27a4f950ccf8754ba585 Mon Sep 17 00:00:00 2001 From: Wladislaw Koschemako Date: Tue, 18 Feb 2020 13:46:54 +0100 Subject: [PATCH 08/11] Add example --- example/response.json | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/example/response.json b/example/response.json index e0a36bf..a3ed488 100644 --- a/example/response.json +++ b/example/response.json @@ -96,6 +96,32 @@ ], "pinnedFilterValueCount": 6 }, + { + "type": "range-slider", + "totalRange": { + "min": 2.37, + "max": 10106.09 + }, + "selectedRange": { + "min": 2.37, + "max": 10106.09 + }, + "stepSize": 0.1, + "unit": "€", + "name": "price", + "displayName": "Preis", + "selectMode": "single", + "values": [ + { + "value": { + "min": 2.37, + "max": 30.75 + }, + "weight": 0.3948, + "frequency": null + } + ] + }, { "name": "vendor", "displayName": "Brand", From 27e9b9137eeb8a670578b14f22ef36c267378e47 Mon Sep 17 00:00:00 2001 From: Wladislaw Koschemako Date: Tue, 18 Feb 2020 13:51:24 +0100 Subject: [PATCH 09/11] Fix schema --- resources/schema.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/resources/schema.json b/resources/schema.json index 5588cc3..2b5864c 100644 --- a/resources/schema.json +++ b/resources/schema.json @@ -9,7 +9,7 @@ "properties": { "value": { "description": "The filter value, as selected or suitable for visualization.", - "type": "string", + "type": ["string", "object"], "minLength": 1 }, "min": { @@ -134,6 +134,10 @@ "stepSize": { "type": "number", "description": "The step size for range filters" + }, + "unit": { + "type": "string", + "description": "The unit for range filters" } }, "additionalProperties": false, From ce11087a9701ce9591b5f7242f8bdbcae73e0216 Mon Sep 17 00:00:00 2001 From: Wladislaw Koschemako Date: Wed, 19 Feb 2020 17:05:44 +0100 Subject: [PATCH 10/11] Resolve Review issues --- resources/schema.json | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/resources/schema.json b/resources/schema.json index 2b5864c..45dc830 100644 --- a/resources/schema.json +++ b/resources/schema.json @@ -106,38 +106,48 @@ "description": "This is the number of filter values that should always be shown, and any more values than that should be hidden, e.g. by putting them in a dropdown." }, "totalRange": { - "description": "The usable range of a range slider", + "description": "The usable range of a range slider.", "properties": { "min": { "type": "number", - "description": "The minimum of the possible range" + "description": "The minimum of the possible range." }, "max": { "type": "number", - "description": "The maximum of the possible range" + "description": "The maximum of the possible range." } - } + }, + "additionalProperties": false, + "required": [ + "min", + "max" + ] }, "selectedRange": { - "description": "The currently selected range of a range slider", + "description": "The currently selected range of a range slider.", "properties": { "min": { "type": "number", - "description": "The minimum of the selected range" + "description": "The minimum of the selected range." }, "max": { "type": "number", - "description": "The maximum of the selected range" + "description": "The maximum of the selected range." } - } + }, + "additionalProperties": false, + "required": [ + "min", + "max" + ] }, "stepSize": { "type": "number", - "description": "The step size for range filters" + "description": "The step size for range filters." }, "unit": { "type": "string", - "description": "The unit for range filters" + "description": "The unit for range filters." } }, "additionalProperties": false, @@ -170,7 +180,7 @@ "description": "Items per page." }, "serviceId": { - "description": "Mirrored from the required request parameter \"shopkey\"", + "description": "Mirrored from the required request parameter \"shopkey\".", "type": "string", "pattern": "^[0-9A-F]{32}$" }, @@ -414,7 +424,7 @@ "minLength": 0 }, "properties": { - "description": "Non-searchable value exported as properties. Includes additional images, if applicable. The desired values have to be requested with the 'properties[]' parameter", + "description": "Non-searchable value exported as properties. Includes additional images, if applicable. The desired values have to be requested with the 'properties[]' parameter.", "type": "object", "properties": { ".*": { From 3fa03731bb9a50d84a17bed23c2168c9ec53abaf Mon Sep 17 00:00:00 2001 From: Wladislaw Koschemako Date: Wed, 19 Feb 2020 17:56:37 +0100 Subject: [PATCH 11/11] Resolve Review issues --- example/response.json | 18 ------------------ resources/schema.json | 9 +++++---- 2 files changed, 5 insertions(+), 22 deletions(-) diff --git a/example/response.json b/example/response.json index 05f4729..811b43d 100644 --- a/example/response.json +++ b/example/response.json @@ -134,24 +134,6 @@ "colorCode": "#00FF00" } ] - }, - { - "name": "price", - "displayName": "max. Price", - "type": "rangeSlider", - "selectMode": "single", - "values": [ - { - "value": "3", - "weight": 0, - "frequency": null - }, - { - "value": "158221", - "weight": 0, - "frequency": null - } - ] } ] } diff --git a/resources/schema.json b/resources/schema.json index a4e0239..4d45b78 100644 --- a/resources/schema.json +++ b/resources/schema.json @@ -39,9 +39,10 @@ "frequencyType": { "type": "string", "enum": [ - "additive" + "additive", + "absolute" ], - "description": "In case of an selected-filter, this attribute indicates that no more products can come from this filter." + "description": "In case of a selected-filter, this property indicates whether the frequency is the number of additional products you'll get after selecting the filter (additive), or whether it's the total number of results you'll have after selecting the filter (absolute)." }, "colorCode": { "description": "For color filters, the hexadecimal code corresponding to the color. The filter's value is the configured color name in such a case.", @@ -90,7 +91,7 @@ "single", "multiple" ], - "description": "Whether one or more filter values can be selected at the same time. Only applies to a subset of available filter types. Filters of select-type single have just one value to select, unless 'cat'-filter and range-filter. Filters of select-type multiple with 'combinationOperation' of type 'or' can have more than one value, each values are OR-combined. Filters of select-type multiple with 'combinationOperation' of type 'and' can have more than one value, each values are AND-combined." + "description": "Whether one or more filter values can be selected at the same time." }, "cssClass": { "type": "string", @@ -118,7 +119,7 @@ "or", "and" ], - "description": "This indicates whether multiple-filters are applied in a OR- or AND-condition." + "description": "This indicates whether multiple-filters are applied in a OR- or AND-condition and do only apply after a minimum of two filters have been selected. The AND-condition shrinks the result (A and B have to match), while the OR-condition makes it grow (A or B have to match)." }, "totalRange": { "description": "The usable range of a range slider.",