From aaaaf1948d2f78c50913fca5e4e098e3aa71832e Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Wed, 29 Mar 2023 18:54:00 +0200 Subject: [PATCH] refactoring: fix special renderings (partly), deprecate --- Logic/ImageProviders/AllImageProviders.ts | 17 ++- Models/Constants.ts | 2 + Models/ThemeConfig/Conversion/PrepareTheme.ts | 32 +++++- Models/ThemeConfig/Conversion/Validation.ts | 20 ++++ .../ThemeConfig/Conversion/ValidationUtils.ts | 9 +- Models/ThemeConfig/Json/LayoutConfigJson.ts | 8 ++ .../Json/TagRenderingConfigJson.ts | 6 -- Models/ThemeConfig/TagRenderingConfig.ts | 11 -- UI/Popup/ImportButton.ts | 3 + UI/SpecialVisualization.ts | 20 +++- UI/SpecialVisualizations.ts | 1 - .../charging_station/charging_station.json | 100 +++++++++--------- .../charging_station.protojson | 2 +- assets/layers/usersettings/usersettings.json | 12 +-- scripts/generateLayerOverview.ts | 12 +++ 15 files changed, 160 insertions(+), 95 deletions(-) diff --git a/Logic/ImageProviders/AllImageProviders.ts b/Logic/ImageProviders/AllImageProviders.ts index 6099d0ee4..6daabfa60 100644 --- a/Logic/ImageProviders/AllImageProviders.ts +++ b/Logic/ImageProviders/AllImageProviders.ts @@ -1,11 +1,10 @@ -import { Mapillary } from "./Mapillary" -import { WikimediaImageProvider } from "./WikimediaImageProvider" -import { Imgur } from "./Imgur" -import GenericImageProvider from "./GenericImageProvider" -import { Store, UIEventSource } from "../UIEventSource" -import ImageProvider, { ProvidedImage } from "./ImageProvider" -import { WikidataImageProvider } from "./WikidataImageProvider" -import { OsmTags } from "../../Models/OsmFeature" +import { Mapillary } from "./Mapillary"; +import { WikimediaImageProvider } from "./WikimediaImageProvider"; +import { Imgur } from "./Imgur"; +import GenericImageProvider from "./GenericImageProvider"; +import { Store, UIEventSource } from "../UIEventSource"; +import ImageProvider, { ProvidedImage } from "./ImageProvider"; +import { WikidataImageProvider } from "./WikidataImageProvider"; /** * A generic 'from the interwebz' image picker, without attribution @@ -45,7 +44,7 @@ export default class AllImageProviders { UIEventSource >() - public static LoadImagesFor(tags: Store, tagKey?: string[]): Store { + public static LoadImagesFor(tags: Store>, tagKey?: string[]): Store { if (tags.data.id === undefined) { return undefined } diff --git a/Models/Constants.ts b/Models/Constants.ts index 8aeb95f96..6b882285d 100644 --- a/Models/Constants.ts +++ b/Models/Constants.ts @@ -42,6 +42,8 @@ export default class Constants { "split_point", "current_view", "matchpoint", + "import_candidate", + "usersettings", ] as const /** * Layer IDs of layers which have special properties through built-in hooks diff --git a/Models/ThemeConfig/Conversion/PrepareTheme.ts b/Models/ThemeConfig/Conversion/PrepareTheme.ts index 03f6869c6..28f3b30c4 100644 --- a/Models/ThemeConfig/Conversion/PrepareTheme.ts +++ b/Models/ThemeConfig/Conversion/PrepareTheme.ts @@ -322,7 +322,9 @@ export class AddMiniMap extends DesugaringStep { * AddMiniMap.hasMinimap({render: "Some random value {minimap}"}) // => false */ static hasMinimap(renderingConfig: TagRenderingConfigJson): boolean { - return ValidationUtils.getSpecialVisualisations(renderingConfig).indexOf("minimap") >= 0 + return ValidationUtils.getSpecialVisualisations(renderingConfig).some( + (vis) => vis.funcName === "minimap" + ) } convert(layerConfig: LayerConfigJson, context: string): { result: LayerConfigJson } { @@ -344,7 +346,7 @@ export class AddMiniMap extends DesugaringStep { } } -class AddContextToTransltionsInLayout extends DesugaringStep { +class AddContextToTranslationsInLayout extends DesugaringStep { constructor() { super( "Adds context to translations, including the prefix 'themes:json.id'; this is to make sure terms in an 'overrides' or inline layer are linkable too", @@ -644,7 +646,7 @@ export class PrepareTheme extends Fuse { super( "Fully prepares and expands a theme", - new AddContextToTransltionsInLayout(), + new AddContextToTranslationsInLayout(), new PreparePersonalTheme(state), new WarnForUnsubstitutedLayersInTheme(), new On("layers", new Concat(new SubstituteLayer(state))), @@ -663,4 +665,28 @@ export class PrepareTheme extends Fuse { new On("layers", new Each(new AddMiniMap(state))) ) } + + convert( + json: LayoutConfigJson, + context: string + ): { result: LayoutConfigJson; errors: string[]; warnings: string[]; information: string[] } { + const result = super.convert(json, context) + + const needsNodeDatabase = result.result.layers?.some((l: LayerConfigJson) => + l.tagRenderings?.some((tr: TagRenderingConfigJson) => + ValidationUtils.getSpecialVisualisations(tr)?.some( + (special) => special.needsNodeDatabase + ) + ) + ) + if (needsNodeDatabase) { + result.information.push( + context + + ": setting 'enableNodeDatabase' as this theme uses a special visualisation which needs to keep track of _all_ nodes" + ) + result.result.enableNodeDatabase = true + } + + return result + } } diff --git a/Models/ThemeConfig/Conversion/Validation.ts b/Models/ThemeConfig/Conversion/Validation.ts index 17cb85b08..443890639 100644 --- a/Models/ThemeConfig/Conversion/Validation.ts +++ b/Models/ThemeConfig/Conversion/Validation.ts @@ -620,6 +620,15 @@ class MiscTagRenderingChecks extends DesugaringStep { ': detected `special` on the top level. Did you mean `{"render":{ "special": ... }}`' ) } + if (json.group) { + errors.push( + "At " + + context + + ': groups are deprecated, use `"label": ["' + + json.group + + '"]` instead' + ) + } const freeformType = json["freeform"]?.["type"] if (freeformType) { if (Validators.AvailableTypes().indexOf(freeformType) < 0) { @@ -688,6 +697,17 @@ export class ValidateLayer extends DesugaringStep { } } + if (json.source === "special") { + if (!Constants.priviliged_layers.find((x) => x == json.id)) { + errors.push( + context + + ": layer " + + json.id + + " uses 'special' as source.osmTags. However, this layer is not a priviliged layer" + ) + } + } + if (json.tagRenderings !== undefined && json.tagRenderings.length > 0) { if (json.title === undefined) { errors.push( diff --git a/Models/ThemeConfig/Conversion/ValidationUtils.ts b/Models/ThemeConfig/Conversion/ValidationUtils.ts index 37ecbac51..691d3b2ec 100644 --- a/Models/ThemeConfig/Conversion/ValidationUtils.ts +++ b/Models/ThemeConfig/Conversion/ValidationUtils.ts @@ -1,18 +1,21 @@ import { TagRenderingConfigJson } from "../Json/TagRenderingConfigJson" import { Utils } from "../../../Utils" import SpecialVisualizations from "../../../UI/SpecialVisualizations" +import { SpecialVisualization } from "../../../UI/SpecialVisualization" export default class ValidationUtils { /** * Gives all the (function names of) used special visualisations * @param renderingConfig */ - public static getSpecialVisualisations(renderingConfig: TagRenderingConfigJson): string[] { + public static getSpecialVisualisations( + renderingConfig: TagRenderingConfigJson + ): SpecialVisualization[] { const translations: any[] = Utils.NoNull([ renderingConfig.render, ...(renderingConfig.mappings ?? []).map((m) => m.then), ]) - const all: string[] = [] + const all: SpecialVisualization[] = [] for (let translation of translations) { if (typeof translation == "string") { translation = { "*": translation } @@ -27,7 +30,7 @@ export default class ValidationUtils { const parts = SpecialVisualizations.constructSpecification(template) const specials = parts .filter((p) => typeof p !== "string") - .map((special) => special["func"].funcName) + .map((special) => special["func"]) all.push(...specials) } } diff --git a/Models/ThemeConfig/Json/LayoutConfigJson.ts b/Models/ThemeConfig/Json/LayoutConfigJson.ts index 33099a062..39894de83 100644 --- a/Models/ThemeConfig/Json/LayoutConfigJson.ts +++ b/Models/ThemeConfig/Json/LayoutConfigJson.ts @@ -297,4 +297,12 @@ export interface LayoutConfigJson { * Set a different timeout for overpass queries - in seconds. Default: 30s */ overpassTimeout?: number + + /** + * Enables tracking of all nodes when data is loaded. + * This is useful for the 'ImportWay' and 'ConflateWay'-buttons who need this database. + * + * Note: this flag will be automatically set. + */ + enableNodeDatabase?: boolean } diff --git a/Models/ThemeConfig/Json/TagRenderingConfigJson.ts b/Models/ThemeConfig/Json/TagRenderingConfigJson.ts index 9f9a6a9af..96bbb8470 100644 --- a/Models/ThemeConfig/Json/TagRenderingConfigJson.ts +++ b/Models/ThemeConfig/Json/TagRenderingConfigJson.ts @@ -13,12 +13,6 @@ export interface TagRenderingConfigJson { */ id?: string - /** - * If 'group' is defined on many tagRenderings, these are grouped together when shown. The questions are grouped together as well. - * The first tagRendering of a group will always be a sticky element. - */ - group?: string - /** * A list of labels. These are strings that are used for various purposes, e.g. to filter them away */ diff --git a/Models/ThemeConfig/TagRenderingConfig.ts b/Models/ThemeConfig/TagRenderingConfig.ts index 69b75609a..a2f7ab90a 100644 --- a/Models/ThemeConfig/TagRenderingConfig.ts +++ b/Models/ThemeConfig/TagRenderingConfig.ts @@ -43,7 +43,6 @@ export interface Mapping { */ export default class TagRenderingConfig { public readonly id: string - public readonly group: string public readonly render?: TypedTranslation public readonly question?: TypedTranslation public readonly questionhint?: TypedTranslation @@ -77,7 +76,6 @@ export default class TagRenderingConfig { this.question = null this.condition = null this.id = "questions" - this.group = "" return } @@ -115,7 +113,6 @@ export default class TagRenderingConfig { ) } - this.group = json.group ?? "" this.labels = json.labels ?? [] this.render = Translations.T(json.render, translationKey + ".render") this.question = Translations.T(json.question, translationKey + ".question") @@ -684,13 +681,6 @@ export default class TagRenderingConfig { ]) } - let group: BaseUIElement = undefined - if (this.group !== undefined && this.group !== "") { - group = new Combine([ - "This tagrendering is part of group ", - new FixedUiElement(this.group).SetClass("code"), - ]) - } let labels: BaseUIElement = undefined if (this.labels?.length > 0) { labels = new Combine([ @@ -713,7 +703,6 @@ export default class TagRenderingConfig { new Combine(withRender), mappings, condition, - group, labels, ]).SetClass("flex flex-col") } diff --git a/UI/Popup/ImportButton.ts b/UI/Popup/ImportButton.ts index 9f5c0bc36..f72fb5361 100644 --- a/UI/Popup/ImportButton.ts +++ b/UI/Popup/ImportButton.ts @@ -363,6 +363,7 @@ ${Utils.special_visualizations_importRequirementDocs} } export class ConflateButton extends AbstractImportButton { + needsNodeDatabase = true constructor() { super( "conflate_button", @@ -442,6 +443,8 @@ export class ConflateButton extends AbstractImportButton { export class ImportWayButton extends AbstractImportButton implements AutoAction { public readonly supportsAutoAction = true + needsNodeDatabase = true + constructor() { super( "import_way_button", diff --git a/UI/SpecialVisualization.ts b/UI/SpecialVisualization.ts index 728f51d33..690427cdc 100644 --- a/UI/SpecialVisualization.ts +++ b/UI/SpecialVisualization.ts @@ -51,13 +51,23 @@ export interface SpecialVisualizationState { } export interface SpecialVisualization { - funcName: string - docs: string | BaseUIElement - example?: string + readonly funcName: string + readonly docs: string | BaseUIElement + readonly example?: string + + /** + * Indicates that this special visualsiation will make requests to the 'alLNodesDatabase' and that it thus should be included + */ + readonly needsNodeDatabase?: boolean + readonly args: { + name: string + defaultValue?: string + doc: string + required?: false | boolean + }[] + readonly getLayerDependencies?: (argument: string[]) => string[] structuredExamples?(): { feature: Feature>; args: string[] }[] - args: { name: string; defaultValue?: string; doc: string; required?: false | boolean }[] - getLayerDependencies?: (argument: string[]) => string[] constr( state: SpecialVisualizationState, diff --git a/UI/SpecialVisualizations.ts b/UI/SpecialVisualizations.ts index 871d49b2a..386cda60f 100644 --- a/UI/SpecialVisualizations.ts +++ b/UI/SpecialVisualizations.ts @@ -55,7 +55,6 @@ import FeatureReviews from "../Logic/Web/MangroveReviews" import Maproulette from "../Logic/Maproulette" import SvelteUIElement from "./Base/SvelteUIElement" import { BBoxFeatureSourceForLayer } from "../Logic/FeatureSource/Sources/TouchesBboxFeatureSource" -import { Feature } from "geojson" export default class SpecialVisualizations { public static specialVisualizations: SpecialVisualization[] = SpecialVisualizations.initList() diff --git a/assets/layers/charging_station/charging_station.json b/assets/layers/charging_station/charging_station.json index 1c314b931..49ecada1c 100644 --- a/assets/layers/charging_station/charging_station.json +++ b/assets/layers/charging_station/charging_station.json @@ -1591,7 +1591,7 @@ }, { "id": "voltage-0", - "group": "technical", + "label": ["technical"], "question": { "en": "What voltage do the plugs with
Schuko wall plug without ground pin (CEE7/4 type F)
offer?", "nl": "Welke spanning levert de stekker van type
Schuko stekker zonder aardingspin (CEE7/4 type F)
", @@ -1629,7 +1629,7 @@ }, { "id": "current-0", - "group": "technical", + "label": ["technical"], "question": { "en": "What current do the plugs with
Schuko wall plug without ground pin (CEE7/4 type F)
offer?", "nl": "Welke stroom levert de stekker van type
Schuko stekker zonder aardingspin (CEE7/4 type F)
?", @@ -1670,7 +1670,7 @@ }, { "id": "power-output-0", - "group": "technical", + "label": ["technical"], "question": { "en": "What power output does a single plug of type
Schuko wall plug without ground pin (CEE7/4 type F)
offer?", "nl": "Welk vermogen levert een enkele stekker van type
Schuko stekker zonder aardingspin (CEE7/4 type F)
?", @@ -1711,7 +1711,7 @@ }, { "id": "voltage-1", - "group": "technical", + "label": ["technical"], "question": { "en": "What voltage do the plugs with
European wall plug with ground pin (CEE7/4 type E)
offer?", "nl": "Welke spanning levert de stekker van type
Europese stekker met aardingspin (CEE7/4 type E)
", @@ -1749,7 +1749,7 @@ }, { "id": "current-1", - "group": "technical", + "label": ["technical"], "question": { "en": "What current do the plugs with
European wall plug with ground pin (CEE7/4 type E)
offer?", "nl": "Welke stroom levert de stekker van type
Europese stekker met aardingspin (CEE7/4 type E)
?", @@ -1790,7 +1790,7 @@ }, { "id": "power-output-1", - "group": "technical", + "label": ["technical"], "question": { "en": "What power output does a single plug of type
European wall plug with ground pin (CEE7/4 type E)
offer?", "nl": "Welk vermogen levert een enkele stekker van type
Europese stekker met aardingspin (CEE7/4 type E)
?", @@ -1843,7 +1843,7 @@ }, { "id": "voltage-2", - "group": "technical", + "label": ["technical"], "question": { "en": "What voltage do the plugs with
Chademo
offer?", "nl": "Welke spanning levert de stekker van type
Chademo
", @@ -1883,7 +1883,7 @@ }, { "id": "current-2", - "group": "technical", + "label": ["technical"], "question": { "en": "What current do the plugs with
Chademo
offer?", "nl": "Welke stroom levert de stekker van type
Chademo
?", @@ -1923,7 +1923,7 @@ }, { "id": "power-output-2", - "group": "technical", + "label": ["technical"], "question": { "en": "What power output does a single plug of type
Chademo
offer?", "nl": "Welk vermogen levert een enkele stekker van type
Chademo
?", @@ -1961,7 +1961,7 @@ }, { "id": "voltage-3", - "group": "technical", + "label": ["technical"], "question": { "en": "What voltage do the plugs with
Type 1 with cable (J1772)
offer?", "nl": "Welke spanning levert de stekker van type
Type 1 met kabel (J1772)
", @@ -2011,7 +2011,7 @@ }, { "id": "current-3", - "group": "technical", + "label": ["technical"], "question": { "en": "What current do the plugs with
Type 1 with cable (J1772)
offer?", "nl": "Welke stroom levert de stekker van type
Type 1 met kabel (J1772)
?", @@ -2052,7 +2052,7 @@ }, { "id": "power-output-3", - "group": "technical", + "label": ["technical"], "question": { "en": "What power output does a single plug of type
Type 1 with cable (J1772)
offer?", "nl": "Welk vermogen levert een enkele stekker van type
Type 1 met kabel (J1772)
?", @@ -2102,7 +2102,7 @@ }, { "id": "voltage-4", - "group": "technical", + "label": ["technical"], "question": { "en": "What voltage do the plugs with
Type 1 without cable (J1772)
offer?", "nl": "Welke spanning levert de stekker van type
Type 1 zonder kabel (J1772)
", @@ -2152,7 +2152,7 @@ }, { "id": "current-4", - "group": "technical", + "label": ["technical"], "question": { "en": "What current do the plugs with
Type 1 without cable (J1772)
offer?", "nl": "Welke stroom levert de stekker van type
Type 1 zonder kabel (J1772)
?", @@ -2193,7 +2193,7 @@ }, { "id": "power-output-4", - "group": "technical", + "label": ["technical"], "question": { "en": "What power output does a single plug of type
Type 1 without cable (J1772)
offer?", "nl": "Welk vermogen levert een enkele stekker van type
Type 1 zonder kabel (J1772)
?", @@ -2267,7 +2267,7 @@ }, { "id": "voltage-5", - "group": "technical", + "label": ["technical"], "question": { "en": "What voltage do the plugs with
Type 1 CCS (aka Type 1 Combo)
offer?", "nl": "Welke spanning levert de stekker van type
Type 1 CCS (ook gekend als Type 1 Combo)
", @@ -2317,7 +2317,7 @@ }, { "id": "current-5", - "group": "technical", + "label": ["technical"], "question": { "en": "What current do the plugs with
Type 1 CCS (aka Type 1 Combo)
offer?", "nl": "Welke stroom levert de stekker van type
Type 1 CCS (ook gekend als Type 1 Combo)
?", @@ -2371,7 +2371,7 @@ }, { "id": "power-output-5", - "group": "technical", + "label": ["technical"], "question": { "en": "What power output does a single plug of type
Type 1 CCS (aka Type 1 Combo)
offer?", "nl": "Welk vermogen levert een enkele stekker van type
Type 1 CCS (ook gekend als Type 1 Combo)
?", @@ -2445,7 +2445,7 @@ }, { "id": "voltage-6", - "group": "technical", + "label": ["technical"], "question": { "en": "What voltage do the plugs with
Tesla Supercharger
offer?", "nl": "Welke spanning levert de stekker van type
Tesla Supercharger
", @@ -2483,7 +2483,7 @@ }, { "id": "current-6", - "group": "technical", + "label": ["technical"], "question": { "en": "What current do the plugs with
Tesla Supercharger
offer?", "nl": "Welke stroom levert de stekker van type
Tesla Supercharger
?", @@ -2537,7 +2537,7 @@ }, { "id": "power-output-6", - "group": "technical", + "label": ["technical"], "question": { "en": "What power output does a single plug of type
Tesla Supercharger
offer?", "nl": "Welk vermogen levert een enkele stekker van type
Tesla Supercharger
?", @@ -2599,7 +2599,7 @@ }, { "id": "voltage-7", - "group": "technical", + "label": ["technical"], "question": { "en": "What voltage do the plugs with
Type 2 (mennekes)
offer?", "nl": "Welke spanning levert de stekker van type
Type 2 (mennekes)
", @@ -2649,7 +2649,7 @@ }, { "id": "current-7", - "group": "technical", + "label": ["technical"], "question": { "en": "What current do the plugs with
Type 2 (mennekes)
offer?", "nl": "Welke stroom levert de stekker van type
Type 2 (mennekes)
?", @@ -2703,7 +2703,7 @@ }, { "id": "power-output-7", - "group": "technical", + "label": ["technical"], "question": { "en": "What power output does a single plug of type
Type 2 (mennekes)
offer?", "nl": "Welk vermogen levert een enkele stekker van type
Type 2 (mennekes)
?", @@ -2753,7 +2753,7 @@ }, { "id": "voltage-8", - "group": "technical", + "label": ["technical"], "question": { "en": "What voltage do the plugs with
Type 2 CCS (mennekes)
offer?", "nl": "Welke spanning levert de stekker van type
Type 2 CCS (mennekes)
", @@ -2803,7 +2803,7 @@ }, { "id": "current-8", - "group": "technical", + "label": ["technical"], "question": { "en": "What current do the plugs with
Type 2 CCS (mennekes)
offer?", "nl": "Welke stroom levert de stekker van type
Type 2 CCS (mennekes)
?", @@ -2857,7 +2857,7 @@ }, { "id": "power-output-8", - "group": "technical", + "label": ["technical"], "question": { "en": "What power output does a single plug of type
Type 2 CCS (mennekes)
offer?", "nl": "Welk vermogen levert een enkele stekker van type
Type 2 CCS (mennekes)
?", @@ -2895,7 +2895,7 @@ }, { "id": "voltage-9", - "group": "technical", + "label": ["technical"], "question": { "en": "What voltage do the plugs with
Type 2 with cable (mennekes)
offer?", "nl": "Welke spanning levert de stekker van type
Type 2 met kabel (J1772)
", @@ -2945,7 +2945,7 @@ }, { "id": "current-9", - "group": "technical", + "label": ["technical"], "question": { "en": "What current do the plugs with
Type 2 with cable (mennekes)
offer?", "nl": "Welke stroom levert de stekker van type
Type 2 met kabel (J1772)
?", @@ -2998,7 +2998,7 @@ }, { "id": "power-output-9", - "group": "technical", + "label": ["technical"], "question": { "en": "What power output does a single plug of type
Type 2 with cable (mennekes)
offer?", "nl": "Welk vermogen levert een enkele stekker van type
Type 2 met kabel (J1772)
?", @@ -3048,7 +3048,7 @@ }, { "id": "voltage-10", - "group": "technical", + "label": ["technical"], "question": { "en": "What voltage do the plugs with
Tesla Supercharger CCS (a branded Type 2 CSS)
offer?", "nl": "Welke spanning levert de stekker van type
Tesla Supercharger CCS (een type2 CCS met Tesla-logo)
", @@ -3098,7 +3098,7 @@ }, { "id": "current-10", - "group": "technical", + "label": ["technical"], "question": { "en": "What current do the plugs with
Tesla Supercharger CCS (a branded type2_css)
offer?", "nl": "Welke stroom levert de stekker van type
Tesla Supercharger CCS (een type2 CCS met Tesla-logo)
?", @@ -3152,7 +3152,7 @@ }, { "id": "power-output-10", - "group": "technical", + "label": ["technical"], "question": { "en": "What power output does a single plug of type
Tesla Supercharger CCS (a branded Type 2 CSS)
offer?", "nl": "Welk vermogen levert een enkele stekker van type
Tesla Supercharger CCS (een type2 CCS met Tesla-logo)
?", @@ -3190,7 +3190,7 @@ }, { "id": "voltage-11", - "group": "technical", + "label": ["technical"], "question": { "en": "What voltage do the plugs with
Tesla Supercharger (Destination)
offer?", "nl": "Welke spanning levert de stekker van type
Tesla Supercharger (Destination)
", @@ -3228,7 +3228,7 @@ }, { "id": "current-11", - "group": "technical", + "label": ["technical"], "question": { "en": "What current do the plugs with
Tesla Supercharger (Destination)
offer?", "nl": "Welke stroom levert de stekker van type
Tesla Supercharger (Destination)
?", @@ -3284,7 +3284,7 @@ }, { "id": "power-output-11", - "group": "technical", + "label": ["technical"], "question": { "en": "What power output does a single plug of type
Tesla Supercharger (Destination)
offer?", "nl": "Welk vermogen levert een enkele stekker van type
Tesla Supercharger (destination)
?", @@ -3346,7 +3346,7 @@ }, { "id": "voltage-12", - "group": "technical", + "label": ["technical"], "question": { "en": "What voltage do the plugs with
Tesla Supercharger (Destination) (A Type 2 with cable branded as Tesla)
offer?", "nl": "Welke spanning levert de stekker van type
Tesla supercharger (destination). (Een Type 2 met kabel en Tesla-logo)
?", @@ -3396,7 +3396,7 @@ }, { "id": "current-12", - "group": "technical", + "label": ["technical"], "question": { "en": "What current do the plugs with
Tesla Supercharger (Destination) (A Type 2 with cable branded as Tesla)
offer?", "nl": "Welke stroom levert de stekker van type
Tesla Supercharger (Destination) (Een Type 2 met kabel en Tesla-logo)
?", @@ -3449,7 +3449,7 @@ }, { "id": "power-output-12", - "group": "technical", + "label": ["technical"], "question": { "en": "What power output does a single plug of type
Tesla Supercharger (Destination) (A Type 2 with cable branded as Tesla)
offer?", "nl": "Welk vermogen levert een enkele stekker van type
Tesla supercharger (destination) (Een Type 2 met kabel en Tesla-logo)
?", @@ -3499,7 +3499,7 @@ }, { "id": "voltage-13", - "group": "technical", + "label": ["technical"], "question": { "en": "What voltage do the plugs with
USB to charge phones and small electronics
offer?", "nl": "Welke spanning levert de stekker van type
USB om GSMs en kleine electronica op te laden
", @@ -3537,7 +3537,7 @@ }, { "id": "current-13", - "group": "technical", + "label": ["technical"], "question": { "en": "What current do the plugs with
USB to charge phones and small electronics
offer?", "nl": "Welke stroom levert de stekker van type
USB om GSMs en kleine electronica op te laden
?", @@ -3595,7 +3595,7 @@ }, { "id": "power-output-13", - "group": "technical", + "label": ["technical"], "question": { "en": "What power output does a single plug of type
USB to charge phones and small electronics
offer?", "nl": "Welk vermogen levert een enkele stekker van type
USB om GSMs en kleine electronica op te laden
?", @@ -3645,7 +3645,7 @@ }, { "id": "voltage-14", - "group": "technical", + "label": ["technical"], "question": { "en": "What voltage do the plugs with
Bosch Active Connect with 3 pins and cable
offer?", "nl": "Welke spanning levert de stekker van type
Bosch Active Connect met 3 pinnen aan een kabel
", @@ -3670,7 +3670,7 @@ }, { "id": "current-14", - "group": "technical", + "label": ["technical"], "question": { "en": "What current do the plugs with
Bosch Active Connect with 3 pins and cable
offer?", "nl": "Welke stroom levert de stekker van type
Bosch Active Connect met 3 pinnen aan een kabel
?", @@ -3697,7 +3697,7 @@ }, { "id": "power-output-14", - "group": "technical", + "label": ["technical"], "question": { "en": "What power output does a single plug of type
Bosch Active Connect with 3 pins and cable
offer?", "nl": "Welk vermogen levert een enkele stekker van type
Bosch Active Connect met 3 pinnen aan een kabel
?", @@ -3722,7 +3722,7 @@ }, { "id": "voltage-15", - "group": "technical", + "label": ["technical"], "question": { "en": "What voltage do the plugs with
Bosch Active Connect with 5 pins and cable
offer?", "nl": "Welke spanning levert de stekker van type
Bosch Active Connect met 5 pinnen aan een kabel
", @@ -3747,7 +3747,7 @@ }, { "id": "current-15", - "group": "technical", + "label": ["technical"], "question": { "en": "What current do the plugs with
Bosch Active Connect with 5 pins and cable
offer?", "nl": "Welke stroom levert de stekker van type
Bosch Active Connect met 5 pinnen aan een kabel
?", @@ -3774,7 +3774,7 @@ }, { "id": "power-output-15", - "group": "technical", + "label": ["technical"], "question": { "en": "What power output does a single plug of type
Bosch Active Connect with 5 pins and cable
offer?", "nl": "Welk vermogen levert een enkele stekker van type
Bosch Active Connect met 5 pinnen aan een kabel
?", @@ -4476,7 +4476,7 @@ }, { "id": "questions", - "group": "technical", + "label": ["technical"], "render": { "en": "

Technical questions

The questions below are very technical. Feel free to ignore them
{questions}", "nl": "

Technische vragen

De vragen hieronder zijn erg technisch - sla deze over indien je hier geen tijd voor hebt
{questions}", @@ -5065,4 +5065,4 @@ }, "neededChangesets": 10 } -} \ No newline at end of file +} diff --git a/assets/layers/charging_station/charging_station.protojson b/assets/layers/charging_station/charging_station.protojson index 81b9efde3..7b1e54a5a 100644 --- a/assets/layers/charging_station/charging_station.protojson +++ b/assets/layers/charging_station/charging_station.protojson @@ -722,7 +722,7 @@ }, { "id": "questions", - "group": "technical", + "label": ["technical"], "render": { "en": "

Technical questions

The questions below are very technical. Feel free to ignore them
{questions}", "nl": "

Technische vragen

De vragen hieronder zijn erg technisch - sla deze over indien je hier geen tijd voor hebt
{questions}" diff --git a/assets/layers/usersettings/usersettings.json b/assets/layers/usersettings/usersettings.json index ec3ce4e30..7a2d4a4bc 100644 --- a/assets/layers/usersettings/usersettings.json +++ b/assets/layers/usersettings/usersettings.json @@ -90,11 +90,11 @@ }, { "id": "translations-title", - "group": "translations", + "label": ["translations"], "render": "

Translating MapComplete

" }, { - "group": "translations", + "label": ["translations"], "id": "translation-mode", "question": { "en": "Do you want to help translating MapComplete?", @@ -127,7 +127,7 @@ ] }, { - "group": "translations", + "label": ["translations"], "id": "translation-help", "mappings": [ { @@ -153,7 +153,7 @@ ] }, { - "group": "translations", + "label": ["translations"], "id": "translation-completeness", "render": { "ca": "Les traduccions de {_theme} en {_language} tenen un {_translation_percentage}%: {_translation_translated_count} cadenes de {_translation_total} estan traduïdes", @@ -188,7 +188,7 @@ }, { "id": "translation-links", - "group": "translations", + "label": ["translations"], "condition": { "and": [ "_translation_links~*", @@ -318,4 +318,4 @@ } ], "mapRendering": null -} \ No newline at end of file +} diff --git a/scripts/generateLayerOverview.ts b/scripts/generateLayerOverview.ts index ee5bc2188..60dfa549a 100644 --- a/scripts/generateLayerOverview.ts +++ b/scripts/generateLayerOverview.ts @@ -233,6 +233,18 @@ class LayerOverviewUtils { } const doesImageExist = new DoesImageExist(licensePaths, existsSync) const sharedLayers = this.buildLayerIndex(doesImageExist, forceReload) + + const priviliged = new Set(Constants.priviliged_layers) + sharedLayers.forEach((_, key) => { + priviliged.delete(key) + }) + if (priviliged.size > 0) { + throw ( + "Priviliged layer " + + Array.from(priviliged).join(", ") + + " has no definition file, create it at `assets/layers//" + ) + } const recompiledThemes: string[] = [] const sharedThemes = this.buildThemeIndex( licensePaths,