wip: cleanup of components

This commit is contained in:
Keviin Åberg Kultalahti 2021-03-23 12:27:10 +01:00
parent c924e03519
commit 8a2ccbc1a9
7 changed files with 12 additions and 13 deletions

View File

@ -22,7 +22,7 @@
$: schema = $tables.selected.schema
$: tableView = {
schema,
name: $views.selected.name,
name: $views.selected?.name,
}
// Fetch rows for specified table

View File

@ -1,7 +1,7 @@
<script>
import { Button, Input } from "@budibase/bbui"
import { goto } from "@sveltech/routify"
import { backendUiStore } from "builderStore"
import { views as viewsStore } from 'builderStore/store/backend/'
import { tables } from 'builderStore/store/backend/'
import { notifier } from "builderStore/store/notifications"
import analytics from "analytics"
@ -20,7 +20,7 @@
notifier.danger(`View exists with name ${name}.`)
return
}
backendUiStore.actions.views.save({
viewsStore.save({
name,
tableId: $tables.selected._id,
field,

View File

@ -1,5 +1,4 @@
<script>
import { backendUiStore } from "builderStore"
import { roles, permissions as permissionsStore } from 'builderStore/store/backend/'
import { notifier } from "builderStore/store/notifications"
import { Button, Label, Input, Select, Spacer } from "@budibase/bbui"

View File

@ -1,5 +1,6 @@
<script>
import { backendUiStore, store, allScreens } from "builderStore"
import { tables } from 'builderStore/store/backend/'
import { notifier } from "builderStore/store/notifications"
import { DropdownMenu, Button, Input } from "@budibase/bbui"
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
@ -36,15 +37,15 @@
}
async function deleteTable() {
await backendUiStore.actions.tables.delete(table)
await tables.delete(table)
store.actions.screens.delete(templateScreens)
await backendUiStore.actions.tables.fetch()
await tables.fetch()
notifier.success("Table deleted")
hideEditor()
}
async function save() {
await backendUiStore.actions.tables.save(table)
await tables.save(table)
notifier.success("Table renamed successfully")
hideEditor()
}

View File

@ -1,6 +1,6 @@
<script>
import { goto } from "@sveltech/routify"
import { backendUiStore } from "builderStore"
import { views } from 'builderStore/store/backend/'
import { notifier } from "builderStore/store/notifications"
import { DropdownMenu, Button, Input } from "@budibase/bbui"
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
@ -29,7 +29,7 @@
}
async function save() {
await backendUiStore.actions.views.save({
await views.save({
originalName,
...view,
})
@ -40,7 +40,7 @@
async function deleteView() {
const name = view.name
const id = view.tableId
await backendUiStore.actions.views.delete(name)
await views.delete(name)
notifier.success("View deleted")
$goto(`./table/${id}`)
}

View File

@ -15,7 +15,6 @@
import IntegrationQueryEditor from "components/integration/index.svelte"
import ExternalDataSourceTable from "components/backend/DataTable/ExternalDataSourceTable.svelte"
import ParameterBuilder from "components/integration/QueryParameterBuilder.svelte"
import { backendUiStore } from "builderStore"
import { datasources, integrations } from 'builderStore/store/backend/'
const PREVIEW_HEADINGS = [

View File

@ -1,6 +1,6 @@
<script>
import { params } from "@sveltech/routify"
import { tables } from 'builderStore/store/backend/'
import { tables, views } from 'builderStore/store/backend/'
if ($params.selectedView) {
let view
@ -11,7 +11,7 @@
}
}
if (view) {
backendUiStore.actions.views.select({
views.select({
name: viewName,
...view,
})