From 4093516a0db895c684e448ee9b4ae420b972dbb0 Mon Sep 17 00:00:00 2001 From: Dean Date: Thu, 27 Apr 2023 12:46:40 +0100 Subject: [PATCH 01/71] Initial commit of filter UX behaviour --- .../_components/BuilderSidePanel.svelte | 44 +++++++++++++++---- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte b/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte index 9a6d9ea1d3..b31488e492 100644 --- a/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte +++ b/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte @@ -28,6 +28,10 @@ let inviting = false let searchFocus = false + //Or searching = true? + let filtered = true + $: console.log("filtering enabled ", filtered) + let appInvites = [] let filteredInvites = [] let filteredUsers = [] @@ -52,15 +56,31 @@ } const filterInvites = async query => { - appInvites = await getInvites() - if (!query || query == "") { - filteredInvites = appInvites + if (!prodAppId) { return } - filteredInvites = appInvites.filter(invite => invite.email.includes(query)) + + appInvites = await getInvites() + + //On Focus behaviour + if (!filtered && (!query || query == "")) { + filteredInvites = [...appInvites] + return + } + + filteredInvites = appInvites.filter(invite => { + const inviteInfo = invite.info?.apps + if ((!query || query == "") && inviteInfo && prodAppId) { + return Object.keys(inviteInfo).includes(prodAppId) + } + return invite.email.includes(query) + }) } - $: filterInvites(query) + $: filtered, prodAppId, filterInvites(query) + $: if (searchFocus === true) { + filtered = false + } const usersFetch = fetchData({ API, @@ -351,7 +371,7 @@ onMount(() => { rendered = true - searchFocus = true + // searchFocus = true }) function handleKeyDown(evt) { @@ -417,7 +437,6 @@ autocomplete="off" disabled={inviting} value={query} - autofocus on:input={e => { query = e.target.value.trim() }} @@ -428,16 +447,20 @@ { + if (!filtered) { + filtered = true + } if (!query) { return } query = null userOnboardResponse = null + filtered = true }} > - + @@ -481,6 +504,8 @@
+ + +
{/each} From bb981603174bfc4f79b3e85b0bd703c1bb7965f9 Mon Sep 17 00:00:00 2001 From: Dean Date: Tue, 2 May 2023 14:35:15 +0100 Subject: [PATCH 02/71] On focus search behaviour renders to 100 invites, all groups and the first page of current users --- .../_components/BuilderSidePanel.svelte | 51 ++++++++++--------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte b/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte index b31488e492..7341dcd35c 100644 --- a/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte +++ b/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte @@ -28,9 +28,9 @@ let inviting = false let searchFocus = false - //Or searching = true? - let filtered = true - $: console.log("filtering enabled ", filtered) + // Initially filter entities without app access + // Show all when false + let filterByAppAccess = true let appInvites = [] let filteredInvites = [] @@ -38,7 +38,6 @@ let filteredGroups = [] let selectedGroup let userOnboardResponse = null - let userLimitReachedModal $: queryIsEmail = emailValidator(query) === true @@ -63,8 +62,9 @@ appInvites = await getInvites() //On Focus behaviour - if (!filtered && (!query || query == "")) { - filteredInvites = [...appInvites] + if (!filterByAppAccess && (!query || query == "")) { + filteredInvites = + appInvites.length > 100 ? appInvites.slice(0, 100) : [...appInvites] return } @@ -77,9 +77,9 @@ }) } - $: filtered, prodAppId, filterInvites(query) + $: filterByAppAccess, prodAppId, filterInvites(query) $: if (searchFocus === true) { - filtered = false + filterByAppAccess = false } const usersFetch = fetchData({ @@ -99,9 +99,9 @@ } await usersFetch.update({ query: { - appId: query ? null : prodAppId, + appId: query || !filterByAppAccess ? null : prodAppId, email: query, - paginated: query ? null : false, + paginated: query || !filterByAppAccess ? null : false, }, }) await usersFetch.refresh() @@ -127,7 +127,12 @@ } const debouncedUpdateFetch = Utils.debounce(searchUsers, 250) - $: debouncedUpdateFetch(query, $store.builderSidePanel, loaded) + $: debouncedUpdateFetch( + query, + $store.builderSidePanel, + loaded, + filterByAppAccess + ) const updateAppUser = async (user, role) => { if (!prodAppId) { @@ -202,9 +207,10 @@ } const searchGroups = (userGroups, query) => { - let filterGroups = query?.length - ? userGroups - : getAppGroups(userGroups, prodAppId) + let filterGroups = + query?.length || !filterByAppAccess + ? userGroups + : getAppGroups(userGroups, prodAppId) return filterGroups .filter(group => { if (!query?.length) { @@ -234,7 +240,7 @@ } // Adds the 'role' attribute and sets it to the current app. - $: enrichedGroups = getEnrichedGroups($groups) + $: enrichedGroups = getEnrichedGroups($groups, filterByAppAccess) $: filteredGroups = searchGroups(enrichedGroups, query) $: groupUsers = buildGroupUsers(filteredGroups, filteredUsers) $: allUsers = [...filteredUsers, ...groupUsers] @@ -246,7 +252,7 @@ specific roles for the app. */ const buildGroupUsers = (userGroups, filteredUsers) => { - if (query) { + if (query || !filterByAppAccess) { return [] } // Must exclude users who have explicit privileges @@ -371,7 +377,6 @@ onMount(() => { rendered = true - // searchFocus = true }) function handleKeyDown(evt) { @@ -447,20 +452,20 @@ { - if (!filtered) { - filtered = true + if (!filterByAppAccess) { + filterByAppAccess = true } if (!query) { return } query = null userOnboardResponse = null - filtered = true + filterByAppAccess = true }} > - + @@ -581,7 +586,7 @@ {#if filteredUsers?.length}
-
+
Users
Access
From 20885a708d56969502c4c4505f95a32f3c8eeabd Mon Sep 17 00:00:00 2001 From: Dean Date: Wed, 3 May 2023 12:23:21 +0100 Subject: [PATCH 03/71] Feedback updates --- .../_components/BuilderSidePanel.svelte | 40 ++++++------------- 1 file changed, 12 insertions(+), 28 deletions(-) diff --git a/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte b/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte index 7341dcd35c..5b35e65ed9 100644 --- a/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte +++ b/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte @@ -28,10 +28,6 @@ let inviting = false let searchFocus = false - // Initially filter entities without app access - // Show all when false - let filterByAppAccess = true - let appInvites = [] let filteredInvites = [] let filteredUsers = [] @@ -62,7 +58,7 @@ appInvites = await getInvites() //On Focus behaviour - if (!filterByAppAccess && (!query || query == "")) { + if (searchFocus && !query) { filteredInvites = appInvites.length > 100 ? appInvites.slice(0, 100) : [...appInvites] return @@ -77,10 +73,7 @@ }) } - $: filterByAppAccess, prodAppId, filterInvites(query) - $: if (searchFocus === true) { - filterByAppAccess = false - } + $: searchFocus, prodAppId, filterInvites(query) const usersFetch = fetchData({ API, @@ -99,9 +92,9 @@ } await usersFetch.update({ query: { - appId: query || !filterByAppAccess ? null : prodAppId, + appId: query || searchFocus ? null : prodAppId, email: query, - paginated: query || !filterByAppAccess ? null : false, + paginated: query || searchFocus ? null : false, }, }) await usersFetch.refresh() @@ -127,12 +120,7 @@ } const debouncedUpdateFetch = Utils.debounce(searchUsers, 250) - $: debouncedUpdateFetch( - query, - $store.builderSidePanel, - loaded, - filterByAppAccess - ) + $: debouncedUpdateFetch(query, $store.builderSidePanel, loaded, searchFocus) const updateAppUser = async (user, role) => { if (!prodAppId) { @@ -208,7 +196,7 @@ const searchGroups = (userGroups, query) => { let filterGroups = - query?.length || !filterByAppAccess + query?.length || searchFocus ? userGroups : getAppGroups(userGroups, prodAppId) return filterGroups @@ -240,7 +228,7 @@ } // Adds the 'role' attribute and sets it to the current app. - $: enrichedGroups = getEnrichedGroups($groups, filterByAppAccess) + $: enrichedGroups = getEnrichedGroups($groups, searchFocus) $: filteredGroups = searchGroups(enrichedGroups, query) $: groupUsers = buildGroupUsers(filteredGroups, filteredUsers) $: allUsers = [...filteredUsers, ...groupUsers] @@ -252,7 +240,7 @@ specific roles for the app. */ const buildGroupUsers = (userGroups, filteredUsers) => { - if (query || !filterByAppAccess) { + if (query || searchFocus) { return [] } // Must exclude users who have explicit privileges @@ -452,20 +440,19 @@ { - if (!filterByAppAccess) { - filterByAppAccess = true + if (searchFocus) { + searchFocus = false } if (!query) { return } query = null userOnboardResponse = null - filterByAppAccess = true }} > - +
@@ -509,8 +496,6 @@
- - -
{/each} From 98963c1505105f2aaf122a25695fe46803de23c5 Mon Sep 17 00:00:00 2001 From: Dean Date: Thu, 4 May 2023 11:21:24 +0100 Subject: [PATCH 04/71] Fix for inclusion parsing for arrays and options. View table fix to hide edit button --- .../components/backend/DataTable/Table.svelte | 2 ++ .../backend/DataTable/ViewDataTable.svelte | 1 + .../server/src/api/controllers/table/utils.ts | 16 ++++++++++------ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/builder/src/components/backend/DataTable/Table.svelte b/packages/builder/src/components/backend/DataTable/Table.svelte index 4df6e9a306..bf14bdfc0c 100644 --- a/packages/builder/src/components/backend/DataTable/Table.svelte +++ b/packages/builder/src/components/backend/DataTable/Table.svelte @@ -22,6 +22,7 @@ export let rowCount export let disableSorting = false export let customPlaceholder = false + export let allowEditing = true const dispatch = createEventDispatcher() @@ -109,6 +110,7 @@ {rowCount} {disableSorting} {customPlaceholder} + allowEditRows={allowEditing} showAutoColumns={!hideAutocolumns} on:clickrelationship={e => selectRelationship(e.detail)} on:sort diff --git a/packages/builder/src/components/backend/DataTable/ViewDataTable.svelte b/packages/builder/src/components/backend/DataTable/ViewDataTable.svelte index 056bc33994..d239cabd59 100644 --- a/packages/builder/src/components/backend/DataTable/ViewDataTable.svelte +++ b/packages/builder/src/components/backend/DataTable/ViewDataTable.svelte @@ -58,6 +58,7 @@ {loading} {type} rowCount={10} + allowEditing={false} bind:hideAutocolumns > diff --git a/packages/server/src/api/controllers/table/utils.ts b/packages/server/src/api/controllers/table/utils.ts index 1a3eda683b..e57da7ae2d 100644 --- a/packages/server/src/api/controllers/table/utils.ts +++ b/packages/server/src/api/controllers/table/utils.ts @@ -129,17 +129,21 @@ export function importToRows( // the real schema of the table passed in, not the clone used for // incrementing auto IDs for (const [fieldName, schema] of Object.entries(originalTable.schema)) { + const rowVal = Array.isArray(row[fieldName]) ? row[fieldName] : [row[fieldName]] if ( (schema.type === FieldTypes.OPTIONS || - schema.type === FieldTypes.ARRAY) && - row[fieldName] && - (!schema.constraints!.inclusion || - schema.constraints!.inclusion.indexOf(row[fieldName]) === -1) + schema.type === FieldTypes.ARRAY) && + row[fieldName] ) { - schema.constraints!.inclusion = [ + + let merged = [ ...schema.constraints!.inclusion!, - row[fieldName], + ...rowVal ] + + let superSet = new Set(merged); + schema.constraints!.inclusion = Array.from(superSet); + schema.constraints!.inclusion.sort() } } From f8da7a9f2853c2b40cd95c1b59595ba82a8d5225 Mon Sep 17 00:00:00 2001 From: Dean Date: Thu, 4 May 2023 12:12:47 +0100 Subject: [PATCH 05/71] Linting --- .../server/src/api/controllers/table/utils.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/packages/server/src/api/controllers/table/utils.ts b/packages/server/src/api/controllers/table/utils.ts index e57da7ae2d..5681095df7 100644 --- a/packages/server/src/api/controllers/table/utils.ts +++ b/packages/server/src/api/controllers/table/utils.ts @@ -129,20 +129,18 @@ export function importToRows( // the real schema of the table passed in, not the clone used for // incrementing auto IDs for (const [fieldName, schema] of Object.entries(originalTable.schema)) { - const rowVal = Array.isArray(row[fieldName]) ? row[fieldName] : [row[fieldName]] + const rowVal = Array.isArray(row[fieldName]) + ? row[fieldName] + : [row[fieldName]] if ( (schema.type === FieldTypes.OPTIONS || - schema.type === FieldTypes.ARRAY) && + schema.type === FieldTypes.ARRAY) && row[fieldName] ) { - - let merged = [ - ...schema.constraints!.inclusion!, - ...rowVal - ] - - let superSet = new Set(merged); - schema.constraints!.inclusion = Array.from(superSet); + let merged = [...schema.constraints!.inclusion!, ...rowVal] + + let superSet = new Set(merged) + schema.constraints!.inclusion = Array.from(superSet) schema.constraints!.inclusion.sort() } From 5cf0e57eec977074c1c7e804b56d85ad2465f405 Mon Sep 17 00:00:00 2001 From: Dean Date: Thu, 4 May 2023 16:01:34 +0100 Subject: [PATCH 06/71] Feedback updates and a fix pass the current query after updating a user invite --- .../_components/BuilderSidePanel.svelte | 43 ++++++++++++------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte b/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte index 5b35e65ed9..9dce1fdf9b 100644 --- a/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte +++ b/packages/builder/src/pages/builder/app/[application]/_components/BuilderSidePanel.svelte @@ -28,6 +28,10 @@ let inviting = false let searchFocus = false + // Initially filter entities without app access + // Show all when false + let filterByAppAccess = true + let appInvites = [] let filteredInvites = [] let filteredUsers = [] @@ -58,7 +62,7 @@ appInvites = await getInvites() //On Focus behaviour - if (searchFocus && !query) { + if (!filterByAppAccess && !query) { filteredInvites = appInvites.length > 100 ? appInvites.slice(0, 100) : [...appInvites] return @@ -66,14 +70,17 @@ filteredInvites = appInvites.filter(invite => { const inviteInfo = invite.info?.apps - if ((!query || query == "") && inviteInfo && prodAppId) { + if (!query && inviteInfo && prodAppId) { return Object.keys(inviteInfo).includes(prodAppId) } return invite.email.includes(query) }) } - $: searchFocus, prodAppId, filterInvites(query) + $: filterByAppAccess, prodAppId, filterInvites(query) + $: if (searchFocus === true) { + filterByAppAccess = false + } const usersFetch = fetchData({ API, @@ -92,9 +99,9 @@ } await usersFetch.update({ query: { - appId: query || searchFocus ? null : prodAppId, + appId: query || !filterByAppAccess ? null : prodAppId, email: query, - paginated: query || searchFocus ? null : false, + paginated: query || !filterByAppAccess ? null : false, }, }) await usersFetch.refresh() @@ -120,7 +127,12 @@ } const debouncedUpdateFetch = Utils.debounce(searchUsers, 250) - $: debouncedUpdateFetch(query, $store.builderSidePanel, loaded, searchFocus) + $: debouncedUpdateFetch( + query, + $store.builderSidePanel, + loaded, + filterByAppAccess + ) const updateAppUser = async (user, role) => { if (!prodAppId) { @@ -196,7 +208,7 @@ const searchGroups = (userGroups, query) => { let filterGroups = - query?.length || searchFocus + query?.length || !filterByAppAccess ? userGroups : getAppGroups(userGroups, prodAppId) return filterGroups @@ -228,7 +240,7 @@ } // Adds the 'role' attribute and sets it to the current app. - $: enrichedGroups = getEnrichedGroups($groups, searchFocus) + $: enrichedGroups = getEnrichedGroups($groups, filterByAppAccess) $: filteredGroups = searchGroups(enrichedGroups, query) $: groupUsers = buildGroupUsers(filteredGroups, filteredUsers) $: allUsers = [...filteredUsers, ...groupUsers] @@ -240,7 +252,7 @@ specific roles for the app. */ const buildGroupUsers = (userGroups, filteredUsers) => { - if (query || searchFocus) { + if (query || !filterByAppAccess) { return [] } // Must exclude users who have explicit privileges @@ -335,12 +347,12 @@ [prodAppId]: role, }, }) - await filterInvites() + await filterInvites(query) } const onUninviteAppUser = async invite => { await uninviteAppUser(invite) - await filterInvites() + await filterInvites(query) } // Purge only the app from the invite or recind the invite if only 1 app remains? @@ -440,19 +452,20 @@ { - if (searchFocus) { - searchFocus = false + if (!filterByAppAccess) { + filterByAppAccess = true } if (!query) { return } query = null userOnboardResponse = null + filterByAppAccess = true }} > - + From 0aeb06bb2b4da2eaaa97b24bab712eb05fad63d1 Mon Sep 17 00:00:00 2001 From: Dean Date: Fri, 5 May 2023 13:39:59 +0100 Subject: [PATCH 07/71] Merge commit --- packages/server/src/api/controllers/table/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/server/src/api/controllers/table/index.ts b/packages/server/src/api/controllers/table/index.ts index bc967a90f4..8e248d57ea 100644 --- a/packages/server/src/api/controllers/table/index.ts +++ b/packages/server/src/api/controllers/table/index.ts @@ -97,6 +97,9 @@ export async function bulkImport(ctx: UserCtx) { // right now we don't trigger anything for bulk import because it // can only be done in the builder, but in the future we may need to // think about events for bulk items + + //const resp = pickApi({ tableId }).save(ctx) + ctx.status = 200 ctx.body = { message: `Bulk rows created.` } } From b387f969d92c7e60cb0902124c56d8591b3f7155 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 8 May 2023 15:59:12 +0100 Subject: [PATCH 08/71] allow passwordless redis --- packages/backend-core/src/environment.ts | 2 +- packages/server/src/api/routes/public/index.ts | 9 ++++++--- yarn.lock | 12 ++++++------ 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/packages/backend-core/src/environment.ts b/packages/backend-core/src/environment.ts index 155f09e6d9..72cd1a4af0 100644 --- a/packages/backend-core/src/environment.ts +++ b/packages/backend-core/src/environment.ts @@ -95,7 +95,7 @@ const environment = { GOOGLE_CLIENT_SECRET: process.env.GOOGLE_CLIENT_SECRET, SALT_ROUNDS: process.env.SALT_ROUNDS, REDIS_URL: process.env.REDIS_URL || "localhost:6379", - REDIS_PASSWORD: process.env.REDIS_PASSWORD || "budibase", + REDIS_PASSWORD: process.env.REDIS_PASSWORD, REDIS_CLUSTERED: process.env.REDIS_CLUSTERED, MOCK_REDIS: process.env.MOCK_REDIS, MINIO_ACCESS_KEY: process.env.MINIO_ACCESS_KEY, diff --git a/packages/server/src/api/routes/public/index.ts b/packages/server/src/api/routes/public/index.ts index bed798f75b..287f6c11de 100644 --- a/packages/server/src/api/routes/public/index.ts +++ b/packages/server/src/api/routes/public/index.ts @@ -42,13 +42,16 @@ if (!env.isTest()) { host: REDIS_OPTS.host, port: REDIS_OPTS.port, }, - password: - REDIS_OPTS.opts.password || REDIS_OPTS.opts.redisOptions.password, + } + + if (REDIS_OPTS.opts?.password || REDIS_OPTS.opts.redisOptions?.password) { + // @ts-ignore + options.password = REDIS_OPTS.opts.password || REDIS_OPTS.opts.redisOptions.password } if (!env.REDIS_CLUSTERED) { - // Can't set direct redis db in clustered env // @ts-ignore + // Can't set direct redis db in clustered env options.database = 1 } } diff --git a/yarn.lock b/yarn.lock index d293366bb3..4b2bab4ec2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1486,15 +1486,15 @@ pouchdb-promise "^6.0.4" through2 "^2.0.0" -"@budibase/pro@2.6.6": - version "2.6.6" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.6.6.tgz#337027168d17a44717c2648b3209a0e2daddcf7d" - integrity sha512-RldUn/WjN7eaYRxL4KBufK1yhVIycJOzoncD+BPgRKstuuuYzPultGZcpNsQQiJkAhNR6QXhG+ovvCUiA+AX6g== +"@budibase/pro@2.6.7": + version "2.6.7" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.6.7.tgz#884b33f3a3e3f2e548fd7519d32b40dc98803400" + integrity sha512-f7g+0So7hr7tHHEF28cz550imYpq/CqRNzhMQpUwmzgbdTlOdVej3PWPNK9+MuBlNea3J9b2WQsjS9TkGZfTlA== dependencies: - "@budibase/backend-core" "2.6.6" + "@budibase/backend-core" "2.6.7" "@budibase/shared-core" "2.5.9" "@budibase/string-templates" "2.5.9" - "@budibase/types" "2.6.6" + "@budibase/types" "2.6.7" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" From eb37dacc733642a4b59bdfaafde5abfeeb01ef94 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 8 May 2023 16:23:49 +0100 Subject: [PATCH 09/71] lint --- packages/server/src/api/routes/public/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/server/src/api/routes/public/index.ts b/packages/server/src/api/routes/public/index.ts index 287f6c11de..6852778e68 100644 --- a/packages/server/src/api/routes/public/index.ts +++ b/packages/server/src/api/routes/public/index.ts @@ -46,7 +46,8 @@ if (!env.isTest()) { if (REDIS_OPTS.opts?.password || REDIS_OPTS.opts.redisOptions?.password) { // @ts-ignore - options.password = REDIS_OPTS.opts.password || REDIS_OPTS.opts.redisOptions.password + options.password = + REDIS_OPTS.opts.password || REDIS_OPTS.opts.redisOptions.password } if (!env.REDIS_CLUSTERED) { From 86f0cd8353aefc899f8acdf5f961cd9f6c8315b7 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 8 May 2023 15:52:34 +0000 Subject: [PATCH 10/71] v2.6.8 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 6 +++--- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 8 ++++---- packages/client/package.json | 12 ++++++------ packages/frontend-core/package.json | 6 +++--- packages/sdk/package.json | 2 +- packages/server/package.json | 12 ++++++------ packages/shared-core/package.json | 4 ++-- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 13 files changed, 39 insertions(+), 39 deletions(-) diff --git a/lerna.json b/lerna.json index 85c77624b8..202e1c6f49 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.6.7", + "version": "2.6.8", "npmClient": "yarn", "useWorkspaces": true, "packages": ["packages/*"], diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 4e186dd705..03dae9feca 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "2.6.7", + "version": "2.6.8", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -24,7 +24,7 @@ "dependencies": { "@budibase/nano": "10.1.2", "@budibase/pouchdb-replication-stream": "1.2.10", - "@budibase/types": "^2.6.7", + "@budibase/types": "^2.6.8", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-cloudfront-sign": "2.2.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 23a145e7c5..f0fe559705 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": "2.6.7", + "version": "2.6.8", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,8 +38,8 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "1.2.1", - "@budibase/shared-core": "^2.6.7", - "@budibase/string-templates": "^2.6.7", + "@budibase/shared-core": "^2.6.8", + "@budibase/string-templates": "^2.6.8", "@spectrum-css/accordion": "3.0.24", "@spectrum-css/actionbutton": "1.0.1", "@spectrum-css/actiongroup": "1.0.1", diff --git a/packages/builder/package.json b/packages/builder/package.json index b32d660471..1b69c7aaac 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "2.6.7", + "version": "2.6.8", "license": "GPL-3.0", "private": true, "scripts": { @@ -58,10 +58,10 @@ } }, "dependencies": { - "@budibase/bbui": "^2.6.7", - "@budibase/frontend-core": "^2.6.7", - "@budibase/shared-core": "^2.6.7", - "@budibase/string-templates": "^2.6.7", + "@budibase/bbui": "^2.6.8", + "@budibase/frontend-core": "^2.6.8", + "@budibase/shared-core": "^2.6.8", + "@budibase/string-templates": "^2.6.8", "@fortawesome/fontawesome-svg-core": "^6.2.1", "@fortawesome/free-brands-svg-icons": "^6.2.1", "@fortawesome/free-solid-svg-icons": "^6.2.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index c80530f716..a28c66fe65 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "2.6.7", + "version": "2.6.8", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "dist/index.js", "bin": { @@ -29,9 +29,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "^2.6.7", - "@budibase/string-templates": "^2.6.7", - "@budibase/types": "^2.6.7", + "@budibase/backend-core": "^2.6.8", + "@budibase/string-templates": "^2.6.8", + "@budibase/types": "^2.6.8", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index c4d3c1b13b..46f365de5d 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "2.6.7", + "version": "2.6.8", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,11 +19,11 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^2.6.7", - "@budibase/frontend-core": "^2.6.7", - "@budibase/shared-core": "^2.6.7", - "@budibase/string-templates": "^2.6.7", - "@budibase/types": "^2.6.7", + "@budibase/bbui": "^2.6.8", + "@budibase/frontend-core": "^2.6.8", + "@budibase/shared-core": "^2.6.8", + "@budibase/string-templates": "^2.6.8", + "@budibase/types": "^2.6.8", "@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 6d917cb863..e701687d10 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,13 +1,13 @@ { "name": "@budibase/frontend-core", - "version": "2.6.7", + "version": "2.6.8", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^2.6.7", - "@budibase/shared-core": "^2.6.7", + "@budibase/bbui": "^2.6.8", + "@budibase/shared-core": "^2.6.8", "dayjs": "^1.11.7", "lodash": "^4.17.21", "socket.io-client": "^4.6.1", diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 3df72d79fb..5b528a145a 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/sdk", - "version": "2.6.7", + "version": "2.6.8", "description": "Budibase Public API SDK", "author": "Budibase", "license": "MPL-2.0", diff --git a/packages/server/package.json b/packages/server/package.json index a8c04bf14e..4e47134947 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "2.6.7", + "version": "2.6.8", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -45,12 +45,12 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "^2.6.7", - "@budibase/client": "^2.6.7", + "@budibase/backend-core": "^2.6.8", + "@budibase/client": "^2.6.8", "@budibase/pro": "2.6.7", - "@budibase/shared-core": "^2.6.7", - "@budibase/string-templates": "^2.6.7", - "@budibase/types": "^2.6.7", + "@budibase/shared-core": "^2.6.8", + "@budibase/string-templates": "^2.6.8", + "@budibase/types": "^2.6.8", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/shared-core/package.json b/packages/shared-core/package.json index e1e4a01f52..68d9824126 100644 --- a/packages/shared-core/package.json +++ b/packages/shared-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/shared-core", - "version": "2.6.7", + "version": "2.6.8", "description": "Shared data utils", "main": "dist/cjs/src/index.js", "types": "dist/mjs/src/index.d.ts", @@ -20,7 +20,7 @@ "dev:builder": "yarn prebuild && concurrently \"tsc -p tsconfig.build.json --watch\" \"tsc -p tsconfig-cjs.build.json --watch\"" }, "dependencies": { - "@budibase/types": "^2.6.7" + "@budibase/types": "^2.6.8" }, "devDependencies": { "concurrently": "^7.6.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index a02d13b3b6..105cb98472 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "2.6.7", + "version": "2.6.8", "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 a39114a76d..1e8e46c44d 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "2.6.7", + "version": "2.6.8", "description": "Budibase types", "main": "dist/cjs/index.js", "types": "dist/mjs/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index 59e7f18d76..6e44e82649 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "2.6.7", + "version": "2.6.8", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -37,10 +37,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^2.6.7", + "@budibase/backend-core": "^2.6.8", "@budibase/pro": "2.6.7", - "@budibase/string-templates": "^2.6.7", - "@budibase/types": "^2.6.7", + "@budibase/string-templates": "^2.6.8", + "@budibase/types": "^2.6.8", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From bd13a2d186819e4159b076c92e23b9852a5e49db Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Mon, 8 May 2023 15:54:09 +0000 Subject: [PATCH 11/71] Update pro version to 2.6.8 --- 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 4e47134947..7be437535e 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -47,7 +47,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "^2.6.8", "@budibase/client": "^2.6.8", - "@budibase/pro": "2.6.7", + "@budibase/pro": "2.6.8", "@budibase/shared-core": "^2.6.8", "@budibase/string-templates": "^2.6.8", "@budibase/types": "^2.6.8", diff --git a/packages/worker/package.json b/packages/worker/package.json index 6e44e82649..ebbe5d62bd 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -38,7 +38,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^2.6.8", - "@budibase/pro": "2.6.7", + "@budibase/pro": "2.6.8", "@budibase/string-templates": "^2.6.8", "@budibase/types": "^2.6.8", "@koa/router": "8.0.8", From bbf271961f95cf1d7997eb9d13bb84a8a4d00b23 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Tue, 9 May 2023 11:48:49 +0100 Subject: [PATCH 12/71] adding healthcheck to proxy service --- hosting/proxy/nginx.prod.conf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hosting/proxy/nginx.prod.conf b/hosting/proxy/nginx.prod.conf index dce1a71918..1a4415395b 100644 --- a/hosting/proxy/nginx.prod.conf +++ b/hosting/proxy/nginx.prod.conf @@ -82,6 +82,12 @@ http { set $couchdb ${COUCHDB_UPSTREAM_URL}; set $watchtower ${WATCHTOWER_UPSTREAM_URL}; + location /health { + access_log off; + add_header 'Content-Type' 'application/json'; + return 200 '{ "status": "OK" }'; + } + location /app { proxy_pass $apps; } From d33a06c89c810e0348e44d71084c39a8aa73901a Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 8 May 2023 14:54:43 +0200 Subject: [PATCH 13/71] Send search term to api call --- .../groups/_components/GroupUsers.svelte | 21 +++++++++++++++++-- packages/frontend-core/src/api/groups.js | 7 +++++-- .../frontend-core/src/fetch/GroupUserFetch.js | 1 + 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/packages/builder/src/pages/builder/portal/users/groups/_components/GroupUsers.svelte b/packages/builder/src/pages/builder/portal/users/groups/_components/GroupUsers.svelte index 9c18008e44..fbc3dd5ac1 100644 --- a/packages/builder/src/pages/builder/portal/users/groups/_components/GroupUsers.svelte +++ b/packages/builder/src/pages/builder/portal/users/groups/_components/GroupUsers.svelte @@ -1,7 +1,7 @@
- Users {#if !scimEnabled} {:else} {/if} -
-
- +
+ +
Date: Thu, 11 May 2023 08:20:52 +0200 Subject: [PATCH 28/71] Adds account locking if user limit is exceeded --- .../licensing/AccountLockedModal.svelte | 31 +++++++++++++++++++ .../portal/licensing/licensingBanners.js | 15 +++------ .../src/components/start/AppRow.svelte | 11 +++++-- .../src/pages/builder/apps/index.svelte | 2 +- .../pages/builder/portal/apps/index.svelte | 28 ++++++++++++++--- .../users/_components/AddUserModal.svelte | 4 +-- .../users/_components/ImportUsersModal.svelte | 6 ++-- .../builder/portal/users/users/index.svelte | 12 +++---- .../builder/src/stores/portal/licensing.js | 22 ++++++------- 9 files changed, 89 insertions(+), 42 deletions(-) create mode 100644 packages/builder/src/components/portal/licensing/AccountLockedModal.svelte diff --git a/packages/builder/src/components/portal/licensing/AccountLockedModal.svelte b/packages/builder/src/components/portal/licensing/AccountLockedModal.svelte new file mode 100644 index 0000000000..63bb6dcfd9 --- /dev/null +++ b/packages/builder/src/components/portal/licensing/AccountLockedModal.svelte @@ -0,0 +1,31 @@ + + + + + Due to the free plan user limit being exceeded, your account has been + de-activated. Upgrade your plan to re-activate your account. + + diff --git a/packages/builder/src/components/portal/licensing/licensingBanners.js b/packages/builder/src/components/portal/licensing/licensingBanners.js index dafa8cfaed..ea4a1bb946 100644 --- a/packages/builder/src/components/portal/licensing/licensingBanners.js +++ b/packages/builder/src/components/portal/licensing/licensingBanners.js @@ -3,7 +3,6 @@ import { temporalStore } from "builderStore" import { admin, auth, licensing } from "stores/portal" import { get } from "svelte/store" import { BANNER_TYPES } from "@budibase/bbui" -import { capitalise } from "helpers" const oneDayInSeconds = 86400 @@ -146,23 +145,19 @@ const buildUsersAboveLimitBanner = EXPIRY_KEY => { const userLicensing = get(licensing) return { key: EXPIRY_KEY, - type: BANNER_TYPES.WARNING, + type: BANNER_TYPES.NEGATIVE, onChange: () => { defaultCacheFn(EXPIRY_KEY) }, criteria: () => { - return userLicensing.warnUserLimit + return userLicensing.errUserLimit }, - message: `${capitalise( - userLicensing.license.plan.type - )} plan changes - Users will be limited to ${ - userLicensing.userLimit - } users in ${userLicensing.userLimitDays}`, + message: "Your Budibase account is de-activated. Upgrade your plan", ...{ - extraButtonText: "Find out more", + extraButtonText: "View plans", extraButtonAction: () => { defaultCacheFn(ExpiringKeys.LICENSING_USERS_ABOVE_LIMIT_BANNER) - window.location.href = "/builder/portal/users/users" + window.location.href = "https://budibase.com/pricing/" }, }, showCloseButton: true, diff --git a/packages/builder/src/components/start/AppRow.svelte b/packages/builder/src/components/start/AppRow.svelte index 34d083a096..194f897fdc 100644 --- a/packages/builder/src/components/start/AppRow.svelte +++ b/packages/builder/src/components/start/AppRow.svelte @@ -6,6 +6,8 @@ export let app + export let lockedAction + const handleDefaultClick = () => { if (window.innerWidth < 640) { goToOverview() @@ -29,7 +31,7 @@ } -
+
@@ -58,8 +60,11 @@
- - + +
diff --git a/packages/builder/src/pages/builder/apps/index.svelte b/packages/builder/src/pages/builder/apps/index.svelte index 23f4df5bb5..4b77671345 100644 --- a/packages/builder/src/pages/builder/apps/index.svelte +++ b/packages/builder/src/pages/builder/apps/index.svelte @@ -133,7 +133,7 @@ - {#if $licensing.usageMetrics?.dayPasses >= 100} + {#if $licensing.usageMetrics?.dayPasses >= 100 || $licensing.errUserLimit}
spaceman diff --git a/packages/builder/src/pages/builder/portal/apps/index.svelte b/packages/builder/src/pages/builder/portal/apps/index.svelte index 783cac49d7..edd308f382 100644 --- a/packages/builder/src/pages/builder/portal/apps/index.svelte +++ b/packages/builder/src/pages/builder/portal/apps/index.svelte @@ -14,6 +14,7 @@ import Spinner from "components/common/Spinner.svelte" import CreateAppModal from "components/start/CreateAppModal.svelte" import AppLimitModal from "components/portal/licensing/AppLimitModal.svelte" + import AccountLockedModal from "components/portal/licensing/AccountLockedModal.svelte" import { store, automationStore } from "builderStore" import { API } from "api" @@ -28,6 +29,7 @@ let template let creationModal let appLimitModal + let accountLockedModal let creatingApp = false let searchTerm = "" let creatingFromTemplate = false @@ -49,6 +51,10 @@ ) $: automationErrors = getAutomationErrors(enrichedApps) + const usersLimitLockAction = $licensing?.errUserLimit + ? () => accountLockedModal.show() + : null + const enrichApps = (apps, user, sortBy) => { const enrichedApps = apps.map(app => ({ ...app, @@ -189,6 +195,9 @@ creatingFromTemplate = true createAppFromTemplateUrl(initInfo.init_template) } + if (usersLimitLockAction) { + usersLimitLockAction() + } } catch (error) { notifications.error("Error getting init info") } @@ -230,20 +239,30 @@
- {#if $apps?.length > 0} {/if} {#if !$apps?.length} - {/if} @@ -267,7 +286,7 @@
{#each filteredApps as app (app.appId)} - + {/each}
@@ -294,6 +313,7 @@ +