moves backend stores to "stores" in the root src directory

This commit is contained in:
Keviin Åberg Kultalahti 2021-03-26 09:50:37 +01:00
parent a40a13af93
commit 44e3f29a0b
68 changed files with 129 additions and 71 deletions

View File

@ -60,6 +60,10 @@ export default {
find: "builderStore", find: "builderStore",
replacement: path.resolve(projectRootDir, "src/builderStore"), replacement: path.resolve(projectRootDir, "src/builderStore"),
}, },
{
find: "stores",
replacement: path.resolve(projectRootDir, "src/stores"),
},
{ {
find: "constants", find: "constants",
replacement: path.resolve(projectRootDir, "src/constants"), replacement: path.resolve(projectRootDir, "src/constants"),

View File

@ -4,7 +4,7 @@ import { store } from "builderStore"
import { import {
tables as tablesStore, tables as tablesStore,
queries as queriesStores, queries as queriesStores,
} from "builderStore/store/backend/" } from "stores/backend/"
import { findComponentPath } from "./storeUtils" import { findComponentPath } from "./storeUtils"
import { makePropSafe } from "@budibase/string-templates" import { makePropSafe } from "@budibase/string-templates"
import { TableNames } from "../constants" import { TableNames } from "../constants"

View File

@ -15,7 +15,7 @@ import {
queries, queries,
database, database,
tables, tables,
} from "builderStore/store/backend/" } from "stores/backend/"
import { fetchComponentLibDefinitions } from "../loadComponentLibraries" import { fetchComponentLibDefinitions } from "../loadComponentLibraries"
import api from "../api" import api from "../api"

View File

@ -24,7 +24,7 @@ export default (frontendState, tables) => {
}) })
const fromScratch = enrichTemplate(createFromScratchScreen) const fromScratch = enrichTemplate(createFromScratchScreen)
const tableTemplates = allTemplates(tables).map(enrichTemplate) const tableTemplates = allTemplates(tables.list).map(enrichTemplate)
return [ return [
fromScratch, fromScratch,
...tableTemplates.sort((templateA, templateB) => { ...tableTemplates.sort((templateA, templateB) => {

View File

@ -1,7 +1,7 @@
<script> <script>
import { processStringSync } from "@budibase/string-templates" import { processStringSync } from "@budibase/string-templates"
import { get } from "lodash/fp" import { get } from "lodash/fp"
import { tables } from 'builderStore/store/backend/' import { tables } from 'stores/backend/'
export let block export let block

View File

@ -1,6 +1,6 @@
<script> <script>
import { automationStore } from "builderStore" import { automationStore } from "builderStore"
import { database } from 'builderStore/store/backend/' import { database } from 'stores/backend/'
import { goto } from "@sveltech/routify" import { goto } from "@sveltech/routify"
import { notifier } from "builderStore/store/notifications" import { notifier } from "builderStore/store/notifications"
import { Input, ModalContent } from "@budibase/bbui" import { Input, ModalContent } from "@budibase/bbui"

View File

@ -1,7 +1,7 @@
<script> <script>
import { goto } from "@sveltech/routify" import { goto } from "@sveltech/routify"
import { automationStore } from "builderStore" import { automationStore } from "builderStore"
import { database } from 'builderStore/store/backend/' import { database } from 'stores/backend/'
import { notifier } from "builderStore/store/notifications" import { notifier } from "builderStore/store/notifications"
import { DropdownMenu } from "@budibase/bbui" import { DropdownMenu } from "@budibase/bbui"
import { DropdownContainer, DropdownItem } from "components/common/Dropdowns" import { DropdownContainer, DropdownItem } from "components/common/Dropdowns"

View File

@ -1,5 +1,5 @@
<script> <script>
import { tables } from 'builderStore/store/backend/' import { tables } from 'stores/backend/'
import { Select } from "@budibase/bbui" import { Select } from "@budibase/bbui"
import DrawerBindableInput from "../../common/DrawerBindableInput.svelte" import DrawerBindableInput from "../../common/DrawerBindableInput.svelte"
import AutomationBindingPanel from "./AutomationBindingPanel.svelte" import AutomationBindingPanel from "./AutomationBindingPanel.svelte"

View File

@ -1,6 +1,6 @@
<script> <script>
import { automationStore } from "builderStore" import { automationStore } from "builderStore"
import { database } from 'builderStore/store/backend/' import { database } from 'stores/backend/'
import { notifier } from "builderStore/store/notifications" import { notifier } from "builderStore/store/notifications"
import AutomationBlockSetup from "./AutomationBlockSetup.svelte" import AutomationBlockSetup from "./AutomationBlockSetup.svelte"
import { Button, Modal } from "@budibase/bbui" import { Button, Modal } from "@budibase/bbui"

View File

@ -1,5 +1,5 @@
<script> <script>
import { tables } from 'builderStore/store/backend/' import { tables } from 'stores/backend/'
import { Select } from "@budibase/bbui" import { Select } from "@budibase/bbui"
export let value export let value

View File

@ -1,6 +1,6 @@
<script> <script>
import { automationStore } from "builderStore" import { automationStore } from "builderStore"
import { database } from 'builderStore/store/backend/' import { database } from 'stores/backend/'
import WebhookDisplay from "./WebhookDisplay.svelte" import WebhookDisplay from "./WebhookDisplay.svelte"
import { ModalContent } from "@budibase/bbui" import { ModalContent } from "@budibase/bbui"
import { onMount, onDestroy } from "svelte" import { onMount, onDestroy } from "svelte"

View File

@ -1,5 +1,5 @@
<script> <script>
import { tables, views } from 'builderStore/store/backend/' import { tables, views } from 'stores/backend/'
import CreateRowButton from "./buttons/CreateRowButton.svelte" import CreateRowButton from "./buttons/CreateRowButton.svelte"
import CreateColumnButton from "./buttons/CreateColumnButton.svelte" import CreateColumnButton from "./buttons/CreateColumnButton.svelte"

View File

@ -1,7 +1,7 @@
<script> <script>
import api from "builderStore/api" import api from "builderStore/api"
import Table from "./Table.svelte" import Table from "./Table.svelte"
import { tables } from 'builderStore/store/backend/' import { tables } from 'stores/backend/'
export let tableId export let tableId
export let rowId export let rowId

View File

@ -1,6 +1,6 @@
<script> <script>
import api from "builderStore/api" import api from "builderStore/api"
import { tables } from 'builderStore/store/backend/' import { tables } from 'stores/backend/'
import Table from "./Table.svelte" import Table from "./Table.svelte"
import CalculateButton from "./buttons/CalculateButton.svelte" import CalculateButton from "./buttons/CalculateButton.svelte"

View File

@ -1,6 +1,6 @@
<script> <script>
import { TextButton, Popover } from "@budibase/bbui" import { TextButton, Popover } from "@budibase/bbui"
import { permissions } from 'builderStore/store/backend/' import { permissions } from 'stores/backend/'
import ManageAccessPopover from "../popovers/ManageAccessPopover.svelte" import ManageAccessPopover from "../popovers/ManageAccessPopover.svelte"
export let resourceId export let resourceId

View File

@ -1,5 +1,5 @@
<script> <script>
import { roles } from 'builderStore/store/backend/' import { roles } from 'stores/backend/'
export let roleId export let roleId

View File

@ -9,7 +9,7 @@
Radio, Radio,
} from "@budibase/bbui" } from "@budibase/bbui"
import { cloneDeep } from "lodash/fp" import { cloneDeep } from "lodash/fp"
import { tables } from 'builderStore/store/backend/' import { tables } from 'stores/backend/'
import { TableNames, UNEDITABLE_USER_FIELDS } from "constants" import { TableNames, UNEDITABLE_USER_FIELDS } from "constants"
import { import {

View File

@ -1,5 +1,5 @@
<script> <script>
import { tables, rows } from 'builderStore/store/backend/' import { tables, rows } from 'stores/backend/'
import { notifier } from "builderStore/store/notifications" import { notifier } from "builderStore/store/notifications"
import RowFieldControl from "../RowFieldControl.svelte" import RowFieldControl from "../RowFieldControl.svelte"
import * as api from "../api" import * as api from "../api"

View File

@ -1,6 +1,6 @@
<script> <script>
import { tables, rows } from 'builderStore/store/backend/' import { tables, rows } from 'stores/backend/'
import { roles } from 'builderStore/store/backend/' import { roles } from 'stores/backend/'
import { notifier } from "builderStore/store/notifications" import { notifier } from "builderStore/store/notifications"
import RowFieldControl from "../RowFieldControl.svelte" import RowFieldControl from "../RowFieldControl.svelte"
import * as backendApi from "../api" import * as backendApi from "../api"

View File

@ -1,5 +1,5 @@
<script> <script>
import { rows } from 'builderStore/store/backend/' import { rows } from 'stores/backend/'
import * as api from "../api" import * as api from "../api"
import { notifier } from "builderStore/store/notifications" import { notifier } from "builderStore/store/notifications"
import ConfirmDialog from "components/common/ConfirmDialog.svelte" import ConfirmDialog from "components/common/ConfirmDialog.svelte"

View File

@ -4,7 +4,7 @@
import api from "builderStore/api" import api from "builderStore/api"
import { notifier } from "builderStore/store/notifications" import { notifier } from "builderStore/store/notifications"
import ErrorsBox from "components/common/ErrorsBox.svelte" import ErrorsBox from "components/common/ErrorsBox.svelte"
import { roles } from 'builderStore/store/backend/' import { roles } from 'stores/backend/'
let basePermissions = [] let basePermissions = []
let selectedRole = {} let selectedRole = {}

View File

@ -1,7 +1,7 @@
<script> <script>
import { Button, Select } from "@budibase/bbui" import { Button, Select } from "@budibase/bbui"
import { tables, views } from 'builderStore/store/backend/' import { tables, views } from 'stores/backend/'
import { notifier } from "builderStore/store/notifications" import { notifier } from "builderStore/store/notifications"
import analytics from "analytics" import analytics from "analytics"

View File

@ -1,8 +1,8 @@
<script> <script>
import { Button, Input } from "@budibase/bbui" import { Button, Input } from "@budibase/bbui"
import { goto } from "@sveltech/routify" import { goto } from "@sveltech/routify"
import { views as viewsStore } from 'builderStore/store/backend/' import { views as viewsStore } from 'stores/backend/'
import { tables } from 'builderStore/store/backend/' import { tables } from 'stores/backend/'
import { notifier } from "builderStore/store/notifications" import { notifier } from "builderStore/store/notifications"
import analytics from "analytics" import analytics from "analytics"

View File

@ -1,6 +1,6 @@
<script> <script>
import { Button, Input, Select, DatePicker } from "@budibase/bbui" import { Button, Input, Select, DatePicker } from "@budibase/bbui"
import { tables, views } from 'builderStore/store/backend/' import { tables, views } from 'stores/backend/'
import { notifier } from "builderStore/store/notifications" import { notifier } from "builderStore/store/notifications"
import analytics from "analytics" import analytics from "analytics"

View File

@ -1,6 +1,6 @@
<script> <script>
import { Button, Select } from "@budibase/bbui" import { Button, Select } from "@budibase/bbui"
import { tables, views } from 'builderStore/store/backend/' import { tables, views } from 'stores/backend/'
import { notifier } from "builderStore/store/notifications" import { notifier } from "builderStore/store/notifications"
import { FIELDS } from "constants/backend" import { FIELDS } from "constants/backend"

View File

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

View File

@ -1,7 +1,7 @@
<script> <script>
import { onMount } from "svelte" import { onMount } from "svelte"
import { goto } from "@sveltech/routify" import { goto } from "@sveltech/routify"
import { database, datasources, queries } from 'builderStore/store/backend/' import { database, datasources, queries } from 'stores/backend/'
import EditDatasourcePopover from "./popovers/EditDatasourcePopover.svelte" import EditDatasourcePopover from "./popovers/EditDatasourcePopover.svelte"
import EditQueryPopover from "./popovers/EditQueryPopover.svelte" import EditQueryPopover from "./popovers/EditQueryPopover.svelte"
import NavItem from "components/common/NavItem.svelte" import NavItem from "components/common/NavItem.svelte"

View File

@ -1,6 +1,6 @@
<script> <script>
import { goto } from "@sveltech/routify" import { goto } from "@sveltech/routify"
import { datasources } from 'builderStore/store/backend/' import { datasources } from 'stores/backend/'
import { notifier } from "builderStore/store/notifications" import { notifier } from "builderStore/store/notifications"
import { Input, Label, ModalContent } from "@budibase/bbui" import { Input, Label, ModalContent } from "@budibase/bbui"
import TableIntegrationMenu from "../TableIntegrationMenu/index.svelte" import TableIntegrationMenu from "../TableIntegrationMenu/index.svelte"

View File

@ -1,6 +1,6 @@
<script> <script>
import { goto } from "@sveltech/routify" import { goto } from "@sveltech/routify"
import { datasources } from 'builderStore/store/backend/' import { datasources } from 'stores/backend/'
import { notifier } from "builderStore/store/notifications" import { notifier } from "builderStore/store/notifications"
import { DropdownMenu } from "@budibase/bbui" import { DropdownMenu } from "@budibase/bbui"
import ConfirmDialog from "components/common/ConfirmDialog.svelte" import ConfirmDialog from "components/common/ConfirmDialog.svelte"

View File

@ -1,6 +1,6 @@
<script> <script>
import { goto } from "@sveltech/routify" import { goto } from "@sveltech/routify"
import { tables, views, database } from 'builderStore/store/backend/' import { tables, views, database } from 'stores/backend/'
import { TableNames } from "constants" import { TableNames } from "constants"
import EditTablePopover from "./popovers/EditTablePopover.svelte" import EditTablePopover from "./popovers/EditTablePopover.svelte"
import EditViewPopover from "./popovers/EditViewPopover.svelte" import EditViewPopover from "./popovers/EditViewPopover.svelte"

View File

@ -1,7 +1,7 @@
<script> <script>
import { goto } from "@sveltech/routify" import { goto } from "@sveltech/routify"
import { store } from "builderStore" import { store } from "builderStore"
import { tables } from 'builderStore/store/backend/' import { tables } from 'stores/backend/'
import { notifier } from "builderStore/store/notifications" import { notifier } from "builderStore/store/notifications"
import { Input, Label, ModalContent, Toggle } from "@budibase/bbui" import { Input, Label, ModalContent, Toggle } from "@budibase/bbui"
import TableDataImport from "../TableDataImport.svelte" import TableDataImport from "../TableDataImport.svelte"

View File

@ -1,6 +1,6 @@
<script> <script>
import { store, allScreens } from "builderStore" import { store, allScreens } from "builderStore"
import { tables } from 'builderStore/store/backend/' import { tables } from 'stores/backend/'
import { notifier } from "builderStore/store/notifications" import { notifier } from "builderStore/store/notifications"
import { DropdownMenu, Button, Input } from "@budibase/bbui" import { DropdownMenu, Button, Input } from "@budibase/bbui"
import ConfirmDialog from "components/common/ConfirmDialog.svelte" import ConfirmDialog from "components/common/ConfirmDialog.svelte"

View File

@ -1,6 +1,6 @@
<script> <script>
import { goto } from "@sveltech/routify" import { goto } from "@sveltech/routify"
import { views } from 'builderStore/store/backend/' import { views } from 'stores/backend/'
import { notifier } from "builderStore/store/notifications" import { notifier } from "builderStore/store/notifications"
import { DropdownMenu, Button, Input } from "@budibase/bbui" import { DropdownMenu, Button, Input } from "@budibase/bbui"
import ConfirmDialog from "components/common/ConfirmDialog.svelte" import ConfirmDialog from "components/common/ConfirmDialog.svelte"

View File

@ -1,5 +1,5 @@
<script> <script>
import { tables } from 'builderStore/store/backend/' import { tables } from 'stores/backend/'
import api from "builderStore/api" import api from "builderStore/api"
import { Select, Label, Multiselect } from "@budibase/bbui" import { Select, Label, Multiselect } from "@budibase/bbui"
import { capitalise } from "../../helpers" import { capitalise } from "../../helpers"

View File

@ -7,7 +7,7 @@
selectedAccessRole, selectedAccessRole,
screenSearchString, screenSearchString,
} from "builderStore" } from "builderStore"
import { roles } from 'builderStore/store/backend/' import { roles } from 'stores/backend/'
import { FrontendTypes } from "constants" import { FrontendTypes } from "constants"
import ComponentNavigationTree from "components/design/NavigationPanel/ComponentNavigationTree/index.svelte" import ComponentNavigationTree from "components/design/NavigationPanel/ComponentNavigationTree/index.svelte"
import Layout from "components/design/NavigationPanel/Layout.svelte" import Layout from "components/design/NavigationPanel/Layout.svelte"

View File

@ -1,7 +1,7 @@
<script> <script>
import { store, allScreens } from "builderStore" import { store, allScreens } from "builderStore"
import { tables } from 'builderStore/store/backend/' import { tables } from 'stores/backend/'
import { roles } from 'builderStore/store/backend/' import { roles } from 'stores/backend/'
import { Input, Select, ModalContent, Toggle } from "@budibase/bbui" import { Input, Select, ModalContent, Toggle } from "@budibase/bbui"
import getTemplates from "builderStore/store/screenTemplates" import getTemplates from "builderStore/store/screenTemplates"
import analytics from "analytics" import analytics from "analytics"

View File

@ -10,8 +10,8 @@
} from "@budibase/bbui" } from "@budibase/bbui"
import { createEventDispatcher } from "svelte" import { createEventDispatcher } from "svelte"
import { store, currentAsset } from "builderStore" import { store, currentAsset } from "builderStore"
import { tables as tablesStore, queries as queriesStore } from 'builderStore/store/backend/' import { tables as tablesStore, queries as queriesStore } from 'stores/backend/'
import { datasources, integrations } from 'builderStore/store/backend/' import { datasources, integrations } from 'stores/backend/'
import { notifier } from "builderStore/store/notifications" import { notifier } from "builderStore/store/notifications"
import ParameterBuilder from "components/integration/QueryParameterBuilder.svelte" import ParameterBuilder from "components/integration/QueryParameterBuilder.svelte"
import IntegrationQueryEditor from "components/integration/index.svelte" import IntegrationQueryEditor from "components/integration/index.svelte"

View File

@ -1,7 +1,7 @@
<script> <script>
import { Select, Label, Spacer } from "@budibase/bbui" import { Select, Label, Spacer } from "@budibase/bbui"
import { store, currentAsset } from "builderStore" import { store, currentAsset } from "builderStore"
import { datasources, integrations, queries } from 'builderStore/store/backend/' import { datasources, integrations, queries } from 'stores/backend/'
import { getBindableProperties } from "builderStore/dataBinding" import { getBindableProperties } from "builderStore/dataBinding"
import ParameterBuilder from "components/integration/QueryParameterBuilder.svelte" import ParameterBuilder from "components/integration/QueryParameterBuilder.svelte"
import IntegrationQueryEditor from "components/integration/index.svelte" import IntegrationQueryEditor from "components/integration/index.svelte"

View File

@ -1,6 +1,6 @@
<script> <script>
import { Select } from "@budibase/bbui" import { Select } from "@budibase/bbui"
import { roles } from 'builderStore/store/backend/' import { roles } from 'stores/backend/'
export let value export let value
</script> </script>

View File

@ -1,6 +1,6 @@
<script> <script>
import { Select } from "@budibase/bbui" import { Select } from "@budibase/bbui"
import { tables } from 'builderStore/store/backend/' import { tables } from 'stores/backend/'
export let value export let value
</script> </script>

View File

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

View File

@ -2,7 +2,7 @@
import { Input, Label, TextButton } from "@budibase/bbui" import { Input, Label, TextButton } from "@budibase/bbui"
import api from "builderStore/api" import api from "builderStore/api"
import { notifier } from "builderStore/store/notifications" import { notifier } from "builderStore/store/notifications"
import { database } from 'builderStore/store/backend/' import { database } from 'stores/backend/'
import analytics from "analytics" import analytics from "analytics"
let keys = { budibase: "" } let keys = { budibase: "" }

View File

@ -1,6 +1,6 @@
<script> <script>
import { store, automationStore } from "builderStore" import { store, automationStore } from "builderStore"
import { roles } from 'builderStore/store/backend/' import { roles } from 'stores/backend/'
import { Button } from "@budibase/bbui" import { Button } from "@budibase/bbui"
import SettingsLink from "components/settings/Link.svelte" import SettingsLink from "components/settings/Link.svelte"
import ThemeEditorDropdown from "components/settings/ThemeEditorDropdown.svelte" import ThemeEditorDropdown from "components/settings/ThemeEditorDropdown.svelte"

View File

@ -1,6 +1,6 @@
<script> <script>
import { params } from "@sveltech/routify" import { params } from "@sveltech/routify"
import { queries } from "builderStore/store/backend/" import { queries } from "stores/backend/"
if ($params.query) { if ($params.query) {
const query = $queries.list.find( const query = $queries.list.find(

View File

@ -1,6 +1,6 @@
<script> <script>
import { params } from "@sveltech/routify" import { params } from "@sveltech/routify"
import { database, queries } from 'builderStore/store/backend/' import { database, queries } from 'stores/backend/'
import QueryInterface from "components/integration/QueryViewer.svelte" import QueryInterface from "components/integration/QueryViewer.svelte"
async function fetchQueryConfig() { async function fetchQueryConfig() {

View File

@ -1,6 +1,6 @@
<script> <script>
import { params } from "@sveltech/routify" import { params } from "@sveltech/routify"
import { datasources } from 'builderStore/store/backend/' import { datasources } from 'stores/backend/'
if ($params.selectedDatasource) { if ($params.selectedDatasource) {
const datasource = $datasources.list.find( const datasource = $datasources.list.find(

View File

@ -1,7 +1,7 @@
<script> <script>
import { goto, beforeUrlChange } from "@sveltech/routify" import { goto, beforeUrlChange } from "@sveltech/routify"
import { Button, Heading, Body, Spacer } from "@budibase/bbui" import { Button, Heading, Body, Spacer } from "@budibase/bbui"
import { datasources, integrations, queries } from 'builderStore/store/backend/' import { datasources, integrations, queries } from 'stores/backend/'
import { notifier } from "builderStore/store/notifications" import { notifier } from "builderStore/store/notifications"
import IntegrationConfigForm from "components/backend/DatasourceNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte" import IntegrationConfigForm from "components/backend/DatasourceNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte"
import ICONS from "components/backend/DatasourceNavigator/icons" import ICONS from "components/backend/DatasourceNavigator/icons"

View File

@ -1,5 +1,5 @@
<script> <script>
import { datasources } from 'builderStore/store/backend/' import { datasources } from 'stores/backend/'
import { goto, leftover } from "@sveltech/routify" import { goto, leftover } from "@sveltech/routify"
import { onMount } from "svelte" import { onMount } from "svelte"

View File

@ -1,5 +1,5 @@
<script> <script>
import { datasources, tables } from 'builderStore/store/backend/' import { datasources, tables } from 'stores/backend/'
import { goto } from "@sveltech/routify" import { goto } from "@sveltech/routify"
import { onMount } from "svelte" import { onMount } from "svelte"

View File

@ -1,6 +1,6 @@
<script> <script>
import { params } from "@sveltech/routify" import { params } from "@sveltech/routify"
import { tables } from 'builderStore/store/backend/' import { tables } from 'stores/backend/'
if ($params.selectedTable) { if ($params.selectedTable) {
const table = $tables.list.find( const table = $tables.list.find(

View File

@ -1,6 +1,6 @@
<script> <script>
import TableDataTable from "components/backend/DataTable/DataTable.svelte" import TableDataTable from "components/backend/DataTable/DataTable.svelte"
import { tables, database } from 'builderStore/store/backend/' import { tables, database } from 'stores/backend/'
</script> </script>
{#if $database?._id && $tables?.selected?.name} {#if $database?._id && $tables?.selected?.name}

View File

@ -1,5 +1,5 @@
<script> <script>
import { tables } from 'builderStore/store/backend/' import { tables } from 'stores/backend/'
import { goto, leftover } from "@sveltech/routify" import { goto, leftover } from "@sveltech/routify"
import { onMount } from "svelte" import { onMount } from "svelte"

View File

@ -1,5 +1,5 @@
<script> <script>
import { tables } from 'builderStore/store/backend/' import { tables } from 'stores/backend/'
import { goto } from "@sveltech/routify" import { goto } from "@sveltech/routify"
import { onMount } from "svelte" import { onMount } from "svelte"

View File

@ -1,6 +1,6 @@
<script> <script>
import { params } from "@sveltech/routify" import { params } from "@sveltech/routify"
import { tables, views } from 'builderStore/store/backend/' import { tables, views } from 'stores/backend/'
if ($params.selectedView) { if ($params.selectedView) {
let view let view

View File

@ -1,6 +1,6 @@
<script> <script>
import ViewDataTable from "components/backend/DataTable/ViewDataTable" import ViewDataTable from "components/backend/DataTable/ViewDataTable"
import { views, database } from 'builderStore/store/backend/' import { views, database } from 'stores/backend/'
$: selectedView = $views.selected $: selectedView = $views.selected
</script> </script>

View File

@ -1,8 +1,8 @@
import { writable } from "svelte/store" import { writable } from "svelte/store"
import { queries } from "./" import { queries } from "./"
import api from "../../api" import api from "builderStore/api"
function createDatasourcesStore() { export function createDatasourcesStore(_api = api) {
const { subscribe, update, set } = writable({ const { subscribe, update, set } = writable({
list: [], list: [],
selected: null, selected: null,

View File

@ -1,7 +1,8 @@
import { writable } from "svelte/store" import { writable } from "svelte/store"
import api from "../../api" import api from "builderStore/api"
function createPermissionStore() {
export function createPermissionStore() {
const { subscribe, set } = writable([]) const { subscribe, set } = writable([])
return { return {

View File

@ -1,8 +1,9 @@
import { writable, get } from "svelte/store" import { writable, get } from "svelte/store"
import { datasources, integrations } from "./" import { datasources, integrations } from "./"
import api from "../../api" import api from "builderStore/api"
function createQueriesStore() {
export function createQueriesStore() {
const { subscribe, set, update } = writable({ list: [], selected: null }) const { subscribe, set, update } = writable({ list: [], selected: null })
return { return {

View File

@ -1,7 +1,8 @@
import { writable } from "svelte/store" import { writable } from "svelte/store"
import api from "../../api" import api from "builderStore/api"
function createRolesStore() {
export function createRolesStore() {
const { subscribe, set } = writable([]) const { subscribe, set } = writable([])
return { return {

View File

@ -1,7 +1,7 @@
import { writable, get } from "svelte/store" import { writable, get } from "svelte/store"
import { views } from "./" import { views } from "./"
function createRowsStore() { export function createRowsStore() {
const { subscribe } = writable([]) const { subscribe } = writable([])
return { return {

View File

@ -1,9 +1,10 @@
import { writable, get } from "svelte/store" import { writable, get } from "svelte/store"
import { views } from "./" import { views } from "./"
import { cloneDeep } from "lodash/fp" import { cloneDeep } from "lodash/fp"
import api from "../../api" import api from "builderStore/api"
function createTablesStore() {
export function createTablesStore() {
const store = writable({ const store = writable({
list: [], list: [],
selected: {}, selected: {},

View File

@ -0,0 +1,26 @@
import { database } from "../"
describe("Backend DataSources Store", () => {
let state;
let unsub;
beforeEach(() => {
unsub = database.subscribe(s => state = s);
})
afterEach(() => {
unsub()
})
it("initialises correctly", () => {
expect(state.list, [])
})
})
const api = {
post: () => ({}),
get: () => ({}),
patch: () => ({}),
delete: () => ({}),
put: () => ({}),
}

View File

@ -0,0 +1,24 @@
import { get } from 'svelte/store'
import { createDatasourcesStore } from "../datasources"
const mockApi = {
post: () => ({}),
get: () => ({}),
patch: () => ({}),
delete: () => ({}),
put: () => ({}),
}
describe("Automation Data Object", () => {
let store
beforeEach(() => {
store = createDatasourcesStore(mockApi)
})
it("Inits properly", () => {
const value = get(store)
expect(value).toBe(true)
})
})

View File

@ -1,8 +1,8 @@
import { writable, get } from "svelte/store" import { writable, get } from "svelte/store"
import { tables } from "./" import { tables } from "./"
import api from "../../api" import api from "builderStore/api"
function createViewsStore() { export function createViewsStore() {
const { subscribe, update } = writable({ const { subscribe, update } = writable({
list: [], list: [],
selected: null, selected: null,