From 1f41444726028505669f2a33a74757e34b71fee9 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Thu, 24 Sep 2020 23:56:08 +0200 Subject: [PATCH] Small fixes --- Logic/Leaflet/Basemap.ts | 3 ++- UI/Input/AndOrTagInput.ts | 1 - UI/Input/TextField.ts | 9 +++++---- UI/TagRendering.ts | 12 ++++++------ test.html | 1 - 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Logic/Leaflet/Basemap.ts b/Logic/Leaflet/Basemap.ts index c19198a..aa852af 100644 --- a/Logic/Leaflet/Basemap.ts +++ b/Logic/Leaflet/Basemap.ts @@ -35,6 +35,7 @@ export class BaseLayers { name: "Luchtfoto Vlaanderen (2013-2015, door AIV)", layer: L.tileLayer.wms('https://geoservices.informatievlaanderen.be/raadpleegdiensten/OGW/wms?s', { + maxZoom: 22, layers: "OGWRGB13_15VL", attribution: "Luchtfoto's van © AIV Vlaanderen (2013-2015) | " }) @@ -45,7 +46,7 @@ export class BaseLayers { layer: L.tileLayer("https://tile.informatievlaanderen.be/ws/raadpleegdiensten/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=grb_bsk&STYLE=&FORMAT=image/png&tileMatrixSet=GoogleMapsVL&tileMatrix={z}&tileCol={x}&tileRow={y}", { attribution: 'Achtergrond Grootschalig ReferentieBestand(GRB) © AGIV', - maxZoom: 20, + maxZoom: 22, minZoom: 1, wmts: true }) diff --git a/UI/Input/AndOrTagInput.ts b/UI/Input/AndOrTagInput.ts index 5935814..f65f056 100644 --- a/UI/Input/AndOrTagInput.ts +++ b/UI/Input/AndOrTagInput.ts @@ -6,7 +6,6 @@ import {SubtleButton} from "../Base/SubtleButton"; import {CheckBox} from "./CheckBox"; import {AndOrTagConfigJson} from "../../Customizations/JSON/TagConfigJson"; import {MultiTagInput} from "./MultiTagInput"; -import {FormatNumberOptions} from "libphonenumber-js"; class AndOrConfig implements AndOrTagConfigJson { public and: (string | AndOrTagConfigJson)[] = undefined; diff --git a/UI/Input/TextField.ts b/UI/Input/TextField.ts index 4401485..8871dc4 100644 --- a/UI/Input/TextField.ts +++ b/UI/Input/TextField.ts @@ -111,7 +111,7 @@ export class TextField extends InputElement { private readonly startValidated: boolean; public readonly IsSelected: UIEventSource = new UIEventSource(false); private readonly _isArea: boolean; - private _textAreaRows: number; + private readonly _textAreaRows: number; constructor(options: { /** @@ -133,12 +133,14 @@ export class TextField extends InputElement { value?: UIEventSource, startValidated?: boolean, textArea?: boolean, - textAreaRows?: number + textAreaRows?: number, }) { super(undefined); const self = this; this.value = new UIEventSource(""); + this._isArea = options.textArea ?? false; + this.startValidated = options.startValidated ?? false; this.mappedValue = options?.value ?? new UIEventSource(undefined); this.mappedValue.addCallback(() => self.InnerUpdate()); @@ -166,8 +168,7 @@ export class TextField extends InputElement { // @ts-ignore field.value = options.toString(t); }); - this.startValidated = options.startValidated ?? false; - } + } GetValue(): UIEventSource { return this.mappedValue; diff --git a/UI/TagRendering.ts b/UI/TagRendering.ts index 54511ac..31a9773 100644 --- a/UI/TagRendering.ts +++ b/UI/TagRendering.ts @@ -133,13 +133,14 @@ export class TagRendering extends UIElement implements TagDependantUIElement { this._appliedTags = new VariableUiElement( self._questionElement.GetValue().map( (tags: TagsFilter) => { - if (tags === undefined) { - return Translations.t.general.noTagsSelected.SetClass("subtle").Render(); - } const csCount = State.state?.osmConnection?.userDetails?.data?.csCount ?? 1000; if (csCount < State.userJourney.tagsVisibleAt) { return ""; } + + if (tags === undefined) { + return Translations.t.general.noTagsSelected.SetClass("subtle").Render(); + } if (csCount < State.userJourney.tagsVisibleAndWikiLinked) { const tagsStr = tags.asHumanString(false, true); return new FixedUiElement(tagsStr).SetClass("subtle").Render(); @@ -360,12 +361,11 @@ export class TagRendering extends UIElement implements TagDependantUIElement { } return undefined; } - - + return new TextField({ placeholder: this._freeform.placeholder, fromString: pickString, - toString: toString + toString: toString, }); } diff --git a/test.html b/test.html index efc81c2..a84c24f 100644 --- a/test.html +++ b/test.html @@ -1,6 +1,5 @@ - Small tests