forked from MapComplete/MapComplete
Refactoring: use svelte for delete flow as well
This commit is contained in:
parent
15a481f864
commit
effcb8ca23
9 changed files with 429 additions and 520 deletions
31
test.ts
31
test.ts
|
@ -7,9 +7,9 @@ import {VariableUiElement} from "./UI/Base/VariableUIElement"
|
|||
import SvelteUIElement from "./UI/Base/SvelteUIElement"
|
||||
import {SvgToPdf} from "./Utils/svgToPdf"
|
||||
import {Utils} from "./Utils"
|
||||
import {PointImportFlowState} from "./UI/Popup/ImportButtons/PointImportFlowState";
|
||||
import PointImportFlow from "./UI/Popup/ImportButtons/PointImportFlow.svelte";
|
||||
import {Feature, Point} from "geojson";
|
||||
import DeleteWizard from "./UI/Popup/DeleteFlow/DeleteWizard.svelte";
|
||||
import DeleteConfig from "./Models/ThemeConfig/DeleteConfig";
|
||||
import {UIEventSource} from "./Logic/UIEventSource";
|
||||
|
||||
function testspecial() {
|
||||
const layout = new LayoutConfig(<any>theme, true) // qp.data === "" ? : new AllKnownLayoutsLazy().get(qp.data)
|
||||
|
@ -33,6 +33,31 @@ async function testPdf() {
|
|||
}
|
||||
|
||||
|
||||
function testDelete() {
|
||||
const layout = new LayoutConfig(<any>theme, true) // qp.data === "" ? : new AllKnownLayoutsLazy().get(qp.data)
|
||||
const state = new ThemeViewState(layout)
|
||||
const tags = new UIEventSource({"amenity": "public_bookcase"})
|
||||
new SvelteUIElement(DeleteWizard, {
|
||||
state,
|
||||
tags,
|
||||
layer: layout.layers.find(l => l.id === "public_bookcase"),
|
||||
featureId: "node/10944136609",
|
||||
deleteConfig: new DeleteConfig({
|
||||
nonDeleteMappings: [
|
||||
{
|
||||
if: {"and": ["disused:amenity=public_bookcase", "amenity="]},
|
||||
then: {
|
||||
en: "The bookcase still exists but is not maintained anymore"
|
||||
}
|
||||
}
|
||||
]
|
||||
}, "test")
|
||||
}).AttachTo("maindiv")
|
||||
|
||||
}
|
||||
|
||||
testDelete()
|
||||
|
||||
// testPdf().then((_) => console.log("All done"))
|
||||
/*/
|
||||
testspecial()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue