Patch from original environment
This commit is contained in:
parent
0610117d87
commit
79da5956b8
|
@ -23,7 +23,7 @@
|
||||||
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/internals/mocks/fileMock.js",
|
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/internals/mocks/fileMock.js",
|
||||||
"\\.(css|less|sass|scss)$": "identity-obj-proxy",
|
"\\.(css|less|sass|scss)$": "identity-obj-proxy",
|
||||||
"components(.*)$": "<rootDir>/src/components$1",
|
"components(.*)$": "<rootDir>/src/components$1",
|
||||||
"builderStore(.*)$": "<rootDir>/src/builderStore$1",
|
"builder(.*)$": "<rootDir>/src/builder$1",
|
||||||
"stores(.*)$": "<rootDir>/src/stores$1",
|
"stores(.*)$": "<rootDir>/src/stores$1",
|
||||||
"analytics(.*)$": "<rootDir>/src/analytics$1",
|
"analytics(.*)$": "<rootDir>/src/analytics$1",
|
||||||
"constants/backend": "<rootDir>/src/constants/backend/index.js"
|
"constants/backend": "<rootDir>/src/constants/backend/index.js"
|
||||||
|
|
|
@ -3,14 +3,14 @@ import {
|
||||||
CookieUtils,
|
CookieUtils,
|
||||||
Constants,
|
Constants,
|
||||||
} from "@budibase/frontend-core"
|
} from "@budibase/frontend-core"
|
||||||
import { store } from "./builderStore"
|
import { appStore } from "./stores/frontend"
|
||||||
import { get } from "svelte/store"
|
import { get } from "svelte/store"
|
||||||
import { auth } from "./stores/portal"
|
import { auth } from "./stores/portal"
|
||||||
|
|
||||||
export const API = createAPIClient({
|
export const API = createAPIClient({
|
||||||
attachHeaders: headers => {
|
attachHeaders: headers => {
|
||||||
// Attach app ID header from store
|
// Attach app ID header from store
|
||||||
let appId = get(store).appId
|
let appId = get(appStore).appId
|
||||||
if (appId) {
|
if (appId) {
|
||||||
headers["x-budibase-app-id"] = appId
|
headers["x-budibase-app-id"] = appId
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,8 +5,13 @@ import {
|
||||||
findComponent,
|
findComponent,
|
||||||
findComponentPath,
|
findComponentPath,
|
||||||
getComponentSettings,
|
getComponentSettings,
|
||||||
} from "./componentUtils"
|
} from "stores/frontend/components/utils"
|
||||||
import { store, currentAsset } from "builderStore"
|
import {
|
||||||
|
currentAsset,
|
||||||
|
componentStore,
|
||||||
|
screenStore,
|
||||||
|
appStore,
|
||||||
|
} from "stores/frontend"
|
||||||
import {
|
import {
|
||||||
queries as queriesStores,
|
queries as queriesStores,
|
||||||
tables as tablesStore,
|
tables as tablesStore,
|
||||||
|
@ -178,7 +183,7 @@ export const getComponentBindableProperties = (asset, componentId) => {
|
||||||
|
|
||||||
// Ensure that the component exists and exposes context
|
// Ensure that the component exists and exposes context
|
||||||
const component = findComponent(asset.props, componentId)
|
const component = findComponent(asset.props, componentId)
|
||||||
const def = store.actions.components.getDefinition(component?._component)
|
const def = componentStore.getDefinition(component?._component)
|
||||||
if (!def?.context) {
|
if (!def?.context) {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
|
@ -209,7 +214,7 @@ export const getContextProviderComponents = (
|
||||||
|
|
||||||
// Filter by only data provider components
|
// Filter by only data provider components
|
||||||
return path.filter(component => {
|
return path.filter(component => {
|
||||||
const def = store.actions.components.getDefinition(component._component)
|
const def = componentStore.getDefinition(component._component)
|
||||||
if (!def?.context) {
|
if (!def?.context) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -240,7 +245,7 @@ export const getActionProviderComponents = (asset, componentId, actionType) => {
|
||||||
|
|
||||||
// Filter by only data provider components
|
// Filter by only data provider components
|
||||||
return path.filter(component => {
|
return path.filter(component => {
|
||||||
const def = store.actions.components.getDefinition(component._component)
|
const def = componentStore.getDefinition(component._component)
|
||||||
return def?.actions?.includes(actionType)
|
return def?.actions?.includes(actionType)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -312,7 +317,7 @@ const getProviderContextBindings = (asset, dataProviders) => {
|
||||||
// Create bindings for each data provider
|
// Create bindings for each data provider
|
||||||
let bindings = []
|
let bindings = []
|
||||||
dataProviders.forEach(component => {
|
dataProviders.forEach(component => {
|
||||||
const def = store.actions.components.getDefinition(component._component)
|
const def = componentStore.getDefinition(component._component)
|
||||||
const contexts = Array.isArray(def.context) ? def.context : [def.context]
|
const contexts = Array.isArray(def.context) ? def.context : [def.context]
|
||||||
|
|
||||||
// Create bindings for each context block provided by this data provider
|
// Create bindings for each context block provided by this data provider
|
||||||
|
@ -502,7 +507,7 @@ export const getUserBindings = () => {
|
||||||
*/
|
*/
|
||||||
const getDeviceBindings = () => {
|
const getDeviceBindings = () => {
|
||||||
let bindings = []
|
let bindings = []
|
||||||
if (get(store).clientFeatures?.deviceAwareness) {
|
if (get(appStore).clientFeatures?.deviceAwareness) {
|
||||||
const safeDevice = makePropSafe("device")
|
const safeDevice = makePropSafe("device")
|
||||||
|
|
||||||
bindings = [
|
bindings = [
|
||||||
|
@ -540,7 +545,7 @@ const getDeviceBindings = () => {
|
||||||
*/
|
*/
|
||||||
const getSelectedRowsBindings = asset => {
|
const getSelectedRowsBindings = asset => {
|
||||||
let bindings = []
|
let bindings = []
|
||||||
if (get(store).clientFeatures?.rowSelection) {
|
if (get(appStore).clientFeatures?.rowSelection) {
|
||||||
// Add bindings for table components
|
// Add bindings for table components
|
||||||
let tables = findAllMatchingComponents(asset?.props, component =>
|
let tables = findAllMatchingComponents(asset?.props, component =>
|
||||||
component._component.endsWith("table")
|
component._component.endsWith("table")
|
||||||
|
@ -595,7 +600,7 @@ export const makeStateBinding = key => {
|
||||||
*/
|
*/
|
||||||
const getStateBindings = () => {
|
const getStateBindings = () => {
|
||||||
let bindings = []
|
let bindings = []
|
||||||
if (get(store).clientFeatures?.state) {
|
if (get(appStore).clientFeatures?.state) {
|
||||||
bindings = getAllStateVariables().map(makeStateBinding)
|
bindings = getAllStateVariables().map(makeStateBinding)
|
||||||
}
|
}
|
||||||
return bindings
|
return bindings
|
||||||
|
@ -671,8 +676,7 @@ export const getEventContextBindings = ({
|
||||||
}
|
}
|
||||||
|
|
||||||
const definition =
|
const definition =
|
||||||
componentDefinition ??
|
componentDefinition ?? componentStore.getDefinition(component?._component)
|
||||||
store.actions.components.getDefinition(component?._component)
|
|
||||||
|
|
||||||
const settings = getComponentSettings(component?._component)
|
const settings = getComponentSettings(component?._component)
|
||||||
const eventSetting = settings.find(setting => setting.key === settingKey)
|
const eventSetting = settings.find(setting => setting.key === settingKey)
|
||||||
|
@ -1015,7 +1019,7 @@ export const getAllStateVariables = () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
// Add on load settings from screens
|
// Add on load settings from screens
|
||||||
get(store).screens.forEach(screen => {
|
get(screenStore).screens.forEach(screen => {
|
||||||
if (screen.onLoad) {
|
if (screen.onLoad) {
|
||||||
eventSettings.push(screen.onLoad)
|
eventSettings.push(screen.onLoad)
|
||||||
}
|
}
|
||||||
|
@ -1044,8 +1048,8 @@ export const getAllStateVariables = () => {
|
||||||
export const getAllAssets = () => {
|
export const getAllAssets = () => {
|
||||||
// Get all component containing assets
|
// Get all component containing assets
|
||||||
let allAssets = []
|
let allAssets = []
|
||||||
allAssets = allAssets.concat(get(store).layouts || [])
|
allAssets = allAssets.concat(get(appStore).layouts || [])
|
||||||
allAssets = allAssets.concat(get(store).screens || [])
|
allAssets = allAssets.concat(get(screenStore).screens || [])
|
||||||
|
|
||||||
return allAssets
|
return allAssets
|
||||||
}
|
}
|
|
@ -33,6 +33,11 @@ export class Screen extends BaseStructure {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
role(role) {
|
||||||
|
this._json.routing.roleId = role
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
normalStyle(styling) {
|
normalStyle(styling) {
|
||||||
this._json.props._styles.normal = styling
|
this._json.props._styles.normal = styling
|
||||||
return this
|
return this
|
|
@ -1,151 +0,0 @@
|
||||||
import { getFrontendStore } from "./store/frontend"
|
|
||||||
import { getAutomationStore } from "./store/automation"
|
|
||||||
import { getTemporalStore } from "./store/temporal"
|
|
||||||
import { getThemeStore } from "./store/theme"
|
|
||||||
import { getUserStore } from "./store/users"
|
|
||||||
import { getDeploymentStore } from "./store/deployments"
|
|
||||||
import { derived, writable } from "svelte/store"
|
|
||||||
import { findComponent, findComponentPath } from "./componentUtils"
|
|
||||||
import { RoleUtils } from "@budibase/frontend-core"
|
|
||||||
import { createHistoryStore } from "builderStore/store/history"
|
|
||||||
import { get } from "svelte/store"
|
|
||||||
|
|
||||||
export const store = getFrontendStore()
|
|
||||||
export const automationStore = getAutomationStore()
|
|
||||||
export const themeStore = getThemeStore()
|
|
||||||
export const temporalStore = getTemporalStore()
|
|
||||||
export const userStore = getUserStore()
|
|
||||||
export const deploymentStore = getDeploymentStore()
|
|
||||||
|
|
||||||
// Setup history for screens
|
|
||||||
export const screenHistoryStore = createHistoryStore({
|
|
||||||
getDoc: id => get(store).screens?.find(screen => screen._id === id),
|
|
||||||
selectDoc: store.actions.screens.select,
|
|
||||||
afterAction: () => {
|
|
||||||
// Ensure a valid component is selected
|
|
||||||
if (!get(selectedComponent)) {
|
|
||||||
store.update(state => ({
|
|
||||||
...state,
|
|
||||||
selectedComponentId: get(selectedScreen)?.props._id,
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
},
|
|
||||||
})
|
|
||||||
store.actions.screens.save = screenHistoryStore.wrapSaveDoc(
|
|
||||||
store.actions.screens.save
|
|
||||||
)
|
|
||||||
store.actions.screens.delete = screenHistoryStore.wrapDeleteDoc(
|
|
||||||
store.actions.screens.delete
|
|
||||||
)
|
|
||||||
|
|
||||||
// Setup history for automations
|
|
||||||
export const automationHistoryStore = createHistoryStore({
|
|
||||||
getDoc: automationStore.actions.getDefinition,
|
|
||||||
selectDoc: automationStore.actions.select,
|
|
||||||
})
|
|
||||||
automationStore.actions.save = automationHistoryStore.wrapSaveDoc(
|
|
||||||
automationStore.actions.save
|
|
||||||
)
|
|
||||||
automationStore.actions.delete = automationHistoryStore.wrapDeleteDoc(
|
|
||||||
automationStore.actions.delete
|
|
||||||
)
|
|
||||||
|
|
||||||
export const selectedScreen = derived(store, $store => {
|
|
||||||
return $store.screens.find(screen => screen._id === $store.selectedScreenId)
|
|
||||||
})
|
|
||||||
|
|
||||||
export const selectedLayout = derived(store, $store => {
|
|
||||||
return $store.layouts?.find(layout => layout._id === $store.selectedLayoutId)
|
|
||||||
})
|
|
||||||
|
|
||||||
export const selectedComponent = derived(
|
|
||||||
[store, selectedScreen],
|
|
||||||
([$store, $selectedScreen]) => {
|
|
||||||
if (
|
|
||||||
$selectedScreen &&
|
|
||||||
$store.selectedComponentId?.startsWith(`${$selectedScreen._id}-`)
|
|
||||||
) {
|
|
||||||
return $selectedScreen?.props
|
|
||||||
}
|
|
||||||
if (!$selectedScreen || !$store.selectedComponentId) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
return findComponent($selectedScreen?.props, $store.selectedComponentId)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
// For legacy compatibility only, but with the new design UI this is just
|
|
||||||
// the selected screen
|
|
||||||
export const currentAsset = selectedScreen
|
|
||||||
|
|
||||||
export const sortedScreens = derived(store, $store => {
|
|
||||||
return $store.screens.slice().sort((a, b) => {
|
|
||||||
// Sort by role first
|
|
||||||
const roleA = RoleUtils.getRolePriority(a.routing.roleId)
|
|
||||||
const roleB = RoleUtils.getRolePriority(b.routing.roleId)
|
|
||||||
if (roleA !== roleB) {
|
|
||||||
return roleA > roleB ? -1 : 1
|
|
||||||
}
|
|
||||||
// Then put home screens first
|
|
||||||
const homeA = !!a.routing.homeScreen
|
|
||||||
const homeB = !!b.routing.homeScreen
|
|
||||||
if (homeA !== homeB) {
|
|
||||||
return homeA ? -1 : 1
|
|
||||||
}
|
|
||||||
// Then sort alphabetically by each URL param
|
|
||||||
const aParams = a.routing.route.split("/")
|
|
||||||
const bParams = b.routing.route.split("/")
|
|
||||||
let minParams = Math.min(aParams.length, bParams.length)
|
|
||||||
for (let i = 0; i < minParams; i++) {
|
|
||||||
if (aParams[i] === bParams[i]) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
return aParams[i] < bParams[i] ? -1 : 1
|
|
||||||
}
|
|
||||||
// Then sort by the fewest amount of URL params
|
|
||||||
return aParams.length < bParams.length ? -1 : 1
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
export const selectedComponentPath = derived(
|
|
||||||
[store, selectedScreen],
|
|
||||||
([$store, $selectedScreen]) => {
|
|
||||||
return findComponentPath(
|
|
||||||
$selectedScreen?.props,
|
|
||||||
$store.selectedComponentId
|
|
||||||
).map(component => component._id)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
// Derived automation state
|
|
||||||
export const selectedAutomation = derived(automationStore, $automationStore => {
|
|
||||||
if (!$automationStore.selectedAutomationId) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
return $automationStore.automations?.find(
|
|
||||||
x => x._id === $automationStore.selectedAutomationId
|
|
||||||
)
|
|
||||||
})
|
|
||||||
|
|
||||||
// Derive map of resource IDs to other users.
|
|
||||||
// We only ever care about a single user in each resource, so if multiple users
|
|
||||||
// share the same datasource we can just overwrite them.
|
|
||||||
export const userSelectedResourceMap = derived(userStore, $userStore => {
|
|
||||||
let map = {}
|
|
||||||
$userStore.forEach(user => {
|
|
||||||
const resource = user.builderMetadata?.selectedResourceId
|
|
||||||
if (resource) {
|
|
||||||
if (!map[resource]) {
|
|
||||||
map[resource] = []
|
|
||||||
}
|
|
||||||
map[resource].push(user)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return map
|
|
||||||
})
|
|
||||||
|
|
||||||
export const isOnlyUser = derived(userStore, $userStore => {
|
|
||||||
return $userStore.length < 2
|
|
||||||
})
|
|
||||||
|
|
||||||
export const screensHeight = writable("210px")
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,5 @@
|
||||||
<script>
|
<script>
|
||||||
import { selectedAutomation } from "builderStore"
|
import { selectedAutomation } from "stores/frontend"
|
||||||
import Flowchart from "./FlowChart/FlowChart.svelte"
|
import Flowchart from "./FlowChart/FlowChart.svelte"
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -9,11 +9,11 @@
|
||||||
Tags,
|
Tags,
|
||||||
Tag,
|
Tag,
|
||||||
} from "@budibase/bbui"
|
} from "@budibase/bbui"
|
||||||
import { automationStore, selectedAutomation } from "builderStore"
|
import { automationStore, selectedAutomation } from "stores/frontend"
|
||||||
import { admin, licensing } from "stores/portal"
|
import { admin, licensing } from "stores/portal"
|
||||||
import { externalActions } from "./ExternalActions"
|
import { externalActions } from "./ExternalActions"
|
||||||
import { TriggerStepID, ActionStepID } from "constants/backend/automations"
|
import { TriggerStepID, ActionStepID } from "constants/backend/automations"
|
||||||
import { checkForCollectStep } from "builderStore/utils"
|
import { checkForCollectStep } from "builder/utils"
|
||||||
|
|
||||||
export let blockIdx
|
export let blockIdx
|
||||||
export let lastStep
|
export let lastStep
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
<script>
|
<script>
|
||||||
import { automationStore, selectedAutomation } from "builderStore"
|
import {
|
||||||
|
automationStore,
|
||||||
|
selectedAutomation,
|
||||||
|
automationHistoryStore,
|
||||||
|
} from "stores/frontend"
|
||||||
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
|
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
|
||||||
import FlowItem from "./FlowItem.svelte"
|
import FlowItem from "./FlowItem.svelte"
|
||||||
import TestDataModal from "./TestDataModal.svelte"
|
import TestDataModal from "./TestDataModal.svelte"
|
||||||
|
@ -14,7 +18,6 @@
|
||||||
} from "@budibase/bbui"
|
} from "@budibase/bbui"
|
||||||
import { ActionStepID } from "constants/backend/automations"
|
import { ActionStepID } from "constants/backend/automations"
|
||||||
import UndoRedoControl from "components/common/UndoRedoControl.svelte"
|
import UndoRedoControl from "components/common/UndoRedoControl.svelte"
|
||||||
import { automationHistoryStore } from "builderStore"
|
|
||||||
|
|
||||||
export let automation
|
export let automation
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script>
|
<script>
|
||||||
import { automationStore, selectedAutomation } from "builderStore"
|
import { automationStore, selectedAutomation } from "stores/frontend"
|
||||||
import {
|
import {
|
||||||
Icon,
|
Icon,
|
||||||
Divider,
|
Divider,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script>
|
<script>
|
||||||
import { automationStore } from "builderStore"
|
import { automationStore } from "stores/frontend"
|
||||||
import { Icon, Body, Detail, StatusLight } from "@budibase/bbui"
|
import { Icon, Body, Detail, StatusLight } from "@budibase/bbui"
|
||||||
import { externalActions } from "./ExternalActions"
|
import { externalActions } from "./ExternalActions"
|
||||||
import { createEventDispatcher } from "svelte"
|
import { createEventDispatcher } from "svelte"
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
Label,
|
Label,
|
||||||
notifications,
|
notifications,
|
||||||
} from "@budibase/bbui"
|
} from "@budibase/bbui"
|
||||||
import { automationStore, selectedAutomation } from "builderStore"
|
import { automationStore, selectedAutomation } from "stores/frontend"
|
||||||
import AutomationBlockSetup from "../../SetupPanel/AutomationBlockSetup.svelte"
|
import AutomationBlockSetup from "../../SetupPanel/AutomationBlockSetup.svelte"
|
||||||
import { cloneDeep } from "lodash/fp"
|
import { cloneDeep } from "lodash/fp"
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<script>
|
<script>
|
||||||
import { Icon, Divider } from "@budibase/bbui"
|
import { Icon, Divider } from "@budibase/bbui"
|
||||||
import TestDisplay from "./TestDisplay.svelte"
|
import TestDisplay from "./TestDisplay.svelte"
|
||||||
import { automationStore } from "builderStore"
|
import { automationStore } from "stores/frontend"
|
||||||
|
|
||||||
export let automation
|
export let automation
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
automationStore,
|
automationStore,
|
||||||
selectedAutomation,
|
selectedAutomation,
|
||||||
userSelectedResourceMap,
|
userSelectedResourceMap,
|
||||||
} from "builderStore"
|
} from "stores/frontend"
|
||||||
import NavItem from "components/common/NavItem.svelte"
|
import NavItem from "components/common/NavItem.svelte"
|
||||||
import EditAutomationPopover from "./EditAutomationPopover.svelte"
|
import EditAutomationPopover from "./EditAutomationPopover.svelte"
|
||||||
import { notifications } from "@budibase/bbui"
|
import { notifications } from "@budibase/bbui"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script>
|
<script>
|
||||||
import { automationStore } from "builderStore"
|
import { automationStore } from "stores/frontend"
|
||||||
import { notifications } from "@budibase/bbui"
|
import { notifications } from "@budibase/bbui"
|
||||||
import {
|
import {
|
||||||
Input,
|
Input,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script>
|
<script>
|
||||||
import { automationStore } from "builderStore"
|
import { automationStore } from "stores/frontend"
|
||||||
import { ActionMenu, MenuItem, notifications, Icon } from "@budibase/bbui"
|
import { ActionMenu, MenuItem, notifications, Icon } from "@budibase/bbui"
|
||||||
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
|
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
|
||||||
import UpdateAutomationModal from "components/automation/AutomationPanel/UpdateAutomationModal.svelte"
|
import UpdateAutomationModal from "components/automation/AutomationPanel/UpdateAutomationModal.svelte"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script>
|
<script>
|
||||||
import { automationStore } from "builderStore"
|
import { automationStore } from "stores/frontend"
|
||||||
import { notifications } from "@budibase/bbui"
|
import { notifications } from "@budibase/bbui"
|
||||||
import { Icon, Input, ModalContent, Modal } from "@budibase/bbui"
|
import { Icon, Input, ModalContent, Modal } from "@budibase/bbui"
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
Detail,
|
Detail,
|
||||||
} from "@budibase/bbui"
|
} from "@budibase/bbui"
|
||||||
import CreateWebhookModal from "components/automation/Shared/CreateWebhookModal.svelte"
|
import CreateWebhookModal from "components/automation/Shared/CreateWebhookModal.svelte"
|
||||||
import { automationStore, selectedAutomation } from "builderStore"
|
import { automationStore, selectedAutomation } from "stores/frontend"
|
||||||
import { tables } from "stores/backend"
|
import { tables } from "stores/backend"
|
||||||
import { environment, licensing } from "stores/portal"
|
import { environment, licensing } from "stores/portal"
|
||||||
import WebhookDisplay from "../Shared/WebhookDisplay.svelte"
|
import WebhookDisplay from "../Shared/WebhookDisplay.svelte"
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
import {
|
import {
|
||||||
getSchemaForDatasourcePlus,
|
getSchemaForDatasourcePlus,
|
||||||
getEnvironmentBindings,
|
getEnvironmentBindings,
|
||||||
} from "builderStore/dataBinding"
|
} from "builder/dataBinding"
|
||||||
import { Utils } from "@budibase/frontend-core"
|
import { Utils } from "@budibase/frontend-core"
|
||||||
import { TriggerStepID, ActionStepID } from "constants/backend/automations"
|
import { TriggerStepID, ActionStepID } from "constants/backend/automations"
|
||||||
import { onMount } from "svelte"
|
import { onMount } from "svelte"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script>
|
<script>
|
||||||
import { Icon, notifications } from "@budibase/bbui"
|
import { Icon, notifications } from "@budibase/bbui"
|
||||||
import { automationStore, selectedAutomation } from "builderStore"
|
import { automationStore, selectedAutomation } from "stores/frontend"
|
||||||
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"
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
import { TableNames } from "constants"
|
import { TableNames } from "constants"
|
||||||
import { Grid } from "@budibase/frontend-core"
|
import { Grid } from "@budibase/frontend-core"
|
||||||
import { API } from "api"
|
import { API } from "api"
|
||||||
import { store } from "builderStore"
|
import { appStore } from "stores/frontend"
|
||||||
import GridAddColumnModal from "components/backend/DataTable/modals/grid/GridCreateColumnModal.svelte"
|
import GridAddColumnModal from "components/backend/DataTable/modals/grid/GridCreateColumnModal.svelte"
|
||||||
import GridCreateEditRowModal from "components/backend/DataTable/modals/grid/GridCreateEditRowModal.svelte"
|
import GridCreateEditRowModal from "components/backend/DataTable/modals/grid/GridCreateEditRowModal.svelte"
|
||||||
import GridEditUserModal from "components/backend/DataTable/modals/grid/GridEditUserModal.svelte"
|
import GridEditUserModal from "components/backend/DataTable/modals/grid/GridEditUserModal.svelte"
|
||||||
|
@ -61,14 +61,14 @@
|
||||||
datasource={gridDatasource}
|
datasource={gridDatasource}
|
||||||
canAddRows={!isUsersTable}
|
canAddRows={!isUsersTable}
|
||||||
canDeleteRows={!isUsersTable}
|
canDeleteRows={!isUsersTable}
|
||||||
canEditRows={!isUsersTable || !$store.features.disableUserMetadata}
|
canEditRows={!isUsersTable || !$appStore.features.disableUserMetadata}
|
||||||
canEditColumns={!isUsersTable || !$store.features.disableUserMetadata}
|
canEditColumns={!isUsersTable || !$appStore.features.disableUserMetadata}
|
||||||
schemaOverrides={isUsersTable ? userSchemaOverrides : null}
|
schemaOverrides={isUsersTable ? userSchemaOverrides : null}
|
||||||
showAvatars={false}
|
showAvatars={false}
|
||||||
on:updatedatasource={handleGridTableUpdate}
|
on:updatedatasource={handleGridTableUpdate}
|
||||||
>
|
>
|
||||||
<svelte:fragment slot="filter">
|
<svelte:fragment slot="filter">
|
||||||
{#if isUsersTable && $store.features.disableUserMetadata}
|
{#if isUsersTable && $appStore.features.disableUserMetadata}
|
||||||
<GridUsersTableButton />
|
<GridUsersTableButton />
|
||||||
{/if}
|
{/if}
|
||||||
<GridFilterButton />
|
<GridFilterButton />
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
SWITCHABLE_TYPES,
|
SWITCHABLE_TYPES,
|
||||||
PrettyRelationshipDefinitions,
|
PrettyRelationshipDefinitions,
|
||||||
} from "constants/backend"
|
} from "constants/backend"
|
||||||
import { getAutoColumnInformation, buildAutoColumn } from "builderStore/utils"
|
import { getAutoColumnInformation, buildAutoColumn } from "builder/utils"
|
||||||
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
|
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
|
||||||
import ModalBindableInput from "components/common/bindings/ModalBindableInput.svelte"
|
import ModalBindableInput from "components/common/bindings/ModalBindableInput.svelte"
|
||||||
import { getBindings } from "components/backend/DataTable/formula"
|
import { getBindings } from "components/backend/DataTable/formula"
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
} from "@budibase/bbui"
|
} from "@budibase/bbui"
|
||||||
import { onMount, createEventDispatcher } from "svelte"
|
import { onMount, createEventDispatcher } from "svelte"
|
||||||
import { FIELDS } from "constants/backend"
|
import { FIELDS } from "constants/backend"
|
||||||
import { generate } from "builderStore/schemaGenerator"
|
import { generate } from "builder/schemaGenerator"
|
||||||
|
|
||||||
export let schema = {}
|
export let schema = {}
|
||||||
export let json
|
export let json
|
||||||
|
|
|
@ -1,15 +1,12 @@
|
||||||
<script>
|
<script>
|
||||||
import { ActionButton, Popover, Heading, Body, Button } from "@budibase/bbui"
|
import { ActionButton, Popover, Heading, Body, Button } from "@budibase/bbui"
|
||||||
import { store } from "builderStore"
|
import { builderStore } from "stores/frontend"
|
||||||
|
|
||||||
let anchor
|
let anchor
|
||||||
let open = false
|
let open = false
|
||||||
|
|
||||||
const openSidePanel = () => {
|
const openSidePanel = () => {
|
||||||
store.update(state => ({
|
builderStore.showBuilderSidePanel()
|
||||||
...state,
|
|
||||||
builderSidePanel: true,
|
|
||||||
}))
|
|
||||||
open = false
|
open = false
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,14 +1,7 @@
|
||||||
<script>
|
<script>
|
||||||
import { goto, isActive, params } from "@roxi/routify"
|
import { goto, isActive, params } from "@roxi/routify"
|
||||||
import { BUDIBASE_INTERNAL_DB_ID } from "constants/backend"
|
import { BUDIBASE_INTERNAL_DB_ID } from "constants/backend"
|
||||||
import {
|
import { datasources, queries, tables, views, viewsV2 } from "stores/backend"
|
||||||
database,
|
|
||||||
datasources,
|
|
||||||
queries,
|
|
||||||
tables,
|
|
||||||
views,
|
|
||||||
viewsV2,
|
|
||||||
} 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"
|
||||||
|
@ -20,7 +13,7 @@
|
||||||
} from "helpers/data/utils"
|
} from "helpers/data/utils"
|
||||||
import IntegrationIcon from "./IntegrationIcon.svelte"
|
import IntegrationIcon from "./IntegrationIcon.svelte"
|
||||||
import { TableNames } from "constants"
|
import { TableNames } from "constants"
|
||||||
import { userSelectedResourceMap } from "builderStore"
|
import { userSelectedResourceMap, database } from "stores/frontend"
|
||||||
|
|
||||||
let openDataSources = []
|
let openDataSources = []
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
<script>
|
<script>
|
||||||
import { tables, views, viewsV2, database } from "stores/backend"
|
import { tables, views, viewsV2 } 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"
|
||||||
import NavItem from "components/common/NavItem.svelte"
|
import NavItem from "components/common/NavItem.svelte"
|
||||||
import { goto, isActive } from "@roxi/routify"
|
import { goto, isActive } from "@roxi/routify"
|
||||||
import { userSelectedResourceMap } from "builderStore"
|
import { userSelectedResourceMap } from "stores/frontend"
|
||||||
|
import { database } from "stores/frontend/database"
|
||||||
|
|
||||||
export let sourceId
|
export let sourceId
|
||||||
export let selectTable
|
export let selectTable
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<script>
|
<script>
|
||||||
import { goto, params } from "@roxi/routify"
|
import { goto, params } from "@roxi/routify"
|
||||||
import { store } from "builderStore"
|
|
||||||
import { cloneDeep } from "lodash/fp"
|
import { cloneDeep } from "lodash/fp"
|
||||||
import { tables, datasources } from "stores/backend"
|
import { tables, datasources } from "stores/backend"
|
||||||
|
import { screenStore } from "stores/frontend"
|
||||||
import {
|
import {
|
||||||
ActionMenu,
|
ActionMenu,
|
||||||
Icon,
|
Icon,
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
$: allowDeletion = !external || table?.created
|
$: allowDeletion = !external || table?.created
|
||||||
|
|
||||||
function showDeleteModal() {
|
function showDeleteModal() {
|
||||||
templateScreens = $store.screens.filter(
|
templateScreens = $screenStore.screens.filter(
|
||||||
screen => screen.autoTableId === table._id
|
screen => screen.autoTableId === table._id
|
||||||
)
|
)
|
||||||
willBeDeleted = ["All table data"].concat(
|
willBeDeleted = ["All table data"].concat(
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
await tables.delete(table)
|
await tables.delete(table)
|
||||||
// Screens need deleted one at a time because of undo/redo
|
// Screens need deleted one at a time because of undo/redo
|
||||||
for (let screen of templateScreens) {
|
for (let screen of templateScreens) {
|
||||||
await store.actions.screens.delete(screen)
|
await screenStore.delete(screen)
|
||||||
}
|
}
|
||||||
if (table.type === "external") {
|
if (table.type === "external") {
|
||||||
await datasources.fetch()
|
await datasources.fetch()
|
||||||
|
|
|
@ -10,11 +10,13 @@
|
||||||
import { API } from "api"
|
import { API } from "api"
|
||||||
import { goto } from "@roxi/routify"
|
import { goto } from "@roxi/routify"
|
||||||
import {
|
import {
|
||||||
store,
|
|
||||||
sortedScreens,
|
|
||||||
automationStore,
|
automationStore,
|
||||||
themeStore,
|
previewStore,
|
||||||
} from "builderStore"
|
builderStore,
|
||||||
|
sortedScreens,
|
||||||
|
appStore,
|
||||||
|
} from "stores/frontend"
|
||||||
|
import { themeStore } from "stores/portal"
|
||||||
import { datasources, queries, tables, views } from "stores/backend"
|
import { datasources, queries, tables, views } from "stores/backend"
|
||||||
import { getContext } from "svelte"
|
import { getContext } from "svelte"
|
||||||
import { Constants } from "@budibase/frontend-core"
|
import { Constants } from "@budibase/frontend-core"
|
||||||
|
@ -26,8 +28,7 @@
|
||||||
name: "Invite users and manage app access",
|
name: "Invite users and manage app access",
|
||||||
description: "",
|
description: "",
|
||||||
icon: "User",
|
icon: "User",
|
||||||
action: () =>
|
action: () => builderStore.showBuilderSidePanel(),
|
||||||
store.update(state => ({ ...state, builderSidePanel: true })),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: "Navigate",
|
type: "Navigate",
|
||||||
|
@ -69,13 +70,13 @@
|
||||||
name: "App",
|
name: "App",
|
||||||
description: "",
|
description: "",
|
||||||
icon: "Play",
|
icon: "Play",
|
||||||
action: () => store.update(state => ({ ...state, showPreview: true })),
|
action: () => previewStore.showPreview(true),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: "Preview",
|
type: "Preview",
|
||||||
name: "Published App",
|
name: "Published App",
|
||||||
icon: "Play",
|
icon: "Play",
|
||||||
action: () => window.open(`/app${$store.url}`),
|
action: () => window.open(`/app${$appStore.url}`),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: "Support",
|
type: "Support",
|
||||||
|
@ -216,7 +217,7 @@
|
||||||
|
|
||||||
async function deployApp() {
|
async function deployApp() {
|
||||||
try {
|
try {
|
||||||
await API.publishAppChanges($store.appId)
|
await API.publishAppChanges($appStore.appId)
|
||||||
notifications.success("App published successfully")
|
notifications.success("App published successfully")
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
notifications.error("Error publishing app")
|
notifications.error("Error publishing app")
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
import { Compartment } from "@codemirror/state"
|
import { Compartment } from "@codemirror/state"
|
||||||
import { javascript } from "@codemirror/lang-javascript"
|
import { javascript } from "@codemirror/lang-javascript"
|
||||||
import { EditorModes, getDefaultTheme } from "./"
|
import { EditorModes, getDefaultTheme } from "./"
|
||||||
import { themeStore } from "builderStore"
|
import { themeStore } from "stores/portal"
|
||||||
|
|
||||||
export let label
|
export let label
|
||||||
export let completions = []
|
export let completions = []
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
<script>
|
<script>
|
||||||
import { Label } from "@budibase/bbui"
|
import { Label } from "@budibase/bbui"
|
||||||
import CodeMirror from "components/integration/codemirror"
|
import CodeMirror from "components/integration/codemirror"
|
||||||
import { themeStore } from "builderStore"
|
import { themeStore } from "stores/portal"
|
||||||
import { createEventDispatcher, onMount } from "svelte"
|
import { createEventDispatcher, onMount } from "svelte"
|
||||||
|
|
||||||
export let mode = EditorModes.JS
|
export let mode = EditorModes.JS
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
import {
|
import {
|
||||||
readableToRuntimeBinding,
|
readableToRuntimeBinding,
|
||||||
runtimeToReadableBinding,
|
runtimeToReadableBinding,
|
||||||
} from "builderStore/dataBinding"
|
} from "builder/dataBinding"
|
||||||
import { createEventDispatcher } from "svelte"
|
import { createEventDispatcher } from "svelte"
|
||||||
import { isJSBinding } from "@budibase/string-templates"
|
import { isJSBinding } from "@budibase/string-templates"
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
import {
|
import {
|
||||||
readableToRuntimeBinding,
|
readableToRuntimeBinding,
|
||||||
runtimeToReadableBinding,
|
runtimeToReadableBinding,
|
||||||
} from "builderStore/dataBinding"
|
} from "builder/dataBinding"
|
||||||
|
|
||||||
import { convertToJS } from "@budibase/string-templates"
|
import { convertToJS } from "@budibase/string-templates"
|
||||||
import { admin } from "stores/portal"
|
import { admin } from "stores/portal"
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
import {
|
import {
|
||||||
readableToRuntimeBinding,
|
readableToRuntimeBinding,
|
||||||
runtimeToReadableBinding,
|
runtimeToReadableBinding,
|
||||||
} from "builderStore/dataBinding"
|
} from "builder/dataBinding"
|
||||||
import ClientBindingPanel from "components/common/bindings/ClientBindingPanel.svelte"
|
import ClientBindingPanel from "components/common/bindings/ClientBindingPanel.svelte"
|
||||||
import { createEventDispatcher, setContext } from "svelte"
|
import { createEventDispatcher, setContext } from "svelte"
|
||||||
import { isJSBinding } from "@budibase/string-templates"
|
import { isJSBinding } from "@budibase/string-templates"
|
||||||
|
|
|
@ -3,11 +3,12 @@
|
||||||
import {
|
import {
|
||||||
readableToRuntimeBinding,
|
readableToRuntimeBinding,
|
||||||
runtimeToReadableBinding,
|
runtimeToReadableBinding,
|
||||||
} from "builderStore/dataBinding"
|
} from "builder/dataBinding"
|
||||||
|
|
||||||
import ClientBindingPanel from "components/common/bindings/ClientBindingPanel.svelte"
|
import ClientBindingPanel from "components/common/bindings/ClientBindingPanel.svelte"
|
||||||
import { createEventDispatcher, setContext } from "svelte"
|
import { createEventDispatcher, setContext } from "svelte"
|
||||||
import { isJSBinding } from "@budibase/string-templates"
|
import { isJSBinding } from "@budibase/string-templates"
|
||||||
|
import { builderStore } from "stores/frontend"
|
||||||
|
|
||||||
export let panel = ClientBindingPanel
|
export let panel = ClientBindingPanel
|
||||||
export let value = ""
|
export let value = ""
|
||||||
|
@ -21,6 +22,7 @@
|
||||||
export let allowHelpers = true
|
export let allowHelpers = true
|
||||||
export let updateOnChange = true
|
export let updateOnChange = true
|
||||||
export let drawerLeft
|
export let drawerLeft
|
||||||
|
export let key
|
||||||
|
|
||||||
const dispatch = createEventDispatcher()
|
const dispatch = createEventDispatcher()
|
||||||
let bindingDrawer
|
let bindingDrawer
|
||||||
|
@ -34,6 +36,7 @@
|
||||||
const saveBinding = () => {
|
const saveBinding = () => {
|
||||||
onChange(tempValue)
|
onChange(tempValue)
|
||||||
onBlur()
|
onBlur()
|
||||||
|
builderStore.propertyFocus()
|
||||||
bindingDrawer.hide()
|
bindingDrawer.hide()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,6 +52,11 @@
|
||||||
const onBlur = () => {
|
const onBlur = () => {
|
||||||
dispatch("blur", currentVal)
|
dispatch("blur", currentVal)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const onDrawerHide = e => {
|
||||||
|
builderStore.propertyFocus()
|
||||||
|
dispatch("drawerHide", e.detail)
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="control" class:disabled>
|
<div class="control" class:disabled>
|
||||||
|
@ -66,6 +74,7 @@
|
||||||
<div
|
<div
|
||||||
class="icon"
|
class="icon"
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
|
builderStore.propertyFocus(key)
|
||||||
bindingDrawer.show()
|
bindingDrawer.show()
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
@ -74,7 +83,7 @@
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<Drawer
|
<Drawer
|
||||||
on:drawerHide
|
on:drawerHide={onDrawerHide}
|
||||||
on:drawerShow
|
on:drawerShow
|
||||||
{fillWidth}
|
{fillWidth}
|
||||||
bind:this={bindingDrawer}
|
bind:this={bindingDrawer}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
import {
|
import {
|
||||||
readableToRuntimeBinding,
|
readableToRuntimeBinding,
|
||||||
runtimeToReadableBinding,
|
runtimeToReadableBinding,
|
||||||
} from "builderStore/dataBinding"
|
} from "builder/dataBinding"
|
||||||
|
|
||||||
import ClientBindingPanel from "components/common/bindings/ClientBindingPanel.svelte"
|
import ClientBindingPanel from "components/common/bindings/ClientBindingPanel.svelte"
|
||||||
import { createEventDispatcher, setContext } from "svelte"
|
import { createEventDispatcher, setContext } from "svelte"
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
import {
|
import {
|
||||||
readableToRuntimeBinding,
|
readableToRuntimeBinding,
|
||||||
runtimeToReadableBinding,
|
runtimeToReadableBinding,
|
||||||
} from "builderStore/dataBinding"
|
} from "builder/dataBinding"
|
||||||
import ServerBindingPanel from "components/common/bindings/ServerBindingPanel.svelte"
|
import ServerBindingPanel from "components/common/bindings/ServerBindingPanel.svelte"
|
||||||
import { createEventDispatcher } from "svelte"
|
import { createEventDispatcher } from "svelte"
|
||||||
import { isJSBinding } from "@budibase/string-templates"
|
import { isJSBinding } from "@budibase/string-templates"
|
||||||
|
|
|
@ -20,7 +20,14 @@
|
||||||
import analytics, { Events, EventSource } from "analytics"
|
import analytics, { Events, EventSource } from "analytics"
|
||||||
import { API } from "api"
|
import { API } from "api"
|
||||||
import { apps } from "stores/portal"
|
import { apps } from "stores/portal"
|
||||||
import { deploymentStore, store, isOnlyUser } from "builderStore"
|
import {
|
||||||
|
previewStore,
|
||||||
|
builderStore,
|
||||||
|
isOnlyUser,
|
||||||
|
appStore,
|
||||||
|
deploymentStore,
|
||||||
|
initialise,
|
||||||
|
} from "stores/frontend"
|
||||||
import TourWrap from "components/portal/onboarding/TourWrap.svelte"
|
import TourWrap from "components/portal/onboarding/TourWrap.svelte"
|
||||||
import { TOUR_STEP_KEYS } from "components/portal/onboarding/tours.js"
|
import { TOUR_STEP_KEYS } from "components/portal/onboarding/tours.js"
|
||||||
import { goto } from "@roxi/routify"
|
import { goto } from "@roxi/routify"
|
||||||
|
@ -45,15 +52,15 @@
|
||||||
$: isPublished =
|
$: isPublished =
|
||||||
selectedApp?.status === "published" && latestDeployments?.length > 0
|
selectedApp?.status === "published" && latestDeployments?.length > 0
|
||||||
$: updateAvailable =
|
$: updateAvailable =
|
||||||
$store.upgradableVersion &&
|
$appStore.upgradableVersion &&
|
||||||
$store.version &&
|
$appStore.version &&
|
||||||
$store.upgradableVersion !== $store.version
|
$appStore.upgradableVersion !== $appStore.version
|
||||||
$: canPublish = !publishing && loaded
|
$: canPublish = !publishing && loaded
|
||||||
$: lastDeployed = getLastDeployedString($deploymentStore)
|
$: lastDeployed = getLastDeployedString($deploymentStore)
|
||||||
|
|
||||||
const initialiseApp = async () => {
|
const initialiseApp = async () => {
|
||||||
const applicationPkg = await API.fetchAppPackage($store.devId)
|
const applicationPkg = await API.fetchAppPackage($appStore.devId)
|
||||||
await store.actions.initialise(applicationPkg)
|
await initialise(applicationPkg)
|
||||||
}
|
}
|
||||||
|
|
||||||
const getLastDeployedString = deployments => {
|
const getLastDeployedString = deployments => {
|
||||||
|
@ -66,10 +73,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
const previewApp = () => {
|
const previewApp = () => {
|
||||||
store.update(state => ({
|
previewStore.showPreview(true)
|
||||||
...state,
|
|
||||||
showPreview: true,
|
|
||||||
}))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const viewApp = () => {
|
const viewApp = () => {
|
||||||
|
@ -87,7 +91,7 @@
|
||||||
async function publishApp() {
|
async function publishApp() {
|
||||||
try {
|
try {
|
||||||
publishing = true
|
publishing = true
|
||||||
await API.publishAppChanges($store.appId)
|
await API.publishAppChanges($appStore.appId)
|
||||||
notifications.send("App published successfully", {
|
notifications.send("App published successfully", {
|
||||||
type: "success",
|
type: "success",
|
||||||
icon: "GlobeCheck",
|
icon: "GlobeCheck",
|
||||||
|
@ -131,7 +135,7 @@
|
||||||
const completePublish = async () => {
|
const completePublish = async () => {
|
||||||
try {
|
try {
|
||||||
await apps.load()
|
await apps.load()
|
||||||
await deploymentStore.actions.load()
|
await deploymentStore.load()
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
notifications.error("Error refreshing app")
|
notifications.error("Error refreshing app")
|
||||||
}
|
}
|
||||||
|
@ -151,7 +155,7 @@
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
<TourWrap
|
<TourWrap
|
||||||
tourStepKey={$store.onboarding
|
tourStepKey={$builderStore.onboarding
|
||||||
? TOUR_STEP_KEYS.BUILDER_USER_MANAGEMENT
|
? TOUR_STEP_KEYS.BUILDER_USER_MANAGEMENT
|
||||||
: TOUR_STEP_KEYS.FEATURE_USER_MANAGEMENT}
|
: TOUR_STEP_KEYS.FEATURE_USER_MANAGEMENT}
|
||||||
>
|
>
|
||||||
|
@ -161,10 +165,7 @@
|
||||||
quiet
|
quiet
|
||||||
icon="UserGroup"
|
icon="UserGroup"
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
store.update(state => {
|
builderStore.showBuilderSidePanel()
|
||||||
state.builderSidePanel = true
|
|
||||||
return state
|
|
||||||
})
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Users
|
Users
|
||||||
|
@ -232,7 +233,7 @@
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{$store.url}
|
{$appStore.url}
|
||||||
{#if isPublished}
|
{#if isPublished}
|
||||||
<Icon size="S" name="LinkOut" />
|
<Icon size="S" name="LinkOut" />
|
||||||
{:else}
|
{:else}
|
||||||
|
@ -313,10 +314,10 @@
|
||||||
<Modal bind:this={updateAppModal} padding={false} width="600px">
|
<Modal bind:this={updateAppModal} padding={false} width="600px">
|
||||||
<UpdateAppModal
|
<UpdateAppModal
|
||||||
app={{
|
app={{
|
||||||
name: $store.name,
|
name: $appStore.name,
|
||||||
url: $store.url,
|
url: $appStore.url,
|
||||||
icon: $store.icon,
|
icon: $appStore.icon,
|
||||||
appId: $store.appId,
|
appId: $appStore.appId,
|
||||||
}}
|
}}
|
||||||
onUpdateComplete={async () => {
|
onUpdateComplete={async () => {
|
||||||
await initialiseApp()
|
await initialiseApp()
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script>
|
<script>
|
||||||
import { automationStore } from "builderStore"
|
import { automationStore } from "stores/frontend"
|
||||||
import { ModalContent } from "@budibase/bbui"
|
import { ModalContent } from "@budibase/bbui"
|
||||||
import { onMount } from "svelte"
|
import { onMount } from "svelte"
|
||||||
import WebhookDisplay from "../automation/Shared/WebhookDisplay.svelte"
|
import WebhookDisplay from "../automation/Shared/WebhookDisplay.svelte"
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<script>
|
<script>
|
||||||
import { Input, notifications } from "@budibase/bbui"
|
import { Input, notifications } from "@budibase/bbui"
|
||||||
import { goto } from "@roxi/routify"
|
import { goto } from "@roxi/routify"
|
||||||
import { store } from "builderStore"
|
|
||||||
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
|
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
|
||||||
import { apps } from "stores/portal"
|
import { apps } from "stores/portal"
|
||||||
|
import { appStore } from "stores/frontend"
|
||||||
import { API } from "api"
|
import { API } from "api"
|
||||||
|
|
||||||
export const show = () => {
|
export const show = () => {
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
const deleteApp = async () => {
|
const deleteApp = async () => {
|
||||||
try {
|
try {
|
||||||
await API.deleteApp($store.appId)
|
await API.deleteApp($appStore.appId)
|
||||||
apps.load()
|
apps.load()
|
||||||
notifications.success("App deleted successfully")
|
notifications.success("App deleted successfully")
|
||||||
$goto("/builder")
|
$goto("/builder")
|
||||||
|
@ -35,11 +35,14 @@
|
||||||
okText="Delete"
|
okText="Delete"
|
||||||
onOk={deleteApp}
|
onOk={deleteApp}
|
||||||
onCancel={() => (deletionConfirmationAppName = null)}
|
onCancel={() => (deletionConfirmationAppName = null)}
|
||||||
disabled={deletionConfirmationAppName !== $store.name}
|
disabled={deletionConfirmationAppName !== $appStore.name}
|
||||||
>
|
>
|
||||||
Are you sure you want to delete <b>{$store.name}</b>?
|
Are you sure you want to delete <b>{$appStore.name}</b>?
|
||||||
<br />
|
<br />
|
||||||
Please enter the app name below to confirm.
|
Please enter the app name below to confirm.
|
||||||
<br /><br />
|
<br /><br />
|
||||||
<Input bind:value={deletionConfirmationAppName} placeholder={$store.name} />
|
<Input
|
||||||
|
bind:value={deletionConfirmationAppName}
|
||||||
|
placeholder={$appStore.name}
|
||||||
|
/>
|
||||||
</ConfirmDialog>
|
</ConfirmDialog>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script>
|
<script>
|
||||||
import { Input, Modal, notifications, ModalContent } from "@budibase/bbui"
|
import { Input, Modal, notifications, ModalContent } from "@budibase/bbui"
|
||||||
import { store } from "builderStore"
|
import { appStore, initialise } from "stores/frontend"
|
||||||
import { API } from "api"
|
import { API } from "api"
|
||||||
|
|
||||||
export let onComplete = () => {}
|
export let onComplete = () => {}
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
let revertModal
|
let revertModal
|
||||||
let appName
|
let appName
|
||||||
|
|
||||||
$: appId = $store.appId
|
$: appId = $appStore.appId
|
||||||
|
|
||||||
const revert = async () => {
|
const revert = async () => {
|
||||||
try {
|
try {
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
// Reset frontend state after revert
|
// Reset frontend state after revert
|
||||||
const applicationPkg = await API.fetchAppPackage(appId)
|
const applicationPkg = await API.fetchAppPackage(appId)
|
||||||
await store.actions.initialise(applicationPkg)
|
await initialise(applicationPkg)
|
||||||
notifications.info("Changes reverted successfully")
|
notifications.info("Changes reverted successfully")
|
||||||
onComplete()
|
onComplete()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
title="Revert Changes"
|
title="Revert Changes"
|
||||||
confirmText="Revert"
|
confirmText="Revert"
|
||||||
onConfirm={revert}
|
onConfirm={revert}
|
||||||
disabled={appName !== $store.name}
|
disabled={appName !== $appStore.name}
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
>The changes you have made will be deleted and the application reverted
|
>The changes you have made will be deleted and the application reverted
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
Button,
|
Button,
|
||||||
StatusLight,
|
StatusLight,
|
||||||
} from "@budibase/bbui"
|
} from "@budibase/bbui"
|
||||||
import { store } from "builderStore"
|
import { appStore, initialise } from "stores/frontend"
|
||||||
import { API } from "api"
|
import { API } from "api"
|
||||||
|
|
||||||
export function show() {
|
export function show() {
|
||||||
|
@ -23,17 +23,17 @@
|
||||||
|
|
||||||
let updateModal
|
let updateModal
|
||||||
|
|
||||||
$: appId = $store.appId
|
$: appId = $appStore.appId
|
||||||
$: updateAvailable =
|
$: updateAvailable =
|
||||||
$store.upgradableVersion &&
|
$appStore.upgradableVersion &&
|
||||||
$store.version &&
|
$appStore.version &&
|
||||||
$store.upgradableVersion !== $store.version
|
$appStore.upgradableVersion !== $appStore.version
|
||||||
$: revertAvailable = $store.revertableVersion != null
|
$: revertAvailable = $appStore.revertableVersion != null
|
||||||
|
|
||||||
const refreshAppPackage = async () => {
|
const refreshAppPackage = async () => {
|
||||||
try {
|
try {
|
||||||
const pkg = await API.fetchAppPackage(appId)
|
const pkg = await API.fetchAppPackage(appId)
|
||||||
await store.actions.initialise(pkg)
|
await initialise(pkg)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
notifications.error("Error fetching app package")
|
notifications.error("Error fetching app package")
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
// Don't wait for the async refresh, since this causes modal flashing
|
// Don't wait for the async refresh, since this causes modal flashing
|
||||||
refreshAppPackage()
|
refreshAppPackage()
|
||||||
notifications.success(
|
notifications.success(
|
||||||
`App updated successfully to version ${$store.upgradableVersion}`
|
`App updated successfully to version ${$appStore.upgradableVersion}`
|
||||||
)
|
)
|
||||||
onComplete()
|
onComplete()
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
@ -62,7 +62,7 @@
|
||||||
// Don't wait for the async refresh, since this causes modal flashing
|
// Don't wait for the async refresh, since this causes modal flashing
|
||||||
refreshAppPackage()
|
refreshAppPackage()
|
||||||
notifications.success(
|
notifications.success(
|
||||||
`App reverted successfully to version ${$store.revertableVersion}`
|
`App reverted successfully to version ${$appStore.revertableVersion}`
|
||||||
)
|
)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
notifications.error(`Error reverting app: ${err}`)
|
notifications.error(`Error reverting app: ${err}`)
|
||||||
|
@ -89,20 +89,21 @@
|
||||||
</div>
|
</div>
|
||||||
{#if updateAvailable}
|
{#if updateAvailable}
|
||||||
<Body size="S">
|
<Body size="S">
|
||||||
This app is currently using version <b>{$store.version}</b>, but version
|
This app is currently using version <b>{$appStore.version}</b>, but
|
||||||
<b>{$store.upgradableVersion}</b> is available. Updates can contain new features,
|
version
|
||||||
performance improvements and bug fixes.
|
<b>{$appStore.upgradableVersion}</b> is available. Updates can contain new
|
||||||
|
features, performance improvements and bug fixes.
|
||||||
</Body>
|
</Body>
|
||||||
{:else}
|
{:else}
|
||||||
<Body size="S">
|
<Body size="S">
|
||||||
This app is currently using version <b>{$store.version}</b> which is the
|
This app is currently using version <b>{$appStore.version}</b> which is the
|
||||||
latest version available.
|
latest version available.
|
||||||
</Body>
|
</Body>
|
||||||
{/if}
|
{/if}
|
||||||
{#if revertAvailable}
|
{#if revertAvailable}
|
||||||
<Body size="S">
|
<Body size="S">
|
||||||
You can revert this app to version
|
You can revert this app to version
|
||||||
<b>{$store.revertableVersion}</b>
|
<b>{$appStore.revertableVersion}</b>
|
||||||
if you're experiencing issues with the current version.
|
if you're experiencing issues with the current version.
|
||||||
</Body>
|
</Body>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<script>
|
<script>
|
||||||
import { ModalContent, Input } from "@budibase/bbui"
|
import { ModalContent, Input } from "@budibase/bbui"
|
||||||
import sanitizeUrl from "builderStore/store/screenTemplates/utils/sanitizeUrl"
|
import sanitizeUrl from "builder/store/screenTemplates/utils/sanitizeUrl"
|
||||||
import { get } from "svelte/store"
|
import { get } from "svelte/store"
|
||||||
import { store } from "builderStore"
|
import { screenStore } from "stores/frontend"
|
||||||
|
|
||||||
export let onConfirm
|
export let onConfirm
|
||||||
export let onCancel
|
export let onCancel
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
if (!screenRole) {
|
if (!screenRole) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return get(store).screens.some(
|
return get(screenStore).screens.some(
|
||||||
screen =>
|
screen =>
|
||||||
screen.routing.route.toLowerCase() === url.toLowerCase() &&
|
screen.routing.route.toLowerCase() === url.toLowerCase() &&
|
||||||
screen.routing.roleId === screenRole
|
screen.routing.roleId === screenRole
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
getEventContextBindings,
|
getEventContextBindings,
|
||||||
getActionBindings,
|
getActionBindings,
|
||||||
makeStateBinding,
|
makeStateBinding,
|
||||||
} from "builderStore/dataBinding"
|
} from "builder/dataBinding"
|
||||||
import { cloneDeep } from "lodash/fp"
|
import { cloneDeep } from "lodash/fp"
|
||||||
|
|
||||||
const flipDurationMs = 150
|
const flipDurationMs = 150
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<script>
|
<script>
|
||||||
import { Select, Label } from "@budibase/bbui"
|
import { Select, Label } from "@budibase/bbui"
|
||||||
import { currentAsset, store } from "builderStore"
|
import { currentAsset, componentStore } from "stores/frontend"
|
||||||
import { getActionProviderComponents } from "builderStore/dataBinding"
|
import { getActionProviderComponents } from "builder/dataBinding"
|
||||||
import { onMount } from "svelte"
|
import { onMount } from "svelte"
|
||||||
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
|
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
$: actionProviders = getActionProviderComponents(
|
$: actionProviders = getActionProviderComponents(
|
||||||
$currentAsset,
|
$currentAsset,
|
||||||
$store.selectedComponentId,
|
$componentStore.selectedComponentId,
|
||||||
"ChangeFormStep"
|
"ChangeFormStep"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
<script>
|
<script>
|
||||||
import { Select, Label } from "@budibase/bbui"
|
import { Select, Label } from "@budibase/bbui"
|
||||||
import { currentAsset, store } from "builderStore"
|
import { currentAsset, componentStore } from "stores/frontend"
|
||||||
import { getActionProviderComponents } from "builderStore/dataBinding"
|
import { getActionProviderComponents } from "builder/dataBinding"
|
||||||
|
|
||||||
export let parameters
|
export let parameters
|
||||||
|
|
||||||
$: actionProviders = getActionProviderComponents(
|
$: actionProviders = getActionProviderComponents(
|
||||||
$currentAsset,
|
$currentAsset,
|
||||||
$store.selectedComponentId,
|
$componentStore.selectedComponentId,
|
||||||
"ClearForm"
|
"ClearForm"
|
||||||
)
|
)
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
<script>
|
<script>
|
||||||
import { Select, Label, Body, Checkbox, Input } from "@budibase/bbui"
|
import { Select, Label, Body, Checkbox, Input } from "@budibase/bbui"
|
||||||
import { store, currentAsset } from "builderStore"
|
import { currentAsset, componentStore } from "stores/frontend"
|
||||||
import { tables, viewsV2 } from "stores/backend"
|
import { tables, viewsV2 } from "stores/backend"
|
||||||
import {
|
import {
|
||||||
getContextProviderComponents,
|
getContextProviderComponents,
|
||||||
getSchemaForDatasourcePlus,
|
getSchemaForDatasourcePlus,
|
||||||
} from "builderStore/dataBinding"
|
} from "builder/dataBinding"
|
||||||
import SaveFields from "./SaveFields.svelte"
|
import SaveFields from "./SaveFields.svelte"
|
||||||
|
|
||||||
export let parameters
|
export let parameters
|
||||||
|
@ -13,12 +13,12 @@
|
||||||
|
|
||||||
$: formComponents = getContextProviderComponents(
|
$: formComponents = getContextProviderComponents(
|
||||||
$currentAsset,
|
$currentAsset,
|
||||||
$store.selectedComponentId,
|
$componentStore.selectedComponentId,
|
||||||
"form"
|
"form"
|
||||||
)
|
)
|
||||||
$: schemaComponents = getContextProviderComponents(
|
$: schemaComponents = getContextProviderComponents(
|
||||||
$currentAsset,
|
$currentAsset,
|
||||||
$store.selectedComponentId,
|
$componentStore.selectedComponentId,
|
||||||
"schema"
|
"schema"
|
||||||
)
|
)
|
||||||
$: providerOptions = getProviderOptions(formComponents, schemaComponents)
|
$: providerOptions = getProviderOptions(formComponents, schemaComponents)
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
|
|
||||||
// Gets a context definition of a certain type from a component definition
|
// Gets a context definition of a certain type from a component definition
|
||||||
const extractComponentContext = (component, contextType) => {
|
const extractComponentContext = (component, contextType) => {
|
||||||
const def = store.actions.components.getDefinition(component?._component)
|
const def = componentStore.getDefinition(component?._component)
|
||||||
if (!def) {
|
if (!def) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,13 +3,13 @@
|
||||||
import {
|
import {
|
||||||
findAllMatchingComponents,
|
findAllMatchingComponents,
|
||||||
findComponent,
|
findComponent,
|
||||||
} from "builderStore/componentUtils"
|
} from "stores/frontend/components/utils"
|
||||||
import { currentAsset } from "builderStore"
|
import { currentAsset } from "stores/frontend"
|
||||||
import { onMount } from "svelte"
|
import { onMount } from "svelte"
|
||||||
import {
|
import {
|
||||||
getDatasourceForProvider,
|
getDatasourceForProvider,
|
||||||
getSchemaForDatasource,
|
getSchemaForDatasource,
|
||||||
} from "builderStore/dataBinding"
|
} from "builder/dataBinding"
|
||||||
|
|
||||||
export let parameters
|
export let parameters
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script>
|
<script>
|
||||||
import { store } from "builderStore"
|
import { screenStore } from "stores/frontend"
|
||||||
import { onMount } from "svelte"
|
import { onMount } from "svelte"
|
||||||
import { Label, Checkbox, Select } from "@budibase/bbui"
|
import { Label, Checkbox, Select } from "@budibase/bbui"
|
||||||
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
|
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
export let parameters
|
export let parameters
|
||||||
export let bindings = []
|
export let bindings = []
|
||||||
|
|
||||||
$: urlOptions = $store.screens
|
$: urlOptions = $screenStore.screens
|
||||||
.map(screen => screen.routing?.route)
|
.map(screen => screen.routing?.route)
|
||||||
.filter(x => x != null)
|
.filter(x => x != null)
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<script>
|
<script>
|
||||||
import { Select, Label } from "@budibase/bbui"
|
import { Select, Label } from "@budibase/bbui"
|
||||||
import { selectedScreen } from "builderStore"
|
import { selectedScreen } from "stores/frontend"
|
||||||
import { findAllMatchingComponents } from "builderStore/componentUtils"
|
import { findAllMatchingComponents } from "stores/frontend/components/utils"
|
||||||
|
|
||||||
export let parameters
|
export let parameters
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
<script>
|
<script>
|
||||||
import { Select, Label } from "@budibase/bbui"
|
import { Select, Label } from "@budibase/bbui"
|
||||||
import { currentAsset, store } from "builderStore"
|
import { currentAsset, componentStore } from "stores/frontend"
|
||||||
import { getActionProviderComponents } from "builderStore/dataBinding"
|
import { getActionProviderComponents } from "builder/dataBinding"
|
||||||
|
|
||||||
export let parameters
|
export let parameters
|
||||||
|
|
||||||
$: actionProviders = getActionProviderComponents(
|
$: actionProviders = getActionProviderComponents(
|
||||||
$currentAsset,
|
$currentAsset,
|
||||||
$store.selectedComponentId,
|
$componentStore.selectedComponentId,
|
||||||
"RefreshDatasource"
|
"RefreshDatasource"
|
||||||
)
|
)
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<script>
|
<script>
|
||||||
import { Select, Label } from "@budibase/bbui"
|
import { Select, Label } from "@budibase/bbui"
|
||||||
import { currentAsset } from "builderStore"
|
import { currentAsset } from "stores/frontend"
|
||||||
import { findAllMatchingComponents } from "builderStore/componentUtils"
|
import { findAllMatchingComponents } from "stores/frontend/components/utils"
|
||||||
|
|
||||||
export let parameters
|
export let parameters
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
<script>
|
<script>
|
||||||
import { Select, Label, Body, Checkbox, Input } from "@budibase/bbui"
|
import { Select, Label, Body, Checkbox, Input } from "@budibase/bbui"
|
||||||
import { store, currentAsset } from "builderStore"
|
import { currentAsset, componentStore } from "stores/frontend"
|
||||||
import { tables, viewsV2 } from "stores/backend"
|
import { tables, viewsV2 } from "stores/backend"
|
||||||
import {
|
import {
|
||||||
getContextProviderComponents,
|
getContextProviderComponents,
|
||||||
getSchemaForDatasourcePlus,
|
getSchemaForDatasourcePlus,
|
||||||
} from "builderStore/dataBinding"
|
} from "builder/dataBinding"
|
||||||
import SaveFields from "./SaveFields.svelte"
|
import SaveFields from "./SaveFields.svelte"
|
||||||
|
|
||||||
export let parameters
|
export let parameters
|
||||||
|
@ -14,13 +14,13 @@
|
||||||
|
|
||||||
$: formComponents = getContextProviderComponents(
|
$: formComponents = getContextProviderComponents(
|
||||||
$currentAsset,
|
$currentAsset,
|
||||||
$store.selectedComponentId,
|
$componentStore.selectedComponentId,
|
||||||
"form",
|
"form",
|
||||||
{ includeSelf: nested }
|
{ includeSelf: nested }
|
||||||
)
|
)
|
||||||
$: schemaComponents = getContextProviderComponents(
|
$: schemaComponents = getContextProviderComponents(
|
||||||
$currentAsset,
|
$currentAsset,
|
||||||
$store.selectedComponentId,
|
$componentStore.selectedComponentId,
|
||||||
"schema"
|
"schema"
|
||||||
)
|
)
|
||||||
$: providerOptions = getProviderOptions(formComponents, schemaComponents)
|
$: providerOptions = getProviderOptions(formComponents, schemaComponents)
|
||||||
|
@ -37,7 +37,9 @@
|
||||||
|
|
||||||
// Gets a context definition of a certain type from a component definition
|
// Gets a context definition of a certain type from a component definition
|
||||||
const extractComponentContext = (component, contextType) => {
|
const extractComponentContext = (component, contextType) => {
|
||||||
const def = store.actions.components.getDefinition(component?._component)
|
const def = componentStore.getDefinition.getDefinition(
|
||||||
|
component?._component
|
||||||
|
)
|
||||||
if (!def) {
|
if (!def) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
<script>
|
<script>
|
||||||
import { currentAsset, store } from "builderStore"
|
import { currentAsset, componentStore } from "stores/frontend"
|
||||||
import { Label, Combobox, Select } from "@budibase/bbui"
|
import { Label, Combobox, Select } from "@budibase/bbui"
|
||||||
import {
|
import {
|
||||||
getActionProviderComponents,
|
getActionProviderComponents,
|
||||||
buildFormSchema,
|
buildFormSchema,
|
||||||
} from "builderStore/dataBinding"
|
} from "builder/dataBinding"
|
||||||
import { findComponent } from "builderStore/componentUtils"
|
import { findComponent } from "stores/frontend/components/utils"
|
||||||
|
|
||||||
export let parameters
|
export let parameters
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
$: fieldOptions = Object.keys(formSchema || {})
|
$: fieldOptions = Object.keys(formSchema || {})
|
||||||
$: actionProviders = getActionProviderComponents(
|
$: actionProviders = getActionProviderComponents(
|
||||||
$currentAsset,
|
$currentAsset,
|
||||||
$store.selectedComponentId,
|
$componentStore.selectedComponentId,
|
||||||
"ScrollTo"
|
"ScrollTo"
|
||||||
)
|
)
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script>
|
<script>
|
||||||
import { Select, Label, Input, Checkbox, Icon, Body } from "@budibase/bbui"
|
import { Select, Label, Input, Checkbox, Icon, Body } from "@budibase/bbui"
|
||||||
import { automationStore } from "builderStore"
|
import { automationStore } from "stores/frontend"
|
||||||
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
|
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
|
||||||
import { TriggerStepID, ActionStepID } from "constants/backend/automations"
|
import { TriggerStepID, ActionStepID } from "constants/backend/automations"
|
||||||
|
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
import { Select, Label, Combobox } from "@budibase/bbui"
|
import { Select, Label, Combobox } from "@budibase/bbui"
|
||||||
import { onMount } from "svelte"
|
import { onMount } from "svelte"
|
||||||
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
|
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
|
||||||
import { currentAsset, store } from "builderStore"
|
import { currentAsset, componentStore } from "stores/frontend"
|
||||||
import {
|
import {
|
||||||
getActionProviderComponents,
|
getActionProviderComponents,
|
||||||
buildFormSchema,
|
buildFormSchema,
|
||||||
} from "builderStore/dataBinding"
|
} from "builder/dataBinding"
|
||||||
import { findComponent } from "builderStore/componentUtils"
|
import { findComponent } from "stores/frontend/components/utils"
|
||||||
|
|
||||||
export let parameters
|
export let parameters
|
||||||
export let bindings = []
|
export let bindings = []
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
$: fieldOptions = Object.keys(formSchema || {})
|
$: fieldOptions = Object.keys(formSchema || {})
|
||||||
$: actionProviders = getActionProviderComponents(
|
$: actionProviders = getActionProviderComponents(
|
||||||
$currentAsset,
|
$currentAsset,
|
||||||
$store.selectedComponentId,
|
$componentStore.selectedComponentId,
|
||||||
"ValidateForm"
|
"ValidateForm"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
import { Select, Label, Combobox, Checkbox, Body } from "@budibase/bbui"
|
import { Select, Label, Combobox, Checkbox, Body } from "@budibase/bbui"
|
||||||
import { onMount } from "svelte"
|
import { onMount } from "svelte"
|
||||||
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
|
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
|
||||||
import { getAllStateVariables } from "builderStore/dataBinding"
|
import { getAllStateVariables } from "builder/dataBinding"
|
||||||
|
|
||||||
export let parameters
|
export let parameters
|
||||||
export let bindings = []
|
export let bindings = []
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
<script>
|
<script>
|
||||||
import { Select, Label } from "@budibase/bbui"
|
import { Select, Label } from "@budibase/bbui"
|
||||||
import { currentAsset, store } from "builderStore"
|
import { currentAsset, componentStore } from "stores/frontend"
|
||||||
import { getActionProviderComponents } from "builderStore/dataBinding"
|
import { getActionProviderComponents } from "builder/dataBinding"
|
||||||
|
|
||||||
export let parameters
|
export let parameters
|
||||||
|
|
||||||
$: actionProviders = getActionProviderComponents(
|
$: actionProviders = getActionProviderComponents(
|
||||||
$currentAsset,
|
$currentAsset,
|
||||||
$store.selectedComponentId,
|
$componentStore.selectedComponentId,
|
||||||
"ValidateForm"
|
"ValidateForm"
|
||||||
)
|
)
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import * as ActionComponents from "./actions"
|
import * as ActionComponents from "./actions"
|
||||||
import { get } from "svelte/store"
|
import { get } from "svelte/store"
|
||||||
import { store } from "builderStore"
|
import { appStore } from "stores/frontend"
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import ActionDefinitions from "./manifest.json"
|
import ActionDefinitions from "./manifest.json"
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ export const getAvailableActions = (getAllActions = false) => {
|
||||||
if (getAllActions || !action.dependsOnFeature) {
|
if (getAllActions || !action.dependsOnFeature) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return get(store).clientFeatures?.[action.dependsOnFeature] === true
|
return get(appStore).clientFeatures?.[action.dependsOnFeature] === true
|
||||||
})
|
})
|
||||||
.map(action => {
|
.map(action => {
|
||||||
// Then enrich the actions with real components
|
// Then enrich the actions with real components
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<script>
|
<script>
|
||||||
import { ColorPicker } from "@budibase/bbui"
|
import { ColorPicker } from "@budibase/bbui"
|
||||||
import { store } from "builderStore"
|
import { themeStore } from "stores/frontend"
|
||||||
|
|
||||||
export let value
|
export let value
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ColorPicker {value} on:change spectrumTheme={$store.theme} />
|
<ColorPicker {value} on:change spectrumTheme={$themeStore.theme} />
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
Layout,
|
Layout,
|
||||||
Label,
|
Label,
|
||||||
} from "@budibase/bbui"
|
} from "@budibase/bbui"
|
||||||
import { store } from "builderStore"
|
import { themeStore } from "stores/frontend"
|
||||||
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
|
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
|
||||||
|
|
||||||
export let column
|
export let column
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
<ColorPicker
|
<ColorPicker
|
||||||
value={column.background}
|
value={column.background}
|
||||||
on:change={e => (column.background = e.detail)}
|
on:change={e => (column.background = e.detail)}
|
||||||
spectrumTheme={$store.theme}
|
spectrumTheme={$themeStore.theme}
|
||||||
/>
|
/>
|
||||||
</Layout>
|
</Layout>
|
||||||
<Layout noPadding gap="XS">
|
<Layout noPadding gap="XS">
|
||||||
|
@ -50,7 +50,7 @@
|
||||||
<ColorPicker
|
<ColorPicker
|
||||||
value={column.color}
|
value={column.color}
|
||||||
on:change={e => (column.color = e.detail)}
|
on:change={e => (column.color = e.detail)}
|
||||||
spectrumTheme={$store.theme}
|
spectrumTheme={$themeStore.theme}
|
||||||
/>
|
/>
|
||||||
</Layout>
|
</Layout>
|
||||||
</Layout>
|
</Layout>
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
import {
|
import {
|
||||||
getDatasourceForProvider,
|
getDatasourceForProvider,
|
||||||
getSchemaForDatasource,
|
getSchemaForDatasource,
|
||||||
} from "builderStore/dataBinding"
|
} from "builder/dataBinding"
|
||||||
import { currentAsset } from "builderStore"
|
import { currentAsset } from "stores/frontend"
|
||||||
import { getFields } from "helpers/searchFields"
|
import { getFields } from "helpers/searchFields"
|
||||||
|
|
||||||
export let componentInstance
|
export let componentInstance
|
||||||
|
|
|
@ -1,14 +1,17 @@
|
||||||
<script>
|
<script>
|
||||||
import { Select } from "@budibase/bbui"
|
import { Select } from "@budibase/bbui"
|
||||||
import { makePropSafe } from "@budibase/string-templates"
|
import { makePropSafe } from "@budibase/string-templates"
|
||||||
import { currentAsset, store } from "builderStore"
|
import { currentAsset, componentStore } from "stores/frontend"
|
||||||
import { findComponentPath } from "builderStore/componentUtils"
|
import { findComponentPath } from "stores/frontend/components/utils"
|
||||||
|
|
||||||
export let value
|
export let value
|
||||||
|
|
||||||
const getValue = component => `{{ literal ${makePropSafe(component._id)} }}`
|
const getValue = component => `{{ literal ${makePropSafe(component._id)} }}`
|
||||||
|
|
||||||
$: path = findComponentPath($currentAsset?.props, $store.selectedComponentId)
|
$: path = findComponentPath(
|
||||||
|
$currentAsset?.props,
|
||||||
|
$componentStore.selectedComponentId
|
||||||
|
)
|
||||||
$: providers = path.filter(c => c._component?.endsWith("/dataprovider"))
|
$: providers = path.filter(c => c._component?.endsWith("/dataprovider"))
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
getContextProviderComponents,
|
getContextProviderComponents,
|
||||||
readableToRuntimeBinding,
|
readableToRuntimeBinding,
|
||||||
runtimeToReadableBinding,
|
runtimeToReadableBinding,
|
||||||
} from "builderStore/dataBinding"
|
} from "builder/dataBinding"
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Popover,
|
Popover,
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
notifications,
|
notifications,
|
||||||
} from "@budibase/bbui"
|
} from "@budibase/bbui"
|
||||||
import { createEventDispatcher } from "svelte"
|
import { createEventDispatcher } from "svelte"
|
||||||
import { store, currentAsset } from "builderStore"
|
import { currentAsset, componentStore } from "stores/frontend"
|
||||||
import {
|
import {
|
||||||
tables as tablesStore,
|
tables as tablesStore,
|
||||||
queries as queriesStore,
|
queries as queriesStore,
|
||||||
|
@ -77,7 +77,7 @@
|
||||||
}))
|
}))
|
||||||
$: contextProviders = getContextProviderComponents(
|
$: contextProviders = getContextProviderComponents(
|
||||||
$currentAsset,
|
$currentAsset,
|
||||||
$store.selectedComponentId
|
$componentStore.selectedComponentId
|
||||||
)
|
)
|
||||||
$: dataProviders = contextProviders
|
$: dataProviders = contextProviders
|
||||||
.filter(component => component._component?.endsWith("/dataprovider"))
|
.filter(component => component._component?.endsWith("/dataprovider"))
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script>
|
<script>
|
||||||
import { Icon, Popover, Layout } from "@budibase/bbui"
|
import { Icon, Popover, Layout } from "@budibase/bbui"
|
||||||
import { store } from "builderStore"
|
import { componentStore } from "stores/frontend"
|
||||||
import { cloneDeep } from "lodash/fp"
|
import { cloneDeep } from "lodash/fp"
|
||||||
import { createEventDispatcher } from "svelte"
|
import { createEventDispatcher } from "svelte"
|
||||||
import ComponentSettingsSection from "../../../../../pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Component/ComponentSettingsSection.svelte"
|
import ComponentSettingsSection from "../../../../../pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Component/ComponentSettingsSection.svelte"
|
||||||
|
@ -26,7 +26,7 @@
|
||||||
$: if (field) {
|
$: if (field) {
|
||||||
pseudoComponentInstance = field
|
pseudoComponentInstance = field
|
||||||
}
|
}
|
||||||
$: componentDef = store.actions.components.getDefinition(
|
$: componentDef = componentStore.getDefinition(
|
||||||
pseudoComponentInstance._component
|
pseudoComponentInstance._component
|
||||||
)
|
)
|
||||||
$: parsedComponentDef = processComponentDefinitionSettings(componentDef)
|
$: parsedComponentDef = processComponentDefinitionSettings(componentDef)
|
||||||
|
@ -48,10 +48,7 @@
|
||||||
const updateSetting = async (setting, value) => {
|
const updateSetting = async (setting, value) => {
|
||||||
const nestedComponentInstance = cloneDeep(pseudoComponentInstance)
|
const nestedComponentInstance = cloneDeep(pseudoComponentInstance)
|
||||||
|
|
||||||
const patchFn = store.actions.components.updateComponentSetting(
|
const patchFn = componentStore.updateComponentSetting(setting.key, value)
|
||||||
setting.key,
|
|
||||||
value
|
|
||||||
)
|
|
||||||
patchFn(nestedComponentInstance)
|
patchFn(nestedComponentInstance)
|
||||||
|
|
||||||
const update = {
|
const update = {
|
||||||
|
|
|
@ -5,11 +5,10 @@
|
||||||
getSchemaForDatasource,
|
getSchemaForDatasource,
|
||||||
getBindableProperties,
|
getBindableProperties,
|
||||||
getComponentBindableProperties,
|
getComponentBindableProperties,
|
||||||
} from "builderStore/dataBinding"
|
} from "builder/dataBinding"
|
||||||
import { currentAsset } from "builderStore"
|
|
||||||
import DraggableList from "../DraggableList.svelte"
|
import DraggableList from "../DraggableList.svelte"
|
||||||
import { createEventDispatcher } from "svelte"
|
import { createEventDispatcher } from "svelte"
|
||||||
import { store, selectedScreen } from "builderStore"
|
import { selectedScreen, currentAsset, componentStore } from "stores/frontend"
|
||||||
import FieldSetting from "./FieldSetting.svelte"
|
import FieldSetting from "./FieldSetting.svelte"
|
||||||
import { convertOldFieldFormat, getComponentForField } from "./utils"
|
import { convertOldFieldFormat, getComponentForField } from "./utils"
|
||||||
|
|
||||||
|
@ -114,7 +113,7 @@
|
||||||
}
|
}
|
||||||
instance._component = `@budibase/standard-components/${type}`
|
instance._component = `@budibase/standard-components/${type}`
|
||||||
|
|
||||||
const pseudoComponentInstance = store.actions.components.createInstance(
|
const pseudoComponentInstance = componentStore.createInstance(
|
||||||
instance._component,
|
instance._component,
|
||||||
{
|
{
|
||||||
_instanceName: instance.field,
|
_instanceName: instance.field,
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
import {
|
import {
|
||||||
getDatasourceForProvider,
|
getDatasourceForProvider,
|
||||||
getSchemaForDatasource,
|
getSchemaForDatasource,
|
||||||
} from "builderStore/dataBinding"
|
} from "builder/dataBinding"
|
||||||
import { currentAsset } from "builderStore"
|
import { currentAsset } from "stores/frontend"
|
||||||
import { createEventDispatcher } from "svelte"
|
import { createEventDispatcher } from "svelte"
|
||||||
|
|
||||||
export let componentInstance = {}
|
export let componentInstance = {}
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
import {
|
import {
|
||||||
getDatasourceForProvider,
|
getDatasourceForProvider,
|
||||||
getSchemaForDatasource,
|
getSchemaForDatasource,
|
||||||
} from "builderStore/dataBinding"
|
} from "builder/dataBinding"
|
||||||
import FilterDrawer from "./FilterDrawer.svelte"
|
import FilterDrawer from "./FilterDrawer.svelte"
|
||||||
import { currentAsset } from "builderStore"
|
import { currentAsset } from "stores/frontend"
|
||||||
|
|
||||||
const dispatch = createEventDispatcher()
|
const dispatch = createEventDispatcher()
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script>
|
<script>
|
||||||
import { Combobox } from "@budibase/bbui"
|
import { Combobox } from "@budibase/bbui"
|
||||||
import { currentAsset } from "builderStore"
|
import { currentAsset } from "stores/frontend"
|
||||||
import { getComponentFieldOptions } from "helpers/formFields"
|
import { getComponentFieldOptions } from "helpers/formFields"
|
||||||
|
|
||||||
export let componentInstance
|
export let componentInstance
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script>
|
<script>
|
||||||
import { store } from "builderStore"
|
import { layoutStore } from "stores/frontend"
|
||||||
import { Select } from "@budibase/bbui"
|
import { Select } from "@budibase/bbui"
|
||||||
|
|
||||||
export let value
|
export let value
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
<Select
|
<Select
|
||||||
bind:value
|
bind:value
|
||||||
on:change
|
on:change
|
||||||
options={$store.layouts}
|
options={$layoutStore.layouts}
|
||||||
getOptionLabel={layout => layout.name}
|
getOptionLabel={layout => layout.name}
|
||||||
getOptionValue={layout => layout._id}
|
getOptionValue={layout => layout._id}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
import {
|
import {
|
||||||
getDatasourceForProvider,
|
getDatasourceForProvider,
|
||||||
getSchemaForDatasource,
|
getSchemaForDatasource,
|
||||||
} from "builderStore/dataBinding"
|
} from "builder/dataBinding"
|
||||||
import { currentAsset } from "builderStore"
|
import { currentAsset } from "stores/frontend"
|
||||||
import { createEventDispatcher } from "svelte"
|
import { createEventDispatcher } from "svelte"
|
||||||
|
|
||||||
export let componentInstance = {}
|
export let componentInstance = {}
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
import {
|
import {
|
||||||
readableToRuntimeBinding,
|
readableToRuntimeBinding,
|
||||||
runtimeToReadableBinding,
|
runtimeToReadableBinding,
|
||||||
} from "builderStore/dataBinding"
|
} from "builder/dataBinding"
|
||||||
import { store } from "builderStore"
|
import { builderStore } from "stores/frontend"
|
||||||
import { onDestroy } from "svelte"
|
import { onDestroy } from "svelte"
|
||||||
|
|
||||||
export let label = ""
|
export let label = ""
|
||||||
|
@ -70,7 +70,7 @@
|
||||||
|
|
||||||
onDestroy(() => {
|
onDestroy(() => {
|
||||||
if (highlighted) {
|
if (highlighted) {
|
||||||
store.actions.settings.highlight(null)
|
builderStore.highlightSetting(null)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
<script>
|
<script>
|
||||||
import { currentAsset } from "builderStore"
|
import { currentAsset } from "stores/frontend"
|
||||||
import { findClosestMatchingComponent } from "builderStore/componentUtils"
|
import { findClosestMatchingComponent } from "stores/frontend/components/utils"
|
||||||
import {
|
import {
|
||||||
getDatasourceForProvider,
|
getDatasourceForProvider,
|
||||||
getSchemaForDatasource,
|
getSchemaForDatasource,
|
||||||
} from "builderStore/dataBinding"
|
} from "builder/dataBinding"
|
||||||
import { tables } from "stores/backend"
|
import { tables } from "stores/backend"
|
||||||
import FilterEditor from "./FilterEditor/FilterEditor.svelte"
|
import FilterEditor from "./FilterEditor/FilterEditor.svelte"
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<script>
|
<script>
|
||||||
import { ActionButton, notifications } from "@budibase/bbui"
|
import { ActionButton, notifications } from "@budibase/bbui"
|
||||||
import { currentAsset, store } from "builderStore"
|
import { currentAsset, componentStore } from "stores/frontend"
|
||||||
import { findClosestMatchingComponent } from "builderStore/componentUtils"
|
import { findClosestMatchingComponent } from "stores/frontend/components/utils"
|
||||||
import { makeDatasourceFormComponents } from "builderStore/store/screenTemplates/utils/commonComponents"
|
import { makeDatasourceFormComponents } from "builder/store/screenTemplates/utils/commonComponents"
|
||||||
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
|
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
|
||||||
|
|
||||||
export let componentInstance
|
export let componentInstance
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
const dataSource = form?.dataSource
|
const dataSource = form?.dataSource
|
||||||
const fields = makeDatasourceFormComponents(dataSource)
|
const fields = makeDatasourceFormComponents(dataSource)
|
||||||
try {
|
try {
|
||||||
await store.actions.components.updateSetting(
|
await componentStore.updateSetting(
|
||||||
"_children",
|
"_children",
|
||||||
fields.map(field => field.json())
|
fields.map(field => field.json())
|
||||||
)
|
)
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
import {
|
import {
|
||||||
getDatasourceForProvider,
|
getDatasourceForProvider,
|
||||||
getSchemaForDatasource,
|
getSchemaForDatasource,
|
||||||
} from "builderStore/dataBinding"
|
} from "builder/dataBinding"
|
||||||
import { currentAsset } from "builderStore"
|
import { currentAsset } from "stores/frontend"
|
||||||
import { tables } from "stores/backend"
|
import { tables } from "stores/backend"
|
||||||
import { createEventDispatcher } from "svelte"
|
import { createEventDispatcher } from "svelte"
|
||||||
import { getFields } from "helpers/searchFields"
|
import { getFields } from "helpers/searchFields"
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
import {
|
import {
|
||||||
getDatasourceForProvider,
|
getDatasourceForProvider,
|
||||||
getSchemaForDatasource,
|
getSchemaForDatasource,
|
||||||
} from "builderStore/dataBinding"
|
} from "builder/dataBinding"
|
||||||
import { currentAsset } from "builderStore"
|
import { currentAsset } from "stores/frontend"
|
||||||
import { createEventDispatcher } from "svelte"
|
import { createEventDispatcher } from "svelte"
|
||||||
import { canBeSortColumn } from "@budibase/shared-core"
|
import { canBeSortColumn } from "@budibase/shared-core"
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
<script>
|
<script>
|
||||||
import { store } from "builderStore"
|
import { screenStore } from "stores/frontend"
|
||||||
import DrawerBindableCombobox from "components/common/bindings/DrawerBindableCombobox.svelte"
|
import DrawerBindableCombobox from "components/common/bindings/DrawerBindableCombobox.svelte"
|
||||||
|
|
||||||
export let value
|
export let value
|
||||||
export let bindings
|
export let bindings
|
||||||
export let placeholder
|
export let placeholder
|
||||||
|
|
||||||
$: urlOptions = $store.screens
|
$: urlOptions = $screenStore.screens
|
||||||
.map(screen => screen.routing?.route)
|
.map(screen => screen.routing?.route)
|
||||||
.filter(x => x != null)
|
.filter(x => x != null)
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -10,9 +10,9 @@
|
||||||
Input,
|
Input,
|
||||||
DatePicker,
|
DatePicker,
|
||||||
} from "@budibase/bbui"
|
} from "@budibase/bbui"
|
||||||
import { currentAsset, selectedComponent } from "builderStore"
|
import { currentAsset, selectedComponent } from "stores/frontend"
|
||||||
import { findClosestMatchingComponent } from "builderStore/componentUtils"
|
import { findClosestMatchingComponent } from "stores/frontend/components/utils"
|
||||||
import { getSchemaForDatasource } from "builderStore/dataBinding"
|
import { getSchemaForDatasource } from "builder/dataBinding"
|
||||||
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
|
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
|
||||||
import { generate } from "shortid"
|
import { generate } from "shortid"
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
import {
|
import {
|
||||||
readableToRuntimeBinding,
|
readableToRuntimeBinding,
|
||||||
runtimeToReadableBinding,
|
runtimeToReadableBinding,
|
||||||
} from "builderStore/dataBinding"
|
} from "builder/dataBinding"
|
||||||
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
|
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
|
||||||
import { createEventDispatcher } from "svelte"
|
import { createEventDispatcher } from "svelte"
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
import CodeMirror from "./codemirror"
|
import CodeMirror from "./codemirror"
|
||||||
import { Label } from "@budibase/bbui"
|
import { Label } from "@budibase/bbui"
|
||||||
import { onMount, createEventDispatcher } from "svelte"
|
import { onMount, createEventDispatcher } from "svelte"
|
||||||
import { themeStore } from "builderStore"
|
import { themeStore } from "stores/portal"
|
||||||
|
|
||||||
const dispatch = createEventDispatcher()
|
const dispatch = createEventDispatcher()
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
<script>
|
<script>
|
||||||
import KeyValueBuilder from "components/integration/KeyValueBuilder.svelte"
|
import KeyValueBuilder from "components/integration/KeyValueBuilder.svelte"
|
||||||
import { getUserBindings } from "builderStore/dataBinding"
|
import { getUserBindings } from "builder/dataBinding"
|
||||||
export let bindable = true
|
|
||||||
export let queryBindings = []
|
export let queryBindings = []
|
||||||
export let hideHeading = false
|
|
||||||
|
|
||||||
const userBindings = getUserBindings()
|
const userBindings = getUserBindings()
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
runtimeToReadableBinding,
|
runtimeToReadableBinding,
|
||||||
runtimeToReadableMap,
|
runtimeToReadableMap,
|
||||||
toBindingsArray,
|
toBindingsArray,
|
||||||
} from "builderStore/dataBinding"
|
} from "builder/dataBinding"
|
||||||
|
|
||||||
export let queryId
|
export let queryId
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<script>
|
<script>
|
||||||
import { licensing, auth } from "stores/portal"
|
import { licensing, auth, temporalStore } from "stores/portal"
|
||||||
import { temporalStore } from "builderStore"
|
|
||||||
import { onMount } from "svelte"
|
import { onMount } from "svelte"
|
||||||
import DayPassWarningModal from "./DayPassWarningModal.svelte"
|
import DayPassWarningModal from "./DayPassWarningModal.svelte"
|
||||||
import PaymentFailedModal from "./PaymentFailedModal.svelte"
|
import PaymentFailedModal from "./PaymentFailedModal.svelte"
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import { ExpiringKeys } from "./constants"
|
import { ExpiringKeys } from "./constants"
|
||||||
import { temporalStore } from "builderStore"
|
import { admin, auth, licensing, temporalStore } from "stores/portal"
|
||||||
import { admin, auth, licensing } from "stores/portal"
|
|
||||||
import { get } from "svelte/store"
|
import { get } from "svelte/store"
|
||||||
import { BANNER_TYPES } from "@budibase/bbui"
|
import { BANNER_TYPES } from "@budibase/bbui"
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<script>
|
<script>
|
||||||
import { Popover, Layout, Heading, Body, Button, Link } from "@budibase/bbui"
|
import { Popover, Layout, Heading, Body, Button, Link } from "@budibase/bbui"
|
||||||
import { store } from "builderStore"
|
|
||||||
import { TOURS } from "./tours.js"
|
import { TOURS } from "./tours.js"
|
||||||
import { goto, layout, isActive } from "@roxi/routify"
|
import { goto, layout, isActive } from "@roxi/routify"
|
||||||
|
import { builderStore } from "stores/frontend"
|
||||||
|
|
||||||
let popoverAnchor
|
let popoverAnchor
|
||||||
let popover
|
let popover
|
||||||
|
@ -12,9 +12,9 @@
|
||||||
let lastStep
|
let lastStep
|
||||||
let skipping = false
|
let skipping = false
|
||||||
|
|
||||||
$: tourNodes = { ...$store.tourNodes }
|
$: tourNodes = { ...$builderStore.tourNodes }
|
||||||
$: tourKey = $store.tourKey
|
$: tourKey = $builderStore.tourKey
|
||||||
$: tourStepKey = $store.tourStepKey
|
$: tourStepKey = $builderStore.tourStepKey
|
||||||
$: tour = TOURS[tourKey]
|
$: tour = TOURS[tourKey]
|
||||||
$: tourOnSkip = tour?.onSkip
|
$: tourOnSkip = tour?.onSkip
|
||||||
|
|
||||||
|
@ -47,12 +47,11 @@
|
||||||
if (step.route) {
|
if (step.route) {
|
||||||
const activeNav = $layout.children.find(c => $isActive(c.path))
|
const activeNav = $layout.children.find(c => $isActive(c.path))
|
||||||
if (activeNav) {
|
if (activeNav) {
|
||||||
store.update(state => {
|
builderStore.setPreviousTopNavPath(
|
||||||
if (!state.previousTopNavPath) state.previousTopNavPath = {}
|
activeNav.path,
|
||||||
state.previousTopNavPath[activeNav.path] = window.location.pathname
|
window.location.pathname
|
||||||
$goto(state.previousTopNavPath[step.route] || step.route)
|
)
|
||||||
return state
|
$goto($builderStore.previousTopNavPath[step.route] || step.route)
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,7 +60,7 @@
|
||||||
if (!lastStep === true) {
|
if (!lastStep === true) {
|
||||||
let target = tourSteps[tourStepIdx + 1]
|
let target = tourSteps[tourStepIdx + 1]
|
||||||
if (target) {
|
if (target) {
|
||||||
store.update(state => ({
|
builderStore.update(state => ({
|
||||||
...state,
|
...state,
|
||||||
tourStepKey: target.id,
|
tourStepKey: target.id,
|
||||||
}))
|
}))
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
import { tourHandler } from "./tourHandler"
|
import { tourHandler } from "./tourHandler"
|
||||||
import { TOURS } from "./tours"
|
import { TOURS } from "./tours"
|
||||||
import { onMount, onDestroy } from "svelte"
|
import { onMount, onDestroy } from "svelte"
|
||||||
import { store } from "builderStore"
|
import { builderStore } from "stores/frontend"
|
||||||
|
|
||||||
export let tourStepKey
|
export let tourStepKey
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$: tourKeyWatch = $store.tourKey
|
$: tourKeyWatch = $builderStore.tourKey
|
||||||
$: registerTourNode(tourKeyWatch, tourStepKey, ready)
|
$: registerTourNode(tourKeyWatch, tourStepKey, ready)
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { store } from "builderStore/index"
|
import { builderStore } from "stores/frontend"
|
||||||
import { get } from "svelte/store"
|
import { get } from "svelte/store"
|
||||||
|
|
||||||
const registerNode = async (node, tourStepKey) => {
|
const registerNode = async (node, tourStepKey) => {
|
||||||
|
@ -6,12 +6,12 @@ const registerNode = async (node, tourStepKey) => {
|
||||||
console.log("Tour Handler - an anchor node is required")
|
console.log("Tour Handler - an anchor node is required")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!get(store).tourKey) {
|
if (!get(builderStore).tourKey) {
|
||||||
console.log("Tour Handler - No active tour ", tourStepKey, node)
|
console.log("Tour Handler - No active tour ", tourStepKey, node)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
store.update(state => {
|
builderStore.update(state => {
|
||||||
const update = {
|
const update = {
|
||||||
...state,
|
...state,
|
||||||
tourNodes: {
|
tourNodes: {
|
||||||
|
@ -29,10 +29,10 @@ export function tourHandler(node, tourStepKey) {
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
destroy: () => {
|
destroy: () => {
|
||||||
const updatedTourNodes = get(store).tourNodes
|
const updatedTourNodes = get(builderStore).tourNodes
|
||||||
if (updatedTourNodes && updatedTourNodes[tourStepKey]) {
|
if (updatedTourNodes && updatedTourNodes[tourStepKey]) {
|
||||||
delete updatedTourNodes[tourStepKey]
|
delete updatedTourNodes[tourStepKey]
|
||||||
store.update(state => {
|
builderStore.update(state => {
|
||||||
const update = {
|
const update = {
|
||||||
...state,
|
...state,
|
||||||
tourNodes: {
|
tourNodes: {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { get } from "svelte/store"
|
import { get } from "svelte/store"
|
||||||
import { store } from "builderStore"
|
import { builderStore } from "stores/frontend"
|
||||||
import { auth } from "stores/portal"
|
import { auth } from "stores/portal"
|
||||||
import analytics from "analytics"
|
import analytics from "analytics"
|
||||||
import { OnboardingData, OnboardingDesign, OnboardingPublish } from "./steps"
|
import { OnboardingData, OnboardingDesign, OnboardingPublish } from "./steps"
|
||||||
|
@ -37,11 +37,11 @@ const endUserOnboarding = async ({ skipped = false } = {}) => {
|
||||||
// Update the cached user
|
// Update the cached user
|
||||||
await auth.getSelf()
|
await auth.getSelf()
|
||||||
|
|
||||||
store.update(state => ({
|
builderStore.update(state => ({
|
||||||
...state,
|
...state,
|
||||||
tourNodes: undefined,
|
tourNodes: null,
|
||||||
tourKey: undefined,
|
tourKey: null,
|
||||||
tourKeyStep: undefined,
|
tourStepKey: null,
|
||||||
onboarding: false,
|
onboarding: false,
|
||||||
}))
|
}))
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<script>
|
<script>
|
||||||
import { ModalContent } from "@budibase/bbui"
|
import { ModalContent } from "@budibase/bbui"
|
||||||
import { Select } from "@budibase/bbui"
|
import { Select } from "@budibase/bbui"
|
||||||
import { themeStore } from "builderStore"
|
import { themeStore } from "stores/portal"
|
||||||
import { Constants } from "@budibase/frontend-core"
|
import { Constants } from "@budibase/frontend-core"
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
ModalContent,
|
ModalContent,
|
||||||
Dropzone,
|
Dropzone,
|
||||||
} from "@budibase/bbui"
|
} from "@budibase/bbui"
|
||||||
import { store, automationStore } from "builderStore"
|
import { initialise as initialiseFrontend } from "stores/frontend"
|
||||||
|
import { initialise as initialiseBackend } from "stores/backend"
|
||||||
import { API } from "api"
|
import { API } from "api"
|
||||||
import { apps, admin, auth } from "stores/portal"
|
import { apps, admin, auth } from "stores/portal"
|
||||||
import { onMount } from "svelte"
|
import { onMount } from "svelte"
|
||||||
|
@ -132,8 +133,10 @@
|
||||||
|
|
||||||
// Select Correct Application/DB in prep for creating user
|
// Select Correct Application/DB in prep for creating user
|
||||||
const pkg = await API.fetchAppPackage(createdApp.instance._id)
|
const pkg = await API.fetchAppPackage(createdApp.instance._id)
|
||||||
await store.actions.initialise(pkg)
|
|
||||||
await automationStore.actions.fetch()
|
await initialiseFrontend(pkg)
|
||||||
|
await initialiseBackend(pkg)
|
||||||
|
|
||||||
// Update checklist - in case first app
|
// Update checklist - in case first app
|
||||||
await admin.init()
|
await admin.init()
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
Body,
|
Body,
|
||||||
} from "@budibase/bbui"
|
} from "@budibase/bbui"
|
||||||
import { API } from "api"
|
import { API } from "api"
|
||||||
import { automationStore, store } from "../../builderStore"
|
import { initialise } from "stores/frontend"
|
||||||
|
|
||||||
export let app
|
export let app
|
||||||
|
|
||||||
|
@ -28,8 +28,8 @@
|
||||||
const appId = app.devId
|
const appId = app.devId
|
||||||
await API.updateAppFromExport(appId, data)
|
await API.updateAppFromExport(appId, data)
|
||||||
const pkg = await API.fetchAppPackage(appId)
|
const pkg = await API.fetchAppPackage(appId)
|
||||||
await store.actions.initialise(pkg)
|
await initialise(pkg)
|
||||||
await automationStore.actions.fetch()
|
|
||||||
notifications.success("App updated successfully")
|
notifications.success("App updated successfully")
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
notifications.error(`Failed to update app - ${err.message || err}`)
|
notifications.error(`Failed to update app - ${err.message || err}`)
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { findClosestMatchingComponent } from "builderStore/componentUtils"
|
import { findClosestMatchingComponent } from "stores/frontend/components/utils"
|
||||||
import {
|
import {
|
||||||
getDatasourceForProvider,
|
getDatasourceForProvider,
|
||||||
getSchemaForDatasource,
|
getSchemaForDatasource,
|
||||||
} from "builderStore/dataBinding"
|
} from "builder/dataBinding"
|
||||||
|
|
||||||
export const getComponentFieldOptions = (asset, id, type, loose = true) => {
|
export const getComponentFieldOptions = (asset, id, type, loose = true) => {
|
||||||
const form = findClosestMatchingComponent(
|
const form = findClosestMatchingComponent(
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
Button,
|
Button,
|
||||||
FancySelect,
|
FancySelect,
|
||||||
} from "@budibase/bbui"
|
} from "@budibase/bbui"
|
||||||
import { store } from "builderStore"
|
import { builderStore, appStore } from "stores/frontend"
|
||||||
import { groups, licensing, apps, users, auth, admin } from "stores/portal"
|
import { groups, licensing, apps, users, auth, admin } from "stores/portal"
|
||||||
import {
|
import {
|
||||||
fetchData,
|
fetchData,
|
||||||
|
@ -55,7 +55,7 @@
|
||||||
|
|
||||||
let inviteFailureResponse = ""
|
let inviteFailureResponse = ""
|
||||||
$: validEmail = emailValidator(email) === true
|
$: validEmail = emailValidator(email) === true
|
||||||
$: prodAppId = apps.getProdAppID($store.appId)
|
$: prodAppId = apps.getProdAppID($appStore.appId)
|
||||||
$: promptInvite = showInvite(
|
$: promptInvite = showInvite(
|
||||||
filteredInvites,
|
filteredInvites,
|
||||||
filteredUsers,
|
filteredUsers,
|
||||||
|
@ -182,7 +182,7 @@
|
||||||
const debouncedUpdateFetch = Utils.debounce(searchUsers, 250)
|
const debouncedUpdateFetch = Utils.debounce(searchUsers, 250)
|
||||||
$: debouncedUpdateFetch(
|
$: debouncedUpdateFetch(
|
||||||
query,
|
query,
|
||||||
$store.builderSidePanel,
|
$builderStore.builderSidePanel,
|
||||||
loaded,
|
loaded,
|
||||||
filterByAppAccess
|
filterByAppAccess
|
||||||
)
|
)
|
||||||
|
@ -200,7 +200,7 @@
|
||||||
[prodAppId]: role,
|
[prodAppId]: role,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
await searchUsers(query, $store.builderSidePanel, loaded)
|
await searchUsers(query, $builderStore.builderSidePanel, loaded)
|
||||||
}
|
}
|
||||||
|
|
||||||
const onUpdateUser = async (user, role) => {
|
const onUpdateUser = async (user, role) => {
|
||||||
|
@ -486,7 +486,7 @@
|
||||||
loaded = true
|
loaded = true
|
||||||
}
|
}
|
||||||
|
|
||||||
$: initSidePanel($store.builderSidePanel)
|
$: initSidePanel($builderStore.builderSidePanel)
|
||||||
|
|
||||||
function handleKeyDown(evt) {
|
function handleKeyDown(evt) {
|
||||||
if (evt.key === "Enter" && validEmail && !inviting) {
|
if (evt.key === "Enter" && validEmail && !inviting) {
|
||||||
|
@ -523,12 +523,7 @@
|
||||||
<div
|
<div
|
||||||
transition:fly={{ x: 400, duration: 260 }}
|
transition:fly={{ x: 400, duration: 260 }}
|
||||||
id="builder-side-panel-container"
|
id="builder-side-panel-container"
|
||||||
use:clickOutside={() => {
|
use:clickOutside={builderStore.hideBuilderSidePanel}
|
||||||
store.update(state => {
|
|
||||||
state.builderSidePanel = false
|
|
||||||
return state
|
|
||||||
})
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<div class="builder-side-panel-header">
|
<div class="builder-side-panel-header">
|
||||||
<div
|
<div
|
||||||
|
@ -551,10 +546,7 @@
|
||||||
name="RailRightClose"
|
name="RailRightClose"
|
||||||
hoverable
|
hoverable
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
store.update(state => {
|
builderStore.hideBuilderSidePanel()
|
||||||
state.builderSidePanel = false
|
|
||||||
return state
|
|
||||||
})
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue