Add documentation

This commit is contained in:
Pieter Vander Vennet 2024-07-09 10:54:41 +02:00
parent 1629cddaf1
commit fe57e12881
5 changed files with 8 additions and 4 deletions

View file

@ -488,9 +488,7 @@ export class OsmConnection {
public addCommentToNote(id: number | string, text: string): Promise<void> { public addCommentToNote(id: number | string, text: string): Promise<void> {
if (this._dryRun.data) { if (this._dryRun.data) {
console.warn("Dryrun enabled - not actually adding comment ", text, "to note ", id) console.warn("Dryrun enabled - not actually adding comment ", text, "to note ", id)
return new Promise((ok) => { return Utils.waitFor(1000)
ok()
})
} }
if ((text ?? "") === "") { if ((text ?? "") === "") {
throw "Invalid text!" throw "Invalid text!"

View file

@ -186,6 +186,8 @@ export default class NameSuggestionIndex {
alsoShowIf: undefined, alsoShowIf: undefined,
icon, icon,
iconClass: "medium", iconClass: "medium",
// The 'frequency' is already for the country of the object we are working with
// As such, it should be "true" but this is not supported
priorityIf: frequency > 0 ? new RegexTag("id", /.*/) : undefined, priorityIf: frequency > 0 ? new RegexTag("id", /.*/) : undefined,
searchTerms: { "*": [nsiItem.displayName, nsiItem.id] }, searchTerms: { "*": [nsiItem.displayName, nsiItem.id] },
}) })

View file

@ -943,6 +943,7 @@ export class TagRenderingConfigUtils {
return config return config
} }
const clone: TagRenderingConfig = Object.create(config) const clone: TagRenderingConfig = Object.create(config)
// The original mappings get "priorityIf" set
const oldMappingsCloned = const oldMappingsCloned =
clone.mappings?.map((m) => ({ clone.mappings?.map((m) => ({
...m, ...m,

View file

@ -53,10 +53,10 @@
async function closeNote() { async function closeNote() {
isProcessing.set(true) isProcessing.set(true)
await state.osmConnection.closeNote(id, txt.data) await state.osmConnection.closeNote(id, txt.data)
isProcessing.set(false)
tags.data["closed_at"] = new Date().toISOString() tags.data["closed_at"] = new Date().toISOString()
NoteCommentElement.addCommentTo(txt.data, tags, state) NoteCommentElement.addCommentTo(txt.data, tags, state)
tags.ping() tags.ping()
isProcessing.set(false)
} }

View file

@ -16,6 +16,9 @@ export default class Translations {
throw "Translations is static. If you want to intitialize a new translation, use the singular form" throw "Translations is static. If you want to intitialize a new translation, use the singular form"
} }
/**
* @deprecated
*/
public static W(s: string | number | boolean | BaseUIElement): BaseUIElement { public static W(s: string | number | boolean | BaseUIElement): BaseUIElement {
if (typeof s === "string") { if (typeof s === "string") {
return new FixedUiElement(s) return new FixedUiElement(s)