drilldown complete, deleting model fields
This commit is contained in:
parent
161e6271f3
commit
c543cb143a
|
@ -56,7 +56,7 @@ export const getBackendUiStore = () => {
|
|||
},
|
||||
views: {
|
||||
select: view => store.update(state => {
|
||||
state.selectedView = { ...state.selectedView, ...view }
|
||||
state.selectedView = view
|
||||
return state
|
||||
})
|
||||
},
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
)
|
||||
|
||||
async function fetchRecordsForView(view, instance) {
|
||||
if (!view.name) return
|
||||
if (!view || !view.name) return
|
||||
|
||||
const viewName = $backendUiStore.selectedRecord
|
||||
? `${$backendUiStore.selectedRecord.key}/${view.name}`
|
||||
|
|
|
@ -59,4 +59,10 @@
|
|||
left: 0;
|
||||
background: #fafafa;
|
||||
}
|
||||
select {
|
||||
width: 100%;
|
||||
}
|
||||
option {
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -29,7 +29,10 @@
|
|||
$: models = $store.hierarchy.children
|
||||
$: parent = record && record.parent()
|
||||
$: isChildModel = parent.name !== "root"
|
||||
$: modelExistsInHierarchy = getNode($store.hierarchy, $store.currentNode.nodeId)
|
||||
$: modelExistsInHierarchy = getNode(
|
||||
$store.hierarchy,
|
||||
$store.currentNode.nodeId
|
||||
)
|
||||
|
||||
store.subscribe($store => {
|
||||
record = $store.currentNode
|
||||
|
@ -133,6 +136,7 @@
|
|||
<th>Name</th>
|
||||
<th>Type</th>
|
||||
<th>Values</th>
|
||||
<th />
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -146,24 +150,32 @@
|
|||
</td>
|
||||
<td>{field.type}</td>
|
||||
<td>{field.typeOptions.values}</td>
|
||||
<td>
|
||||
<i
|
||||
class="ri-delete-bin-6-line hoverable"
|
||||
on:click={() => deleteField(field)} />
|
||||
</td>
|
||||
</tr>
|
||||
{/each}
|
||||
</tbody>
|
||||
</table>
|
||||
<ActionsHeader>
|
||||
{#if modelExistsInHierarchy}
|
||||
<div class="uk-margin">
|
||||
<ActionButton color="primary" on:click={store.newChildRecord}>
|
||||
Create Child Model on {record.name}
|
||||
</ActionButton>
|
||||
<ActionButton color="primary" on:click={async () => {
|
||||
backendUiStore.actions.modals.show("VIEW")
|
||||
<ActionButton
|
||||
color="primary"
|
||||
on:click={async () => {
|
||||
backendUiStore.actions.modals.show('VIEW')
|
||||
await tick()
|
||||
store.newChildIndex()
|
||||
}}>
|
||||
Create Child View on {record.name}
|
||||
</ActionButton>
|
||||
</div>
|
||||
{/if}
|
||||
</ActionsHeader>
|
||||
<ActionsHeader />
|
||||
{:else}
|
||||
<FieldView
|
||||
field={fieldToEdit}
|
||||
|
|
|
@ -1,14 +1,17 @@
|
|||
<script>
|
||||
import { tick } from "svelte";
|
||||
import { store, backendUiStore } from "../builderStore"
|
||||
import getIcon from "../common/icon"
|
||||
import { CheckIcon } from "../common/Icons"
|
||||
|
||||
$: instances = $store.appInstances
|
||||
$: views = $store.hierarchy.indexes
|
||||
|
||||
function selectDatabase(database) {
|
||||
backendUiStore.actions.database.select(database)
|
||||
backendUiStore.actions.records.select(null)
|
||||
async function selectDatabase(database) {
|
||||
backendUiStore.actions.navigate("DATABASE")
|
||||
backendUiStore.actions.records.select(null)
|
||||
backendUiStore.actions.views.select(views[0])
|
||||
backendUiStore.actions.database.select(database)
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in New Issue