diff --git a/hosting/.env b/hosting/.env index c2b6d55eef..8a0756c0e3 100644 --- a/hosting/.env +++ b/hosting/.env @@ -28,3 +28,4 @@ BB_ADMIN_USER_PASSWORD= # A path that is watched for plugin bundles. Any bundles found are imported automatically/ PLUGINS_DIR= +ROLLING_LOG_MAX_SIZE= \ No newline at end of file diff --git a/hosting/single/nginx/nginx-default-site.conf b/hosting/single/nginx/nginx-default-site.conf index 3903c0647d..d2f8e229c6 100644 --- a/hosting/single/nginx/nginx-default-site.conf +++ b/hosting/single/nginx/nginx-default-site.conf @@ -22,6 +22,16 @@ server { proxy_pass http://127.0.0.1:4001; } + location /embed { + rewrite /embed/(.*) /app/$1 break; + proxy_pass http://127.0.0.1:4001; + proxy_redirect off; + proxy_set_header Host $host; + proxy_set_header x-budibase-embed "true"; + add_header x-budibase-embed "true"; + add_header Content-Security-Policy "frame-ancestors *"; + } + location = / { proxy_pass http://127.0.0.1:4001; } diff --git a/lerna.json b/lerna.json index 141b8203ca..b7a520c00e 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.8.3-alpha.1", + "version": "2.8.10-alpha.2", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/nx.json b/nx.json index fc0712eed4..3df61886c2 100644 --- a/nx.json +++ b/nx.json @@ -1,9 +1,13 @@ { "tasksRunnerOptions": { "default": { - "runner": "nx/tasks-runners/default", + "runner": "nx-cloud", "options": { - "cacheableOperations": ["build", "test"] + "cacheableOperations": [ + "build", + "test" + ], + "accessToken": "YWNiYzc5NTEtMzMzZC00NDhjLTgyNjktZTllMjI1MzM4OGQxfHJlYWQtd3JpdGU=" } } }, @@ -11,7 +15,9 @@ "dev:builder": { "dependsOn": [ { - "projects": ["@budibase/string-templates"], + "projects": [ + "@budibase/string-templates" + ], "target": "build" } ] diff --git a/package.json b/package.json index a4b830d40b..83719d7589 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "private": true, "devDependencies": { "@esbuild-plugins/tsconfig-paths": "^0.1.2", - "@nx/js": "16.2.1", + "@nx/js": "16.4.3", "@rollup/plugin-json": "^4.0.2", "@typescript-eslint/parser": "5.45.0", "esbuild": "^0.17.18", @@ -13,9 +13,11 @@ "husky": "^8.0.3", "js-yaml": "^4.1.0", "kill-port": "^1.6.1", - "lerna": "7.0.2", + "lerna": "7.1.1", "madge": "^6.0.0", "minimist": "^1.2.8", + "nx": "16.4.3", + "nx-cloud": "16.0.5", "prettier": "2.8.8", "prettier-plugin-svelte": "^2.3.0", "rimraf": "^3.0.2", @@ -44,15 +46,15 @@ "restore": "yarn run clean && yarn run bootstrap && yarn run build", "nuke": "yarn run nuke:packages && yarn run nuke:docker", "nuke:packages": "yarn run restore", - "nuke:docker": "lerna run --stream --parallel dev:stack:nuke", + "nuke:docker": "lerna run --stream dev:stack:nuke", "clean": "lerna clean", "kill-builder": "kill-port 3000", "kill-server": "kill-port 4001 4002", "kill-all": "yarn run kill-builder && yarn run kill-server", - "dev": "yarn run kill-all && lerna run --stream --parallel dev:builder --stream", - "dev:noserver": "yarn run kill-builder && lerna run --stream dev:stack:up && lerna run --stream --parallel dev:builder --ignore @budibase/backend-core --ignore @budibase/server --ignore @budibase/worker", - "dev:server": "yarn run kill-server && yarn build --projects=@budibase/client && lerna run --stream --parallel dev:builder --scope @budibase/worker --scope @budibase/server", - "dev:built": "yarn run kill-all && cd packages/server && yarn dev:stack:up && cd ../../ && lerna run --stream --parallel dev:built", + "dev": "yarn run kill-all && lerna run --stream dev:builder --stream", + "dev:noserver": "yarn run kill-builder && lerna run --stream dev:stack:up && lerna run --stream dev:builder --ignore @budibase/backend-core --ignore @budibase/server --ignore @budibase/worker", + "dev:server": "yarn run kill-server && yarn build --projects=@budibase/client && lerna run --stream dev:builder --scope @budibase/worker --scope @budibase/server", + "dev:built": "yarn run kill-all && cd packages/server && yarn dev:stack:up && cd ../../ && lerna run --stream dev:built", "dev:docker": "yarn build:docker:pre && docker-compose -f hosting/docker-compose.build.yaml -f hosting/docker-compose.dev.yaml --env-file hosting/.env up --build --scale proxy-service=0", "test": "lerna run --stream test --stream", "lint:eslint": "eslint packages qa-core --max-warnings=0", @@ -106,6 +108,5 @@ "@budibase/string-templates": "0.0.0", "@budibase/types": "0.0.0" }, - "dependencies": { - } + "dependencies": {} } diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 4a1ed5c373..7f3c064c92 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -51,6 +51,7 @@ "pouchdb": "7.3.0", "pouchdb-find": "7.2.2", "redlock": "4.2.0", + "rotating-file-stream": "3.1.0", "sanitize-s3-objectkey": "0.0.1", "semver": "7.3.7", "tar-fs": "2.1.1", diff --git a/packages/backend-core/src/db/lucene.ts b/packages/backend-core/src/db/lucene.ts index d501bb2166..a491451a62 100644 --- a/packages/backend-core/src/db/lucene.ts +++ b/packages/backend-core/src/db/lucene.ts @@ -433,6 +433,9 @@ export class QueryBuilder { if (!value) { return null } + if (typeof value === "boolean") { + return `(*:* AND !${key}:${value})` + } return `!${key}:${builder.preprocess(value, allPreProcessingOpts)}` }) } diff --git a/packages/backend-core/src/environment.ts b/packages/backend-core/src/environment.ts index eab8cd4c45..5076b7569b 100644 --- a/packages/backend-core/src/environment.ts +++ b/packages/backend-core/src/environment.ts @@ -47,7 +47,10 @@ function httpLogging() { return process.env.HTTP_LOGGING } -function findVersion() { +function getPackageJsonFields(): { + VERSION: string + SERVICE_NAME: string +} { function findFileInAncestors( fileName: string, currentDir: string @@ -69,10 +72,14 @@ function findVersion() { try { const packageJsonFile = findFileInAncestors("package.json", process.cwd()) const content = readFileSync(packageJsonFile!, "utf-8") - return JSON.parse(content).version + const parsedContent = JSON.parse(content) + return { + VERSION: parsedContent.version, + SERVICE_NAME: parsedContent.name, + } } catch { // throwing an error here is confusing/causes backend-core to be hard to import - return undefined + return { VERSION: "", SERVICE_NAME: "" } } } @@ -154,13 +161,14 @@ const environment = { ENABLE_SSO_MAINTENANCE_MODE: selfHosted ? process.env.ENABLE_SSO_MAINTENANCE_MODE : false, - VERSION: findVersion(), + ...getPackageJsonFields(), DISABLE_PINO_LOGGER: process.env.DISABLE_PINO_LOGGER, _set(key: any, value: any) { process.env[key] = value // @ts-ignore environment[key] = value }, + ROLLING_LOG_MAX_SIZE: process.env.ROLLING_LOG_MAX_SIZE || "10M", } // clean up any environment variable edge cases diff --git a/packages/backend-core/src/logging/index.ts b/packages/backend-core/src/logging/index.ts index b87062c478..f7e1c4fa41 100644 --- a/packages/backend-core/src/logging/index.ts +++ b/packages/backend-core/src/logging/index.ts @@ -1,6 +1,7 @@ export * as correlation from "./correlation/correlation" export { logger } from "./pino/logger" export * from "./alerts" +export * as system from "./system" // turn off or on context logging i.e. tenantId, appId etc export let LOG_CONTEXT = true diff --git a/packages/backend-core/src/logging/pino/logger.ts b/packages/backend-core/src/logging/pino/logger.ts index c96bc83e04..0b130068f3 100644 --- a/packages/backend-core/src/logging/pino/logger.ts +++ b/packages/backend-core/src/logging/pino/logger.ts @@ -1,10 +1,15 @@ -import env from "../../environment" import pino, { LoggerOptions } from "pino" +import pinoPretty from "pino-pretty" + +import { IdentityType } from "@budibase/types" + +import env from "../../environment" import * as context from "../../context" import * as correlation from "../correlation" -import { IdentityType } from "@budibase/types" import { LOG_CONTEXT } from "../index" +import { localFileDestination } from "../system" + // LOGGER let pinoInstance: pino.Logger | undefined @@ -16,22 +21,27 @@ if (!env.DISABLE_PINO_LOGGER) { return { level: label.toUpperCase() } }, bindings: () => { - return {} + return { + service: env.SERVICE_NAME, + } }, }, timestamp: () => `,"timestamp":"${new Date(Date.now()).toISOString()}"`, } + const destinations: pino.DestinationStream[] = [] + if (env.isDev()) { - pinoOptions.transport = { - target: "pino-pretty", - options: { - singleLine: true, - }, - } + destinations.push(pinoPretty({ singleLine: true })) } - pinoInstance = pino(pinoOptions) + if (env.SELF_HOSTED) { + destinations.push(localFileDestination()) + } + + pinoInstance = destinations.length + ? pino(pinoOptions, pino.multistream(destinations)) + : pino(pinoOptions) // CONSOLE OVERRIDES diff --git a/packages/backend-core/src/logging/system.ts b/packages/backend-core/src/logging/system.ts new file mode 100644 index 0000000000..d918c6efd6 --- /dev/null +++ b/packages/backend-core/src/logging/system.ts @@ -0,0 +1,81 @@ +import fs from "fs" +import path from "path" +import * as rfs from "rotating-file-stream" + +import env from "../environment" +import { budibaseTempDir } from "../objectStore" + +const logsFileName = `budibase.log` +const budibaseLogsHistoryFileName = "budibase-logs-history.txt" + +const logsPath = path.join(budibaseTempDir(), "systemlogs") + +function getFullPath(fileName: string) { + return path.join(logsPath, fileName) +} + +export function getSingleFileMaxSizeInfo(totalMaxSize: string) { + const regex = /(\d+)([A-Za-z])/ + const match = totalMaxSize?.match(regex) + if (!match) { + console.warn(`totalMaxSize does not have a valid value`, { + totalMaxSize, + }) + return undefined + } + + const size = +match[1] + const unit = match[2] + if (size === 1) { + switch (unit) { + case "B": + return { size: `${size}B`, totalHistoryFiles: 1 } + case "K": + return { size: `${(size * 1000) / 2}B`, totalHistoryFiles: 1 } + case "M": + return { size: `${(size * 1000) / 2}K`, totalHistoryFiles: 1 } + case "G": + return { size: `${(size * 1000) / 2}M`, totalHistoryFiles: 1 } + default: + return undefined + } + } + + if (size % 2 === 0) { + return { size: `${size / 2}${unit}`, totalHistoryFiles: 1 } + } + + return { size: `1${unit}`, totalHistoryFiles: size - 1 } +} + +export function localFileDestination() { + const fileInfo = getSingleFileMaxSizeInfo(env.ROLLING_LOG_MAX_SIZE) + const outFile = rfs.createStream(logsFileName, { + // As we have a rolling size, we want to half the max size + size: fileInfo?.size, + path: logsPath, + maxFiles: fileInfo?.totalHistoryFiles || 1, + immutable: true, + history: budibaseLogsHistoryFileName, + initialRotation: false, + }) + + return outFile +} + +export function getLogReadStream() { + const streams = [] + const historyFile = getFullPath(budibaseLogsHistoryFileName) + if (fs.existsSync(historyFile)) { + const fileContent = fs.readFileSync(historyFile, "utf-8") + const historyFiles = fileContent.split("\n") + for (const historyFile of historyFiles.filter(x => x)) { + streams.push(fs.readFileSync(historyFile)) + } + } + + streams.push(fs.readFileSync(getFullPath(logsFileName))) + + const combinedContent = Buffer.concat(streams) + return combinedContent +} diff --git a/packages/backend-core/src/logging/tests/system.spec.ts b/packages/backend-core/src/logging/tests/system.spec.ts new file mode 100644 index 0000000000..b84d8e8456 --- /dev/null +++ b/packages/backend-core/src/logging/tests/system.spec.ts @@ -0,0 +1,61 @@ +import { getSingleFileMaxSizeInfo } from "../system" + +describe("system", () => { + describe("getSingleFileMaxSizeInfo", () => { + it.each([ + ["100B", "50B"], + ["200K", "100K"], + ["20M", "10M"], + ["4G", "2G"], + ])( + "Halving even number (%s) returns halved size and 1 history file (%s)", + (totalValue, expectedMaxSize) => { + const result = getSingleFileMaxSizeInfo(totalValue) + expect(result).toEqual({ + size: expectedMaxSize, + totalHistoryFiles: 1, + }) + } + ) + + it.each([ + ["5B", "1B", 4], + ["17K", "1K", 16], + ["21M", "1M", 20], + ["3G", "1G", 2], + ])( + "Halving an odd number (%s) returns as many files as size (-1) (%s)", + (totalValue, expectedMaxSize, totalHistoryFiles) => { + const result = getSingleFileMaxSizeInfo(totalValue) + expect(result).toEqual({ + size: expectedMaxSize, + totalHistoryFiles, + }) + } + ) + + it.each([ + ["1B", "1B"], + ["1K", "500B"], + ["1M", "500K"], + ["1G", "500M"], + ])( + "Halving '%s' returns halved unit (%s)", + (totalValue, expectedMaxSize) => { + const result = getSingleFileMaxSizeInfo(totalValue) + expect(result).toEqual({ + size: expectedMaxSize, + totalHistoryFiles: 1, + }) + } + ) + + it.each([[undefined], [""], ["50"], ["wrongvalue"]])( + "Halving wrongly formatted value ('%s') returns undefined", + totalValue => { + const result = getSingleFileMaxSizeInfo(totalValue!) + expect(result).toBeUndefined() + } + ) + }) +}) diff --git a/packages/bbui/src/Button/Button.svelte b/packages/bbui/src/Button/Button.svelte index 91affdb6c7..9e49d84d44 100644 --- a/packages/bbui/src/Button/Button.svelte +++ b/packages/bbui/src/Button/Button.svelte @@ -1,6 +1,7 @@ - + + + diff --git a/packages/bbui/src/Popover/Popover.svelte b/packages/bbui/src/Popover/Popover.svelte index 20207a85da..9f951a6a7e 100644 --- a/packages/bbui/src/Popover/Popover.svelte +++ b/packages/bbui/src/Popover/Popover.svelte @@ -90,6 +90,6 @@ .spectrum-Popover { min-width: var(--spectrum-global-dimension-size-2000); border-color: var(--spectrum-global-color-gray-300); - overflow: visible; + overflow: auto; } diff --git a/packages/bbui/src/Tooltip/AbsTooltip.svelte b/packages/bbui/src/Tooltip/AbsTooltip.svelte new file mode 100644 index 0000000000..9be7251445 --- /dev/null +++ b/packages/bbui/src/Tooltip/AbsTooltip.svelte @@ -0,0 +1,157 @@ + + + + +
(hovered = true)} + on:mouseleave={() => (hovered = false)} +> + +
+ +{#if visible && text && left != null && top != null} + + + {text} + + + +{/if} + + diff --git a/packages/bbui/src/Tooltip/TempTooltip.svelte b/packages/bbui/src/Tooltip/TempTooltip.svelte new file mode 100644 index 0000000000..0d590b1ec6 --- /dev/null +++ b/packages/bbui/src/Tooltip/TempTooltip.svelte @@ -0,0 +1,39 @@ + + + + + diff --git a/packages/bbui/src/index.js b/packages/bbui/src/index.js index a9d71723f8..97762d2b3a 100644 --- a/packages/bbui/src/index.js +++ b/packages/bbui/src/index.js @@ -36,6 +36,12 @@ export { default as Layout } from "./Layout/Layout.svelte" export { default as Page } from "./Layout/Page.svelte" export { default as Link } from "./Link/Link.svelte" export { default as Tooltip } from "./Tooltip/Tooltip.svelte" +export { default as TempTooltip } from "./Tooltip/TempTooltip.svelte" +export { + default as AbsTooltip, + TooltipPosition, + TooltipType, +} from "./Tooltip/AbsTooltip.svelte" export { default as TooltipWrapper } from "./Tooltip/TooltipWrapper.svelte" export { default as Menu } from "./Menu/Menu.svelte" export { default as MenuSection } from "./Menu/Section.svelte" diff --git a/packages/builder/src/builderStore/index.js b/packages/builder/src/builderStore/index.js index 16a87810ad..2ca8057b48 100644 --- a/packages/builder/src/builderStore/index.js +++ b/packages/builder/src/builderStore/index.js @@ -127,8 +127,12 @@ export const selectedAutomation = derived(automationStore, $automationStore => { export const userSelectedResourceMap = derived(userStore, $userStore => { let map = {} $userStore.forEach(user => { - if (user.builderMetadata?.selectedResourceId) { - map[user.builderMetadata?.selectedResourceId] = user + const resource = user.builderMetadata?.selectedResourceId + if (resource) { + if (!map[resource]) { + map[resource] = [] + } + map[resource].push(user) } }) return map diff --git a/packages/builder/src/components/backend/DataTable/buttons/TableFilterButton.svelte b/packages/builder/src/components/backend/DataTable/buttons/TableFilterButton.svelte index ce6a3f0c51..b96738ab1a 100644 --- a/packages/builder/src/components/backend/DataTable/buttons/TableFilterButton.svelte +++ b/packages/builder/src/components/backend/DataTable/buttons/TableFilterButton.svelte @@ -17,7 +17,7 @@ $: text = getText(filters) const getText = filters => { - const count = filters?.length + const count = filters?.filter(filter => filter.field)?.length return count ? `Filter (${count})` : "Filter" } diff --git a/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte b/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte index bfca91afaa..d13a7c30db 100644 --- a/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte +++ b/packages/builder/src/components/backend/TableNavigator/modals/CreateTableModal.svelte @@ -2,21 +2,13 @@ import { goto, url } from "@roxi/routify" import { tables } from "stores/backend" import { notifications } from "@budibase/bbui" - import { - Input, - Label, - ModalContent, - Toggle, - Divider, - Layout, - } from "@budibase/bbui" + import { Input, Label, ModalContent, Layout } from "@budibase/bbui" import { datasources } from "stores/backend" import TableDataImport from "../TableDataImport.svelte" import { BUDIBASE_INTERNAL_DB_ID, BUDIBASE_DATASOURCE_TYPE, } from "constants/backend" - import { buildAutoColumn, getAutoColumnInformation } from "builderStore/utils" $: tableNames = $tables.list.map(table => table.name) $: selectedSource = $datasources.list.find( @@ -43,28 +35,12 @@ } let error = "" - let autoColumns = getAutoColumnInformation() + let schema = {} let rows = [] let allValid = true let displayColumn = null - function getAutoColumns() { - const selectedAutoColumns = {} - - Object.entries(autoColumns).forEach(([subtype, column]) => { - if (column.enabled) { - selectedAutoColumns[column.name] = buildAutoColumn( - name, - column.name, - subtype - ) - } - }) - - return selectedAutoColumns - } - function checkValid(evt) { const tableName = evt.target.value if (tableNames.includes(tableName)) { @@ -77,7 +53,7 @@ async function saveTable() { let newTable = { name, - schema: { ...schema, ...getAutoColumns() }, + schema: { ...schema }, rows, type: "internal", sourceId: targetDatasourceId, @@ -118,21 +94,6 @@ bind:value={name} {error} /> -
- -
-
- - - -
-
- - -
-
- -
- - diff --git a/packages/builder/src/components/common/CreationPage.svelte b/packages/builder/src/components/common/CreationPage.svelte new file mode 100644 index 0000000000..9631e9d961 --- /dev/null +++ b/packages/builder/src/components/common/CreationPage.svelte @@ -0,0 +1,39 @@ + + +
+
+ {#if showClose} + + {/if} +
+
+ {heading} +
+ +
+ + diff --git a/packages/builder/src/components/common/NavItem.svelte b/packages/builder/src/components/common/NavItem.svelte index 467827dbf6..6f87c8c362 100644 --- a/packages/builder/src/components/common/NavItem.svelte +++ b/packages/builder/src/components/common/NavItem.svelte @@ -2,6 +2,7 @@ import { Icon } from "@budibase/bbui" import { createEventDispatcher, getContext } from "svelte" import { helpers } from "@budibase/shared-core" + import UserAvatars from "../../pages/builder/app/[application]/_components/UserAvatars.svelte" export let icon export let withArrow = false @@ -98,21 +99,25 @@ {/if} -
{text}
+
+ {text} + {#if selectedBy} + + {/if} +
+ {#if withActions}
{/if} + {#if $$slots.right}
{/if} - {#if selectedBy} -
{helpers.getUserLabel(selectedBy)}
- {/if} diff --git a/packages/builder/src/components/design/settings/controls/ColumnEditor/ColumnEditor.svelte b/packages/builder/src/components/design/settings/controls/ColumnEditor/ColumnEditor.svelte index 5f1abdbeca..cebb429ac4 100644 --- a/packages/builder/src/components/design/settings/controls/ColumnEditor/ColumnEditor.svelte +++ b/packages/builder/src/components/design/settings/controls/ColumnEditor/ColumnEditor.svelte @@ -20,6 +20,7 @@ let drawer let boundValue + $: text = getText(value) $: datasource = getDatasourceForProvider($currentAsset, componentInstance) $: schema = getSchema($currentAsset, datasource) $: options = allowCellEditing @@ -31,6 +32,17 @@ allowLinks: true, }) + const getText = value => { + if (!value?.length) { + return "All columns" + } + let text = `${value.length} column` + if (value.length !== 1) { + text += "s" + } + return text + } + const getSchema = (asset, datasource) => { const schema = getSchemaForDatasource(asset, datasource).schema @@ -76,7 +88,7 @@
- Configure columns + {text}
diff --git a/packages/builder/src/components/design/settings/controls/FieldConfiguration/FieldConfiguration.svelte b/packages/builder/src/components/design/settings/controls/FieldConfiguration/FieldConfiguration.svelte index 2778ce4f74..f9dccf586c 100644 --- a/packages/builder/src/components/design/settings/controls/FieldConfiguration/FieldConfiguration.svelte +++ b/packages/builder/src/components/design/settings/controls/FieldConfiguration/FieldConfiguration.svelte @@ -12,25 +12,36 @@ export let componentInstance export let value = [] - const convertOldColumnFormat = oldColumns => { - if (typeof oldColumns?.[0] === "string") { - value = oldColumns.map(field => ({ name: field, displayName: field })) - } - } - - $: convertOldColumnFormat(value) - const dispatch = createEventDispatcher() let drawer let boundValue + $: text = getText(value) + $: convertOldColumnFormat(value) $: datasource = getDatasourceForProvider($currentAsset, componentInstance) $: schema = getSchema($currentAsset, datasource) $: options = Object.keys(schema || {}) $: sanitisedValue = getValidColumns(value, options) $: updateBoundValue(sanitisedValue) + const getText = value => { + if (!value?.length) { + return "All fields" + } + let text = `${value.length} field` + if (value.length !== 1) { + text += "s" + } + return text + } + + const convertOldColumnFormat = oldColumns => { + if (typeof oldColumns?.[0] === "string") { + value = oldColumns.map(field => ({ name: field, displayName: field })) + } + } + const getSchema = (asset, datasource) => { const schema = getSchemaForDatasource(asset, datasource).schema @@ -75,7 +86,10 @@ } -Configure fields +
+ {text} +
+ Configure the fields in your form. @@ -83,3 +97,9 @@ + + diff --git a/packages/builder/src/components/design/settings/controls/FilterEditor/FilterEditor.svelte b/packages/builder/src/components/design/settings/controls/FilterEditor/FilterEditor.svelte index 9d48789947..88c3842f54 100644 --- a/packages/builder/src/components/design/settings/controls/FilterEditor/FilterEditor.svelte +++ b/packages/builder/src/components/design/settings/controls/FilterEditor/FilterEditor.svelte @@ -20,7 +20,7 @@ $: datasource = getDatasourceForProvider($currentAsset, componentInstance) $: schema = getSchemaForDatasource($currentAsset, datasource)?.schema $: schemaFields = Object.values(schema || {}) - $: text = getText(value) + $: text = getText(value?.filter(filter => filter.field)) async function saveFilter() { dispatch("change", tempValue) diff --git a/packages/builder/src/components/portal/page/SideNavItem.svelte b/packages/builder/src/components/portal/page/SideNavItem.svelte index 11c1102050..8bf5248fb3 100644 --- a/packages/builder/src/components/portal/page/SideNavItem.svelte +++ b/packages/builder/src/components/portal/page/SideNavItem.svelte @@ -1,11 +1,8 @@
@@ -18,11 +15,6 @@ {text || ""}
{/if} - {#if tooltip} -
- -
- {/if} diff --git a/packages/builder/src/components/start/CreateAppModal.svelte b/packages/builder/src/components/start/CreateAppModal.svelte index f29b7067c3..9e831f5bd9 100644 --- a/packages/builder/src/components/start/CreateAppModal.svelte +++ b/packages/builder/src/components/start/CreateAppModal.svelte @@ -15,8 +15,6 @@ import { createValidationStore } from "helpers/validation/yup" import * as appValidation from "helpers/validation/yup/app" import TemplateCard from "components/common/TemplateCard.svelte" - import createFromScratchScreen from "builderStore/store/screenTemplates/createFromScratchScreen" - import { Roles } from "constants/backend" import { lowercase } from "helpers" export let template @@ -142,21 +140,6 @@ // Create user await auth.setInitInfo({}) - // Create a default home screen if no template was selected - if (template == null) { - let defaultScreenTemplate = createFromScratchScreen.create() - defaultScreenTemplate.routing.route = "/home" - defaultScreenTemplate.routing.roldId = Roles.BASIC - try { - await store.actions.screens.save(defaultScreenTemplate) - } catch (err) { - console.error("Could not create a default application screen", err) - notifications.warning( - "Encountered an issue creating the default screen." - ) - } - } - $goto(`/builder/app/${createdApp.instance._id}`) } catch (error) { creating = false 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 d069d1b4c7..eedff6c2a7 100644 --- a/packages/builder/src/pages/builder/app/[application]/_components/PreviewOverlay.svelte +++ b/packages/builder/src/pages/builder/app/[application]/_components/PreviewOverlay.svelte @@ -15,6 +15,7 @@ } onMount(() => { + window.isBuilder = true window.closePreview = () => { store.update(state => ({ ...state, diff --git a/packages/builder/src/pages/builder/app/[application]/_components/UserAvatars.svelte b/packages/builder/src/pages/builder/app/[application]/_components/UserAvatars.svelte index 0cd8c5bf6b..2399c659cc 100644 --- a/packages/builder/src/pages/builder/app/[application]/_components/UserAvatars.svelte +++ b/packages/builder/src/pages/builder/app/[application]/_components/UserAvatars.svelte @@ -1,9 +1,14 @@
- {#each uniqueUsers as user} - + {#each avatars as user} + + {#if user._id === "overflow"} + + {:else} + + {/if} + {/each}
diff --git a/packages/builder/src/pages/builder/app/[application]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/_layout.svelte index e7f5102e44..805bc6ed29 100644 --- a/packages/builder/src/pages/builder/app/[application]/_layout.svelte +++ b/packages/builder/src/pages/builder/app/[application]/_layout.svelte @@ -15,6 +15,7 @@ Heading, Modal, notifications, + TooltipPosition, } from "@budibase/bbui" import AppActions from "components/deploy/AppActions.svelte" import { API } from "api" @@ -172,7 +173,11 @@
- +
diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/_components/panels/Queries/RestImportButton.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/_components/panels/Queries/RestImportButton.svelte index 682284adca..7f179d18b4 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/_components/panels/Queries/RestImportButton.svelte +++ b/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/_components/panels/Queries/RestImportButton.svelte @@ -2,11 +2,12 @@ import { Button, Modal } from "@budibase/bbui" import ImportQueriesModal from "./RestImportQueriesModal.svelte" + export let datasourceId let importQueriesModal - +
diff --git a/packages/builder/src/pages/builder/app/[application]/data/new.svelte b/packages/builder/src/pages/builder/app/[application]/data/new.svelte index 4eb9ce16e1..b2aca33c6a 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/new.svelte +++ b/packages/builder/src/pages/builder/app/[application]/data/new.svelte @@ -7,14 +7,14 @@ } from "stores/backend" import { hasData } from "stores/selectors" - import { Icon, notifications, Heading, Body } from "@budibase/bbui" + import { notifications, Body, Icon, AbsTooltip } from "@budibase/bbui" import { params, goto } from "@roxi/routify" import CreateExternalDatasourceModal from "./_components/CreateExternalDatasourceModal/index.svelte" import CreateInternalTableModal from "./_components/CreateInternalTableModal.svelte" import DatasourceOption from "./_components/DatasourceOption.svelte" import IntegrationIcon from "components/backend/DatasourceNavigator/IntegrationIcon.svelte" + import CreationPage from "components/common/CreationPage.svelte" import ICONS from "components/backend/DatasourceNavigator/icons/index.js" - import FontAwesomeIcon from "components/common/FontAwesomeIcon.svelte" let internalTableModal let externalDatasourceModal @@ -46,25 +46,16 @@ bind:this={externalDatasourceModal} /> -
-
- {#if hasData($datasources, $tables)} - - {/if} -
-
- Add new data source -
- + $goto("./table")} + heading="Add new data source" +>
Get started with our Budibase DB - + + +
@@ -113,37 +104,19 @@ {/each}
-
+ diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenDropdownMenu.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenDropdownMenu.svelte index ec965ed659..fd5ddd9459 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenDropdownMenu.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenDropdownMenu.svelte @@ -9,7 +9,7 @@ Helpers, notifications, } from "@budibase/bbui" - import ScreenDetailsModal from "./ScreenDetailsModal.svelte" + import ScreenDetailsModal from "components/design/ScreenDetailsModal.svelte" import sanitizeUrl from "builderStore/store/screenTemplates/utils/sanitizeUrl" import { makeComponentUnique } from "builderStore/componentUtils" diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenListPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenListPanel.svelte index 92a88abb13..6362af3073 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenListPanel.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenListPanel.svelte @@ -1,17 +1,16 @@ - - - - newScreenModal.show()} initalScreens={!selectedTemplates ? [] : [...selectedTemplates]} /> @@ -198,7 +194,6 @@ newScreenModal.show()} initialUrl={blankScreenUrl} /> diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/DatasourceModal.svelte b/packages/builder/src/pages/builder/app/[application]/design/_components/DatasourceModal.svelte similarity index 100% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/DatasourceModal.svelte rename to packages/builder/src/pages/builder/app/[application]/design/_components/DatasourceModal.svelte diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenRoleModal.svelte b/packages/builder/src/pages/builder/app/[application]/design/_components/ScreenRoleModal.svelte similarity index 93% rename from packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenRoleModal.svelte rename to packages/builder/src/pages/builder/app/[application]/design/_components/ScreenRoleModal.svelte index cde8047b97..5d73b7961c 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenRoleModal.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/_components/ScreenRoleModal.svelte @@ -40,14 +40,14 @@ - Select which level of access you want your screens to have + Select the level of access required to see these screens