forked from MapComplete/MapComplete
Chore: Remove unused variables
This commit is contained in:
parent
1a415f4815
commit
e68b31e267
42 changed files with 48 additions and 106 deletions
|
|
@ -27,7 +27,7 @@
|
|||
mapExtent: state.mapProperties.bounds.data,
|
||||
width: maindiv.offsetWidth,
|
||||
height: maindiv.offsetHeight,
|
||||
noSelfIntersectingLines: true,
|
||||
noSelfIntersectingLines,
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
on:click={() => {
|
||||
previewedImage?.setData(image)
|
||||
}}
|
||||
on:error={(event) => {
|
||||
on:error={() => {
|
||||
if (fallbackImage) {
|
||||
imgEl.src = fallbackImage
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,8 +21,7 @@ export class ImageCarousel extends Toggle {
|
|||
changes?: Changes
|
||||
layout: LayoutConfig
|
||||
previewedImage?: UIEventSource<ProvidedImage>
|
||||
},
|
||||
feature: Feature
|
||||
}
|
||||
) {
|
||||
const uiElements = images.map(
|
||||
(imageURLS: { key: string; url: string; provider: ImageProvider; id: string }[]) => {
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ class SelfHidingToggle extends UIElement implements InputElement<boolean> {
|
|||
return this._selected
|
||||
}
|
||||
|
||||
IsValid(t: boolean): boolean {
|
||||
IsValid(_: boolean): boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
@ -298,7 +298,7 @@ export class SearchablePillsSelector<T> extends Combine implements InputElement<
|
|||
return this.selectedElements
|
||||
}
|
||||
|
||||
IsValid(t: T[]): boolean {
|
||||
IsValid(_: T[]): boolean {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
function update() {
|
||||
const v = currentVal.data
|
||||
const l = currentLang.data
|
||||
if (translations.data === "" || translations.data === undefined) {
|
||||
if (<any> translations.data === "" || translations.data === undefined) {
|
||||
translations.data = {}
|
||||
}
|
||||
if (translations.data[l] === v) {
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
)
|
||||
|
||||
onDestroy(
|
||||
currentVal.addCallbackAndRunD((v) => {
|
||||
currentVal.addCallbackAndRunD(() => {
|
||||
update()
|
||||
})
|
||||
)
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ export abstract class Validator {
|
|||
return Translations.t.validation[this.name].description
|
||||
}
|
||||
|
||||
public isValid(key: string, getCountry?: () => string): boolean {
|
||||
public isValid(_: string): boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ export default class TranslationValidator extends Validator {
|
|||
super("translation", "Makes sure the the string is of format `Record<string, string>` ")
|
||||
}
|
||||
|
||||
isValid(value: string, getCountry?: () => string): boolean {
|
||||
isValid(value: string): boolean {
|
||||
try {
|
||||
JSON.parse(value)
|
||||
return true
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ export class MapLibreAdaptor implements MapProperties, ExportableMap {
|
|||
map.on("dblclick", (e) => {
|
||||
handleClick(e)
|
||||
})
|
||||
map.on("rotateend", (e) => {
|
||||
map.on("rotateend", (_) => {
|
||||
this.updateStores()
|
||||
})
|
||||
map.getContainer().addEventListener("keydown", (event) => {
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ export default class OpeningHoursInput extends InputElement<string> {
|
|||
return this._value
|
||||
}
|
||||
|
||||
IsValid(t: string): boolean {
|
||||
IsValid(_: string): boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ export default class OpeningHoursPicker extends InputElement<OpeningHour[]> {
|
|||
return this._ohs
|
||||
}
|
||||
|
||||
IsValid(t: OpeningHour[]): boolean {
|
||||
IsValid(_: OpeningHour[]): boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ export default class OpeningHoursPickerTable extends InputElement<OpeningHour[]>
|
|||
this.SetClass("w-full block")
|
||||
}
|
||||
|
||||
IsValid(t: OpeningHour[]): boolean {
|
||||
IsValid(_: OpeningHour[]): boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ export default class PublicHolidayInput extends InputElement<string> {
|
|||
return this._value
|
||||
}
|
||||
|
||||
IsValid(t: string): boolean {
|
||||
IsValid(_: string): boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -86,8 +86,7 @@ export default class ConflateImportButtonViz implements SpecialVisualization, Au
|
|||
state: SpecialVisualizationState,
|
||||
tagSource: UIEventSource<Record<string, string>>,
|
||||
argument: string[],
|
||||
feature: Feature,
|
||||
layer: LayerConfig
|
||||
feature: Feature
|
||||
): BaseUIElement {
|
||||
const canBeImported =
|
||||
feature.geometry.type === "LineString" ||
|
||||
|
|
|
|||
|
|
@ -51,8 +51,7 @@ export class PointImportButtonViz implements SpecialVisualization {
|
|||
state: SpecialVisualizationState,
|
||||
tagSource: UIEventSource<Record<string, string>>,
|
||||
argument: string[],
|
||||
feature: Feature,
|
||||
layer: LayerConfig
|
||||
feature: Feature
|
||||
): BaseUIElement {
|
||||
if (feature.geometry.type !== "Point") {
|
||||
return Translations.t.general.add.import.wrongType.SetClass("alert")
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import { EditButton, SaveButton } from "./SaveButton"
|
|||
import Translations from "../i18n/Translations"
|
||||
import Toggle from "../Input/Toggle"
|
||||
import { Feature } from "geojson"
|
||||
|
||||
class xyz {}
|
||||
export class LanguageElement implements SpecialVisualization {
|
||||
funcName: string = "language_chooser"
|
||||
needsUrls = []
|
||||
|
|
|
|||
|
|
@ -18,8 +18,7 @@ export class AddNoteCommentViz implements SpecialVisualization {
|
|||
|
||||
public constr(
|
||||
state: SpecialVisualizationState,
|
||||
tags: UIEventSource<Record<string, string>>,
|
||||
args: string[]
|
||||
tags: UIEventSource<Record<string, string>>
|
||||
) {
|
||||
return new SvelteUIElement(AddNoteComment, { state, tags })
|
||||
}
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
function onSave(e = undefined, deleteFreeform = false) {
|
||||
function onSave(_ = undefined) {
|
||||
if (selectedTags === undefined) {
|
||||
return
|
||||
}
|
||||
|
|
@ -395,7 +395,7 @@
|
|||
<slot name="cancel" />
|
||||
<slot name="save-button" {selectedTags}>
|
||||
{#if allowDeleteOfFreeform && mappings?.length === 0 && $freeformInput === undefined && $freeformInputUnvalidated === ""}
|
||||
<button class="primary flex" on:click|stopPropagation|preventDefault={_ => onSave(_, true)}>
|
||||
<button class="primary flex" on:click|stopPropagation|preventDefault={onSave}>
|
||||
<TrashIcon class="w-6 h-6 text-red-500" />
|
||||
<Tr t={Translations.t.general.eraseValue}/>
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@
|
|||
on:hover={(e) => {
|
||||
score = e.detail.score
|
||||
}}
|
||||
on:mouseout={(e) => {
|
||||
on:mouseout={() => {
|
||||
score = null
|
||||
}}
|
||||
score={score ?? confirmedScore ?? 0}
|
||||
|
|
|
|||
|
|
@ -681,8 +681,7 @@ export default class SpecialVisualizations {
|
|||
return new ImageCarousel(
|
||||
AllImageProviders.LoadImagesFor(tags, imagePrefixes),
|
||||
tags,
|
||||
state,
|
||||
feature
|
||||
state
|
||||
)
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ export abstract class EditJsonState<T> {
|
|||
this.setValueAt(path, v)
|
||||
})
|
||||
this._stores.set(key, store)
|
||||
this.configuration.addCallbackD((config) => {
|
||||
this.configuration.addCallbackD(() => {
|
||||
store.setData(this.getCurrentValueFor(path))
|
||||
})
|
||||
return store
|
||||
|
|
|
|||
|
|
@ -6,13 +6,11 @@
|
|||
|
||||
export let state: EditLayerState
|
||||
export let path: (string | number)[] = []
|
||||
export let schema: ConfigMeta
|
||||
|
||||
let value = new UIEventSource<string>({})
|
||||
let value = new UIEventSource<Record<string,string>>({})
|
||||
console.log("Registering translation to path", path)
|
||||
state.register(
|
||||
path,
|
||||
value.mapD((v) => JSON.parse(value.data))
|
||||
value.mapD(() => JSON.parse(value.data))
|
||||
)
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ export default class StudioServer {
|
|||
category: "layers" | "themes"
|
||||
}[]
|
||||
> {
|
||||
const uid = this._userId.data
|
||||
const { allFiles } = <{ allFiles: string[] }>(
|
||||
await Utils.downloadJson(this.url + "/overview")
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue