Merge develop

This commit is contained in:
Pieter Vander Vennet 2024-09-05 17:34:13 +02:00
commit 423618847b
334 changed files with 9307 additions and 6025 deletions

View file

@ -95,7 +95,7 @@ export default class UserRelatedState {
this.showAllQuestionsAtOnce = UIEventSource.asBoolean(
this.osmConnection.GetPreference("show-all-questions", "false", {
documentation:
"Either 'true' or 'false'. If set, all questions will be shown all at once"
"Either 'true' or 'false'. If set, all questions will be shown all at once",
})
)
this.language = this.osmConnection.GetPreference("language")
@ -115,7 +115,7 @@ export default class UserRelatedState {
undefined,
{
documentation:
"The ID of a layer or layer category that MapComplete uses by default"
"The ID of a layer or layer category that MapComplete uses by default",
}
)
@ -123,12 +123,12 @@ export default class UserRelatedState {
"preferences-add-new-mode",
"button_click_right",
{
documentation: "How adding a new feature is done"
documentation: "How adding a new feature is done",
}
)
this.imageLicense = this.osmConnection.GetPreference("pictures-license", "CC0", {
documentation: "The license under which new images are uploaded"
documentation: "The license under which new images are uploaded",
})
this.installedUserThemes = this.InitInstalledUserThemes()
this.translationMode = this.initTranslationMode()
@ -171,7 +171,6 @@ export default class UserRelatedState {
this.language.syncWith(Locale.language)
}
private initTranslationMode(): UIEventSource<"false" | "true" | "mobile" | undefined | string> {
const translationMode: UIEventSource<undefined | "true" | "false" | "mobile" | string> =
this.osmConnection.GetPreference("translation-mode", "false")
@ -191,7 +190,6 @@ export default class UserRelatedState {
}
})
return translationMode
}
private static initUserSettingsState(): LayerConfig {
@ -216,8 +214,8 @@ export default class UserRelatedState {
} catch (e) {
console.warn(
"Removing theme " +
id +
" as it could not be parsed from the preferences; the content is:",
id +
" as it could not be parsed from the preferences; the content is:",
str
)
pref.setData(null)
@ -247,7 +245,7 @@ export default class UserRelatedState {
icon: layout.icon,
title: layout.title.translations,
shortDescription: layout.shortDescription.translations,
definition: layout["definition"]
definition: layout["definition"],
})
)
}
@ -287,13 +285,13 @@ export default class UserRelatedState {
id: "home",
"user:home": "yes",
_lon: homeLonLat[0],
_lat: homeLonLat[1]
_lat: homeLonLat[1],
},
geometry: {
type: "Point",
coordinates: homeLonLat
}
}
coordinates: homeLonLat,
},
},
]
})
return new StaticFeatureSource(feature)
@ -314,7 +312,7 @@ export default class UserRelatedState {
_applicationOpened: new Date().toISOString(),
_supports_sharing:
typeof window === "undefined" ? "no" : window.navigator.share ? "yes" : "no",
_iframe: Utils.isIframe ? "yes" : "no"
_iframe: Utils.isIframe ? "yes" : "no",
})
for (const key in Constants.userJourney) {
@ -367,18 +365,18 @@ export default class UserRelatedState {
const zenLinks: { link: string; id: string }[] = Utils.NoNull([
hasMissingTheme
? {
id: "theme:" + layout.id,
link: LinkToWeblate.hrefToWeblateZen(
language,
"themes",
layout.id
)
}
id: "theme:" + layout.id,
link: LinkToWeblate.hrefToWeblateZen(
language,
"themes",
layout.id
),
}
: undefined,
...missingLayers.map((id) => ({
id: "layer:" + id,
link: LinkToWeblate.hrefToWeblateZen(language, "layers", id)
}))
link: LinkToWeblate.hrefToWeblateZen(language, "layers", id),
})),
])
const untranslated_count = untranslated.length
amendedPrefs.data["_translation_total"] = "" + total