diff --git a/.github/workflows/deploy-featurebranch.yml b/.github/workflows/deploy-featurebranch.yml index eccc783dfb..d86d301507 100644 --- a/.github/workflows/deploy-featurebranch.yml +++ b/.github/workflows/deploy-featurebranch.yml @@ -22,6 +22,7 @@ jobs: env: PAYLOAD_BRANCH: ${{ github.head_ref }} PAYLOAD_PR_NUMBER: ${{ github.event.pull_request.number }} + PAYLOAD_LICENSE_TYPE: "free" with: repository: budibase/budibase-deploys event: featurebranch-qa-deploy diff --git a/lerna.json b/lerna.json index 754041d6ef..3396c082bf 100644 --- a/lerna.json +++ b/lerna.json @@ -1,6 +1,6 @@ { "$schema": "node_modules/lerna/schemas/lerna-schema.json", - "version": "2.31.3", + "version": "2.31.4", "npmClient": "yarn", "packages": [ "packages/*", diff --git a/packages/backend-core/src/features/index.ts b/packages/backend-core/src/features/index.ts index 1ee644bc6f..49f8044e8f 100644 --- a/packages/backend-core/src/features/index.ts +++ b/packages/backend-core/src/features/index.ts @@ -266,7 +266,7 @@ export class FlagSet, T extends { [key: string]: V }> { // All of the machinery in this file is to make sure that flags have their // default values set correctly and their types flow through the system. export const flags = new FlagSet({ - DEFAULT_VALUES: Flag.boolean(false), + DEFAULT_VALUES: Flag.boolean(env.isDev()), SQS: Flag.boolean(env.isDev()), [FeatureFlag.ENRICHED_RELATIONSHIPS]: Flag.boolean(false), }) diff --git a/packages/builder/src/dataBinding.js b/packages/builder/src/dataBinding.js index a7e98e1c3f..3eefb373ca 100644 --- a/packages/builder/src/dataBinding.js +++ b/packages/builder/src/dataBinding.js @@ -57,6 +57,7 @@ export const getBindableProperties = (asset, componentId) => { const stateBindings = getStateBindings() const selectedRowsBindings = getSelectedRowsBindings(asset) const roleBindings = getRoleBindings() + const embedBindings = getEmbedBindings() return [ ...contextBindings, ...urlBindings, @@ -65,6 +66,7 @@ export const getBindableProperties = (asset, componentId) => { ...deviceBindings, ...selectedRowsBindings, ...roleBindings, + ...embedBindings, ] } @@ -813,6 +815,25 @@ export const getActionBindings = (actions, actionId) => { return bindings } +/** + * Gets all device bindings for embeds. + */ +const getEmbedBindings = () => { + let bindings = [] + const safeEmbed = makePropSafe("embed") + + bindings = [ + { + type: "context", + runtimeBinding: `${safeEmbed}`, + readableBinding: `ParentWindow`, + category: "Embed", + icon: "DistributeVertically", + }, + ] + return bindings +} + /** * Gets the schema for a certain datasource plus. * The options which can be passed in are: diff --git a/packages/builder/src/helpers/utils.js b/packages/builder/src/helpers/utils.js index a1f9b34e3d..f3d48331e7 100644 --- a/packages/builder/src/helpers/utils.js +++ b/packages/builder/src/helpers/utils.js @@ -7,10 +7,22 @@ import { FIELDS, isAutoColumnUserRelationship, } from "constants/backend" +import { isEnabled } from "helpers/featureFlags" export function getAutoColumnInformation(enabled = true) { let info = {} - for (let [key, subtype] of Object.entries(AUTO_COLUMN_SUB_TYPES)) { + for (const [key, subtype] of Object.entries(AUTO_COLUMN_SUB_TYPES)) { + // Because it's possible to replicate the functionality of CREATED_AT and + // CREATED_BY columns, we disable their creation when the DEFAULT_VALUES + // feature flag is enabled. + if (isEnabled("DEFAULT_VALUES")) { + if ( + subtype === AUTO_COLUMN_SUB_TYPES.CREATED_AT || + subtype === AUTO_COLUMN_SUB_TYPES.CREATED_BY + ) { + continue + } + } info[subtype] = { enabled, name: AUTO_COLUMN_DISPLAY_NAMES[key] } } return info diff --git a/packages/builder/src/pages/builder/app/[application]/_components/PreviewOverlay.svelte b/packages/builder/src/pages/builder/app/[application]/_components/PreviewOverlay.svelte index 6d3441400f..d77744a809 100644 --- a/packages/builder/src/pages/builder/app/[application]/_components/PreviewOverlay.svelte +++ b/packages/builder/src/pages/builder/app/[application]/_components/PreviewOverlay.svelte @@ -49,7 +49,7 @@ right: 0; left: 0; bottom: 0; - z-index: 999; + z-index: 9000; position: absolute; background: rgba(255, 255, 255, 0.1); display: flex; diff --git a/packages/client/src/components/ClientApp.svelte b/packages/client/src/components/ClientApp.svelte index 2f8ba36cf7..f1e4f10403 100644 --- a/packages/client/src/components/ClientApp.svelte +++ b/packages/client/src/components/ClientApp.svelte @@ -42,6 +42,7 @@ import FreeFooter from "components/FreeFooter.svelte" import MaintenanceScreen from "components/MaintenanceScreen.svelte" import SnippetsProvider from "./context/SnippetsProvider.svelte" + import EmbedProvider from "./context/EmbedProvider.svelte" // Provide contexts setContext("sdk", SDK) @@ -160,116 +161,119 @@ {#if $environmentStore.maintenance.length > 0} {:else} - - - - - - - - - {#key $builderStore.selectedComponentId} - {#if $builderStore.inBuilder} - - {/if} - {/key} - - -
- -
- {#if showDevTools} - + + + + + + + + + + {#key $builderStore.selectedComponentId} + {#if $builderStore.inBuilder} + {/if} + {/key} -
- {#if permissionError} -
- - - {@html ErrorSVG} - - You don't have permission to use this app - - - Ask your administrator to grant you access - - -
- {:else if !$screenStore.activeLayout} -
- - - {@html ErrorSVG} - - Something went wrong rendering your app - - - Get in touch with support if this issue persists - - -
- {:else if embedNoScreens} -
- - - {@html ErrorSVG} - - This Budibase app is not publicly accessible - - -
- {:else} - - {#key $screenStore.activeLayout._id} - - {/key} - - - - - - + +
+ +
+ {#if showDevTools} + {/if} - {#if showDevTools} - +
+ {#if permissionError} +
+ + + {@html ErrorSVG} + + You don't have permission to use this app + + + Ask your administrator to grant you access + + +
+ {:else if !$screenStore.activeLayout} +
+ + + {@html ErrorSVG} + + Something went wrong rendering your app + + + Get in touch with support if this issue + persists + + +
+ {:else if embedNoScreens} +
+ + + {@html ErrorSVG} + + This Budibase app is not publicly accessible + + +
+ {:else} + + {#key $screenStore.activeLayout._id} + + {/key} + + + + + + + {/if} + + {#if showDevTools} + + {/if} +
+ + {#if !$builderStore.inBuilder && $featuresStore.logoEnabled} + {/if}
- {#if !$builderStore.inBuilder && $featuresStore.logoEnabled} - + + {#if $appStore.isDevApp} + + {/if} + {#if $builderStore.inBuilder || $devToolsStore.allowSelection} + + {/if} + {#if $builderStore.inBuilder} + + {/if}
- - - {#if $appStore.isDevApp} - - {/if} - {#if $builderStore.inBuilder || $devToolsStore.allowSelection} - - {/if} - {#if $builderStore.inBuilder} - - - {/if} -
-
-
-
-
-
-
+ + + + + + +
{/if}
diff --git a/packages/client/src/components/context/EmbedProvider.svelte b/packages/client/src/components/context/EmbedProvider.svelte new file mode 100644 index 0000000000..5c402ec75d --- /dev/null +++ b/packages/client/src/components/context/EmbedProvider.svelte @@ -0,0 +1,43 @@ + + + + +