From 96c03dc8e3243f852ecd7e3202a2f081df870a57 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Mon, 20 Jul 2020 17:37:16 +0200 Subject: [PATCH] Add more quests for bike shop --- Customizations/Layers/BikeShop.ts | 38 +++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/Customizations/Layers/BikeShop.ts b/Customizations/Layers/BikeShop.ts index 0056139..3e4413a 100644 --- a/Customizations/Layers/BikeShop.ts +++ b/Customizations/Layers/BikeShop.ts @@ -8,8 +8,8 @@ import {NameQuestion} from "../Questions/NameQuestion"; export class BikeShop extends LayerDefinition { - const - sellsBikes = new Tag("service:bicycle:retail", "yes"); + private readonly sellsBikes = new Tag("service:bicycle:retail", "yes"); + private readonly repairsBikes = new Tag("service:bicycle:repair", "yes"); constructor() { super( @@ -35,31 +35,49 @@ export class BikeShop extends LayerDefinition { new ImageCarouselWithUploadConstructor(), new TagRenderingOptions({ question: "What is the name of this bicycle shop?", - freeform:{ - key:"name", + freeform: { + key: "name", renderTemplate: "The name of this bicycle shop is {name}", template: "The name of this bicycle shop is $$$" } }), new TagRenderingOptions({ - question: "Can one buy a new bike here?", + question: "Can one buy a bike here?", mappings: [ {k: this.sellsBikes, txt: "Bikes are sold here"}, - {k: new Tag("service:bicycle:retail", "no"), txt: "No bikes can be bought here"}, + {k: new Tag("service:bicycle:retail", "no"), txt: "No bikes are sold here"}, ] }), - - - + + new TagRenderingOptions({ + question: "Can one buy a new bike here?", + mappings: [ + {k: new Tag("service:bicycle:second_hand", "yes"), txt: "Second-hand bikes are sold here"}, + {k: new Tag("service:bicycle:second_hand", "only"), txt: "All bicycles sold here are second-hand"}, + {k: new Tag("service:bicycle:second_hand", "no"), txt: "Only brand new bikes are sold here"}, + ] + }).OnlyShowIf(this.sellsBikes), + + new TagRenderingOptions({ question: "Does this shop repair bicycles?", mappings: [ - {k: new Tag("service:bicycle:repair", "yes"), txt: "Bikes are repaired here, by the shop owner (for a fee)"}, + {k: this.repairsBikes, txt: "Bikes are repaired here, by the shop owner (for a fee)"}, + {k: new Tag("service:bicycle:repair", "only_sold"), txt: "Only bikes that were bought here, are repaired"}, + {k: new Tag("service:bicycle:repair", "brand"), txt: "Only bikes of a fixed brand are repaired here"}, {k: new Tag("service:bicycle:repair", "no"), txt: "Bikes are not repaired here"}, ] }), + new TagRenderingOptions({ + question: "Can one hire a new bike here?", + mappings: [ + {k: new Tag("service:bicycle:rental", "yes"), txt: "Bikes can be rented here"}, + {k: new Tag("service:bicycle:rental", "no"), txt: "Bikes cannot be rented here"}, + ] + }).OnlyShowIf(this.sellsBikes), + new TagRenderingOptions({ question: "Are there tools here so that one can repair their own bike?", mappings: [