Skip to content

Commit

Permalink
Merge branch 'master' into BUDI-8885/only-select-required-columns-fro…
Browse files Browse the repository at this point in the history
…m-sql-databases
  • Loading branch information
mike12345567 authored Dec 20, 2024
2 parents 8905f9d + 45f2ec3 commit 3168b42
Show file tree
Hide file tree
Showing 32 changed files with 305 additions and 246 deletions.
2 changes: 1 addition & 1 deletion examples/nextjs-api-sales/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"dependencies": {
"bulma": "^0.9.3",
"next": "14.2.10",
"next": "14.2.15",
"node-fetch": "^3.2.10",
"sass": "^1.52.3",
"react": "17.0.2",
Expand Down
124 changes: 62 additions & 62 deletions examples/nextjs-api-sales/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@
resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45"
integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==

"@next/[email protected].10":
version "14.2.10"
resolved "https://registry.yarnpkg.com/@next/env/-/env-14.2.10.tgz#1d3178340028ced2d679f84140877db4f420333c"
integrity sha512-dZIu93Bf5LUtluBXIv4woQw2cZVZ2DJTjax5/5DOs3lzEOeKLy7GxRSr4caK9/SCPdaW6bCgpye6+n4Dh9oJPw==
"@next/[email protected].15":
version "14.2.15"
resolved "https://registry.yarnpkg.com/@next/env/-/env-14.2.15.tgz#06d984e37e670d93ddd6790af1844aeb935f332f"
integrity sha512-S1qaj25Wru2dUpcIZMjxeMVSwkt8BK4dmWHHiBuRstcIyOsMapqT4A4jSB6onvqeygkSSmOkyny9VVx8JIGamQ==

"@next/[email protected]":
version "12.1.0"
Expand All @@ -58,50 +58,50 @@
dependencies:
glob "7.1.7"

"@next/[email protected].10":
version "14.2.10"
resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.10.tgz#49d10ca4086fbd59ee68e204f75d7136eda2aa80"
integrity sha512-V3z10NV+cvMAfxQUMhKgfQnPbjw+Ew3cnr64b0lr8MDiBJs3eLnM6RpGC46nhfMZsiXgQngCJKWGTC/yDcgrDQ==

"@next/[email protected].10":
version "14.2.10"
resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.10.tgz#0ebeae3afb8eac433882b79543295ab83624a1a8"
integrity sha512-Y0TC+FXbFUQ2MQgimJ/7Ina2mXIKhE7F+GUe1SgnzRmwFY3hX2z8nyVCxE82I2RicspdkZnSWMn4oTjIKz4uzA==

"@next/[email protected].10":
version "14.2.10"
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.10.tgz#7e602916d2fb55a3c532f74bed926a0137c16f20"
integrity sha512-ZfQ7yOy5zyskSj9rFpa0Yd7gkrBnJTkYVSya95hX3zeBG9E55Z6OTNPn1j2BTFWvOVVj65C3T+qsjOyVI9DQpA==

"@next/[email protected].10":
version "14.2.10"
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.10.tgz#6b143f628ccee490b527562e934f8de578d4be47"
integrity sha512-n2i5o3y2jpBfXFRxDREr342BGIQCJbdAUi/K4q6Env3aSx8erM9VuKXHw5KNROK9ejFSPf0LhoSkU/ZiNdacpQ==

"@next/[email protected].10":
version "14.2.10"
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.10.tgz#086f2f16a0678890a1eb46518c4dda381b046082"
integrity sha512-GXvajAWh2woTT0GKEDlkVhFNxhJS/XdDmrVHrPOA83pLzlGPQnixqxD8u3bBB9oATBKB//5e4vpACnx5Vaxdqg==

"@next/[email protected].10":
version "14.2.10"
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.10.tgz#1befef10ed8dbcc5047b5d637a25ae3c30a0bfc3"
integrity sha512-opFFN5B0SnO+HTz4Wq4HaylXGFV+iHrVxd3YvREUX9K+xfc4ePbRrxqOuPOFjtSuiVouwe6uLeDtabjEIbkmDA==

"@next/[email protected].10":
version "14.2.10"
resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.10.tgz#731f52c3ae3c56a26cf21d474b11ae1529531209"
integrity sha512-9NUzZuR8WiXTvv+EiU/MXdcQ1XUvFixbLIMNQiVHuzs7ZIFrJDLJDaOF1KaqttoTujpcxljM/RNAOmw1GhPPQQ==

"@next/[email protected].10":
version "14.2.10"
resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.10.tgz#32723ef7f04e25be12af357cc72ddfdd42fd1041"
integrity sha512-fr3aEbSd1GeW3YUMBkWAu4hcdjZ6g4NBl1uku4gAn661tcxd1bHs1THWYzdsbTRLcCKLjrDZlNp6j2HTfrw+Bg==

"@next/[email protected].10":
version "14.2.10"
resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.10.tgz#ee1d036cb5ec871816f96baee7991035bb242455"
integrity sha512-UjeVoRGKNL2zfbcQ6fscmgjBAS/inHBh63mjIlfPg/NG8Yn2ztqylXt5qilYb6hoHIwaU2ogHknHWWmahJjgZQ==
"@next/[email protected].15":
version "14.2.15"
resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.15.tgz#6386d585f39a1c490c60b72b1f76612ba4434347"
integrity sha512-Rvh7KU9hOUBnZ9TJ28n2Oa7dD9cvDBKua9IKx7cfQQ0GoYUwg9ig31O2oMwH3wm+pE3IkAQ67ZobPfEgurPZIA==

"@next/[email protected].15":
version "14.2.15"
resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.15.tgz#b7baeedc6a28f7545ad2bc55adbab25f7b45cb89"
integrity sha512-5TGyjFcf8ampZP3e+FyCax5zFVHi+Oe7sZyaKOngsqyaNEpOgkKB3sqmymkZfowy3ufGA/tUgDPPxpQx931lHg==

"@next/[email protected].15":
version "14.2.15"
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.15.tgz#fa13c59d3222f70fb4cb3544ac750db2c6e34d02"
integrity sha512-3Bwv4oc08ONiQ3FiOLKT72Q+ndEMyLNsc/D3qnLMbtUYTQAmkx9E/JRu0DBpHxNddBmNT5hxz1mYBphJ3mfrrw==

"@next/[email protected].15":
version "14.2.15"
resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.15.tgz#30e45b71831d9a6d6d18d7ac7d611a8d646a17f9"
integrity sha512-k5xf/tg1FBv/M4CMd8S+JL3uV9BnnRmoe7F+GWC3DxkTCD9aewFRH1s5rJ1zkzDa+Do4zyN8qD0N8c84Hu96FQ==

"@next/[email protected].15":
version "14.2.15"
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.15.tgz#5065db17fc86f935ad117483f21f812dc1b39254"
integrity sha512-kE6q38hbrRbKEkkVn62reLXhThLRh6/TvgSP56GkFNhU22TbIrQDEMrO7j0IcQHcew2wfykq8lZyHFabz0oBrA==

"@next/[email protected].15":
version "14.2.15"
resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.15.tgz#3c4a4568d8be7373a820f7576cf33388b5dab47e"
integrity sha512-PZ5YE9ouy/IdO7QVJeIcyLn/Rc4ml9M2G4y3kCM9MNf1YKvFY4heg3pVa/jQbMro+tP6yc4G2o9LjAz1zxD7tQ==

"@next/[email protected].15":
version "14.2.15"
resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.15.tgz#fb812cc4ca0042868e32a6a021da91943bb08b98"
integrity sha512-2raR16703kBvYEQD9HNLyb0/394yfqzmIeyp2nDzcPV4yPjqNUG3ohX6jX00WryXz6s1FXpVhsCo3i+g4RUX+g==

"@next/[email protected].15":
version "14.2.15"
resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.15.tgz#ec26e6169354f8ced240c1427be7fd485c5df898"
integrity sha512-fyTE8cklgkyR1p03kJa5zXEaZ9El+kDNM5A+66+8evQS5e/6v0Gk28LqA0Jet8gKSOyP+OTm/tJHzMlGdQerdQ==

"@next/[email protected].15":
version "14.2.15"
resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.15.tgz#18d68697002b282006771f8d92d79ade9efd35c4"
integrity sha512-SzqGbsLsP9OwKNUG9nekShTwhj6JSB9ZLMWQ8g1gG6hdE5gQLncbnbymrwy2yVmH9nikSLYRYxYMFu78Ggp7/g==

"@nodelib/[email protected]":
version "2.1.5"
Expand Down Expand Up @@ -1253,28 +1253,28 @@ natural-compare@^1.4.0:
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=

[email protected].10:
version "14.2.10"
resolved "https://registry.yarnpkg.com/next/-/next-14.2.10.tgz#331981a4fecb1ae8af1817d4db98fc9687ee1cb6"
integrity sha512-sDDExXnh33cY3RkS9JuFEKaS4HmlWmDKP1VJioucCG6z5KuA008DPsDZOzi8UfqEk3Ii+2NCQSJrfbEWtZZfww==
[email protected].15:
version "14.2.15"
resolved "https://registry.yarnpkg.com/next/-/next-14.2.15.tgz#348e5603e22649775d19c785c09a89c9acb5189a"
integrity sha512-h9ctmOokpoDphRvMGnwOJAedT6zKhwqyZML9mDtspgf4Rh3Pn7UTYKqePNoDvhsWBAO5GoPNYshnAUGIazVGmw==
dependencies:
"@next/env" "14.2.10"
"@next/env" "14.2.15"
"@swc/helpers" "0.5.5"
busboy "1.6.0"
caniuse-lite "^1.0.30001579"
graceful-fs "^4.2.11"
postcss "8.4.31"
styled-jsx "5.1.1"
optionalDependencies:
"@next/swc-darwin-arm64" "14.2.10"
"@next/swc-darwin-x64" "14.2.10"
"@next/swc-linux-arm64-gnu" "14.2.10"
"@next/swc-linux-arm64-musl" "14.2.10"
"@next/swc-linux-x64-gnu" "14.2.10"
"@next/swc-linux-x64-musl" "14.2.10"
"@next/swc-win32-arm64-msvc" "14.2.10"
"@next/swc-win32-ia32-msvc" "14.2.10"
"@next/swc-win32-x64-msvc" "14.2.10"
"@next/swc-darwin-arm64" "14.2.15"
"@next/swc-darwin-x64" "14.2.15"
"@next/swc-linux-arm64-gnu" "14.2.15"
"@next/swc-linux-arm64-musl" "14.2.15"
"@next/swc-linux-x64-gnu" "14.2.15"
"@next/swc-linux-x64-musl" "14.2.15"
"@next/swc-win32-arm64-msvc" "14.2.15"
"@next/swc-win32-ia32-msvc" "14.2.15"
"@next/swc-win32-x64-msvc" "14.2.15"

node-domexception@^1.0.0:
version "1.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
...datasource,
name,
}
await datasources.update({
await datasources.save({
datasource: updatedDatasource,
integration: integrationForDatasource(get(integrations), datasource),
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
export let name
export let config
export let showModal = () => {}
export let placeholder
const selectComponent = type => {
if (type === "object") {
Expand Down Expand Up @@ -40,6 +41,7 @@
{name}
{config}
{showModal}
{placeholder}
on:blur
on:change
/>
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
export let name
export let value
export let error
export let placeholder
</script>

<div class="form-row">
<Label>{name}</Label>
<TextArea on:blur on:change {type} {value} {error} />
<TextArea on:blur on:change {type} {value} {error} {placeholder} />
</div>

<style>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
export let value
export let error
export let config
export let placeholder
</script>

<div class="form-row">
Expand All @@ -17,6 +18,7 @@
{type}
value={value || undefined}
{error}
{placeholder}
/>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
export let name
export let value
export let error
export let placeholder
export let showModal = () => {}
async function handleUpgradePanel() {
Expand All @@ -22,6 +23,7 @@
type={type === "port" ? "string" : type}
{value}
{error}
{placeholder}
variables={$environment.variables}
environmentVariablesEnabled={$licensing.environmentVariablesEnabled}
{showModal}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,15 @@
/>
{/if}

{#each $configStore.validatedConfig as { type, key, value, error, name, hidden, config }}
{#each $configStore.validatedConfig as { type, key, value, error, name, hidden, config, placeholder }}
{#if hidden === undefined || !eval(processStringSync(hidden, $configStore.config))}
<ConfigInput
{type}
{value}
{error}
{name}
{config}
{placeholder}
showModal={() =>
showModal(newValue => configStore.updateFieldValue(key, newValue))}
on:blur={() => configStore.markFieldActive(key)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ export const createValidatedConfigStore = (integration, config) => {
value: getValue(),
error: $errorsStore[key],
name: capitalise(properties.display || key),
placeholder: properties.placeholder,
type: properties.type,
hidden: properties.hidden,
config: properties.config,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
get(integrations),
datasource
)
await datasources.update({ datasource, integration })
await datasources.save({ datasource, integration })
await afterSave({ datasource, action })
} catch (err) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
notifications.success(`Request saved successfully`)
if (dynamicVariables) {
datasource.config.dynamicVariables = rebuildVariables(saveId)
datasource = await datasources.update({
datasource = await datasources.save({
integration: integrationInfo,
datasource,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,20 +368,22 @@
const payload = [
{
email: newUserEmail,
builder: {
global: creationRoleType === Constants.BudibaseRoles.Admin,
creator: creationRoleType === Constants.BudibaseRoles.Creator,
userInfo: {
builder: {
global: creationRoleType === Constants.BudibaseRoles.Admin,
creator: creationRoleType === Constants.BudibaseRoles.Creator,
},
admin: { global: creationRoleType === Constants.BudibaseRoles.Admin },
},
admin: { global: creationRoleType === Constants.BudibaseRoles.Admin },
},
]
const notCreatingAdmin = creationRoleType !== Constants.BudibaseRoles.Admin
const isCreator = creationAccessType === Constants.Roles.CREATOR
if (notCreatingAdmin && isCreator) {
payload[0].builder.apps = [prodAppId]
payload[0].userInfo.builder.apps = [prodAppId]
} else if (notCreatingAdmin && !isCreator) {
payload[0].apps = { [prodAppId]: creationAccessType }
payload[0].userInfo.apps = { [prodAppId]: creationAccessType }
}
let userInviteResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
async function saveDatasource({ config, name }) {
try {
await datasources.update({
await datasources.save({
integration,
datasource: { ...datasource, config, name },
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
get(integrations),
updatedDatasource
)
await datasources.update({ datasource: updatedDatasource, integration })
await datasources.save({ datasource: updatedDatasource, integration })
notifications.success(
`Datasource ${updatedDatasource.name} updated successfully`
)
Expand Down
41 changes: 19 additions & 22 deletions packages/builder/src/stores/BudiStore.ts
Original file line number Diff line number Diff line change
@@ -1,44 +1,41 @@
import { writable, Writable } from "svelte/store"
import { writable, Writable, Readable } from "svelte/store"

interface BudiStoreOpts {
debug?: boolean
}

export default class BudiStore<T> implements Writable<T> {
export class BudiStore<T> {
store: Writable<T>
subscribe: Writable<T>["subscribe"]
update: Writable<T>["update"]
set: Writable<T>["set"]

constructor(init: T, opts?: BudiStoreOpts) {
const store = writable<T>(init)

/**
* Internal Svelte store
*/
this.store = store

/**
* Exposes the svelte subscribe fn to allow $ notation access
* @example
* $navigation.selectedScreenId
*/
this.store = writable<T>(init)
this.subscribe = this.store.subscribe

/**
* Exposes the svelte update fn.
* *Store modification should be kept to a minimum
*/
this.update = this.store.update
this.set = this.store.set

/**
* Optional debug mode to output the store updates to console
*/
// Optional debug mode to output the store updates to console
if (opts?.debug) {
this.subscribe(state => {
console.warn(`${this.constructor.name}`, state)
})
}
}
}

export class DerivedBudiStore<T, DerivedT extends T> extends BudiStore<T> {
derivedStore: Readable<DerivedT>
subscribe: Readable<DerivedT>["subscribe"]

constructor(
init: T,
makeDerivedStore: (store: Writable<T>) => Readable<DerivedT>,
opts?: BudiStoreOpts
) {
super(init, opts)
this.derivedStore = makeDerivedStore(this.store)
this.subscribe = this.derivedStore.subscribe
}
}
2 changes: 1 addition & 1 deletion packages/builder/src/stores/builder/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { API } from "api"
import BudiStore from "../BudiStore"
import { BudiStore } from "../BudiStore"

export const INITIAL_APP_META_STATE = {
appId: "",
Expand Down
Loading

0 comments on commit 3168b42

Please sign in to comment.