From 55a68890af40972aae221b09a5933787b89019ea Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 15 Mar 2022 11:18:34 +0000 Subject: [PATCH 01/26] Add nord theme --- packages/frontend-core/src/themes/nord.css | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 packages/frontend-core/src/themes/nord.css diff --git a/packages/frontend-core/src/themes/nord.css b/packages/frontend-core/src/themes/nord.css new file mode 100644 index 0000000000..113adfb853 --- /dev/null +++ b/packages/frontend-core/src/themes/nord.css @@ -0,0 +1,46 @@ +.spectrum--nord { + --spectrum-global-color-red-400: #bf616a; + --spectrum-global-color-red-500: #c26971; + --spectrum-global-color-red-600: #c57179; + --spectrum-global-color-red-700: #c97980; + --spectrum-global-color-static-red-400: #bf616a; + --spectrum-global-color-static-red-500: #c26971; + --spectrum-global-color-static-red-600: #c57179; + --spectrum-global-color-static-red-700: #c97980; + + --spectrum-global-color-green-400: #719453; + --spectrum-global-color-green-500: #789d58; + --spectrum-global-color-green-600: #7fa55e; + --spectrum-global-color-green-700: #86aa67; + --spectrum-global-color-static-green-400: #719453; + --spectrum-global-color-static-green-500: #789d58; + --spectrum-global-color-static-green-600: #7fa55e; + --spectrum-global-color-static-green-700: #86aa67; + + --spectrum-global-color-blue-400: #5680b4; + --spectrum-global-color-blue-500: #5e86b8; + --spectrum-global-color-blue-600: #668dbb; + --spectrum-global-color-blue-700: #6f93bf; + --spectrum-global-color-static-blue-200: #7799c4; + --spectrum-global-color-static-blue-300: #6f93bf; + --spectrum-global-color-static-blue-400: #668dbb; + --spectrum-global-color-static-blue-500: #5e86b8; + --spectrum-global-color-static-blue-600: #5680b4; + --spectrum-global-color-static-blue-700: #4e79af; + --spectrum-global-color-static-blue-800: #4a73a6; + + --spectrum-global-color-gray-50: #2e3440; + --spectrum-global-color-gray-75: #353b4a; + --spectrum-global-color-gray-100: #3b4252; + --spectrum-global-color-gray-200: #4a5367; + --spectrum-global-color-gray-300: #4c566a; + --spectrum-global-color-gray-400: #5a657d; + --spectrum-global-color-gray-500: #677590; + --spectrum-global-color-gray-600: #79869f; + --spectrum-global-color-gray-700: #a9b1c1; + --spectrum-global-color-gray-800: #bac1cd; + --spectrum-global-color-gray-900: #eceff4; + + --spectrum-alias-highlight-hover: rgba(169, 177, 193, 0.06); + --spectrum-alias-highlight-active: rgba(169, 177, 193, 0.1); +} From 3acea6b14832ac5b83ed4cd246e30e1e70c6579e Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 15 Mar 2022 11:20:06 +0000 Subject: [PATCH 02/26] Add nord theme --- packages/builder/src/builderStore/store/theme.js | 4 ++++ .../components/design/AppPreview/AppThemeSelect.svelte | 4 ++++ packages/builder/src/main.js | 1 + packages/client/src/components/ClientApp.svelte | 2 +- packages/client/src/components/app/index.js | 8 +++++--- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/packages/builder/src/builderStore/store/theme.js b/packages/builder/src/builderStore/store/theme.js index d4d7460ed2..77b84ca78c 100644 --- a/packages/builder/src/builderStore/store/theme.js +++ b/packages/builder/src/builderStore/store/theme.js @@ -21,6 +21,10 @@ export const getThemeStore = () => { `spectrum--${option}`, option === state.theme ) + + // Ensure darkest is always added as this is the base class for custom + // themes + themeElement.classList.add("spectrum--darkest") }) }) diff --git a/packages/builder/src/components/design/AppPreview/AppThemeSelect.svelte b/packages/builder/src/components/design/AppPreview/AppThemeSelect.svelte index cdab47db66..59a8671bfd 100644 --- a/packages/builder/src/components/design/AppPreview/AppThemeSelect.svelte +++ b/packages/builder/src/components/design/AppPreview/AppThemeSelect.svelte @@ -20,6 +20,10 @@ label: "Darkest", value: "spectrum--darkest", }, + { + label: "Nord", + value: "spectrum--nord", + }, ] const onChangeTheme = async theme => { diff --git a/packages/builder/src/main.js b/packages/builder/src/main.js index bc5ec4f009..8ab2c16ba2 100644 --- a/packages/builder/src/main.js +++ b/packages/builder/src/main.js @@ -5,6 +5,7 @@ import "@spectrum-css/vars/dist/spectrum-darkest.css" import "@spectrum-css/vars/dist/spectrum-dark.css" import "@spectrum-css/vars/dist/spectrum-light.css" import "@spectrum-css/vars/dist/spectrum-lightest.css" +import "@budibase/frontend-core/src/themes/nord.css" import "@spectrum-css/page/dist/index-vars.css" import "./global.css" import { suppressWarnings } from "./helpers/warnings" diff --git a/packages/client/src/components/ClientApp.svelte b/packages/client/src/components/ClientApp.svelte index e8ed7e9538..8af065f972 100644 --- a/packages/client/src/components/ClientApp.svelte +++ b/packages/client/src/components/ClientApp.svelte @@ -77,7 +77,7 @@ id="spectrum-root" lang="en" dir="ltr" - class="spectrum spectrum--medium {$themeStore.theme}" + class="spectrum spectrum--medium spectrum--darkest {$themeStore.theme}" > {#if permissionError}
diff --git a/packages/client/src/components/app/index.js b/packages/client/src/components/app/index.js index 5af62201e5..71acee5eff 100644 --- a/packages/client/src/components/app/index.js +++ b/packages/client/src/components/app/index.js @@ -1,10 +1,11 @@ import "@spectrum-css/vars/dist/spectrum-global.css" import "@spectrum-css/vars/dist/spectrum-medium.css" import "@spectrum-css/vars/dist/spectrum-large.css" -import "@spectrum-css/vars/dist/spectrum-lightest.css" -import "@spectrum-css/vars/dist/spectrum-light.css" -import "@spectrum-css/vars/dist/spectrum-dark.css" import "@spectrum-css/vars/dist/spectrum-darkest.css" +import "@spectrum-css/vars/dist/spectrum-dark.css" +import "@spectrum-css/vars/dist/spectrum-light.css" +import "@spectrum-css/vars/dist/spectrum-lightest.css" +import "@budibase/frontend-core/src/themes/nord.css" import "@spectrum-css/page/dist/index-vars.css" // Non user-facing components @@ -34,6 +35,7 @@ export { default as markdownviewer } from "./MarkdownViewer.svelte" export * from "./charts" export * from "./forms" export * from "./table" + export * from "./blocks" export * from "./dynamic-filter" From ed8ab95ae7eea9bca42168700d053c7574dfef79 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 21 Jul 2022 18:37:34 +0100 Subject: [PATCH 03/26] Allow dropping on the screen component --- .../_components/navigation/ComponentListPanel.svelte | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentListPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentListPanel.svelte index 5b86d4da29..1bb4e3d9cd 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentListPanel.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentListPanel.svelte @@ -9,6 +9,7 @@ import { setContext } from "svelte" import DNDPositionIndicator from "./DNDPositionIndicator.svelte" import { DropPosition } from "./dndStore" + import { notifications } from "@budibase/bbui" let scrollRef @@ -55,6 +56,15 @@ }) } + const onDrop = async () => { + try { + await dndStore.actions.drop() + } catch (error) { + console.error(error) + notifications.error("Error saving component") + } + } + // Set scroll context so components can invoke scrolling when selected setContext("scroll", { scrollTo, @@ -83,6 +93,7 @@ opened scrollable icon="WebPage" + on:drop={onDrop} > From 303bfd5be48ba0f4786c5958f52148cd6fe1a7f7 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 22 Jul 2022 11:10:20 +0100 Subject: [PATCH 04/26] Make block searching on dates useful by using a range of the whole day --- .../components/app/blocks/CardsBlock.svelte | 42 +--------- .../components/app/blocks/TableBlock.svelte | 45 +---------- .../src/components/app/forms/Form.svelte | 5 ++ .../src/components/app/forms/InnerForm.svelte | 4 +- packages/client/src/utils/blocks.js | 81 +++++++++++++++++++ packages/frontend-core/src/utils/lucene.js | 12 ++- 6 files changed, 102 insertions(+), 87 deletions(-) create mode 100644 packages/client/src/utils/blocks.js diff --git a/packages/client/src/components/app/blocks/CardsBlock.svelte b/packages/client/src/components/app/blocks/CardsBlock.svelte index f6aed54760..a13364833a 100644 --- a/packages/client/src/components/app/blocks/CardsBlock.svelte +++ b/packages/client/src/components/app/blocks/CardsBlock.svelte @@ -4,6 +4,7 @@ import BlockComponent from "components/BlockComponent.svelte" import { Heading } from "@budibase/bbui" import { makePropSafe as safe } from "@budibase/string-templates" + import { enrichSearchColumns, enrichFilter } from "utils/blocks.js" export let title export let dataSource @@ -33,14 +34,6 @@ const { fetchDatasourceSchema, styleable } = getContext("sdk") const context = getContext("context") const component = getContext("component") - const schemaComponentMap = { - string: "stringfield", - options: "optionsfield", - number: "numberfield", - datetime: "datetimefield", - boolean: "booleanfield", - formula: "stringfield", - } let formId let dataProviderId @@ -68,39 +61,6 @@ }, ] - // Enrich the default filter with the specified search fields - const enrichFilter = (filter, columns, formId) => { - let enrichedFilter = [...(filter || [])] - columns?.forEach(column => { - const safePath = column.name.split(".").map(safe).join(".") - enrichedFilter.push({ - field: column.name, - operator: column.type === "string" ? "string" : "equal", - type: column.type, - valueType: "Binding", - value: `{{ ${safe(formId)}.${safePath} }}`, - }) - }) - return enrichedFilter - } - - // Determine data types for search fields and only use those that are valid - const enrichSearchColumns = (searchColumns, schema) => { - let enrichedColumns = [] - searchColumns?.forEach(column => { - const schemaType = schema?.[column]?.type - const componentType = schemaComponentMap[schemaType] - if (componentType) { - enrichedColumns.push({ - name: column, - componentType, - type: schemaType, - }) - } - }) - return enrichedColumns.slice(0, 5) - } - // Builds a full details page URL for the card title const buildFullCardUrl = (link, url, repeaterId, linkColumn) => { if (!link || !url || !repeaterId) { diff --git a/packages/client/src/components/app/blocks/TableBlock.svelte b/packages/client/src/components/app/blocks/TableBlock.svelte index 4ae169ca72..e67124fc4f 100644 --- a/packages/client/src/components/app/blocks/TableBlock.svelte +++ b/packages/client/src/components/app/blocks/TableBlock.svelte @@ -4,6 +4,7 @@ import BlockComponent from "components/BlockComponent.svelte" import { Heading } from "@budibase/bbui" import { makePropSafe as safe } from "@budibase/string-templates" + import { enrichSearchColumns, enrichFilter } from "utils/blocks.js" export let title export let dataSource @@ -31,14 +32,6 @@ const { fetchDatasourceSchema, styleable } = getContext("sdk") const context = getContext("context") const component = getContext("component") - const schemaComponentMap = { - string: "stringfield", - options: "optionsfield", - number: "numberfield", - datetime: "datetimefield", - boolean: "booleanfield", - formula: "stringfield", - } let formId let dataProviderId @@ -58,40 +51,6 @@ }, ] - // Enrich the default filter with the specified search fields - const enrichFilter = (filter, columns, formId) => { - let enrichedFilter = [...(filter || [])] - columns?.forEach(column => { - const safePath = column.name.split(".").map(safe).join(".") - const stringType = column.type === "string" || column.type === "formula" - enrichedFilter.push({ - field: column.name, - type: column.type, - operator: stringType ? "string" : "equal", - valueType: "Binding", - value: `{{ ${safe(formId)}.${safePath} }}`, - }) - }) - return enrichedFilter - } - - // Determine data types for search fields and only use those that are valid - const enrichSearchColumns = (searchColumns, schema) => { - let enrichedColumns = [] - searchColumns?.forEach(column => { - const schemaType = schema?.[column]?.type - const componentType = schemaComponentMap[schemaType] - if (componentType) { - enrichedColumns.push({ - name: column, - componentType, - type: schemaType, - }) - } - }) - return enrichedColumns.slice(0, 5) - } - // Load the datasource schema so we can determine column types const fetchSchema = async dataSource => { if (dataSource) { @@ -109,7 +68,7 @@ {#if title || enrichedSearchColumns?.length || showTitleButton}
diff --git a/packages/client/src/components/app/forms/Form.svelte b/packages/client/src/components/app/forms/Form.svelte index a274fb24f0..320fc712aa 100644 --- a/packages/client/src/components/app/forms/Form.svelte +++ b/packages/client/src/components/app/forms/Form.svelte @@ -13,6 +13,10 @@ // for fields rendered in things like search blocks. export let disableValidation = false + // Not exposed as a builder setting. Used internally to allow searching on + // auto columns. + export let editAutoColumns = false + const context = getContext("context") const { API, fetchDatasourceSchema } = getContext("sdk") @@ -107,6 +111,7 @@ {table} {initialValues} {disableValidation} + {editAutoColumns} > diff --git a/packages/client/src/components/app/forms/InnerForm.svelte b/packages/client/src/components/app/forms/InnerForm.svelte index 752bc9a2eb..316b697043 100644 --- a/packages/client/src/components/app/forms/InnerForm.svelte +++ b/packages/client/src/components/app/forms/InnerForm.svelte @@ -11,6 +11,7 @@ export let schema export let table export let disableValidation = false + export let editAutoColumns = false const component = getContext("component") const { styleable, Provider, ActionTypes } = getContext("sdk") @@ -183,7 +184,8 @@ fieldId, value: initialValue, error: initialError, - disabled: disabled || fieldDisabled || isAutoColumn, + disabled: + disabled || fieldDisabled || (isAutoColumn && !editAutoColumns), defaultValue, validator, lastUpdate: Date.now(), diff --git a/packages/client/src/utils/blocks.js b/packages/client/src/utils/blocks.js new file mode 100644 index 0000000000..3b97544238 --- /dev/null +++ b/packages/client/src/utils/blocks.js @@ -0,0 +1,81 @@ +import { makePropSafe as safe } from "@budibase/string-templates" + +// Map of data types to component types for search fields inside blocks +const schemaComponentMap = { + string: "stringfield", + options: "optionsfield", + number: "numberfield", + datetime: "datetimefield", + boolean: "booleanfield", + formula: "stringfield", +} + +/** + * Determine data types for search fields and only use those that are valid + * @param searchColumns the search columns to use + * @param schema the data source schema + */ +export const enrichSearchColumns = (searchColumns, schema) => { + let enrichedColumns = [] + searchColumns?.forEach(column => { + const schemaType = schema?.[column]?.type + const componentType = schemaComponentMap[schemaType] + if (componentType) { + enrichedColumns.push({ + name: column, + componentType, + type: schemaType, + }) + } + }) + return enrichedColumns.slice(0, 5) +} + +/** + * Enriches a normal datasource filter with bindings representing the additional + * search fields configured as part of a searchable block. These bindings are + * fields inside a form used as part of the block. + * @param filter the normal data provider filter + * @param columns the enriched search column structure + * @param formId the ID of the form containing the search fields + */ +export const enrichFilter = (filter, columns, formId) => { + let enrichedFilter = [...(filter || [])] + columns?.forEach(column => { + const safePath = column.name.split(".").map(safe).join(".") + const stringType = column.type === "string" || column.type === "formula" + const dateType = column.type === "datetime" + const binding = `${safe(formId)}.${safePath}` + + // For dates, use a range of the entire day selected + if (dateType) { + enrichedFilter.push({ + field: column.name, + type: column.type, + operator: "rangeLow", + valueType: "Binding", + value: `{{ ${binding} }}`, + }) + const format = "YYYY-MM-DDTHH:mm:ss.SSSZ" + enrichedFilter.push({ + field: column.name, + type: column.type, + operator: "rangeHigh", + valueType: "Binding", + value: `{{ date (add (date ${binding} "x") 86399999) "${format}" }}`, + }) + } + + // For other fields, do an exact match + else { + enrichedFilter.push({ + field: column.name, + type: column.type, + operator: stringType ? "string" : "equal", + valueType: "Binding", + value: `{{ ${binding} }}`, + }) + } + }) + return enrichedFilter +} diff --git a/packages/frontend-core/src/utils/lucene.js b/packages/frontend-core/src/utils/lucene.js index 1001ec26a8..b27296af37 100644 --- a/packages/frontend-core/src/utils/lucene.js +++ b/packages/frontend-core/src/utils/lucene.js @@ -99,8 +99,16 @@ export const buildLuceneQuery = filter => { filter.forEach(expression => { let { operator, field, type, value, externalType } = expression // Parse all values into correct types - if (type === "datetime" && value) { - value = new Date(value).toISOString() + if (type === "datetime") { + // Ensure date value is a valid date and parse into correct format + if (!value) { + return + } + try { + value = new Date(value).toISOString() + } catch (error) { + return + } } if (type === "number" && !Array.isArray(value)) { if (operator === "oneOf") { From a84d4d014d4b7a9390c39a12789b58370ad6999e Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 22 Jul 2022 18:16:14 +0100 Subject: [PATCH 05/26] Fixing issues with exporting apps, first removing the deleted documents when exporting and second making it so that the user has a choice whether to export the development app or the published app from the UI. --- .../portal/overview/[application]/index.svelte | 18 ++++++++++++++---- .../server/src/utilities/fileSystem/index.js | 18 ++++++------------ 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/packages/builder/src/pages/builder/portal/overview/[application]/index.svelte b/packages/builder/src/pages/builder/portal/overview/[application]/index.svelte index 293f19ebe4..2a5cdaf3bd 100644 --- a/packages/builder/src/pages/builder/portal/overview/[application]/index.svelte +++ b/packages/builder/src/pages/builder/portal/overview/[application]/index.svelte @@ -139,9 +139,10 @@ notifications.success("App ID copied to clipboard.") } - const exportApp = app => { - const id = isPublished ? app.prodId : app.devId + const exportApp = (app, opts = { published: false }) => { const appName = encodeURIComponent(app.name) + const id = opts?.published ? app.prodId : app.devId + // always export the development version window.location = `/api/backups/export?appId=${id}&appname=${appName}` } @@ -266,12 +267,21 @@ - exportApp(selectedApp)} icon="Download"> + exportApp(selectedApp, { published: false })} + icon="DownloadFromCloud" + > Export {#if isPublished} + exportApp(selectedApp, { published: true })} + icon="DownloadFromCloudOutline" + > + Export published + copyAppId(selectedApp)} icon="Copy"> - Copy App ID + Copy app ID {/if} {#if !isPublished} diff --git a/packages/server/src/utilities/fileSystem/index.js b/packages/server/src/utilities/fileSystem/index.js index ed1cb1923a..f4aebd11a8 100644 --- a/packages/server/src/utilities/fileSystem/index.js +++ b/packages/server/src/utilities/fileSystem/index.js @@ -111,20 +111,12 @@ exports.apiFileReturn = contents => { } exports.defineFilter = excludeRows => { + const ids = [USER_METDATA_PREFIX, LINK_USER_METADATA_PREFIX] if (excludeRows) { - return doc => - !( - doc._id.includes(USER_METDATA_PREFIX) || - doc._id.includes(LINK_USER_METADATA_PREFIX) || - doc._id.includes(TABLE_ROW_PREFIX) - ) - } else if (!excludeRows) { - return doc => - !( - doc._id.includes(USER_METDATA_PREFIX) || - doc._id.includes(LINK_USER_METADATA_PREFIX) - ) + ids.push(TABLE_ROW_PREFIX) } + return doc => + !ids.map(key => doc._id.includes(key)).reduce((prev, curr) => prev || curr) } /** @@ -132,6 +124,7 @@ exports.defineFilter = excludeRows => { * data or user relationships. * @param {string} appId The app to backup * @param {object} config Config to send to export DB + * @param {boolean} includeRows Flag to state whether the export should include data. * @returns {*} either a string or a stream of the backup */ const backupAppData = async (appId, config, includeRows) => { @@ -154,6 +147,7 @@ exports.performBackup = async (appId, backupName) => { /** * Streams a backup of the database state for an app * @param {string} appId The ID of the app which is to be backed up. + * @param {boolean} includeRows Flag to state whether the export should include data. * @returns {*} a readable stream of the backup which is written in real time */ exports.streamBackup = async (appId, includeRows) => { From ff1ae2f8fa5248536face11a4c0218cb8a36b442 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 22 Jul 2022 18:43:35 +0100 Subject: [PATCH 06/26] Fix for permission spamming in the automation UI. --- .../automation/AutomationBuilder/FlowChart/FlowItem.svelte | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte index 412683721f..c1618a890f 100644 --- a/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte +++ b/packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte @@ -52,8 +52,9 @@ x => x.blockToLoop === block.id ) - $: setPermissions(role) - $: getPermissions(automationId) + $: isAppAction = block?.stepId === TriggerStepID.APP + $: isAppAction && setPermissions(role) + $: isAppAction && getPermissions(automationId) async function setPermissions(role) { if (!role || !automationId) { @@ -238,7 +239,7 @@
{/if} - {#if block.stepId === TriggerStepID.APP} + {#if isAppAction} {/if} From f82b407f305c149bc7a53457a5f77916c8db759a Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 25 Jul 2022 12:17:40 +0100 Subject: [PATCH 07/26] Ignore 409s in write-through cache --- packages/backend-core/src/cache/writethrough.ts | 7 +++---- packages/backend-core/src/logging.ts | 5 +++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/backend-core/src/cache/writethrough.ts b/packages/backend-core/src/cache/writethrough.ts index e11ca0acaa..701351d75b 100644 --- a/packages/backend-core/src/cache/writethrough.ts +++ b/packages/backend-core/src/cache/writethrough.ts @@ -1,5 +1,6 @@ import BaseCache from "./base" import { getWritethroughClient } from "../redis/init" +import { logInfo } from "../logging" const DEFAULT_WRITE_RATE_MS = 10000 let CACHE: BaseCache | null = null @@ -51,10 +52,8 @@ export async function put( if (err.status !== 409) { throw err } else { - // get the rev, update over it - this is risky, may change in future - const readDoc = await db.get(doc._id) - doc._rev = readDoc._rev - await writeDb(doc) + // Swallow 409s but log them + logInfo(`Ignoring conflict in write-through cache`) } } } diff --git a/packages/backend-core/src/logging.ts b/packages/backend-core/src/logging.ts index 68c3307b2f..fcfa04bbb9 100644 --- a/packages/backend-core/src/logging.ts +++ b/packages/backend-core/src/logging.ts @@ -15,6 +15,11 @@ export function logAlert(message: string, e?: any) { console.error(`bb-alert: ${message} ${errorJson}`) } +export function logInfo(message: string) { + console.warn(`bb-info: ${message}`) +} + export default { logAlert, + logInfo, } From 8bd254f31316f094777b6594827511f9813f449a Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 25 Jul 2022 12:22:27 +0100 Subject: [PATCH 08/26] Use log rather than warn for logInfo --- packages/backend-core/src/logging.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend-core/src/logging.ts b/packages/backend-core/src/logging.ts index fcfa04bbb9..63bdc092e9 100644 --- a/packages/backend-core/src/logging.ts +++ b/packages/backend-core/src/logging.ts @@ -16,7 +16,7 @@ export function logAlert(message: string, e?: any) { } export function logInfo(message: string) { - console.warn(`bb-info: ${message}`) + console.log(`bb-info: ${message}`) } export default { From d9dacbc901c149daaea68f551d46a1d1b4a3bbde Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 25 Jul 2022 12:23:30 +0100 Subject: [PATCH 09/26] Use warn rather than info when notifying about ignored conflicts --- packages/backend-core/src/cache/writethrough.ts | 4 ++-- packages/backend-core/src/logging.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/backend-core/src/cache/writethrough.ts b/packages/backend-core/src/cache/writethrough.ts index 701351d75b..ec6b1604c8 100644 --- a/packages/backend-core/src/cache/writethrough.ts +++ b/packages/backend-core/src/cache/writethrough.ts @@ -1,6 +1,6 @@ import BaseCache from "./base" import { getWritethroughClient } from "../redis/init" -import { logInfo } from "../logging" +import { logWarn } from "../logging" const DEFAULT_WRITE_RATE_MS = 10000 let CACHE: BaseCache | null = null @@ -53,7 +53,7 @@ export async function put( throw err } else { // Swallow 409s but log them - logInfo(`Ignoring conflict in write-through cache`) + logWarn(`Ignoring conflict in write-through cache`) } } } diff --git a/packages/backend-core/src/logging.ts b/packages/backend-core/src/logging.ts index 63bdc092e9..8eda15ac79 100644 --- a/packages/backend-core/src/logging.ts +++ b/packages/backend-core/src/logging.ts @@ -15,11 +15,11 @@ export function logAlert(message: string, e?: any) { console.error(`bb-alert: ${message} ${errorJson}`) } -export function logInfo(message: string) { - console.log(`bb-info: ${message}`) +export function logWarn(message: string) { + console.warn(`bb-warn: ${message}`) } export default { logAlert, - logInfo, + logWarn, } From c96b78a9d405557b089680e4f26ad1c72ef49752 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 25 Jul 2022 14:11:42 +0000 Subject: [PATCH 10/26] v1.1.22 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 11 files changed, 28 insertions(+), 28 deletions(-) diff --git a/lerna.json b/lerna.json index 904cdf8fd6..a54e5ff8aa 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.1.21", + "version": "1.1.22", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 6050311ca0..6383e1f2d8 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.1.21", + "version": "1.1.22", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -20,7 +20,7 @@ "test:watch": "jest --watchAll" }, "dependencies": { - "@budibase/types": "^1.1.21", + "@budibase/types": "^1.1.22", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", "bcrypt": "5.0.1", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index c049cf328e..2d19a2a2ff 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "1.1.21", + "version": "1.1.22", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.1.21", + "@budibase/string-templates": "^1.1.22", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 989e6ffc7a..1056924d7f 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.1.21", + "version": "1.1.22", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.1.21", - "@budibase/client": "^1.1.21", - "@budibase/frontend-core": "^1.1.21", - "@budibase/string-templates": "^1.1.21", + "@budibase/bbui": "^1.1.22", + "@budibase/client": "^1.1.22", + "@budibase/frontend-core": "^1.1.22", + "@budibase/string-templates": "^1.1.22", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 4f98996748..c8375ba0cf 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.1.21", + "version": "1.1.22", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index 926ffe8bf7..a2a6492e30 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.1.21", + "version": "1.1.22", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^1.1.21", - "@budibase/frontend-core": "^1.1.21", - "@budibase/string-templates": "^1.1.21", + "@budibase/bbui": "^1.1.22", + "@budibase/frontend-core": "^1.1.22", + "@budibase/string-templates": "^1.1.22", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index d1ab255484..b623f6cd4f 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.1.21", + "version": "1.1.22", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.1.21", + "@budibase/bbui": "^1.1.22", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index c92242507a..8592fce11a 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.1.21", + "version": "1.1.22", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -77,11 +77,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "^1.1.21", - "@budibase/client": "^1.1.21", + "@budibase/backend-core": "^1.1.22", + "@budibase/client": "^1.1.22", "@budibase/pro": "1.1.21", - "@budibase/string-templates": "^1.1.21", - "@budibase/types": "^1.1.21", + "@budibase/string-templates": "^1.1.22", + "@budibase/types": "^1.1.22", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 7e9ff93214..81a7ad4e4e 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.1.21", + "version": "1.1.22", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index 6ea09c4fd2..3f6f9d959f 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "1.1.21", + "version": "1.1.22", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index b70109d066..84bde488b2 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.1.21", + "version": "1.1.22", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -35,10 +35,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.1.21", + "@budibase/backend-core": "^1.1.22", "@budibase/pro": "1.1.21", - "@budibase/string-templates": "^1.1.21", - "@budibase/types": "^1.1.21", + "@budibase/string-templates": "^1.1.22", + "@budibase/types": "^1.1.22", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From ebdc8718486e184df71bbee50feafee273194e0f Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 25 Jul 2022 14:13:32 +0000 Subject: [PATCH 11/26] Update pro version to 1.1.22 --- packages/server/package.json | 2 +- packages/worker/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 8592fce11a..0db2214eeb 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -79,7 +79,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "^1.1.22", "@budibase/client": "^1.1.22", - "@budibase/pro": "1.1.21", + "@budibase/pro": "1.1.22", "@budibase/string-templates": "^1.1.22", "@budibase/types": "^1.1.22", "@bull-board/api": "3.7.0", diff --git a/packages/worker/package.json b/packages/worker/package.json index 84bde488b2..3e5b1bd567 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -36,7 +36,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^1.1.22", - "@budibase/pro": "1.1.21", + "@budibase/pro": "1.1.22", "@budibase/string-templates": "^1.1.22", "@budibase/types": "^1.1.22", "@koa/router": "8.0.8", From e504c6a37ce1e0436cdf942b9692d0f45f8fcd44 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 26 Jul 2022 11:19:28 +0100 Subject: [PATCH 12/26] Updating based on PR comments. --- .../pages/builder/portal/overview/[application]/index.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/src/pages/builder/portal/overview/[application]/index.svelte b/packages/builder/src/pages/builder/portal/overview/[application]/index.svelte index 2a5cdaf3bd..b2dac7682f 100644 --- a/packages/builder/src/pages/builder/portal/overview/[application]/index.svelte +++ b/packages/builder/src/pages/builder/portal/overview/[application]/index.svelte @@ -271,7 +271,7 @@ on:click={() => exportApp(selectedApp, { published: false })} icon="DownloadFromCloud" > - Export + Export latest {#if isPublished} Date: Tue, 26 Jul 2022 13:41:18 +0100 Subject: [PATCH 13/26] Update tooltip to use theme colour rather than static grey --- packages/bbui/src/Tooltip/Tooltip.svelte | 4 ++++ packages/frontend-core/src/themes/midnight.css | 0 2 files changed, 4 insertions(+) create mode 100644 packages/frontend-core/src/themes/midnight.css diff --git a/packages/bbui/src/Tooltip/Tooltip.svelte b/packages/bbui/src/Tooltip/Tooltip.svelte index 50a3242d1e..ea511b0060 100644 --- a/packages/bbui/src/Tooltip/Tooltip.svelte +++ b/packages/bbui/src/Tooltip/Tooltip.svelte @@ -26,5 +26,9 @@ diff --git a/packages/frontend-core/src/themes/midnight.css b/packages/frontend-core/src/themes/midnight.css new file mode 100644 index 0000000000..e69de29bb2 From 3aef4d8e4986db6374a6ca413114ae581efb1f44 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 26 Jul 2022 13:41:30 +0100 Subject: [PATCH 14/26] Don't load theme options from the store --- packages/builder/src/builderStore/store/theme.js | 5 ++--- packages/builder/src/main.js | 1 + .../builder/src/pages/builder/portal/settings/theming.svelte | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/builder/src/builderStore/store/theme.js b/packages/builder/src/builderStore/store/theme.js index 8ddbd7678a..54323ba55f 100644 --- a/packages/builder/src/builderStore/store/theme.js +++ b/packages/builder/src/builderStore/store/theme.js @@ -1,11 +1,10 @@ -import { createLocalStorageStore } from "@budibase/frontend-core" +import { Constants, createLocalStorageStore } from "@budibase/frontend-core" export const getThemeStore = () => { const themeElement = document.documentElement const initialValue = { theme: "darkest", - options: ["lightest", "light", "dark", "darkest", "nord"], } const store = createLocalStorageStore("bb-theme", initialValue) @@ -17,7 +16,7 @@ export const getThemeStore = () => { return } - state.options.forEach(option => { + Constants.ThemeOptions.forEach(option => { themeElement.classList.toggle( `spectrum--${option}`, option === state.theme diff --git a/packages/builder/src/main.js b/packages/builder/src/main.js index 8ab2c16ba2..dc1e1cf1bf 100644 --- a/packages/builder/src/main.js +++ b/packages/builder/src/main.js @@ -6,6 +6,7 @@ import "@spectrum-css/vars/dist/spectrum-dark.css" import "@spectrum-css/vars/dist/spectrum-light.css" import "@spectrum-css/vars/dist/spectrum-lightest.css" import "@budibase/frontend-core/src/themes/nord.css" +import "@budibase/frontend-core/src/themes/midnight.css" import "@spectrum-css/page/dist/index-vars.css" import "./global.css" import { suppressWarnings } from "./helpers/warnings" diff --git a/packages/builder/src/pages/builder/portal/settings/theming.svelte b/packages/builder/src/pages/builder/portal/settings/theming.svelte index 2a2aaa8a3b..2a8e82f0e5 100644 --- a/packages/builder/src/pages/builder/portal/settings/theming.svelte +++ b/packages/builder/src/pages/builder/portal/settings/theming.svelte @@ -2,6 +2,7 @@ import { Layout, Heading, Body, Divider, Label, Select } from "@budibase/bbui" import { themeStore } from "builderStore" import { capitalise } from "helpers" + import { Constants } from "@budibase/frontend-core" @@ -14,7 +15,7 @@