Merge branch 'master' into develop

This commit is contained in:
Pieter Vander Vennet 2022-09-12 20:15:01 +02:00
commit 79e0ff3ea8
3 changed files with 49 additions and 18 deletions

View file

@ -1,11 +1,11 @@
import { OsmObject } from "../OsmObject"
import {OsmObject} from "../OsmObject"
import OsmChangeAction from "./OsmChangeAction"
import { Changes } from "../Changes"
import { ChangeDescription } from "./ChangeDescription"
import {Changes} from "../Changes"
import {ChangeDescription} from "./ChangeDescription"
import ChangeTagAction from "./ChangeTagAction"
import { TagsFilter } from "../../Tags/TagsFilter"
import { And } from "../../Tags/And"
import { Tag } from "../../Tags/Tag"
import {TagsFilter} from "../../Tags/TagsFilter"
import {And} from "../../Tags/And"
import {Tag} from "../../Tags/Tag"
export default class DeleteAction extends OsmChangeAction {
private readonly _softDeletionTags: TagsFilter
@ -29,14 +29,18 @@ export default class DeleteAction extends OsmChangeAction {
super(id, true)
this._id = id
this._hardDelete = hardDelete
this.meta = { ...meta, changeType: "deletion" }
this._softDeletionTags = new And([
softDeletionTags,
new Tag(
"fixme",
`A mapcomplete user marked this feature to be deleted (${meta.specialMotivation})`
),
])
this.meta = {...meta, changeType: "deletion"}
if (softDeletionTags.usedKeys().indexOf("fixme") >= 0) {
this._softDeletionTags = softDeletionTags
} else {
this._softDeletionTags = new And([
softDeletionTags,
new Tag(
"fixme",
`A mapcomplete user marked this feature to be deleted (${meta.specialMotivation})`
),
])
}
}
public async CreateChangeDescriptions(changes: Changes): Promise<ChangeDescription[]> {