diff --git a/Logic/Osm/Actions/ChangeDescription.ts b/Logic/Osm/Actions/ChangeDescription.ts index 345087ef2a..44804bc327 100644 --- a/Logic/Osm/Actions/ChangeDescription.ts +++ b/Logic/Osm/Actions/ChangeDescription.ts @@ -16,7 +16,7 @@ export interface ChangeDescription { /** * The type of the change */ - changeType: "answer" | "create" | "split" | "delete" | string + changeType: "answer" | "create" | "split" | "delete" | "move" | string /** * THe motivation for the change, e.g. 'deleted because does not exist anymore' */ diff --git a/Logic/Osm/Actions/ChangeLocationAction.ts b/Logic/Osm/Actions/ChangeLocationAction.ts index 56234e67e1..506dc65398 100644 --- a/Logic/Osm/Actions/ChangeLocationAction.ts +++ b/Logic/Osm/Actions/ChangeLocationAction.ts @@ -3,15 +3,40 @@ import OsmChangeAction from "./OsmChangeAction"; import {Changes} from "../Changes"; export default class ChangeLocationAction extends OsmChangeAction { + private readonly _id: number; + private readonly _newLonLat: [number, number]; + private readonly _meta: { theme: string; reason: string }; + constructor(id: string, newLonLat: [number, number], meta: { theme: string, reason: string }) { super(); + if (!id.startsWith("node/")) { + throw "Invalid ID: only 'node/number' is accepted" + } + this._id = Number(id.substring("node/".length)) + this._newLonLat = newLonLat; + this._meta = meta; throw "TODO" } - protected CreateChangeDescriptions(changes: Changes): Promise { - return Promise.resolve([]); + protected async CreateChangeDescriptions(changes: Changes): Promise { + + const d: ChangeDescription = { + changes: { + lat: this._newLonLat[1], + lon: this._newLonLat[0] + }, + type: "node", + id: this._id, meta: { + changeType: "move", + theme: this._meta.theme, + specialMotivation: this._meta.reason + } + + } + + return [d] } } \ No newline at end of file diff --git a/langs/themes/en.json b/langs/themes/en.json index d5976735da..82008ccbdf 100644 --- a/langs/themes/en.json +++ b/langs/themes/en.json @@ -750,6 +750,11 @@ "override": { "name": "Streets without etymology information" } + }, + "2": { + "override": { + "name": "Parks and forests without etymology information" + } } }, "shortDescription": "What is the origin of a toponym?", diff --git a/langs/themes/nl.json b/langs/themes/nl.json index 7d6fbf6d7c..e09f723b95 100644 --- a/langs/themes/nl.json +++ b/langs/themes/nl.json @@ -631,6 +631,11 @@ "override": { "name": "Straten zonder etymologische informatie" } + }, + "2": { + "override": { + "name": "Parken en bossen zonder etymologische informatie" + } } }, "shortDescription": "Wat is de oorsprong van een plaatsnaam?",