forked from MapComplete/MapComplete
		
	Remove all roaming tagRenderings
This commit is contained in:
		
							parent
							
								
									4153193500
								
							
						
					
					
						commit
						5806848dc8
					
				
					 4 changed files with 48 additions and 10 deletions
				
			
		| 
						 | 
				
			
			@ -62,6 +62,9 @@ export default class TagRenderingConfig {
 | 
			
		|||
        this.render = Translations.T(json.render, context + ".render");
 | 
			
		||||
        this.question = Translations.T(json.question, context + ".question");
 | 
			
		||||
        this.roaming = json.roaming ?? false;
 | 
			
		||||
        if(this.roaming){
 | 
			
		||||
            console.warn("Deprecation notice: roaming renderings will be scrapped.", this.id, context)
 | 
			
		||||
        }
 | 
			
		||||
        const condition = TagUtils.Tag(json.condition ?? {"and": []}, `${context}.condition`);
 | 
			
		||||
        if (this.roaming && conditionIfRoaming !== undefined) {
 | 
			
		||||
            this.condition = new And([condition, conditionIfRoaming]);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -79,16 +79,13 @@
 | 
			
		|||
                ]
 | 
			
		||||
            },
 | 
			
		||||
            "then": {
 | 
			
		||||
                "render": "./assets/layers/bike_cleaning/bike_cleaning_icon.svg",
 | 
			
		||||
                "roaming": true
 | 
			
		||||
            },
 | 
			
		||||
            "badge": true
 | 
			
		||||
                "render": "./assets/layers/bike_cleaning/bike_cleaning_icon.svg"
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    ],
 | 
			
		||||
    "titleIcons": [
 | 
			
		||||
        {
 | 
			
		||||
            "render": "<img src='./assets/layers/bike_cleaning/bike_cleaning_icon.svg'/>",
 | 
			
		||||
            "roaming": true
 | 
			
		||||
            "render": "<img src='./assets/layers/bike_cleaning/bike_cleaning_icon.svg'/>"
 | 
			
		||||
        }
 | 
			
		||||
    ],
 | 
			
		||||
    "tagRenderings": [
 | 
			
		||||
| 
						 | 
				
			
			@ -118,7 +115,6 @@
 | 
			
		|||
                    "then": "The cleaning service has a fee"
 | 
			
		||||
                }
 | 
			
		||||
            ],
 | 
			
		||||
            "roaming": true,
 | 
			
		||||
            "id": "bike_cleaning-service:bicycle:cleaning:charge"
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			@ -146,7 +142,6 @@
 | 
			
		|||
                    "then": "The cleaning service has a fee"
 | 
			
		||||
                }
 | 
			
		||||
            ],
 | 
			
		||||
            "roaming": false,
 | 
			
		||||
            "id": "bike_cleaning-charge"
 | 
			
		||||
        }
 | 
			
		||||
    ],
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -129,8 +129,7 @@
 | 
			
		|||
    "titleIcons": [
 | 
			
		||||
        {
 | 
			
		||||
            "render": "<a href='https://fietsambassade.gent.be/' target='_blank'><img src='./assets/themes/cyclofix/fietsambassade_gent_logo_small.svg'/></a>",
 | 
			
		||||
            "condition": "operator=De Fietsambassade Gent",
 | 
			
		||||
            "roaming": true
 | 
			
		||||
            "condition": "operator=De Fietsambassade Gent"
 | 
			
		||||
        },
 | 
			
		||||
        "defaults"
 | 
			
		||||
    ],
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -174,6 +174,10 @@
 | 
			
		|||
            "condition": "service:bicycle:diy=yes",
 | 
			
		||||
            "render": "<img src='./assets/layers/bike_shop/tools.svg'/>"
 | 
			
		||||
        },
 | 
			
		||||
        {   "condition": "service:bicycle:cleaning=yes",
 | 
			
		||||
 | 
			
		||||
            "render": "<img src='./assets/layers/bike_cleaning/bike_cleaning_icon.svg'/>"
 | 
			
		||||
        },
 | 
			
		||||
        "defaults"
 | 
			
		||||
    ],
 | 
			
		||||
    "description": {
 | 
			
		||||
| 
						 | 
				
			
			@ -659,6 +663,32 @@
 | 
			
		|||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            ]
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
            "question": "How much does it cost to use the cleaning service?",
 | 
			
		||||
            "render": "Using the cleaning service costs {charge}",
 | 
			
		||||
            "freeform": {
 | 
			
		||||
                "key": "service:bicycle:cleaning:charge",
 | 
			
		||||
                "addExtraTags": [
 | 
			
		||||
                    "service:bicycle:cleaning:fee=yes"
 | 
			
		||||
                ]
 | 
			
		||||
            },
 | 
			
		||||
            "mappings": [
 | 
			
		||||
                {
 | 
			
		||||
                    "if": "service:bicycle:cleaning:fee=no&service:bicycle:cleaning:charge=",
 | 
			
		||||
                    "then": "The cleaning service is free to use"
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "if": "service:bicycle:cleaning:fee=no&",
 | 
			
		||||
                    "then": "Free to use",
 | 
			
		||||
                    "hideInAnswer": true
 | 
			
		||||
                },
 | 
			
		||||
                {
 | 
			
		||||
                    "if": "service:bicycle:cleaning:fee=yes",
 | 
			
		||||
                    "then": "The cleaning service has a fee"
 | 
			
		||||
                }
 | 
			
		||||
            ],
 | 
			
		||||
            "id": "bike_cleaning-service:bicycle:cleaning:charge"
 | 
			
		||||
        }
 | 
			
		||||
    ],
 | 
			
		||||
    "presets": [
 | 
			
		||||
| 
						 | 
				
			
			@ -700,6 +730,17 @@
 | 
			
		|||
            "if": "service:bicycle:pump=yes",
 | 
			
		||||
            "then": "circle:#e2783d;./assets/layers/bike_repair_station/pump.svg",
 | 
			
		||||
            "badge": true
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
            "if": {
 | 
			
		||||
                "and": [
 | 
			
		||||
                    "service:bicycle:cleaning~*"
 | 
			
		||||
                ]
 | 
			
		||||
            },
 | 
			
		||||
            "then": {
 | 
			
		||||
                "render": "./assets/layers/bike_cleaning/bike_cleaning_icon.svg"
 | 
			
		||||
            },
 | 
			
		||||
            "badge": true
 | 
			
		||||
        }
 | 
			
		||||
    ],
 | 
			
		||||
    "width": {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue