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> {
if (this._dryRun.data) {
console.warn("Dryrun enabled - not actually adding comment ", text, "to note ", id)
return new Promise((ok) => {
ok()
})
return Utils.waitFor(1000)
}
if ((text ?? "") === "") {
throw "Invalid text!"

View file

@ -186,6 +186,8 @@ export default class NameSuggestionIndex {
alsoShowIf: undefined,
icon,
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,
searchTerms: { "*": [nsiItem.displayName, nsiItem.id] },
})

View file

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

View file

@ -53,10 +53,10 @@
async function closeNote() {
isProcessing.set(true)
await state.osmConnection.closeNote(id, txt.data)
isProcessing.set(false)
tags.data["closed_at"] = new Date().toISOString()
NoteCommentElement.addCommentTo(txt.data, tags, state)
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"
}
/**
* @deprecated
*/
public static W(s: string | number | boolean | BaseUIElement): BaseUIElement {
if (typeof s === "string") {
return new FixedUiElement(s)