2020-11-27 03:43:56 +13:00
|
|
|
<script>
|
|
|
|
import { backendUiStore } from "builderStore"
|
|
|
|
import * as api from "./api"
|
|
|
|
import Table from "./Table.svelte"
|
|
|
|
import EditIntegrationConfigButton from "./buttons/EditIntegrationConfigButton.svelte"
|
|
|
|
|
|
|
|
let data = []
|
|
|
|
let loading = false
|
|
|
|
|
|
|
|
$: table = $backendUiStore.selectedTable
|
|
|
|
$: title = table.name
|
|
|
|
$: schema = table.schema
|
|
|
|
$: tableView = {
|
|
|
|
schema,
|
|
|
|
name: $backendUiStore.selectedView.name,
|
|
|
|
}
|
|
|
|
|
|
|
|
// Fetch rows for specified table
|
|
|
|
$: {
|
|
|
|
if ($backendUiStore.selectedView?.name?.startsWith("all_")) {
|
|
|
|
loading = true
|
|
|
|
api.fetchDataForView($backendUiStore.selectedView).then(rows => {
|
|
|
|
data = rows || []
|
|
|
|
loading = false
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2020-11-27 05:46:36 +13:00
|
|
|
<Table {title} {schema} {data} {loading}>
|
2020-11-27 03:43:56 +13:00
|
|
|
<EditIntegrationConfigButton {table} />
|
|
|
|
</Table>
|