Formatting

This commit is contained in:
Pieter Vander Vennet 2022-10-27 01:50:41 +02:00
parent 6d822b42ca
commit 61aebc61eb
32 changed files with 664 additions and 511 deletions

View file

@ -3,10 +3,10 @@ import OsmChangeAction from "./OsmChangeAction"
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 {OsmId} from "../../../Models/OsmFeature";
import { TagsFilter } from "../../Tags/TagsFilter"
import { And } from "../../Tags/And"
import { Tag } from "../../Tags/Tag"
import { OsmId } from "../../../Models/OsmFeature"
import { Utils } from "../../../Utils"
export default class DeleteAction extends OsmChangeAction {
@ -19,7 +19,6 @@ export default class DeleteAction extends OsmChangeAction {
private readonly _id: OsmId
private readonly _hardDelete: boolean
constructor(
id: OsmId,
softDeletionTags: TagsFilter | undefined,
@ -39,11 +38,12 @@ export default class DeleteAction extends OsmChangeAction {
this._softDeletionTags = new And(
Utils.NoNull([
softDeletionTags,
new Tag(
"fixme",
`A mapcomplete user marked this feature to be deleted (${meta.specialMotivation})`
)
]))
new Tag(
"fixme",
`A mapcomplete user marked this feature to be deleted (${meta.specialMotivation})`
),
])
)
}
}
/**
@ -63,8 +63,11 @@ export default class DeleteAction extends OsmChangeAction {
* const descr = await da.CreateChangeDescriptions(new Changes(), obj)
* descr[0] // => {doDelete: true, meta: {theme: "test", specialMotivation: "Testcase", changeType: "deletion"}, type: "node",id: 1 }
*/
public async CreateChangeDescriptions(changes: Changes, object?: OsmObject): Promise<ChangeDescription[]> {
const osmObject = object ?? await OsmObject.DownloadObjectAsync(this._id)
public async CreateChangeDescriptions(
changes: Changes,
object?: OsmObject
): Promise<ChangeDescription[]> {
const osmObject = object ?? (await OsmObject.DownloadObjectAsync(this._id))
if (this._hardDelete) {
return [