Add explicit api_url to config and testserver-mode indication, add id rewrite when changes are applied to fix image upload on a new object, various formatting fixes; version bump

This commit is contained in:
Pieter Vander Vennet 2024-07-17 18:42:39 +02:00
parent 39376c0012
commit a4db7178f4
16 changed files with 277 additions and 192 deletions

View file

@ -94,6 +94,7 @@ export class ChangesetHandler {
return hasChange
}
/**
* The full logic to upload a change to one or more elements.
*
@ -187,7 +188,7 @@ export class ChangesetHandler {
await this.UpdateTags(csId, rewrittenTags)
} catch (e) {
if (this._reportError) {
this._reportError("Could not reuse changeset "+csId+", might be closed: " + (e.stacktrace ?? ("" + e)))
this._reportError("Could not reuse changeset " + csId + ", might be closed: " + (e.stacktrace ?? ("" + e)))
}
console.warn("Could not upload, changeset is probably closed: ", e)
openChangeset.setData(undefined)
@ -236,7 +237,7 @@ export class ChangesetHandler {
if (newMetaTag === undefined) {
extraMetaTags.push({
key: key,
value: oldCsTags[key],
value: oldCsTags[key]
})
continue
}
@ -373,11 +374,11 @@ export class ChangesetHandler {
["locale", Locale.language.data],
["host", `${window.location.origin}${window.location.pathname}`],
["source", setSourceAsSurvey ? "survey" : undefined],
["imagery", this.changes.state["backgroundLayer"]?.data?.id],
["imagery", this.changes.state["backgroundLayer"]?.data?.id]
].map(([key, value]) => ({
key,
value,
aggregate: false,
aggregate: false
}))
}
@ -409,7 +410,7 @@ export class ChangesetHandler {
changesetId: number,
changesetXML: string
): Promise<Map<string, string>> {
const response = await this.osmConnection.post(
const response = await this.osmConnection.post<XMLDocument>(
"changeset/" + changesetId + "/upload",
changesetXML,
{ "Content-Type": "text/xml" }