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

View File

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

View File

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