forked from MapComplete/MapComplete
Merge branch 'develop' into feature/android-capacitator
This commit is contained in:
commit
c62705c1dd
5 changed files with 26 additions and 31 deletions
|
@ -117,7 +117,6 @@
|
||||||
"it": "Negozi che accettano i cani",
|
"it": "Negozi che accettano i cani",
|
||||||
"ko": "반려견 친화적 상점"
|
"ko": "반려견 친화적 상점"
|
||||||
},
|
},
|
||||||
|
|
||||||
"pointRendering": [
|
"pointRendering": [
|
||||||
{
|
{
|
||||||
"iconBadges+": [
|
"iconBadges+": [
|
||||||
|
|
|
@ -59,6 +59,21 @@ export default class DetermineTheme {
|
||||||
return layoutConfig
|
return layoutConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static createConversionContext(): DesugaringContext {
|
||||||
|
const knownLayersDict = new Map<string, LayerConfigJson>()
|
||||||
|
for (const key in known_layers["layers"]) {
|
||||||
|
const layer = known_layers["layers"][key]
|
||||||
|
knownLayersDict.set(layer.id, <LayerConfigJson>layer)
|
||||||
|
}
|
||||||
|
const convertState: DesugaringContext = {
|
||||||
|
tagRenderings: DetermineTheme.getSharedTagRenderings(),
|
||||||
|
tagRenderingOrder: DetermineTheme.getSharedTagRenderingOrder(),
|
||||||
|
sharedLayers: knownLayersDict,
|
||||||
|
publicLayers: new Set<string>()
|
||||||
|
}
|
||||||
|
return convertState
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the correct layout for this website
|
* Gets the correct layout for this website
|
||||||
*/
|
*/
|
||||||
|
@ -107,7 +122,8 @@ export default class DetermineTheme {
|
||||||
"./assets/generated/themes/" + id + ".json",
|
"./assets/generated/themes/" + id + ".json",
|
||||||
1000 * 60 * 60 * 60
|
1000 * 60 * 60 * 60
|
||||||
)
|
)
|
||||||
return new ThemeConfig(config, true)
|
const withDefault = new PrepareTheme(this.createConversionContext()).convertStrict(config)
|
||||||
|
return new ThemeConfig(withDefault, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
private static getSharedTagRenderings(): Map<string, QuestionableTagRenderingConfigJson> {
|
private static getSharedTagRenderings(): Map<string, QuestionableTagRenderingConfigJson> {
|
||||||
|
@ -163,22 +179,12 @@ export default class DetermineTheme {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const knownLayersDict = new Map<string, LayerConfigJson>()
|
|
||||||
for (const key in known_layers["layers"]) {
|
|
||||||
const layer = known_layers["layers"][key]
|
|
||||||
knownLayersDict.set(layer.id, <LayerConfigJson>layer)
|
|
||||||
}
|
|
||||||
const convertState: DesugaringContext = {
|
|
||||||
tagRenderings: DetermineTheme.getSharedTagRenderings(),
|
|
||||||
tagRenderingOrder: DetermineTheme.getSharedTagRenderingOrder(),
|
|
||||||
sharedLayers: knownLayersDict,
|
|
||||||
publicLayers: new Set<string>(),
|
|
||||||
}
|
|
||||||
json = new FixLegacyTheme().convertStrict(json)
|
json = new FixLegacyTheme().convertStrict(json)
|
||||||
const raw = json
|
const raw = json
|
||||||
|
|
||||||
json = new FixImages(DetermineTheme._knownImages).convertStrict(json)
|
json = new FixImages(DetermineTheme._knownImages).convertStrict(json)
|
||||||
json.enableNoteImports = json.enableNoteImports ?? false
|
json.enableNoteImports = json.enableNoteImports ?? false
|
||||||
|
const convertState = this.createConversionContext()
|
||||||
json = new PrepareTheme(convertState).convertStrict(json)
|
json = new PrepareTheme(convertState).convertStrict(json)
|
||||||
console.log("The layoutconfig is ", json)
|
console.log("The layoutconfig is ", json)
|
||||||
|
|
||||||
|
|
|
@ -317,6 +317,10 @@ export class OsmPreferences {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Utils.runningFromConsole) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (this._fakeUser) {
|
if (this._fakeUser) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,4 @@
|
||||||
import {
|
import { Concat, Conversion, DesugaringContext, DesugaringStep, Each, Fuse, On, Pass, SetDefault } from "./Conversion"
|
||||||
Concat,
|
|
||||||
Conversion,
|
|
||||||
DesugaringContext,
|
|
||||||
DesugaringStep,
|
|
||||||
Each,
|
|
||||||
Fuse,
|
|
||||||
On,
|
|
||||||
Pass,
|
|
||||||
SetDefault,
|
|
||||||
} from "./Conversion"
|
|
||||||
import { ThemeConfigJson } from "../Json/ThemeConfigJson"
|
import { ThemeConfigJson } from "../Json/ThemeConfigJson"
|
||||||
import { PrepareLayer } from "./PrepareLayer"
|
import { PrepareLayer } from "./PrepareLayer"
|
||||||
import { LayerConfigJson } from "../Json/LayerConfigJson"
|
import { LayerConfigJson } from "../Json/LayerConfigJson"
|
||||||
|
@ -175,7 +165,7 @@ class SubstituteLayer extends Conversion<string | LayerConfigJson, LayerConfigJs
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class AddDefaultLayers extends DesugaringStep<ThemeConfigJson> {
|
export class AddDefaultLayers extends DesugaringStep<ThemeConfigJson> {
|
||||||
private readonly _state: DesugaringContext
|
private readonly _state: DesugaringContext
|
||||||
|
|
||||||
constructor(state: DesugaringContext) {
|
constructor(state: DesugaringContext) {
|
||||||
|
|
|
@ -3,11 +3,7 @@ import { FixedUiElement } from "./Base/FixedUiElement"
|
||||||
import BaseUIElement from "./BaseUIElement"
|
import BaseUIElement from "./BaseUIElement"
|
||||||
import Title from "./Base/Title"
|
import Title from "./Base/Title"
|
||||||
import { default as FeatureTitle } from "./Popup/Title.svelte"
|
import { default as FeatureTitle } from "./Popup/Title.svelte"
|
||||||
import {
|
import { RenderingSpecification, SpecialVisualization, SpecialVisualizationState } from "./SpecialVisualization"
|
||||||
RenderingSpecification,
|
|
||||||
SpecialVisualization,
|
|
||||||
SpecialVisualizationState,
|
|
||||||
} from "./SpecialVisualization"
|
|
||||||
import { HistogramViz } from "./Popup/HistogramViz"
|
import { HistogramViz } from "./Popup/HistogramViz"
|
||||||
import MinimapViz from "./Popup/MinimapViz.svelte"
|
import MinimapViz from "./Popup/MinimapViz.svelte"
|
||||||
import { ShareLinkViz } from "./Popup/ShareLinkViz"
|
import { ShareLinkViz } from "./Popup/ShareLinkViz"
|
||||||
|
@ -453,7 +449,7 @@ export default class SpecialVisualizations {
|
||||||
assignTo: state.userRelatedState.language,
|
assignTo: state.userRelatedState.language,
|
||||||
availableLanguages: languages,
|
availableLanguages: languages,
|
||||||
preferredLanguages: state.osmConnection.userDetails.map(
|
preferredLanguages: state.osmConnection.userDetails.map(
|
||||||
(ud) => ud.languages
|
(ud) => ud?.languages ?? []
|
||||||
),
|
),
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue