Merge branch 'master' into develop

This commit is contained in:
Pieter Vander Vennet 2022-02-24 03:09:34 +01:00
commit 80c24bddca
14 changed files with 97 additions and 60 deletions

View file

@ -41,6 +41,7 @@ import {AutoAction} from "./AutoApplyButton";
import LayoutConfig from "../../Models/ThemeConfig/LayoutConfig";
import {Changes} from "../../Logic/Osm/Changes";
import {ElementStorage} from "../../Logic/ElementStorage";
import Hash from "../../Logic/Web/Hash";
/**
* A helper class for the various import-flows.
@ -268,8 +269,8 @@ ${Utils.special_visualizations_importRequirementDocs}
originalFeatureTags.data["_imported"] = "yes"
originalFeatureTags.ping() // will set isImported as per its definition
state.changes.applyAction(action)
state.selectedElement.setData(state.allElements.ContainingFeatures.get(action.newElementId ?? action.mainObjectId))
const newId = action.newElementId ?? action.mainObjectId
state.selectedElement.setData(state.allElements.ContainingFeatures.get(newId))
}
})
@ -503,14 +504,23 @@ export class ImportWayButton extends AbstractImportButton implements AutoAction
mergeConfigs,
"import"
)
} else {
} else if(feature.geometry.type === "Polygon"){
const outer = coors[0]
return new CreateWayWithPointReuseAction(
args.newTags.data,
outer,
state,
mergeConfigs
)
}else if(feature.geometry.type === "LineString"){
return new CreateWayWithPointReuseAction(
args.newTags.data,
coors,
state,
mergeConfigs
)
}else{
throw "Unsupported type"
}
}
}
@ -572,6 +582,8 @@ export class ImportPointButton extends AbstractImportButton {
state.selectedElement.setData(state.allElements.ContainingFeatures.get(
newElementAction.newElementId
))
Hash.hash.setData(newElementAction.newElementId)
if (note_id !== undefined) {
state.osmConnection.closeNote(note_id, "imported")
originalFeatureTags.data["closed_at"] = new Date().toISOString()