From 0a73b28ee120e34a104f88fb2fd0342f8d7f7d29 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Fri, 12 Apr 2024 15:37:10 +0200 Subject: [PATCH] Chore: fix linting errors, obsolete console.logs and typos --- src/Logic/SimpleMetaTagger.ts | 2 +- src/UI/Popup/Notes/AddNoteComment.svelte | 2 +- src/UI/Popup/Notes/NoteCommentElement.ts | 6 +++--- src/UI/Popup/TagApplyButton.ts | 9 +-------- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/Logic/SimpleMetaTagger.ts b/src/Logic/SimpleMetaTagger.ts index 25a5e2b30..90dd0b9a9 100644 --- a/src/Logic/SimpleMetaTagger.ts +++ b/src/Logic/SimpleMetaTagger.ts @@ -84,7 +84,7 @@ export class ReferencingWaysMetaTagger extends SimpleMetaTagger { super({ keys: ["_referencing_ways"], isLazy: true, - doc: "_referencing_ways contains - for a node - which ways use this this node as point in their geometry. ", + doc: "_referencing_ways contains - for a node - which ways use this node as point in their geometry. ", }) } diff --git a/src/UI/Popup/Notes/AddNoteComment.svelte b/src/UI/Popup/Notes/AddNoteComment.svelte index 3f25c8c4a..1cd579c14 100644 --- a/src/UI/Popup/Notes/AddNoteComment.svelte +++ b/src/UI/Popup/Notes/AddNoteComment.svelte @@ -17,7 +17,7 @@ id = $tags.id } - let txt = new UIEventSource(undefined) + let txt: UIEventSource = new UIEventSource(undefined) let _txt: string = undefined txt.addCallbackD((t) => { _txt = t diff --git a/src/UI/Popup/Notes/NoteCommentElement.ts b/src/UI/Popup/Notes/NoteCommentElement.ts index 17de2d8ef..c6d84e0b5 100644 --- a/src/UI/Popup/Notes/NoteCommentElement.ts +++ b/src/UI/Popup/Notes/NoteCommentElement.ts @@ -49,13 +49,13 @@ export default class NoteCommentElement extends Combine { user = new Link(comment.user, comment.user_url ?? "", true) } - let userinfo = Stores.FromPromise( + const userinfo = Stores.FromPromise( Utils.downloadJsonCached( "https://api.openstreetmap.org/api/0.6/user/" + comment.uid, 24 * 60 * 60 * 1000 ) ) - let userImg = new VariableUiElement( + const userImg = new VariableUiElement( userinfo.map((userinfo) => { const href = userinfo?.user?.img?.href if (href !== undefined) { @@ -123,7 +123,7 @@ export default class NoteCommentElement extends Combine { const comments: any[] = JSON.parse(tags.data["comments"]) const username = state.osmConnection.userDetails.data.name - var urlRegex = /(https?:\/\/[^\s]+)/g + const urlRegex = /(https?:\/\/[^\s]+)/g const html = txt.replace(urlRegex, function (url) { return '' + url + "" }) diff --git a/src/UI/Popup/TagApplyButton.ts b/src/UI/Popup/TagApplyButton.ts index 37b6982c5..273f4a646 100644 --- a/src/UI/Popup/TagApplyButton.ts +++ b/src/UI/Popup/TagApplyButton.ts @@ -11,16 +11,11 @@ import { And } from "../../Logic/Tags/And" import Toggle from "../Input/Toggle" import { Utils } from "../../Utils" import { Tag } from "../../Logic/Tags/Tag" -import LayoutConfig from "../../Models/ThemeConfig/LayoutConfig" -import { Changes } from "../../Logic/Osm/Changes" import { SpecialVisualization, SpecialVisualizationState } from "../SpecialVisualization" -import { IndexedFeatureSource } from "../../Logic/FeatureSource/FeatureSource" import { Feature } from "geojson" -import LayerConfig from "../../Models/ThemeConfig/LayerConfig" import Maproulette from "../../Logic/Maproulette" import SvelteUIElement from "../Base/SvelteUIElement" import Icon from "../Map/Icon.svelte" -import { Map } from "maplibre-gl" export default class TagApplyButton implements AutoAction, SpecialVisualization { public readonly funcName = "tag_apply" @@ -177,7 +172,6 @@ export default class TagApplyButton implements AutoAction, SpecialVisualization tags: UIEventSource>, args: string[], feature: Feature, - _: LayerConfig ): BaseUIElement { const tagsToApply = TagApplyButton.generateTagsToApply(args[0], tags) const msg = args[1] @@ -200,7 +194,6 @@ export default class TagApplyButton implements AutoAction, SpecialVisualization return el }) ).SetClass("subtle") - const self = this const applied = new UIEventSource( tags?.data?.["mr_taskStatus"] !== undefined && tags?.data?.["mr_taskStatus"] !== "Created" @@ -210,7 +203,7 @@ export default class TagApplyButton implements AutoAction, SpecialVisualization new Combine([msg, tagsExplanation]).SetClass("flex flex-col") ).onClick(async () => { applied.setData(true) - await self.applyActionOn(feature, state, tags, args) + await this.applyActionOn(feature, state, tags, args) }) return new Toggle(