From c8971a1cbec5ebd38bc077bcfa696241c60a1fab Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Fri, 23 Dec 2022 18:24:56 +0100 Subject: [PATCH] Make bicycle-rental questions conditional in bike_shop layer --- assets/layers/bicycle_rental/bicycle_rental.json | 11 ++++++++--- assets/layers/bike_shop/bike_shop.json | 11 +++++++++-- assets/themes/cyclofix/cyclofix.json | 4 ++-- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/assets/layers/bicycle_rental/bicycle_rental.json b/assets/layers/bicycle_rental/bicycle_rental.json index b761f6b8f..fc6f5e02d 100644 --- a/assets/layers/bicycle_rental/bicycle_rental.json +++ b/assets/layers/bicycle_rental/bicycle_rental.json @@ -314,7 +314,10 @@ "cs": "Zde si můžete půjčit cyklistické přilby" } } - ] + ], + "condition": { + "and": [] + } }, { "id": "rental_types", @@ -443,7 +446,9 @@ "key": "capacity:bicycle_type", "type": "pnat" }, - "condition": "rental~.*bicycle_type.*" + "condition": {"and": + ["rental~.*bicycle_type.*"] + } } ] } @@ -554,4 +559,4 @@ } ] } -} \ No newline at end of file +} diff --git a/assets/layers/bike_shop/bike_shop.json b/assets/layers/bike_shop/bike_shop.json index 908ab06cf..3246859f4 100644 --- a/assets/layers/bike_shop/bike_shop.json +++ b/assets/layers/bike_shop/bike_shop.json @@ -487,7 +487,14 @@ } ] }, - "bicycle_rental.*bicycle_rental", + { + "builtin": "bicycle_rental.*bicycle_rental", + "override": { + "condition": { + "and+": ["service:bicycle:rental=yes"] + } + } + }, { "id": "bike_repair_second-hand-bikes", "question": { @@ -783,4 +790,4 @@ } } ] -} \ No newline at end of file +} diff --git a/assets/themes/cyclofix/cyclofix.json b/assets/themes/cyclofix/cyclofix.json index 3460b5864..c5408946f 100644 --- a/assets/themes/cyclofix/cyclofix.json +++ b/assets/themes/cyclofix/cyclofix.json @@ -39,6 +39,7 @@ "socialImage": "./assets/themes/cyclofix/logo.svg", "layers": [ "bike_cafe", + "bike_shop", { "builtin": [ "bicycle_rental" @@ -87,7 +88,6 @@ ] } }, - "bike_shop", { "builtin": "bicycle_library", "override": { @@ -130,4 +130,4 @@ } } ] -} \ No newline at end of file +}