diff --git a/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte b/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte index 11ef60480b..4c5619cb06 100644 --- a/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte +++ b/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte @@ -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() } diff --git a/packages/builder/src/pages/builder/app/[application]/design/_components/NewScreen/CreateScreenModal.svelte b/packages/builder/src/pages/builder/app/[application]/design/_components/NewScreen/CreateScreenModal.svelte index 2bfa2d0013..7e5ef96411 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/_components/NewScreen/CreateScreenModal.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/_components/NewScreen/CreateScreenModal.svelte @@ -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 }) diff --git a/packages/builder/src/pages/builder/app/[application]/design/_components/NewScreen/DatasourceModal.svelte b/packages/builder/src/pages/builder/app/[application]/design/_components/NewScreen/DatasourceModal.svelte index ad62d84eaf..fc6601178a 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/_components/NewScreen/DatasourceModal.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/_components/NewScreen/DatasourceModal.svelte @@ -72,7 +72,9 @@ {#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 )} toggleSelection(datasource)}