convert modelcreator and vieweditor to new modal

This commit is contained in:
kevmodrome 2020-04-06 16:51:17 +02:00
parent 3ce9124d3d
commit b035c56522
3 changed files with 33 additions and 2 deletions

View File

@ -8,3 +8,9 @@
<section> <section>
<ModelView /> <ModelView />
</section> </section>
<style>
section {
padding: 30px;
}
</style>

View File

@ -6,3 +6,9 @@
<section> <section>
<IndexView /> <IndexView />
</section> </section>
<style>
section {
padding: 30px;
}
</style>

View File

@ -1,9 +1,16 @@
<script> <script>
import { getContext } from "svelte"
import { store, backendUiStore } from "builderStore" import { store, backendUiStore } from "builderStore"
import HierarchyRow from "./HierarchyRow.svelte" import HierarchyRow from "./HierarchyRow.svelte"
import DropdownButton from "components/common/DropdownButton.svelte" import DropdownButton from "components/common/DropdownButton.svelte"
import NavItem from "./NavItem.svelte" import NavItem from "./NavItem.svelte"
import getIcon from "components/common/icon" import getIcon from "components/common/icon"
import {
CreateEditModelModal,
CreateEditViewModal,
} from "components/database/ModelDataTable/modals"
const { open, close } = getContext("simple-modal")
function newModel() { function newModel() {
if ($store.currentNode) { if ($store.currentNode) {
@ -11,12 +18,24 @@
} else { } else {
store.newRootRecord() store.newRootRecord()
} }
backendUiStore.actions.modals.show("MODEL") open(
CreateEditModelModal,
{
onClosed: close,
},
{ styleContent: { padding: "0" } }
)
} }
function newView() { function newView() {
store.newRootIndex() store.newRootIndex()
backendUiStore.actions.modals.show("VIEW") open(
CreateEditViewModal,
{
onClosed: close,
},
{ styleContent: { padding: "0" } }
)
} }
</script> </script>