From d40d77d86fa946e2a4d2cff0347561a081a1fe8c Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Wed, 2 Mar 2022 17:13:21 +0100 Subject: [PATCH 1/5] Fix optimalization, some cleanup --- Logic/State/FeaturePipelineState.ts | 8 ++++---- Models/Constants.ts | 2 +- UI/DefaultGUI.ts | 1 - UI/ExportPDF.ts | 1 - UI/ImportFlow/MapPreview.ts | 2 +- UI/Input/LocationInput.ts | 2 -- UI/Popup/AutoApplyButton.ts | 1 - UI/Popup/ImportButton.ts | 2 -- UI/Popup/SplitRoadWizard.ts | 2 -- UI/ShowDataLayer/ShowDataLayer.ts | 2 +- UI/ShowDataLayer/ShowDataLayerOptions.ts | 2 +- UI/ShowDataLayer/ShowTileInfo.ts | 1 - UI/SpecialVisualizations.ts | 2 -- 13 files changed, 8 insertions(+), 20 deletions(-) diff --git a/Logic/State/FeaturePipelineState.ts b/Logic/State/FeaturePipelineState.ts index 900a031f4..d6ed0f315 100644 --- a/Logic/State/FeaturePipelineState.ts +++ b/Logic/State/FeaturePipelineState.ts @@ -140,12 +140,12 @@ export default class FeaturePipelineState extends MapState { } - public CreatePopup(tags:any , layer: LayerConfig): ScrollableFullScreen{ - if(this.popups.has(tags.id)){ - // return this.popups.get(tags.id) + public CreatePopup(tags:UIEventSource , layer: LayerConfig): ScrollableFullScreen{ + if(this.popups.has(tags.data.id)){ + return this.popups.get(tags.data.id) } const popup = new FeatureInfoBox(tags, layer, this) - this.popups.set(tags.id, popup) + this.popups.set(tags.data.id, popup) return popup } diff --git a/Models/Constants.ts b/Models/Constants.ts index bf95f3f27..7c917da57 100644 --- a/Models/Constants.ts +++ b/Models/Constants.ts @@ -2,7 +2,7 @@ import {Utils} from "../Utils"; export default class Constants { - public static vNumber = "0.16.4"; + public static vNumber = "0.16.5"; public static ImgurApiKey = '7070e7167f0a25a' public static readonly mapillary_client_token_v4 = "MLY|4441509239301885|b40ad2d3ea105435bd40c7e76993ae85" diff --git a/UI/DefaultGUI.ts b/UI/DefaultGUI.ts index 7a9786787..cfbb9aabc 100644 --- a/UI/DefaultGUI.ts +++ b/UI/DefaultGUI.ts @@ -141,7 +141,6 @@ export default class DefaultGUI { leafletMap: state.leafletMap, layerToShow: new LayerConfig(home_location_json, "all_known_layers", true), features: state.homeLocation, - popup: undefined, state }) diff --git a/UI/ExportPDF.ts b/UI/ExportPDF.ts index c4b9f6b4b..efe0fffc0 100644 --- a/UI/ExportPDF.ts +++ b/UI/ExportPDF.ts @@ -95,7 +95,6 @@ export default class ExportPDF { features: tile, leafletMap: minimap.leafletMap, layerToShow: tile.layer.layerDef, - popup: undefined, doShowLayer: tile.layer.isDisplayed, state: undefined } diff --git a/UI/ImportFlow/MapPreview.ts b/UI/ImportFlow/MapPreview.ts index 1929cd09a..0d632a472 100644 --- a/UI/ImportFlow/MapPreview.ts +++ b/UI/ImportFlow/MapPreview.ts @@ -27,7 +27,7 @@ import CheckBoxes from "../Input/Checkboxes"; class PreviewPanel extends ScrollableFullScreen { - constructor(tags, layer) { + constructor(tags: UIEventSource, layer) { super( _ => new FixedUiElement("Element to import"), _ => new Combine(["The tags are:", diff --git a/UI/Input/LocationInput.ts b/UI/Input/LocationInput.ts index 8e66d4270..5743cd851 100644 --- a/UI/Input/LocationInput.ts +++ b/UI/Input/LocationInput.ts @@ -189,7 +189,6 @@ export default class LocationInput extends InputElement implements MinimapO console.log("Constructing the snap-to layer", this._snapTo) new ShowDataMultiLayer({ features: new StaticFeatureSource(this._snapTo, true), - popup: undefined, zoomToFeatures: false, leafletMap: this.map.leafletMap, layers: State.state.filteredLayers @@ -204,7 +203,6 @@ export default class LocationInput extends InputElement implements MinimapO }) new ShowDataLayer({ features: new StaticFeatureSource(matchPoint, true), - popup: undefined, zoomToFeatures: false, leafletMap: this.map.leafletMap, layerToShow: this._matching_layer, diff --git a/UI/Popup/AutoApplyButton.ts b/UI/Popup/AutoApplyButton.ts index f4eb86725..27c1d2a48 100644 --- a/UI/Popup/AutoApplyButton.ts +++ b/UI/Popup/AutoApplyButton.ts @@ -96,7 +96,6 @@ class ApplyButton extends UIElement { new ShowDataLayer({ leafletMap: previewMap.leafletMap, - popup: undefined, zoomToFeatures: true, features: new StaticFeatureSource(features, false), state: this.state, diff --git a/UI/Popup/ImportButton.ts b/UI/Popup/ImportButton.ts index f6f5337aa..efacb975d 100644 --- a/UI/Popup/ImportButton.ts +++ b/UI/Popup/ImportButton.ts @@ -237,7 +237,6 @@ ${Utils.special_visualizations_importRequirementDocs} // SHow all relevant data - including (eventually) the way of which the geometry will be replaced new ShowDataMultiLayer({ leafletMap: confirmationMap.leafletMap, - popup: undefined, zoomToFeatures: true, features: new StaticFeatureSource([feature], false), state: state, @@ -248,7 +247,6 @@ ${Utils.special_visualizations_importRequirementDocs} action.getPreview().then(changePreview => { new ShowDataLayer({ leafletMap: confirmationMap.leafletMap, - popup: undefined, zoomToFeatures: false, features: changePreview, state, diff --git a/UI/Popup/SplitRoadWizard.ts b/UI/Popup/SplitRoadWizard.ts index 8ae8b0158..51bf4ab6a 100644 --- a/UI/Popup/SplitRoadWizard.ts +++ b/UI/Popup/SplitRoadWizard.ts @@ -81,7 +81,6 @@ export default class SplitRoadWizard extends Toggle { features: new StaticFeatureSource([roadElement], false), layers: state.filteredLayers, leafletMap: miniMap.leafletMap, - popup: undefined, zoomToFeatures: true, state }) @@ -90,7 +89,6 @@ export default class SplitRoadWizard extends Toggle { features: new StaticFeatureSource(splitPoints, true), leafletMap: miniMap.leafletMap, zoomToFeatures: false, - popup: undefined, layerToShow: SplitRoadWizard.splitLayerStyling, state }) diff --git a/UI/ShowDataLayer/ShowDataLayer.ts b/UI/ShowDataLayer/ShowDataLayer.ts index dd50db6ad..72ab8f909 100644 --- a/UI/ShowDataLayer/ShowDataLayer.ts +++ b/UI/ShowDataLayer/ShowDataLayer.ts @@ -44,7 +44,7 @@ export default class ShowDataLayer { */ private readonly leafletLayersPerId = new Map() private readonly showDataLayerid: number; - private readonly createPopup: (tags: any, layer: LayerConfig) => ScrollableFullScreen + private readonly createPopup: (tags: UIEventSource, layer: LayerConfig) => ScrollableFullScreen /** * Creates a datalayer. diff --git a/UI/ShowDataLayer/ShowDataLayerOptions.ts b/UI/ShowDataLayer/ShowDataLayerOptions.ts index e79fe00d4..a9ace1f8d 100644 --- a/UI/ShowDataLayer/ShowDataLayerOptions.ts +++ b/UI/ShowDataLayer/ShowDataLayerOptions.ts @@ -8,7 +8,7 @@ export interface ShowDataLayerOptions { features: FeatureSource, selectedElement?: UIEventSource, leafletMap: UIEventSource, - popup?: undefined | ((tags: any, layer: LayerConfig) => ScrollableFullScreen), + popup?: undefined | ((tags: UIEventSource, layer: LayerConfig) => ScrollableFullScreen), zoomToFeatures?: false | boolean, doShowLayer?: UIEventSource, state?: { allElements?: ElementStorage } diff --git a/UI/ShowDataLayer/ShowTileInfo.ts b/UI/ShowDataLayer/ShowTileInfo.ts index 1b6cc1d85..7698de25a 100644 --- a/UI/ShowDataLayer/ShowTileInfo.ts +++ b/UI/ShowDataLayer/ShowTileInfo.ts @@ -56,7 +56,6 @@ export default class ShowTileInfo { leafletMap: options.leafletMap, doShowLayer: options.doShowLayer, state: State.state, - popup: undefined }) } diff --git a/UI/SpecialVisualizations.ts b/UI/SpecialVisualizations.ts index 97b594375..9f1fc857a 100644 --- a/UI/SpecialVisualizations.ts +++ b/UI/SpecialVisualizations.ts @@ -268,7 +268,6 @@ export default class SpecialVisualizations { new ShowDataMultiLayer( { leafletMap: minimap["leafletMap"], - popup: undefined, zoomToFeatures: true, layers: state.filteredLayers, features: new StaticFeatureSource(featuresToShow, true) @@ -314,7 +313,6 @@ export default class SpecialVisualizations { new ShowDataLayer( { leafletMap: minimap["leafletMap"], - popup: undefined, zoomToFeatures: true, layerToShow: new LayerConfig(left_right_style_json, "all_known_layers", true), features: new StaticFeatureSource([copy], false), From c5ade24f786d9dbb6ff368a185a17313f8d1b946 Mon Sep 17 00:00:00 2001 From: Reza Almanda Date: Thu, 3 Mar 2022 02:22:59 +0000 Subject: [PATCH 2/5] Translated using Weblate (Indonesian) Currently translated at 22.7% (98 of 430 strings) Translation: MapComplete/Core Translate-URL: https://hosted.weblate.org/projects/mapcomplete/core/id/ --- langs/id.json | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/langs/id.json b/langs/id.json index 24ebe01a3..45ef6bea2 100644 --- a/langs/id.json +++ b/langs/id.json @@ -1,10 +1,19 @@ { "centerMessage": { "loadingData": "Memuat data…", - "ready": "Selesai!" + "ready": "Selesai!", + "retrying": "Memuat data gagal. Mencoba lagi dalam {count} detik…", + "zoomIn": "Perbesar untuk melihat atau mengedit data" }, "delete": { - "cancel": "Batal" + "cancel": "Batal", + "cannotBeDeleted": "Fitur ini tidak dapat dihapus", + "explanations": { + "selectReason": "Silahkan pilih mengapa fitur ini harus dihapus" + }, + "isntAPoint": "Hanya titik yang dapat dihapus, fitur yang dipilih adalah jalan, area, atau relasi.", + "delete": "Hapus", + "isDeleted": "Fitur ini telah dihapus" }, "favourite": { "reload": "Muat ulang data" @@ -106,4 +115,4 @@ "split": { "cancel": "Batal" } -} \ No newline at end of file +} From c81e6b9fcbd55f4582f569a88f0b3c9cccfe0134 Mon Sep 17 00:00:00 2001 From: Reza Almanda Date: Thu, 3 Mar 2022 02:24:00 +0000 Subject: [PATCH 3/5] Translated using Weblate (Indonesian) Currently translated at 18.3% (80 of 436 strings) Translation: MapComplete/themes Translate-URL: https://hosted.weblate.org/projects/mapcomplete/themes/id/ --- langs/themes/id.json | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/langs/themes/id.json b/langs/themes/id.json index d9fabf17f..efe1d30c2 100644 --- a/langs/themes/id.json +++ b/langs/themes/id.json @@ -8,7 +8,8 @@ "title": "Buka Peta Karya Seni" }, "benches": { - "title": "Bangku" + "title": "Bangku", + "shortDescription": "Peta bangku" }, "cafes_and_pubs": { "title": "Kafe dan pub" @@ -282,5 +283,12 @@ }, "waste_basket": { "title": "Keranjang Sampah" + }, + "bicyclelib": { + "title": "Perpustakaan sepeda" + }, + "bicycle_rental": { + "title": "Sewa sepeda", + "shortDescription": "Peta dengan stasiun persewaan sepeda dan toko penyewaan sepeda" } -} \ No newline at end of file +} From 1462b7f4faec012ea3051669ff877e33077b3222 Mon Sep 17 00:00:00 2001 From: Reza Almanda Date: Thu, 3 Mar 2022 02:26:08 +0000 Subject: [PATCH 4/5] Translated using Weblate (Indonesian) Currently translated at 48.6% (18 of 37 strings) Translation: MapComplete/shared-questions Translate-URL: https://hosted.weblate.org/projects/mapcomplete/shared-questions/id/ --- langs/shared-questions/id.json | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/langs/shared-questions/id.json b/langs/shared-questions/id.json index 3bf4b6d9d..6cebfc7ad 100644 --- a/langs/shared-questions/id.json +++ b/langs/shared-questions/id.json @@ -13,8 +13,12 @@ }, "2": { "then": "Anjing diperbolehkan, tetapi mereka harus diikat" + }, + "3": { + "then": "Anjing diperbolehkan dan dapat berkeliaran dengan bebas" } - } + }, + "question": "Apakah anjing diperbolehkan dalam bisnis ini?" }, "email": { "question": "Apa alamat surel dari {title()}?" @@ -23,6 +27,18 @@ "mappings": { "3": { "then": "Berlokasi di lantai pertama" + }, + "1": { + "then": "Terletak di lantai dasar" + }, + "0": { + "then": "Terletak di bawah tanah" + }, + "2": { + "then": "Terletak di lantai dasar" + }, + "4": { + "then": "Terletak di lantai basement pertama" } }, "question": "Pada tingkat apa fitur ini diletakkan?" @@ -45,4 +61,4 @@ "question": "Apa situs web dari {title()}?" } } -} \ No newline at end of file +} From c88632ce8beea89b3bf40e9c942e267129437c8f Mon Sep 17 00:00:00 2001 From: Tobias Date: Sun, 6 Mar 2022 22:01:01 +0100 Subject: [PATCH 5/5] Changeset tag `host`: Add domain and path (#689) * Changeset tag `host`: Add domain and path Extend the value of the changeset tag host key to include the full url of the editor. This way a reader of the changeset can open the editor based on this value. * Remove `path` from changeset tags --- Logic/Osm/ChangesetHandler.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Logic/Osm/ChangesetHandler.ts b/Logic/Osm/ChangesetHandler.ts index 21fc42dd2..b62f9374b 100644 --- a/Logic/Osm/ChangesetHandler.ts +++ b/Logic/Osm/ChangesetHandler.ts @@ -347,13 +347,10 @@ export class ChangesetHandler { const self = this; return new Promise(function (resolve, reject) { - let path = window.location.pathname; - path = path.substr(1, path.lastIndexOf("/")); const metadata = [ ["created_by", `MapComplete ${Constants.vNumber}`], ["locale", Locale.language.data], - ["host", window.location.host], - ["path", path], + ["host", `${window.location.origin}${window.location.pathname}`], ["source", self.changes.state["currentUserLocation"]?.features?.data?.length > 0 ? "survey" : undefined], ["imagery", self.changes.state["backgroundLayer"]?.data?.id], ...changesetTags.map(cstag => [cstag.key, cstag.value]) @@ -408,4 +405,4 @@ export class ChangesetHandler { } -} \ No newline at end of file +}