Update table deletion to properly delete screens

This commit is contained in:
Andrew Kingston 2023-08-25 12:21:19 +01:00
parent 09ad3e73ae
commit 22f34d83ee
3 changed files with 6 additions and 5 deletions

View File

@ -35,7 +35,7 @@
screen => screen.autoTableId === table._id
)
willBeDeleted = ["All table data"].concat(
templateScreens.map(screen => `Screen ${screen.props._instanceName}`)
templateScreens.map(screen => `Screen ${screen.routing?.route || ""}`)
)
confirmDeleteDialog.show()
}

View File

@ -131,8 +131,7 @@
const completeDatasourceScreenCreation = async () => {
const screens = selectedTemplates.map(template => {
let screenTemplate = template.create()
screenTemplate.datasource = template.datasource
screenTemplate.autoTableId = template.table
screenTemplate.autoTableId = template.resourceId
return screenTemplate
})
await createScreens({ screens, screenAccessRole })

View File

@ -72,7 +72,9 @@
</div>
<!-- List all tables -->
{#each entities.filter(table => table._id !== "ta_users") as table}
{@const views = Object.values(table.views || {})}
{@const views = Object.values(table.views || {}).filter(
view => view.version === 2
)}
{@const datasource = {
...table,
// Legacy properties
@ -84,7 +86,7 @@
type: "table",
}}
{@const selected = selectedScreens.find(
x => x.resourceId === datasource.resourceId
screen => screen.resourceId === datasource.resourceId
)}
<DatasourceTemplateRow
on:click={() => toggleSelection(datasource)}