forked from MapComplete/MapComplete
		
	Merge master
This commit is contained in:
		
						commit
						be95ad58f8
					
				
					 101 changed files with 6900 additions and 8378 deletions
				
			
		|  | @ -2,7 +2,7 @@ import {Utils} from "../Utils"; | |||
| 
 | ||||
| export default class Constants { | ||||
| 
 | ||||
|     public static vNumber = "0.10.0-alpha-1"; | ||||
|     public static vNumber = "0.10.0-alpha-2"; | ||||
|     public static ImgurApiKey = '7070e7167f0a25a' | ||||
| 
 | ||||
|     // The user journey states thresholds when a new feature gets unlocked
 | ||||
|  |  | |||
|  | @ -5,6 +5,13 @@ import {AndOrTagConfigJson} from "./TagConfigJson"; | |||
|  * If the desired tags are missing and a question is defined, a question will be shown instead. | ||||
|  */ | ||||
| export interface TagRenderingConfigJson { | ||||
| 
 | ||||
|     /** | ||||
|      * The id of the tagrendering, should be an unique string. | ||||
|      * Used to keep the translations in sync. Only used in the tagRenderings-array of a layerConfig, not requered otherwise | ||||
|      */ | ||||
|     id?: string, | ||||
|      | ||||
|     /** | ||||
|      * Renders this value. Note that "{key}"-parts are substituted by the corresponding values of the element. | ||||
|      * If neither 'textFieldQuestion' nor 'mappings' are defined, this text is simply shown as default value. | ||||
|  |  | |||
|  | @ -291,7 +291,14 @@ export default class LayerConfig { | |||
|         } | ||||
| 
 | ||||
|         this.tagRenderings = trs(json.tagRenderings, false); | ||||
|          | ||||
|        const missingIds = json.tagRenderings?.filter(tr => typeof tr !== "string" && tr["builtin"] === undefined && tr["id"] === undefined) ?? []; | ||||
| 
 | ||||
|        if(missingIds.length > 0 && official){ | ||||
|            console.error("Some tagRenderings of", this.id, "are missing an id:", missingIds) | ||||
|            throw "Missing ids in tagrenderings" | ||||
|        } | ||||
|         | ||||
|         this.filters = (json.filter ?? []).map((option, i) => { | ||||
|             return new FilterConfig(option, `${context}.filter-[${i}]`) | ||||
|         }); | ||||
|  |  | |||
|  | @ -13,6 +13,7 @@ import {Utils} from "../../Utils"; | |||
|  */ | ||||
| export default class TagRenderingConfig { | ||||
| 
 | ||||
|     readonly id: string; | ||||
|     readonly render?: Translation; | ||||
|     readonly question?: Translation; | ||||
|     readonly condition?: TagsFilter; | ||||
|  | @ -56,6 +57,8 @@ export default class TagRenderingConfig { | |||
|             return; | ||||
|         } | ||||
| 
 | ||||
|          | ||||
|         this.id = json.id ?? ""; | ||||
|         this.render = Translations.T(json.render, context + ".render"); | ||||
|         this.question = Translations.T(json.question, context + ".question"); | ||||
|         this.roaming = json.roaming ?? false; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue