Update to support new stores
This commit is contained in:
parent
88e700c19e
commit
b3b7c54901
|
@ -1,10 +1,7 @@
|
|||
import { cloneDeep } from "lodash/fp"
|
||||
import { get } from "svelte/store"
|
||||
import { store } from "builderStore"
|
||||
import {
|
||||
tables as tablesStore,
|
||||
queries as queriesStores,
|
||||
} from "stores/backend/"
|
||||
import { tables as tablesStore, queries as queriesStores } from "stores/backend"
|
||||
import { findComponentPath } from "./storeUtils"
|
||||
import { makePropSafe } from "@budibase/string-templates"
|
||||
import { TableNames } from "../constants"
|
||||
|
|
|
@ -15,7 +15,7 @@ import {
|
|||
queries,
|
||||
database,
|
||||
tables,
|
||||
} from "stores/backend/"
|
||||
} from "stores/backend"
|
||||
|
||||
import { fetchComponentLibDefinitions } from "../loadComponentLibraries"
|
||||
import api from "../api"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script>
|
||||
import { processStringSync } from "@budibase/string-templates"
|
||||
import { get } from "lodash/fp"
|
||||
import { tables } from 'stores/backend/'
|
||||
import { tables } from "stores/backend"
|
||||
|
||||
export let block
|
||||
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
<script>
|
||||
<<<<<<< HEAD
|
||||
import { backendUiStore, automationStore } from "builderStore"
|
||||
import { goto } from "@roxi/routify"
|
||||
=======
|
||||
import { automationStore } from "builderStore"
|
||||
import { database } from 'stores/backend/'
|
||||
import { goto } from "@sveltech/routify"
|
||||
>>>>>>> d803aa0bd7a74220e432f4a1b338abdd7fbe9b7d
|
||||
import { database } from "stores/backend"
|
||||
import { notifier } from "builderStore/store/notifications"
|
||||
import { Input, ModalContent } from "@budibase/bbui"
|
||||
import analytics from "analytics"
|
||||
|
|
|
@ -1,12 +1,7 @@
|
|||
<script>
|
||||
<<<<<<< HEAD
|
||||
import { goto } from "@roxi/routify"
|
||||
import { automationStore, backendUiStore } from "builderStore"
|
||||
=======
|
||||
import { goto } from "@sveltech/routify"
|
||||
import { automationStore } from "builderStore"
|
||||
import { database } from 'stores/backend/'
|
||||
>>>>>>> d803aa0bd7a74220e432f4a1b338abdd7fbe9b7d
|
||||
import { database } from "stores/backend"
|
||||
import { notifier } from "builderStore/store/notifications"
|
||||
import { DropdownMenu } from "@budibase/bbui"
|
||||
import { DropdownContainer, DropdownItem } from "components/common/Dropdowns"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script>
|
||||
import { tables } from 'stores/backend/'
|
||||
import { tables } from "stores/backend"
|
||||
import { Select } from "@budibase/bbui"
|
||||
import DrawerBindableInput from "../../common/DrawerBindableInput.svelte"
|
||||
import AutomationBindingPanel from "./AutomationBindingPanel.svelte"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<script>
|
||||
import { automationStore } from "builderStore"
|
||||
import { database } from 'stores/backend/'
|
||||
import { database } from "stores/backend"
|
||||
import { notifier } from "builderStore/store/notifications"
|
||||
import AutomationBlockSetup from "./AutomationBlockSetup.svelte"
|
||||
import { Button, Modal } from "@budibase/bbui"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script>
|
||||
import { tables } from 'stores/backend/'
|
||||
import { tables } from "stores/backend"
|
||||
import { Select } from "@budibase/bbui"
|
||||
|
||||
export let value
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<script>
|
||||
import { automationStore } from "builderStore"
|
||||
import { database } from 'stores/backend/'
|
||||
import { database } from "stores/backend"
|
||||
import WebhookDisplay from "./WebhookDisplay.svelte"
|
||||
import { ModalContent } from "@budibase/bbui"
|
||||
import { onMount, onDestroy } from "svelte"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script>
|
||||
import { tables, views } from 'stores/backend/'
|
||||
import { tables, views } from "stores/backend"
|
||||
|
||||
import CreateRowButton from "./buttons/CreateRowButton.svelte"
|
||||
import CreateColumnButton from "./buttons/CreateColumnButton.svelte"
|
||||
|
|
|
@ -1,11 +1,4 @@
|
|||
<script>
|
||||
<<<<<<< HEAD
|
||||
import { params } from "@roxi/routify"
|
||||
import { backendUiStore } from "builderStore"
|
||||
import { notifier } from "builderStore/store/notifications"
|
||||
import * as api from "./api"
|
||||
=======
|
||||
>>>>>>> d803aa0bd7a74220e432f4a1b338abdd7fbe9b7d
|
||||
import Table from "./Table.svelte"
|
||||
|
||||
export let query = {}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script>
|
||||
import api from "builderStore/api"
|
||||
import Table from "./Table.svelte"
|
||||
import { tables } from 'stores/backend/'
|
||||
import { tables } from "stores/backend"
|
||||
|
||||
export let tableId
|
||||
export let rowId
|
||||
|
@ -12,9 +12,7 @@
|
|||
|
||||
$: data = row?.[fieldName] ?? []
|
||||
$: linkedTableId = data?.length ? data[0].tableId : null
|
||||
$: linkedTable = $tables.list.find(
|
||||
table => table._id === linkedTableId
|
||||
)
|
||||
$: linkedTable = $tables.list.find(table => table._id === linkedTableId)
|
||||
$: schema = linkedTable?.schema
|
||||
$: table = $tables.list.find(table => table._id === tableId)
|
||||
$: fetchData(tableId, rowId)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<script>
|
||||
import api from "builderStore/api"
|
||||
import { tables } from 'stores/backend/'
|
||||
import { tables } from "stores/backend"
|
||||
|
||||
import Table from "./Table.svelte"
|
||||
import CalculateButton from "./buttons/CalculateButton.svelte"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<script>
|
||||
import { TextButton, Popover } from "@budibase/bbui"
|
||||
import { permissions } from 'stores/backend/'
|
||||
import { permissions } from "stores/backend"
|
||||
import ManageAccessPopover from "../popovers/ManageAccessPopover.svelte"
|
||||
|
||||
export let resourceId
|
||||
|
@ -10,9 +10,7 @@
|
|||
let resourcePermissions
|
||||
|
||||
async function openDropdown() {
|
||||
resourcePermissions = await permissions.forResource(
|
||||
resourceId
|
||||
)
|
||||
resourcePermissions = await permissions.forResource(resourceId)
|
||||
dropdown.show()
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script>
|
||||
import { roles } from 'stores/backend/'
|
||||
import { roles } from "stores/backend"
|
||||
|
||||
export let roleId
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
Radio,
|
||||
} from "@budibase/bbui"
|
||||
import { cloneDeep } from "lodash/fp"
|
||||
import { tables } from 'stores/backend/'
|
||||
import { tables } from "stores/backend"
|
||||
|
||||
import { TableNames, UNEDITABLE_USER_FIELDS } from "constants"
|
||||
import {
|
||||
|
@ -56,9 +56,7 @@
|
|||
UNEDITABLE_USER_FIELDS.includes(field.name)
|
||||
$: invalid =
|
||||
(field.type === LINK_TYPE && !field.tableId) ||
|
||||
Object.keys($tables.draft.schema).some(
|
||||
key => key === field.name
|
||||
)
|
||||
Object.keys($tables.draft.schema).some(key => key === field.name)
|
||||
|
||||
// used to select what different options can be displayed for column type
|
||||
$: canBeSearched =
|
||||
|
@ -72,18 +70,14 @@
|
|||
|
||||
async function saveColumn() {
|
||||
if (field.type === AUTO_COL) {
|
||||
field = buildAutoColumn(
|
||||
$tables.draft.name,
|
||||
field.name,
|
||||
field.subtype
|
||||
)
|
||||
field = buildAutoColumn($tables.draft.name, field.name, field.subtype)
|
||||
}
|
||||
tables.saveField({
|
||||
originalName,
|
||||
field,
|
||||
primaryDisplay,
|
||||
indexes,
|
||||
})
|
||||
originalName,
|
||||
field,
|
||||
primaryDisplay,
|
||||
indexes,
|
||||
})
|
||||
onClosed()
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script>
|
||||
import { tables, rows } from 'stores/backend/'
|
||||
import { tables, rows } from "stores/backend"
|
||||
import { notifier } from "builderStore/store/notifications"
|
||||
import RowFieldControl from "../RowFieldControl.svelte"
|
||||
import * as api from "../api"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<script>
|
||||
import { tables, rows } from 'stores/backend/'
|
||||
import { roles } from 'stores/backend/'
|
||||
import { tables, rows } from "stores/backend"
|
||||
import { roles } from "stores/backend"
|
||||
import { notifier } from "builderStore/store/notifications"
|
||||
import RowFieldControl from "../RowFieldControl.svelte"
|
||||
import * as backendApi from "../api"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script>
|
||||
import { rows } from 'stores/backend/'
|
||||
import { rows } from "stores/backend"
|
||||
import * as api from "../api"
|
||||
import { notifier } from "builderStore/store/notifications"
|
||||
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
|
||||
|
|
|
@ -4,16 +4,14 @@
|
|||
import api from "builderStore/api"
|
||||
import { notifier } from "builderStore/store/notifications"
|
||||
import ErrorsBox from "components/common/ErrorsBox.svelte"
|
||||
import { roles } from 'stores/backend/'
|
||||
import { roles } from "stores/backend"
|
||||
|
||||
let basePermissions = []
|
||||
let selectedRole = {}
|
||||
let errors = []
|
||||
let builtInRoles = ["Admin", "Power", "Basic", "Public"]
|
||||
$: selectedRoleId = selectedRole._id
|
||||
$: otherRoles = $roles.filter(
|
||||
role => role._id !== selectedRoleId
|
||||
)
|
||||
$: otherRoles = $roles.filter(role => role._id !== selectedRoleId)
|
||||
$: isCreating = selectedRoleId == null || selectedRoleId === ""
|
||||
|
||||
const fetchBasePermissions = async () => {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script>
|
||||
import { Button, Select } from "@budibase/bbui"
|
||||
|
||||
import { tables, views } from 'stores/backend/'
|
||||
|
||||
import { tables, views } from "stores/backend"
|
||||
import { notifier } from "builderStore/store/notifications"
|
||||
import analytics from "analytics"
|
||||
|
||||
|
@ -23,9 +23,7 @@
|
|||
export let view = {}
|
||||
export let onClosed
|
||||
|
||||
$: viewTable = $tables.list.find(
|
||||
({ _id }) => _id === $views.selected.tableId
|
||||
)
|
||||
$: viewTable = $tables.list.find(({ _id }) => _id === $views.selected.tableId)
|
||||
$: fields =
|
||||
viewTable &&
|
||||
Object.keys(viewTable.schema).filter(
|
||||
|
|
|
@ -1,13 +1,8 @@
|
|||
<script>
|
||||
import { Button, Input } from "@budibase/bbui"
|
||||
<<<<<<< HEAD
|
||||
import { goto } from "@roxi/routify"
|
||||
import { backendUiStore } from "builderStore"
|
||||
=======
|
||||
import { goto } from "@sveltech/routify"
|
||||
import { views as viewsStore } from 'stores/backend/'
|
||||
import { tables } from 'stores/backend/'
|
||||
>>>>>>> d803aa0bd7a74220e432f4a1b338abdd7fbe9b7d
|
||||
import { views as viewsStore } from "stores/backend"
|
||||
import { tables } from "stores/backend"
|
||||
import { notifier } from "builderStore/store/notifications"
|
||||
import analytics from "analytics"
|
||||
|
||||
|
@ -16,9 +11,7 @@
|
|||
let name
|
||||
let field
|
||||
|
||||
$: views = $tables.list.flatMap(table =>
|
||||
Object.keys(table.views || {})
|
||||
)
|
||||
$: views = $tables.list.flatMap(table => Object.keys(table.views || {}))
|
||||
|
||||
function saveView() {
|
||||
if (views.includes(name)) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<script>
|
||||
import { Button, Input, Select, DatePicker } from "@budibase/bbui"
|
||||
import { tables, views } from 'stores/backend/'
|
||||
import { tables, views } from "stores/backend"
|
||||
import { notifier } from "builderStore/store/notifications"
|
||||
import analytics from "analytics"
|
||||
|
||||
|
@ -49,9 +49,7 @@
|
|||
export let view = {}
|
||||
export let onClosed
|
||||
|
||||
$: viewTable = $tables.list.find(
|
||||
({ _id }) => _id === $views.selected.tableId
|
||||
)
|
||||
$: viewTable = $tables.list.find(({ _id }) => _id === $views.selected.tableId)
|
||||
$: fields = viewTable && Object.keys(viewTable.schema)
|
||||
|
||||
function saveView() {
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
<script>
|
||||
import { Button, Select } from "@budibase/bbui"
|
||||
import { tables, views } from 'stores/backend/'
|
||||
import { tables, views } from "stores/backend"
|
||||
import { notifier } from "builderStore/store/notifications"
|
||||
import { FIELDS } from "constants/backend"
|
||||
|
||||
export let view = {}
|
||||
export let onClosed
|
||||
|
||||
$: viewTable = $tables.list.find(
|
||||
({ _id }) => _id === $views.selected.tableId
|
||||
)
|
||||
$: viewTable = $tables.list.find(({ _id }) => _id === $views.selected.tableId)
|
||||
$: fields =
|
||||
viewTable &&
|
||||
Object.entries(viewTable.schema)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script>
|
||||
import { roles, permissions as permissionsStore } from 'stores/backend/'
|
||||
import { roles, permissions as permissionsStore } from "stores/backend"
|
||||
import { notifier } from "builderStore/store/notifications"
|
||||
import { Button, Label, Input, Select, Spacer } from "@budibase/bbui"
|
||||
|
||||
|
@ -15,9 +15,7 @@
|
|||
})
|
||||
|
||||
// Show updated permissions in UI: REMOVE
|
||||
permissions = await permissionsStore.forResource(
|
||||
resourceId
|
||||
)
|
||||
permissions = await permissionsStore.forResource(resourceId)
|
||||
notifier.success("Updated permissions.")
|
||||
// TODO: update permissions
|
||||
// permissions[]
|
||||
|
|
|
@ -1,12 +1,7 @@
|
|||
<script>
|
||||
import { onMount } from "svelte"
|
||||
<<<<<<< HEAD
|
||||
import { goto } from "@roxi/routify"
|
||||
import { backendUiStore } from "builderStore"
|
||||
=======
|
||||
import { goto } from "@sveltech/routify"
|
||||
import { database, datasources, queries } from 'stores/backend/'
|
||||
>>>>>>> d803aa0bd7a74220e432f4a1b338abdd7fbe9b7d
|
||||
import { database, datasources, queries } from "stores/backend"
|
||||
import EditDatasourcePopover from "./popovers/EditDatasourcePopover.svelte"
|
||||
import EditQueryPopover from "./popovers/EditQueryPopover.svelte"
|
||||
import NavItem from "components/common/NavItem.svelte"
|
||||
|
|
|
@ -1,11 +1,6 @@
|
|||
<script>
|
||||
<<<<<<< HEAD
|
||||
import { goto, params } from "@roxi/routify"
|
||||
import { backendUiStore, store } from "builderStore"
|
||||
=======
|
||||
import { goto } from "@sveltech/routify"
|
||||
import { datasources } from 'stores/backend/'
|
||||
>>>>>>> d803aa0bd7a74220e432f4a1b338abdd7fbe9b7d
|
||||
import { goto } from "@roxi/routify"
|
||||
import { datasources } from "stores/backend"
|
||||
import { notifier } from "builderStore/store/notifications"
|
||||
import { Input, Label, ModalContent } from "@budibase/bbui"
|
||||
import TableIntegrationMenu from "../TableIntegrationMenu/index.svelte"
|
||||
|
@ -19,9 +14,7 @@
|
|||
function checkValid(evt) {
|
||||
const datasourceName = evt.target.value
|
||||
if (
|
||||
$datasources?.list.some(
|
||||
datasource => datasource.name === datasourceName
|
||||
)
|
||||
$datasources?.list.some(datasource => datasource.name === datasourceName)
|
||||
) {
|
||||
error = `Datasource with name ${datasourceName} already exists. Please choose another name.`
|
||||
return
|
||||
|
|
|
@ -1,11 +1,6 @@
|
|||
<script>
|
||||
<<<<<<< HEAD
|
||||
import { goto } from "@roxi/routify"
|
||||
import { backendUiStore } from "builderStore"
|
||||
=======
|
||||
import { goto } from "@sveltech/routify"
|
||||
import { datasources } from 'stores/backend/'
|
||||
>>>>>>> d803aa0bd7a74220e432f4a1b338abdd7fbe9b7d
|
||||
import { datasources } from "stores/backend"
|
||||
import { notifier } from "builderStore/store/notifications"
|
||||
import { DropdownMenu } from "@budibase/bbui"
|
||||
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
|
||||
|
|
|
@ -1,18 +1,12 @@
|
|||
<script>
|
||||
<<<<<<< HEAD
|
||||
import { goto } from "@roxi/routify"
|
||||
import { backendUiStore } from "builderStore"
|
||||
=======
|
||||
import { goto } from "@sveltech/routify"
|
||||
import { tables, views, database } from 'stores/backend/'
|
||||
>>>>>>> d803aa0bd7a74220e432f4a1b338abdd7fbe9b7d
|
||||
import { tables, views, database } from "stores/backend"
|
||||
import { TableNames } from "constants"
|
||||
import EditTablePopover from "./popovers/EditTablePopover.svelte"
|
||||
import EditViewPopover from "./popovers/EditViewPopover.svelte"
|
||||
import NavItem from "components/common/NavItem.svelte"
|
||||
|
||||
$: selectedView =
|
||||
$views.selected && $views.selected.name
|
||||
$: selectedView = $views.selected && $views.selected.name
|
||||
|
||||
function selectTable(table) {
|
||||
tables.select(table)
|
||||
|
@ -33,7 +27,6 @@
|
|||
...table.views[viewName],
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
{#if $database?._id}
|
||||
|
|
|
@ -1,12 +1,7 @@
|
|||
<script>
|
||||
<<<<<<< HEAD
|
||||
import { goto } from "@roxi/routify"
|
||||
import { backendUiStore, store } from "builderStore"
|
||||
=======
|
||||
import { goto } from "@sveltech/routify"
|
||||
import { store } from "builderStore"
|
||||
import { tables } from 'stores/backend/'
|
||||
>>>>>>> d803aa0bd7a74220e432f4a1b338abdd7fbe9b7d
|
||||
import { tables } from "stores/backend"
|
||||
import { notifier } from "builderStore/store/notifications"
|
||||
import { Input, Label, ModalContent, Toggle } from "@budibase/bbui"
|
||||
import TableDataImport from "../TableDataImport.svelte"
|
||||
|
|
|
@ -1,12 +1,7 @@
|
|||
<script>
|
||||
<<<<<<< HEAD
|
||||
import { goto } from "@roxi/routify"
|
||||
import { backendUiStore, store, allScreens } from "builderStore"
|
||||
=======
|
||||
import { goto } from '@sveltech/routify'
|
||||
import { store, allScreens } from "builderStore"
|
||||
import { tables } from 'stores/backend/'
|
||||
>>>>>>> d803aa0bd7a74220e432f4a1b338abdd7fbe9b7d
|
||||
import { tables } from "stores/backend"
|
||||
import { notifier } from "builderStore/store/notifications"
|
||||
import { DropdownMenu, Button, Input } from "@budibase/bbui"
|
||||
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
|
||||
|
@ -62,9 +57,10 @@
|
|||
|
||||
function checkValid(evt) {
|
||||
const tableName = evt.target.value
|
||||
error = originalName !== tableName
|
||||
? `Table with name ${tableName} already exists. Please choose another name.`
|
||||
: ""
|
||||
error =
|
||||
originalName !== tableName
|
||||
? `Table with name ${tableName} already exists. Please choose another name.`
|
||||
: ""
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -1,11 +1,6 @@
|
|||
<script>
|
||||
<<<<<<< HEAD
|
||||
import { goto } from "@roxi/routify"
|
||||
import { backendUiStore } from "builderStore"
|
||||
=======
|
||||
import { goto } from "@sveltech/routify"
|
||||
import { views } from 'stores/backend/'
|
||||
>>>>>>> d803aa0bd7a74220e432f4a1b338abdd7fbe9b7d
|
||||
import { views } from "stores/backend"
|
||||
import { notifier } from "builderStore/store/notifications"
|
||||
import { DropdownMenu, Button, Input } from "@budibase/bbui"
|
||||
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script>
|
||||
import { tables } from 'stores/backend/'
|
||||
import { tables } from "stores/backend"
|
||||
import api from "builderStore/api"
|
||||
import { Select, Label, Multiselect } from "@budibase/bbui"
|
||||
import { capitalise } from "../../helpers"
|
||||
|
@ -13,9 +13,7 @@
|
|||
$: linkedRows = linkedIds
|
||||
$: label = capitalise(schema.name)
|
||||
$: linkedTableId = schema.tableId
|
||||
$: linkedTable = $tables.list.find(
|
||||
table => table._id === linkedTableId
|
||||
)
|
||||
$: linkedTable = $tables.list.find(table => table._id === linkedTableId)
|
||||
$: fetchRows(linkedTableId)
|
||||
|
||||
async function fetchRows(linkedTableId) {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
selectedAccessRole,
|
||||
screenSearchString,
|
||||
} from "builderStore"
|
||||
import { roles } from 'stores/backend/'
|
||||
import { roles } from "stores/backend"
|
||||
import { FrontendTypes } from "constants"
|
||||
import ComponentNavigationTree from "components/design/NavigationPanel/ComponentNavigationTree/index.svelte"
|
||||
import Layout from "components/design/NavigationPanel/Layout.svelte"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script>
|
||||
import { store, allScreens } from "builderStore"
|
||||
import { tables } from 'stores/backend/'
|
||||
import { roles } from 'stores/backend/'
|
||||
import { tables } from "stores/backend"
|
||||
import { roles } from "stores/backend"
|
||||
import { Input, Select, ModalContent, Toggle } from "@budibase/bbui"
|
||||
import getTemplates from "builderStore/store/screenTemplates"
|
||||
import analytics from "analytics"
|
||||
|
|
|
@ -10,8 +10,11 @@
|
|||
} from "@budibase/bbui"
|
||||
import { createEventDispatcher } from "svelte"
|
||||
import { store, currentAsset } from "builderStore"
|
||||
import { tables as tablesStore, queries as queriesStore } from 'stores/backend/'
|
||||
import { datasources, integrations } from 'stores/backend/'
|
||||
import {
|
||||
tables as tablesStore,
|
||||
queries as queriesStore,
|
||||
} from "stores/backend"
|
||||
import { datasources, integrations } from "stores/backend"
|
||||
import { notifier } from "builderStore/store/notifications"
|
||||
import ParameterBuilder from "components/integration/QueryParameterBuilder.svelte"
|
||||
import IntegrationQueryEditor from "components/integration/index.svelte"
|
||||
|
@ -83,9 +86,8 @@
|
|||
}
|
||||
|
||||
function fetchQueryDefinition(query) {
|
||||
const source = $datasources.list.find(
|
||||
ds => ds._id === query.datasourceId
|
||||
).source
|
||||
const source = $datasources.list.find(ds => ds._id === query.datasourceId)
|
||||
.source
|
||||
return $integrations[source].query[query.queryVerb]
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
<script>
|
||||
import { Select, Label } from "@budibase/bbui"
|
||||
import { store, currentAsset, backendUiStore } from "builderStore"
|
||||
import { store, currentAsset } from "builderStore"
|
||||
import { tables } from "stores/backend"
|
||||
import { getBindableProperties } from "builderStore/dataBinding"
|
||||
import DrawerBindableInput from "components/common/DrawerBindableInput.svelte"
|
||||
|
||||
export let parameters
|
||||
|
||||
$: tableOptions = $backendUiStore.tables || []
|
||||
$: tableOptions = $tables || []
|
||||
$: bindings = getBindableProperties($currentAsset, $store.selectedComponentId)
|
||||
</script>
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<script>
|
||||
import { Select, Label, Spacer } from "@budibase/bbui"
|
||||
import { store, currentAsset } from "builderStore"
|
||||
import { datasources, integrations, queries } from 'stores/backend/'
|
||||
import { datasources, integrations, queries } from "stores/backend"
|
||||
import { getBindableProperties } from "builderStore/dataBinding"
|
||||
import ParameterBuilder from "components/integration/QueryParameterBuilder.svelte"
|
||||
import IntegrationQueryEditor from "components/integration/index.svelte"
|
||||
|
@ -25,14 +25,7 @@
|
|||
}
|
||||
</script>
|
||||
|
||||
<<<<<<< HEAD
|
||||
<div class="root">
|
||||
<Label small>Datasource</Label>
|
||||
<Select thin secondary bind:value={parameters.datasourceId}>
|
||||
<option value="" />
|
||||
{#each $backendUiStore.datasources as datasource}
|
||||
<option value={datasource._id}>{datasource.name}</option>
|
||||
=======
|
||||
|
||||
<Label small>Datasource</Label>
|
||||
<Select thin secondary bind:value={parameters.datasourceId}>
|
||||
<option value="" />
|
||||
|
@ -49,7 +42,6 @@
|
|||
<option value="" />
|
||||
{#each $queries.list.filter(query => query.datasourceId === datasource._id) as query}
|
||||
<option value={query._id}>{query.name}</option>
|
||||
>>>>>>> d803aa0bd7a74220e432f4a1b338abdd7fbe9b7d
|
||||
{/each}
|
||||
</Select>
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<script>
|
||||
import { Select, Label, Body } from "@budibase/bbui"
|
||||
import { store, currentAsset, backendUiStore } from "builderStore"
|
||||
import { store, currentAsset } from "builderStore"
|
||||
import { tables } from "stores/backend"
|
||||
import {
|
||||
getDataProviderComponents,
|
||||
getSchemaForDatasource,
|
||||
|
@ -14,7 +15,7 @@
|
|||
$store.selectedComponentId
|
||||
)
|
||||
$: schemaFields = getSchemaFields(parameters?.tableId)
|
||||
$: tableOptions = $backendUiStore.tables || []
|
||||
$: tableOptions = $tables || []
|
||||
|
||||
const getSchemaFields = tableId => {
|
||||
const { schema } = getSchemaForDatasource({ type: "table", tableId })
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<script>
|
||||
import { Select } from "@budibase/bbui"
|
||||
import { roles } from 'stores/backend/'
|
||||
import { roles } from "stores/backend"
|
||||
|
||||
export let value
|
||||
</script>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<script>
|
||||
import { Select } from "@budibase/bbui"
|
||||
import { tables } from 'stores/backend/'
|
||||
import { tables } from "stores/backend"
|
||||
|
||||
export let value
|
||||
</script>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
import IntegrationQueryEditor from "components/integration/index.svelte"
|
||||
import ExternalDataSourceTable from "components/backend/DataTable/ExternalDataSourceTable.svelte"
|
||||
import ParameterBuilder from "components/integration/QueryParameterBuilder.svelte"
|
||||
import { datasources, integrations, queries } from 'stores/backend/'
|
||||
import { datasources, integrations, queries } from "stores/backend"
|
||||
|
||||
const PREVIEW_HEADINGS = [
|
||||
{
|
||||
|
@ -39,9 +39,7 @@
|
|||
let parameters
|
||||
let data = []
|
||||
|
||||
$: datasource = $datasources.list.find(
|
||||
ds => ds._id === query.datasourceId
|
||||
)
|
||||
$: datasource = $datasources.list.find(ds => ds._id === query.datasourceId)
|
||||
|
||||
$: query.schema = fields.reduce(
|
||||
(acc, next) => ({
|
||||
|
@ -113,10 +111,7 @@
|
|||
|
||||
async function saveQuery() {
|
||||
try {
|
||||
const { _id } = await queries.save(
|
||||
query.datasourceId,
|
||||
query
|
||||
)
|
||||
const { _id } = await queries.save(query.datasourceId, query)
|
||||
notifier.success(`Query saved successfully.`)
|
||||
$goto(`../../${_id}`)
|
||||
} catch (err) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
import { Input, Label, TextButton } from "@budibase/bbui"
|
||||
import api from "builderStore/api"
|
||||
import { notifier } from "builderStore/store/notifications"
|
||||
import { database } from 'stores/backend/'
|
||||
import { database } from "stores/backend"
|
||||
import analytics from "analytics"
|
||||
|
||||
let keys = { budibase: "" }
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<script>
|
||||
import { store, automationStore } from "builderStore"
|
||||
import { roles } from 'stores/backend/'
|
||||
import { roles } from "stores/backend"
|
||||
import { Button } from "@budibase/bbui"
|
||||
import SettingsLink from "components/settings/Link.svelte"
|
||||
import ThemeEditorDropdown from "components/settings/ThemeEditorDropdown.svelte"
|
||||
|
|
|
@ -1,16 +1,9 @@
|
|||
<script>
|
||||
<<<<<<< HEAD:packages/builder/src/pages/builder/[application]/data/datasource/[selectedDatasource]/[query]/_layout.svelte
|
||||
import { params } from "@roxi/routify"
|
||||
import { backendUiStore } from "builderStore"
|
||||
=======
|
||||
import { params } from "@sveltech/routify"
|
||||
import { queries } from "stores/backend/"
|
||||
>>>>>>> d803aa0bd7a74220e432f4a1b338abdd7fbe9b7d:packages/builder/src/pages/[application]/data/datasource/[selectedDatasource]/[query]/_layout.svelte
|
||||
import { queries } from "stores/backend"
|
||||
|
||||
if ($params.query) {
|
||||
const query = $queries.list.find(
|
||||
m => m._id === $params.query
|
||||
)
|
||||
const query = $queries.list.find(m => m._id === $params.query)
|
||||
if (query) {
|
||||
queries.select(query)
|
||||
}
|
||||
|
|
|
@ -1,11 +1,6 @@
|
|||
<script>
|
||||
<<<<<<< HEAD:packages/builder/src/pages/builder/[application]/data/datasource/[selectedDatasource]/[query]/index.svelte
|
||||
import { params } from "@roxi/routify"
|
||||
import { backendUiStore } from "builderStore"
|
||||
=======
|
||||
import { params } from "@sveltech/routify"
|
||||
import { database, queries } from 'stores/backend/'
|
||||
>>>>>>> d803aa0bd7a74220e432f4a1b338abdd7fbe9b7d:packages/builder/src/pages/[application]/data/datasource/[selectedDatasource]/[query]/index.svelte
|
||||
import { database, queries } from "stores/backend"
|
||||
import QueryInterface from "components/integration/QueryViewer.svelte"
|
||||
|
||||
async function fetchQueryConfig() {
|
||||
|
|
|
@ -1,11 +1,6 @@
|
|||
<script>
|
||||
<<<<<<< HEAD:packages/builder/src/pages/builder/[application]/data/datasource/[selectedDatasource]/_layout.svelte
|
||||
import { params } from "@roxi/routify"
|
||||
import { backendUiStore } from "builderStore"
|
||||
=======
|
||||
import { params } from "@sveltech/routify"
|
||||
import { datasources } from 'stores/backend/'
|
||||
>>>>>>> d803aa0bd7a74220e432f4a1b338abdd7fbe9b7d:packages/builder/src/pages/[application]/data/datasource/[selectedDatasource]/_layout.svelte
|
||||
import { datasources } from "stores/backend"
|
||||
|
||||
if ($params.selectedDatasource) {
|
||||
const datasource = $datasources.list.find(
|
||||
|
|
|
@ -1,16 +1,14 @@
|
|||
<script>
|
||||
import { goto, beforeUrlChange } from "@roxi/routify"
|
||||
import { Button, Heading, Body, Spacer } from "@budibase/bbui"
|
||||
import { datasources, integrations, queries } from 'stores/backend/'
|
||||
import { datasources, integrations, queries } from "stores/backend"
|
||||
import { notifier } from "builderStore/store/notifications"
|
||||
import IntegrationConfigForm from "components/backend/DatasourceNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte"
|
||||
import ICONS from "components/backend/DatasourceNavigator/icons"
|
||||
|
||||
let unsaved = false
|
||||
|
||||
$: datasource = $datasources.list.find(
|
||||
ds => ds._id === $datasources.selected
|
||||
)
|
||||
$: datasource = $datasources.list.find(ds => ds._id === $datasources.selected)
|
||||
$: integration = datasource && $integrations[datasource.source]
|
||||
|
||||
async function saveDatasource() {
|
||||
|
|
|
@ -1,15 +1,11 @@
|
|||
<script>
|
||||
import { datasources } from 'stores/backend/'
|
||||
import { goto, leftover } from "@sveltech/routify"
|
||||
import { datasources } from "stores/backend"
|
||||
import { goto, leftover } from "@roxi/routify"
|
||||
import { onMount } from "svelte"
|
||||
|
||||
onMount(async () => {
|
||||
// navigate to first datasource in list, if not already selected
|
||||
if (
|
||||
!$leftover &&
|
||||
$datasources.list.length > 0 &&
|
||||
!$datasources.selected
|
||||
) {
|
||||
if (!$leftover && $datasources.list.length > 0 && !$datasources.selected) {
|
||||
$goto(`./${$datasources.list[0]._id}`)
|
||||
}
|
||||
})
|
||||
|
|
|
@ -1,17 +1,15 @@
|
|||
<script>
|
||||
<<<<<<< HEAD:packages/builder/src/pages/builder/[application]/data/datasource/index.svelte
|
||||
import { backendUiStore } from "builderStore"
|
||||
import { datasources, tables } from "stores/backend"
|
||||
import { goto } from "@roxi/routify"
|
||||
import { onMount } from "svelte"
|
||||
|
||||
onMount(async () => {
|
||||
// navigate to first table in list, if not already selected
|
||||
$backendUiStore.datasources.length > 0 &&
|
||||
$goto(`./${$backendUiStore.datasources[0]._id}`)
|
||||
$datasources.list.length > 0 && $goto(`../${$datasources.list[0]._id}`)
|
||||
})
|
||||
</script>
|
||||
|
||||
{#if $backendUiStore.tables.length === 0}
|
||||
{#if $tables.list.length === 0}
|
||||
<i>Connect your first datasource to start building.</i>
|
||||
{:else}<i>Select a datasource to edit</i>{/if}
|
||||
|
||||
|
@ -22,26 +20,3 @@
|
|||
margin-top: 2px;
|
||||
}
|
||||
</style>
|
||||
=======
|
||||
import { datasources, tables } from 'stores/backend/'
|
||||
import { goto } from "@sveltech/routify"
|
||||
import { onMount } from "svelte"
|
||||
|
||||
onMount(async () => {
|
||||
// navigate to first table in list, if not already selected
|
||||
$datasources.list.length > 0 && $goto(`../${$datasources.list[0]._id}`)
|
||||
})
|
||||
</script>
|
||||
|
||||
{#if $tables.list.length === 0}
|
||||
<i>Connect your first datasource to start building.</i>
|
||||
{:else}<i>Select a datasource to edit</i>{/if}
|
||||
|
||||
<style>
|
||||
i {
|
||||
font-size: var(--font-size-m);
|
||||
color: var(--grey-5);
|
||||
margin-top: 2px;
|
||||
}
|
||||
</style>
|
||||
>>>>>>> d803aa0bd7a74220e432f4a1b338abdd7fbe9b7d:packages/builder/src/pages/[application]/data/datasource/index.svelte
|
||||
|
|
|
@ -1,16 +1,9 @@
|
|||
<script>
|
||||
<<<<<<< HEAD:packages/builder/src/pages/builder/[application]/data/table/[selectedTable]/_layout.svelte
|
||||
import { params } from "@roxi/routify"
|
||||
import { backendUiStore } from "builderStore"
|
||||
=======
|
||||
import { params } from "@sveltech/routify"
|
||||
import { tables } from 'stores/backend/'
|
||||
>>>>>>> d803aa0bd7a74220e432f4a1b338abdd7fbe9b7d:packages/builder/src/pages/[application]/data/table/[selectedTable]/_layout.svelte
|
||||
import { tables } from "stores/backend"
|
||||
|
||||
if ($params.selectedTable) {
|
||||
const table = $tables.list.find(
|
||||
m => m._id === $params.selectedTable
|
||||
)
|
||||
const table = $tables.list.find(m => m._id === $params.selectedTable)
|
||||
if (table) {
|
||||
tables.select(table)
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<script>
|
||||
import TableDataTable from "components/backend/DataTable/DataTable.svelte"
|
||||
import { tables, database } from 'stores/backend/'
|
||||
import { tables, database } from "stores/backend"
|
||||
</script>
|
||||
|
||||
{#if $database?._id && $tables?.selected?.name}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<script>
|
||||
import { tables } from 'stores/backend/'
|
||||
import { goto, leftover } from "@sveltech/routify"
|
||||
import { tables } from "stores/backend"
|
||||
import { goto, leftover } from "@roxi/routify"
|
||||
import { onMount } from "svelte"
|
||||
|
||||
onMount(async () => {
|
||||
|
|
|
@ -1,20 +1,10 @@
|
|||
<script>
|
||||
<<<<<<< HEAD:packages/builder/src/pages/builder/[application]/data/table/index.svelte
|
||||
import { backendUiStore } from "builderStore"
|
||||
import { goto } from "@roxi/routify"
|
||||
import { onMount } from "svelte"
|
||||
|
||||
onMount(async () => {
|
||||
$backendUiStore.tables.length > 0 &&
|
||||
$goto(`./${$backendUiStore.tables[0]._id}`)
|
||||
=======
|
||||
import { tables } from 'stores/backend/'
|
||||
import { goto } from "@sveltech/routify"
|
||||
import { onMount } from "svelte"
|
||||
import { tables } from "stores/backend"
|
||||
|
||||
onMount(async () => {
|
||||
$tables.list.length > 0 && $goto(`../${$tables.list[0]._id}`)
|
||||
>>>>>>> d803aa0bd7a74220e432f4a1b338abdd7fbe9b7d:packages/builder/src/pages/[application]/data/table/index.svelte
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
@ -1,11 +1,6 @@
|
|||
<script>
|
||||
<<<<<<< HEAD:packages/builder/src/pages/builder/[application]/data/view/[selectedView]/_layout.svelte
|
||||
import { params } from "@roxi/routify"
|
||||
import { backendUiStore } from "builderStore"
|
||||
=======
|
||||
import { params } from "@sveltech/routify"
|
||||
import { tables, views } from 'stores/backend/'
|
||||
>>>>>>> d803aa0bd7a74220e432f4a1b338abdd7fbe9b7d:packages/builder/src/pages/[application]/data/view/[selectedView]/_layout.svelte
|
||||
import { tables, views } from "stores/backend"
|
||||
|
||||
if ($params.selectedView) {
|
||||
let view
|
||||
|
|
|
@ -1,11 +1,6 @@
|
|||
<script>
|
||||
<<<<<<< HEAD:packages/builder/src/pages/builder/[application]/data/view/[selectedView]/index.svelte
|
||||
import ViewDataTable from "components/backend/DataTable/ViewDataTable.svelte"
|
||||
import { backendUiStore } from "builderStore"
|
||||
=======
|
||||
import ViewDataTable from "components/backend/DataTable/ViewDataTable"
|
||||
import { views, database } from 'stores/backend/'
|
||||
>>>>>>> d803aa0bd7a74220e432f4a1b338abdd7fbe9b7d:packages/builder/src/pages/[application]/data/view/[selectedView]/index.svelte
|
||||
import { views, database } from "stores/backend"
|
||||
|
||||
$: selectedView = $views.selected
|
||||
</script>
|
||||
|
|
|
@ -40,6 +40,10 @@ export default ({ mode }) => {
|
|||
find: "builderStore",
|
||||
replacement: path.resolve("./src/builderStore"),
|
||||
},
|
||||
{
|
||||
find: "stores",
|
||||
replacement: path.resolve("./src/stores"),
|
||||
},
|
||||
{
|
||||
find: "constants",
|
||||
replacement: path.resolve("./src/constants"),
|
||||
|
|
Loading…
Reference in New Issue