refactoring: fix special renderings (partly), deprecate

This commit is contained in:
Pieter Vander Vennet 2023-03-29 18:54:00 +02:00
parent 9b2f92dedc
commit aaaaf1948d
15 changed files with 160 additions and 95 deletions

View file

@ -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<ProvidedImage[]>
>()
public static LoadImagesFor(tags: Store<OsmTags>, tagKey?: string[]): Store<ProvidedImage[]> {
public static LoadImagesFor(tags: Store<Record<string, string>>, tagKey?: string[]): Store<ProvidedImage[]> {
if (tags.data.id === undefined) {
return undefined
}

View file

@ -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

View file

@ -322,7 +322,9 @@ export class AddMiniMap extends DesugaringStep<LayerConfigJson> {
* 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<LayerConfigJson> {
}
}
class AddContextToTransltionsInLayout extends DesugaringStep<LayoutConfigJson> {
class AddContextToTranslationsInLayout extends DesugaringStep<LayoutConfigJson> {
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<LayoutConfigJson> {
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<LayoutConfigJson> {
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
}
}

View file

@ -620,6 +620,15 @@ class MiscTagRenderingChecks extends DesugaringStep<TagRenderingConfigJson> {
': 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<LayerConfigJson> {
}
}
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(

View file

@ -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)
}
}

View file

@ -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
}

View file

@ -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
*/

View file

@ -43,7 +43,6 @@ export interface Mapping {
*/
export default class TagRenderingConfig {
public readonly id: string
public readonly group: string
public readonly render?: TypedTranslation<object>
public readonly question?: TypedTranslation<object>
public readonly questionhint?: TypedTranslation<object>
@ -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")
}

View file

@ -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",

View file

@ -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<Geometry, Record<string, string>>; args: string[] }[]
args: { name: string; defaultValue?: string; doc: string; required?: false | boolean }[]
getLayerDependencies?: (argument: string[]) => string[]
constr(
state: SpecialVisualizationState,

View file

@ -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()

View file

@ -1591,7 +1591,7 @@
},
{
"id": "voltage-0",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What voltage do the plugs with <div style='display: inline-block'><b><b>Schuko wall plug</b> without ground pin (CEE7/4 type F)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/CEE7_4F.svg'/></div> offer?",
"nl": "Welke spanning levert de stekker van type <div style='display: inline-block'><b><b>Schuko stekker</b> zonder aardingspin (CEE7/4 type F)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/CEE7_4F.svg'/></div>",
@ -1629,7 +1629,7 @@
},
{
"id": "current-0",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What current do the plugs with <div style='display: inline-block'><b><b>Schuko wall plug</b> without ground pin (CEE7/4 type F)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/CEE7_4F.svg'/></div> offer?",
"nl": "Welke stroom levert de stekker van type <div style='display: inline-block'><b><b>Schuko stekker</b> zonder aardingspin (CEE7/4 type F)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/CEE7_4F.svg'/></div>?",
@ -1670,7 +1670,7 @@
},
{
"id": "power-output-0",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What power output does a single plug of type <div style='display: inline-block'><b><b>Schuko wall plug</b> without ground pin (CEE7/4 type F)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/CEE7_4F.svg'/></div> offer?",
"nl": "Welk vermogen levert een enkele stekker van type <div style='display: inline-block'><b><b>Schuko stekker</b> zonder aardingspin (CEE7/4 type F)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/CEE7_4F.svg'/></div>?",
@ -1711,7 +1711,7 @@
},
{
"id": "voltage-1",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What voltage do the plugs with <div style='display: inline-block'><b><b>European wall plug</b> with ground pin (CEE7/4 type E)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/TypeE.svg'/></div> offer?",
"nl": "Welke spanning levert de stekker van type <div style='display: inline-block'><b><b>Europese stekker</b> met aardingspin (CEE7/4 type E)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/TypeE.svg'/></div>",
@ -1749,7 +1749,7 @@
},
{
"id": "current-1",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What current do the plugs with <div style='display: inline-block'><b><b>European wall plug</b> with ground pin (CEE7/4 type E)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/TypeE.svg'/></div> offer?",
"nl": "Welke stroom levert de stekker van type <div style='display: inline-block'><b><b>Europese stekker</b> met aardingspin (CEE7/4 type E)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/TypeE.svg'/></div>?",
@ -1790,7 +1790,7 @@
},
{
"id": "power-output-1",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What power output does a single plug of type <div style='display: inline-block'><b><b>European wall plug</b> with ground pin (CEE7/4 type E)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/TypeE.svg'/></div> offer?",
"nl": "Welk vermogen levert een enkele stekker van type <div style='display: inline-block'><b><b>Europese stekker</b> met aardingspin (CEE7/4 type E)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/TypeE.svg'/></div>?",
@ -1843,7 +1843,7 @@
},
{
"id": "voltage-2",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What voltage do the plugs with <div style='display: inline-block'><b><b>Chademo</b></b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Chademo_type4.svg'/></div> offer?",
"nl": "Welke spanning levert de stekker van type <div style='display: inline-block'><b><b>Chademo</b></b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Chademo_type4.svg'/></div>",
@ -1883,7 +1883,7 @@
},
{
"id": "current-2",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What current do the plugs with <div style='display: inline-block'><b><b>Chademo</b></b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Chademo_type4.svg'/></div> offer?",
"nl": "Welke stroom levert de stekker van type <div style='display: inline-block'><b><b>Chademo</b></b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Chademo_type4.svg'/></div>?",
@ -1923,7 +1923,7 @@
},
{
"id": "power-output-2",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What power output does a single plug of type <div style='display: inline-block'><b><b>Chademo</b></b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Chademo_type4.svg'/></div> offer?",
"nl": "Welk vermogen levert een enkele stekker van type <div style='display: inline-block'><b><b>Chademo</b></b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Chademo_type4.svg'/></div>?",
@ -1961,7 +1961,7 @@
},
{
"id": "voltage-3",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What voltage do the plugs with <div style='display: inline-block'><b><b>Type 1 with cable</b> (J1772)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type1_J1772.svg'/></div> offer?",
"nl": "Welke spanning levert de stekker van type <div style='display: inline-block'><b><b>Type 1 met kabel</b> (J1772)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type1_J1772.svg'/></div>",
@ -2011,7 +2011,7 @@
},
{
"id": "current-3",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What current do the plugs with <div style='display: inline-block'><b><b>Type 1 with cable</b> (J1772)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type1_J1772.svg'/></div> offer?",
"nl": "Welke stroom levert de stekker van type <div style='display: inline-block'><b><b>Type 1 met kabel</b> (J1772)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type1_J1772.svg'/></div>?",
@ -2052,7 +2052,7 @@
},
{
"id": "power-output-3",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What power output does a single plug of type <div style='display: inline-block'><b><b>Type 1 with cable</b> (J1772)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type1_J1772.svg'/></div> offer?",
"nl": "Welk vermogen levert een enkele stekker van type <div style='display: inline-block'><b><b>Type 1 met kabel</b> (J1772)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type1_J1772.svg'/></div>?",
@ -2102,7 +2102,7 @@
},
{
"id": "voltage-4",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What voltage do the plugs with <div style='display: inline-block'><b><b>Type 1 <i>without</i> cable</b> (J1772)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type1_J1772.svg'/></div> offer?",
"nl": "Welke spanning levert de stekker van type <div style='display: inline-block'><b><b>Type 1 <i>zonder</i> kabel</b> (J1772)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type1_J1772.svg'/></div>",
@ -2152,7 +2152,7 @@
},
{
"id": "current-4",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What current do the plugs with <div style='display: inline-block'><b><b>Type 1 <i>without</i> cable</b> (J1772)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type1_J1772.svg'/></div> offer?",
"nl": "Welke stroom levert de stekker van type <div style='display: inline-block'><b><b>Type 1 <i>zonder</i> kabel</b> (J1772)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type1_J1772.svg'/></div>?",
@ -2193,7 +2193,7 @@
},
{
"id": "power-output-4",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What power output does a single plug of type <div style='display: inline-block'><b><b>Type 1 <i>without</i> cable</b> (J1772)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type1_J1772.svg'/></div> offer?",
"nl": "Welk vermogen levert een enkele stekker van type <div style='display: inline-block'><b><b>Type 1 <i>zonder</i> kabel</b> (J1772)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type1_J1772.svg'/></div>?",
@ -2267,7 +2267,7 @@
},
{
"id": "voltage-5",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What voltage do the plugs with <div style='display: inline-block'><b><b>Type 1 CCS</b> (aka Type 1 Combo)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type1-ccs.svg'/></div> offer?",
"nl": "Welke spanning levert de stekker van type <div style='display: inline-block'><b><b>Type 1 CCS</b> (ook gekend als Type 1 Combo)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type1-ccs.svg'/></div>",
@ -2317,7 +2317,7 @@
},
{
"id": "current-5",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What current do the plugs with <div style='display: inline-block'><b><b>Type 1 CCS</b> (aka Type 1 Combo)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type1-ccs.svg'/></div> offer?",
"nl": "Welke stroom levert de stekker van type <div style='display: inline-block'><b><b>Type 1 CCS</b> (ook gekend als Type 1 Combo)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type1-ccs.svg'/></div>?",
@ -2371,7 +2371,7 @@
},
{
"id": "power-output-5",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What power output does a single plug of type <div style='display: inline-block'><b><b>Type 1 CCS</b> (aka Type 1 Combo)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type1-ccs.svg'/></div> offer?",
"nl": "Welk vermogen levert een enkele stekker van type <div style='display: inline-block'><b><b>Type 1 CCS</b> (ook gekend als Type 1 Combo)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type1-ccs.svg'/></div>?",
@ -2445,7 +2445,7 @@
},
{
"id": "voltage-6",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What voltage do the plugs with <div style='display: inline-block'><b><b>Tesla Supercharger</b></b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Tesla-hpwc-model-s.svg'/></div> offer?",
"nl": "Welke spanning levert de stekker van type <div style='display: inline-block'><b><b>Tesla Supercharger</b></b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Tesla-hpwc-model-s.svg'/></div>",
@ -2483,7 +2483,7 @@
},
{
"id": "current-6",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What current do the plugs with <div style='display: inline-block'><b><b>Tesla Supercharger</b></b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Tesla-hpwc-model-s.svg'/></div> offer?",
"nl": "Welke stroom levert de stekker van type <div style='display: inline-block'><b><b>Tesla Supercharger</b></b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Tesla-hpwc-model-s.svg'/></div>?",
@ -2537,7 +2537,7 @@
},
{
"id": "power-output-6",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What power output does a single plug of type <div style='display: inline-block'><b><b>Tesla Supercharger</b></b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Tesla-hpwc-model-s.svg'/></div> offer?",
"nl": "Welk vermogen levert een enkele stekker van type <div style='display: inline-block'><b><b>Tesla Supercharger</b></b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Tesla-hpwc-model-s.svg'/></div>?",
@ -2599,7 +2599,7 @@
},
{
"id": "voltage-7",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What voltage do the plugs with <div style='display: inline-block'><b><b>Type 2</b> (mennekes)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type2_socket.svg'/></div> offer?",
"nl": "Welke spanning levert de stekker van type <div style='display: inline-block'><b><b>Type 2</b> (mennekes)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type2_socket.svg'/></div>",
@ -2649,7 +2649,7 @@
},
{
"id": "current-7",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What current do the plugs with <div style='display: inline-block'><b><b>Type 2</b> (mennekes)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type2_socket.svg'/></div> offer?",
"nl": "Welke stroom levert de stekker van type <div style='display: inline-block'><b><b>Type 2</b> (mennekes)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type2_socket.svg'/></div>?",
@ -2703,7 +2703,7 @@
},
{
"id": "power-output-7",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What power output does a single plug of type <div style='display: inline-block'><b><b>Type 2</b> (mennekes)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type2_socket.svg'/></div> offer?",
"nl": "Welk vermogen levert een enkele stekker van type <div style='display: inline-block'><b><b>Type 2</b> (mennekes)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type2_socket.svg'/></div>?",
@ -2753,7 +2753,7 @@
},
{
"id": "voltage-8",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What voltage do the plugs with <div style='display: inline-block'><b><b>Type 2 CCS</b> (mennekes)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type2_CCS.svg'/></div> offer?",
"nl": "Welke spanning levert de stekker van type <div style='display: inline-block'><b><b>Type 2 CCS</b> (mennekes)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type2_CCS.svg'/></div>",
@ -2803,7 +2803,7 @@
},
{
"id": "current-8",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What current do the plugs with <div style='display: inline-block'><b><b>Type 2 CCS</b> (mennekes)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type2_CCS.svg'/></div> offer?",
"nl": "Welke stroom levert de stekker van type <div style='display: inline-block'><b><b>Type 2 CCS</b> (mennekes)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type2_CCS.svg'/></div>?",
@ -2857,7 +2857,7 @@
},
{
"id": "power-output-8",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What power output does a single plug of type <div style='display: inline-block'><b><b>Type 2 CCS</b> (mennekes)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type2_CCS.svg'/></div> offer?",
"nl": "Welk vermogen levert een enkele stekker van type <div style='display: inline-block'><b><b>Type 2 CCS</b> (mennekes)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type2_CCS.svg'/></div>?",
@ -2895,7 +2895,7 @@
},
{
"id": "voltage-9",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What voltage do the plugs with <div style='display: inline-block'><b><b>Type 2 with cable</b> (mennekes)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type2_tethered.svg'/></div> offer?",
"nl": "Welke spanning levert de stekker van type <div style='display: inline-block'><b><b>Type 2 met kabel</b> (J1772)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type2_tethered.svg'/></div>",
@ -2945,7 +2945,7 @@
},
{
"id": "current-9",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What current do the plugs with <div style='display: inline-block'><b><b>Type 2 with cable</b> (mennekes)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type2_tethered.svg'/></div> offer?",
"nl": "Welke stroom levert de stekker van type <div style='display: inline-block'><b><b>Type 2 met kabel</b> (J1772)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type2_tethered.svg'/></div>?",
@ -2998,7 +2998,7 @@
},
{
"id": "power-output-9",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What power output does a single plug of type <div style='display: inline-block'><b><b>Type 2 with cable</b> (mennekes)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type2_tethered.svg'/></div> offer?",
"nl": "Welk vermogen levert een enkele stekker van type <div style='display: inline-block'><b><b>Type 2 met kabel</b> (J1772)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type2_tethered.svg'/></div>?",
@ -3048,7 +3048,7 @@
},
{
"id": "voltage-10",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What voltage do the plugs with <div style='display: inline-block'><b><b>Tesla Supercharger CCS</b> (a branded Type 2 CSS)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type2_CCS.svg'/></div> offer?",
"nl": "Welke spanning levert de stekker van type <div style='display: inline-block'><b><b>Tesla Supercharger CCS</b> (een type2 CCS met Tesla-logo)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type2_CCS.svg'/></div>",
@ -3098,7 +3098,7 @@
},
{
"id": "current-10",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What current do the plugs with <div style='display: inline-block'><b><b>Tesla Supercharger CCS</b> (a branded type2_css)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type2_CCS.svg'/></div> offer?",
"nl": "Welke stroom levert de stekker van type <div style='display: inline-block'><b><b>Tesla Supercharger CCS</b> (een type2 CCS met Tesla-logo)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type2_CCS.svg'/></div>?",
@ -3152,7 +3152,7 @@
},
{
"id": "power-output-10",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What power output does a single plug of type <div style='display: inline-block'><b><b>Tesla Supercharger CCS</b> (a branded Type 2 CSS)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type2_CCS.svg'/></div> offer?",
"nl": "Welk vermogen levert een enkele stekker van type <div style='display: inline-block'><b><b>Tesla Supercharger CCS</b> (een type2 CCS met Tesla-logo)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type2_CCS.svg'/></div>?",
@ -3190,7 +3190,7 @@
},
{
"id": "voltage-11",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What voltage do the plugs with <div style='display: inline-block'><b><b>Tesla Supercharger (Destination)</b></b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Tesla-hpwc-model-s.svg'/></div> offer?",
"nl": "Welke spanning levert de stekker van type <div style='display: inline-block'><b><b>Tesla Supercharger (Destination)</b></b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Tesla-hpwc-model-s.svg'/></div>",
@ -3228,7 +3228,7 @@
},
{
"id": "current-11",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What current do the plugs with <div style='display: inline-block'><b><b>Tesla Supercharger (Destination)</b></b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Tesla-hpwc-model-s.svg'/></div> offer?",
"nl": "Welke stroom levert de stekker van type <div style='display: inline-block'><b><b>Tesla Supercharger (Destination)</b></b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Tesla-hpwc-model-s.svg'/></div>?",
@ -3284,7 +3284,7 @@
},
{
"id": "power-output-11",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What power output does a single plug of type <div style='display: inline-block'><b><b>Tesla Supercharger (Destination)</b></b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Tesla-hpwc-model-s.svg'/></div> offer?",
"nl": "Welk vermogen levert een enkele stekker van type <div style='display: inline-block'><b><b>Tesla Supercharger (destination)</b></b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Tesla-hpwc-model-s.svg'/></div>?",
@ -3346,7 +3346,7 @@
},
{
"id": "voltage-12",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What voltage do the plugs with <div style='display: inline-block'><b><b>Tesla Supercharger (Destination)</b> (A Type 2 with cable branded as Tesla)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type2_tethered.svg'/></div> offer?",
"nl": "Welke spanning levert de stekker van type <div style='display: inline-block'><b><b>Tesla supercharger (destination).</b> (Een Type 2 met kabel en Tesla-logo)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type2_tethered.svg'/></div>?",
@ -3396,7 +3396,7 @@
},
{
"id": "current-12",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What current do the plugs with <div style='display: inline-block'><b><b>Tesla Supercharger (Destination)</b> (A Type 2 with cable branded as Tesla)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type2_tethered.svg'/></div> offer?",
"nl": "Welke stroom levert de stekker van type <div style='display: inline-block'><b><b>Tesla Supercharger (Destination)</b> (Een Type 2 met kabel en Tesla-logo)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type2_tethered.svg'/></div>?",
@ -3449,7 +3449,7 @@
},
{
"id": "power-output-12",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What power output does a single plug of type <div style='display: inline-block'><b><b>Tesla Supercharger (Destination)</b> (A Type 2 with cable branded as Tesla)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type2_tethered.svg'/></div> offer?",
"nl": "Welk vermogen levert een enkele stekker van type <div style='display: inline-block'><b><b>Tesla supercharger (destination)</b> (Een Type 2 met kabel en Tesla-logo)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/Type2_tethered.svg'/></div>?",
@ -3499,7 +3499,7 @@
},
{
"id": "voltage-13",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What voltage do the plugs with <div style='display: inline-block'><b><b>USB</b> to charge phones and small electronics</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/usb_port.svg'/></div> offer?",
"nl": "Welke spanning levert de stekker van type <div style='display: inline-block'><b><b>USB</b> om GSMs en kleine electronica op te laden</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/usb_port.svg'/></div>",
@ -3537,7 +3537,7 @@
},
{
"id": "current-13",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What current do the plugs with <div style='display: inline-block'><b><b>USB</b> to charge phones and small electronics</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/usb_port.svg'/></div> offer?",
"nl": "Welke stroom levert de stekker van type <div style='display: inline-block'><b><b>USB</b> om GSMs en kleine electronica op te laden</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/usb_port.svg'/></div>?",
@ -3595,7 +3595,7 @@
},
{
"id": "power-output-13",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What power output does a single plug of type <div style='display: inline-block'><b><b>USB</b> to charge phones and small electronics</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/usb_port.svg'/></div> offer?",
"nl": "Welk vermogen levert een enkele stekker van type <div style='display: inline-block'><b><b>USB</b> om GSMs en kleine electronica op te laden</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/usb_port.svg'/></div>?",
@ -3645,7 +3645,7 @@
},
{
"id": "voltage-14",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What voltage do the plugs with <div style='display: inline-block'><b><b>Bosch Active Connect with 3 pins</b> and cable</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/bosch-3pin.svg'/></div> offer?",
"nl": "Welke spanning levert de stekker van type <div style='display: inline-block'><b><b>Bosch Active Connect met 3 pinnen</b> aan een kabel</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/bosch-3pin.svg'/></div>",
@ -3670,7 +3670,7 @@
},
{
"id": "current-14",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What current do the plugs with <div style='display: inline-block'><b><b>Bosch Active Connect with 3 pins</b> and cable</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/bosch-3pin.svg'/></div> offer?",
"nl": "Welke stroom levert de stekker van type <div style='display: inline-block'><b><b>Bosch Active Connect met 3 pinnen</b> aan een kabel</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/bosch-3pin.svg'/></div>?",
@ -3697,7 +3697,7 @@
},
{
"id": "power-output-14",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What power output does a single plug of type <div style='display: inline-block'><b><b>Bosch Active Connect with 3 pins</b> and cable</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/bosch-3pin.svg'/></div> offer?",
"nl": "Welk vermogen levert een enkele stekker van type <div style='display: inline-block'><b><b>Bosch Active Connect met 3 pinnen</b> aan een kabel</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/bosch-3pin.svg'/></div>?",
@ -3722,7 +3722,7 @@
},
{
"id": "voltage-15",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What voltage do the plugs with <div style='display: inline-block'><b><b>Bosch Active Connect with 5 pins</b> and cable</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/bosch-5pin.svg'/></div> offer?",
"nl": "Welke spanning levert de stekker van type <div style='display: inline-block'><b><b>Bosch Active Connect met 5 pinnen</b> aan een kabel</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/bosch-5pin.svg'/></div>",
@ -3747,7 +3747,7 @@
},
{
"id": "current-15",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What current do the plugs with <div style='display: inline-block'><b><b>Bosch Active Connect with 5 pins</b> and cable</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/bosch-5pin.svg'/></div> offer?",
"nl": "Welke stroom levert de stekker van type <div style='display: inline-block'><b><b>Bosch Active Connect met 5 pinnen</b> aan een kabel</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/bosch-5pin.svg'/></div>?",
@ -3774,7 +3774,7 @@
},
{
"id": "power-output-15",
"group": "technical",
"label": ["technical"],
"question": {
"en": "What power output does a single plug of type <div style='display: inline-block'><b><b>Bosch Active Connect with 5 pins</b> and cable</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/bosch-5pin.svg'/></div> offer?",
"nl": "Welk vermogen levert een enkele stekker van type <div style='display: inline-block'><b><b>Bosch Active Connect met 5 pinnen</b> aan een kabel</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/bosch-5pin.svg'/></div>?",
@ -4476,7 +4476,7 @@
},
{
"id": "questions",
"group": "technical",
"label": ["technical"],
"render": {
"en": "<h3>Technical questions</h3>The questions below are very technical. Feel free to ignore them<br/>{questions}",
"nl": "<h3>Technische vragen</h3>De vragen hieronder zijn erg technisch - sla deze over indien je hier geen tijd voor hebt<br/>{questions}",
@ -5065,4 +5065,4 @@
},
"neededChangesets": 10
}
}
}

View file

@ -722,7 +722,7 @@
},
{
"id": "questions",
"group": "technical",
"label": ["technical"],
"render": {
"en": "<h3>Technical questions</h3>The questions below are very technical. Feel free to ignore them<br/>{questions}",
"nl": "<h3>Technische vragen</h3>De vragen hieronder zijn erg technisch - sla deze over indien je hier geen tijd voor hebt<br/>{questions}"

View file

@ -90,11 +90,11 @@
},
{
"id": "translations-title",
"group": "translations",
"label": ["translations"],
"render": "<h3>Translating MapComplete</h3>"
},
{
"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
}
}

View file

@ -233,6 +233,18 @@ class LayerOverviewUtils {
}
const doesImageExist = new DoesImageExist(licensePaths, existsSync)
const sharedLayers = this.buildLayerIndex(doesImageExist, forceReload)
const priviliged = new Set<string>(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/<layername>/<layername.json>"
)
}
const recompiledThemes: string[] = []
const sharedThemes = this.buildThemeIndex(
licensePaths,