diff --git a/.eslintrc.json b/.eslintrc.json index a94ea87704..4e6a169dae 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -27,9 +27,8 @@ "extends": "plugin:svelte/recommended", "parser": "svelte-eslint-parser", "parserOptions": { - "parser": "@babel/eslint-parser", + "parser": "@typescript-eslint/parser", "ecmaVersion": 2019, - "sourceType": "module", "allowImportExportEverywhere": true } }, diff --git a/.github/workflows/readme-openapi.yml b/.github/workflows/readme-openapi.yml new file mode 100644 index 0000000000..14e9887dd6 --- /dev/null +++ b/.github/workflows/readme-openapi.yml @@ -0,0 +1,28 @@ +name: ReadMe GitHub Action 🦉 + +on: + push: + branches: + - master + +jobs: + rdme-openapi: + runs-on: ubuntu-latest + steps: + - name: Check out repo + uses: actions/checkout@v3 + + - name: Use Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: 20.x + cache: yarn + - run: yarn --frozen-lockfile + + - name: update specs + run: cd packages/server && yarn specs + + - name: Run `openapi` command + uses: readmeio/rdme@v8 + with: + rdme: openapi specs/openapi.yaml --key=${{ secrets.README_API_KEY }} --id=6728a74f5918b50036c61841 diff --git a/charts/budibase/templates/secrets.yaml b/charts/budibase/templates/secrets.yaml index a44d2c0d9b..20701d4125 100644 --- a/charts/budibase/templates/secrets.yaml +++ b/charts/budibase/templates/secrets.yaml @@ -12,12 +12,12 @@ metadata: type: Opaque data: {{- if $existingSecret }} - internalApiKey: {{ index $existingSecret.data "internalApiKey" }} - jwtSecret: {{ index $existingSecret.data "jwtSecret" }} - objectStoreAccess: {{ index $existingSecret.data "objectStoreAccess" }} - objectStoreSecret: {{ index $existingSecret.data "objectStoreSecret" }} - bbEncryptionKey: {{ index $existingSecret.data "bbEncryptionKey" }} - apiEncryptionKey: {{ index $existingSecret.data "apiEncryptionKey" }} + internalApiKey: {{ index $existingSecret.data "internalApiKey" | quote }} + jwtSecret: {{ index $existingSecret.data "jwtSecret" | quote }} + objectStoreAccess: {{ index $existingSecret.data "objectStoreAccess" | quote }} + objectStoreSecret: {{ index $existingSecret.data "objectStoreSecret" | quote }} + bbEncryptionKey: {{ index $existingSecret.data "bbEncryptionKey" | quote }} + apiEncryptionKey: {{ index $existingSecret.data "apiEncryptionKey" | quote }} {{- else }} internalApiKey: {{ template "budibase.defaultsecret" .Values.globals.internalApiKey }} jwtSecret: {{ template "budibase.defaultsecret" .Values.globals.jwtSecret }} diff --git a/lerna.json b/lerna.json index a1006702cc..be6673e7ae 100644 --- a/lerna.json +++ b/lerna.json @@ -1,6 +1,6 @@ { "$schema": "node_modules/lerna/schemas/lerna-schema.json", - "version": "3.2.11", + "version": "3.2.14", "npmClient": "yarn", "concurrency": 20, "command": { diff --git a/package.json b/package.json index 860447fc57..e354f36d2a 100644 --- a/package.json +++ b/package.json @@ -25,11 +25,12 @@ "prettier": "2.8.8", "prettier-plugin-svelte": "^2.3.0", "proper-lockfile": "^4.1.2", - "svelte": "^4.2.10", + "svelte": "4.2.19", "svelte-eslint-parser": "^0.33.1", "typescript": "5.5.2", "typescript-eslint": "^7.3.1", - "yargs": "^17.7.2" + "yargs": "^17.7.2", + "cross-spawn": "7.0.6" }, "scripts": { "get-past-client-version": "node scripts/getPastClientVersion.js", diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 8f91d1e55d..a4381b4200 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -40,7 +40,7 @@ "bcryptjs": "2.4.3", "bull": "4.10.1", "correlation-id": "4.0.0", - "dd-trace": "5.23.0", + "dd-trace": "5.26.0", "dotenv": "16.0.1", "google-auth-library": "^8.0.1", "google-spreadsheet": "npm:@budibase/google-spreadsheet@4.1.5", diff --git a/packages/backend-core/src/db/couch/DatabaseImpl.ts b/packages/backend-core/src/db/couch/DatabaseImpl.ts index 83b9b69d0b..371f3dc997 100644 --- a/packages/backend-core/src/db/couch/DatabaseImpl.ts +++ b/packages/backend-core/src/db/couch/DatabaseImpl.ts @@ -190,7 +190,7 @@ export class DatabaseImpl implements Database { } } - private async performCall(call: DBCallback): Promise { + private async performCall(call: DBCallback): Promise { const db = this.getDb() const fnc = await call(db) try { @@ -467,7 +467,7 @@ export class DatabaseImpl implements Database { } catch (err: any) { // didn't exist, don't worry if (err.statusCode === 404) { - return + return { ok: true } } else { throw new CouchDBError(err.message, err) } diff --git a/packages/backend-core/src/db/instrumentation.ts b/packages/backend-core/src/db/instrumentation.ts index e08bfc0362..0c0056d6ed 100644 --- a/packages/backend-core/src/db/instrumentation.ts +++ b/packages/backend-core/src/db/instrumentation.ts @@ -27,7 +27,7 @@ export class DDInstrumentedDatabase implements Database { exists(docId?: string): Promise { return tracer.trace("db.exists", span => { - span?.addTags({ db_name: this.name, doc_id: docId }) + span.addTags({ db_name: this.name, doc_id: docId }) if (docId) { return this.db.exists(docId) } @@ -37,15 +37,17 @@ export class DDInstrumentedDatabase implements Database { get(id?: string | undefined): Promise { return tracer.trace("db.get", span => { - span?.addTags({ db_name: this.name, doc_id: id }) + span.addTags({ db_name: this.name, doc_id: id }) return this.db.get(id) }) } tryGet(id?: string | undefined): Promise { - return tracer.trace("db.tryGet", span => { - span?.addTags({ db_name: this.name, doc_id: id }) - return this.db.tryGet(id) + return tracer.trace("db.tryGet", async span => { + span.addTags({ db_name: this.name, doc_id: id }) + const doc = await this.db.tryGet(id) + span.addTags({ doc_found: doc !== undefined }) + return doc }) } @@ -53,13 +55,15 @@ export class DDInstrumentedDatabase implements Database { ids: string[], opts?: { allowMissing?: boolean | undefined } | undefined ): Promise { - return tracer.trace("db.getMultiple", span => { - span?.addTags({ + return tracer.trace("db.getMultiple", async span => { + span.addTags({ db_name: this.name, num_docs: ids.length, allow_missing: opts?.allowMissing, }) - return this.db.getMultiple(ids, opts) + const docs = await this.db.getMultiple(ids, opts) + span.addTags({ num_docs_found: docs.length }) + return docs }) } @@ -69,12 +73,14 @@ export class DDInstrumentedDatabase implements Database { idOrDoc: string | Document, rev?: string ): Promise { - return tracer.trace("db.remove", span => { - span?.addTags({ db_name: this.name, doc_id: idOrDoc }) + return tracer.trace("db.remove", async span => { + span.addTags({ db_name: this.name, doc_id: idOrDoc, rev }) const isDocument = typeof idOrDoc === "object" const id = isDocument ? idOrDoc._id! : idOrDoc rev = isDocument ? idOrDoc._rev : rev - return this.db.remove(id, rev) + const resp = await this.db.remove(id, rev) + span.addTags({ ok: resp.ok }) + return resp }) } @@ -83,7 +89,11 @@ export class DDInstrumentedDatabase implements Database { opts?: { silenceErrors?: boolean } ): Promise { return tracer.trace("db.bulkRemove", span => { - span?.addTags({ db_name: this.name, num_docs: documents.length }) + span.addTags({ + db_name: this.name, + num_docs: documents.length, + silence_errors: opts?.silenceErrors, + }) return this.db.bulkRemove(documents, opts) }) } @@ -92,15 +102,21 @@ export class DDInstrumentedDatabase implements Database { document: AnyDocument, opts?: DatabasePutOpts | undefined ): Promise { - return tracer.trace("db.put", span => { - span?.addTags({ db_name: this.name, doc_id: document._id }) - return this.db.put(document, opts) + return tracer.trace("db.put", async span => { + span.addTags({ + db_name: this.name, + doc_id: document._id, + force: opts?.force, + }) + const resp = await this.db.put(document, opts) + span.addTags({ ok: resp.ok }) + return resp }) } bulkDocs(documents: AnyDocument[]): Promise { return tracer.trace("db.bulkDocs", span => { - span?.addTags({ db_name: this.name, num_docs: documents.length }) + span.addTags({ db_name: this.name, num_docs: documents.length }) return this.db.bulkDocs(documents) }) } @@ -108,9 +124,15 @@ export class DDInstrumentedDatabase implements Database { allDocs( params: DatabaseQueryOpts ): Promise> { - return tracer.trace("db.allDocs", span => { - span?.addTags({ db_name: this.name }) - return this.db.allDocs(params) + return tracer.trace("db.allDocs", async span => { + span.addTags({ db_name: this.name, ...params }) + const resp = await this.db.allDocs(params) + span.addTags({ + total_rows: resp.total_rows, + rows_length: resp.rows.length, + offset: resp.offset, + }) + return resp }) } @@ -118,57 +140,75 @@ export class DDInstrumentedDatabase implements Database { viewName: string, params: DatabaseQueryOpts ): Promise> { - return tracer.trace("db.query", span => { - span?.addTags({ db_name: this.name, view_name: viewName }) - return this.db.query(viewName, params) + return tracer.trace("db.query", async span => { + span.addTags({ db_name: this.name, view_name: viewName, ...params }) + const resp = await this.db.query(viewName, params) + span.addTags({ + total_rows: resp.total_rows, + rows_length: resp.rows.length, + offset: resp.offset, + }) + return resp }) } - destroy(): Promise { - return tracer.trace("db.destroy", span => { - span?.addTags({ db_name: this.name }) - return this.db.destroy() + destroy(): Promise { + return tracer.trace("db.destroy", async span => { + span.addTags({ db_name: this.name }) + const resp = await this.db.destroy() + span.addTags({ ok: resp.ok }) + return resp }) } - compact(): Promise { - return tracer.trace("db.compact", span => { - span?.addTags({ db_name: this.name }) - return this.db.compact() + compact(): Promise { + return tracer.trace("db.compact", async span => { + span.addTags({ db_name: this.name }) + const resp = await this.db.compact() + span.addTags({ ok: resp.ok }) + return resp }) } dump(stream: Writable, opts?: DatabaseDumpOpts | undefined): Promise { return tracer.trace("db.dump", span => { - span?.addTags({ db_name: this.name }) + span.addTags({ + db_name: this.name, + batch_limit: opts?.batch_limit, + batch_size: opts?.batch_size, + style: opts?.style, + timeout: opts?.timeout, + num_doc_ids: opts?.doc_ids?.length, + view: opts?.view, + }) return this.db.dump(stream, opts) }) } load(...args: any[]): Promise { return tracer.trace("db.load", span => { - span?.addTags({ db_name: this.name }) + span.addTags({ db_name: this.name, num_args: args.length }) return this.db.load(...args) }) } createIndex(...args: any[]): Promise { return tracer.trace("db.createIndex", span => { - span?.addTags({ db_name: this.name }) + span.addTags({ db_name: this.name, num_args: args.length }) return this.db.createIndex(...args) }) } deleteIndex(...args: any[]): Promise { return tracer.trace("db.deleteIndex", span => { - span?.addTags({ db_name: this.name }) + span.addTags({ db_name: this.name, num_args: args.length }) return this.db.deleteIndex(...args) }) } getIndexes(...args: any[]): Promise { return tracer.trace("db.getIndexes", span => { - span?.addTags({ db_name: this.name }) + span.addTags({ db_name: this.name, num_args: args.length }) return this.db.getIndexes(...args) }) } @@ -177,22 +217,27 @@ export class DDInstrumentedDatabase implements Database { sql: string, parameters?: SqlQueryBinding ): Promise { - return tracer.trace("db.sql", span => { - span?.addTags({ db_name: this.name }) - return this.db.sql(sql, parameters) + return tracer.trace("db.sql", async span => { + span.addTags({ db_name: this.name, num_bindings: parameters?.length }) + const resp = await this.db.sql(sql, parameters) + span.addTags({ num_rows: resp.length }) + return resp }) } sqlPurgeDocument(docIds: string[] | string): Promise { return tracer.trace("db.sqlPurgeDocument", span => { - span?.addTags({ db_name: this.name }) + span.addTags({ + db_name: this.name, + num_docs: Array.isArray(docIds) ? docIds.length : 1, + }) return this.db.sqlPurgeDocument(docIds) }) } sqlDiskCleanup(): Promise { return tracer.trace("db.sqlDiskCleanup", span => { - span?.addTags({ db_name: this.name }) + span.addTags({ db_name: this.name }) return this.db.sqlDiskCleanup() }) } diff --git a/packages/backend-core/tests/core/utilities/structures/licenses.ts b/packages/backend-core/tests/core/utilities/structures/licenses.ts index b4d209a7ee..77f6d57b09 100644 --- a/packages/backend-core/tests/core/utilities/structures/licenses.ts +++ b/packages/backend-core/tests/core/utilities/structures/licenses.ts @@ -22,7 +22,6 @@ export function price(): PurchasedPrice { currency: "usd", duration: PriceDuration.MONTHLY, priceId: "price_123", - dayPasses: undefined, isPerUser: true, } } @@ -50,11 +49,6 @@ export function quotas(): Quotas { value: 1, triggers: [], }, - dayPasses: { - name: "Queries", - value: 1, - triggers: [], - }, budibaseAICredits: { name: "Budibase AI Credits", value: 1, diff --git a/packages/backend-core/tests/core/utilities/structures/quotas.ts b/packages/backend-core/tests/core/utilities/structures/quotas.ts index 58817e4831..83c3a8a766 100644 --- a/packages/backend-core/tests/core/utilities/structures/quotas.ts +++ b/packages/backend-core/tests/core/utilities/structures/quotas.ts @@ -15,7 +15,6 @@ export const usage = (users: number = 0, creators: number = 0): QuotaUsage => { monthly: { "01-2023": { automations: 0, - dayPasses: 0, queries: 0, budibaseAICredits: 0, triggers: {}, @@ -45,14 +44,12 @@ export const usage = (users: number = 0, creators: number = 0): QuotaUsage => { }, "02-2023": { automations: 0, - dayPasses: 0, queries: 0, budibaseAICredits: 0, triggers: {}, }, current: { automations: 0, - dayPasses: 0, queries: 0, budibaseAICredits: 0, triggers: {}, diff --git a/packages/bbui/src/Button/Button.svelte b/packages/bbui/src/Button/Button.svelte index 0a8917c3c1..77653d0c42 100644 --- a/packages/bbui/src/Button/Button.svelte +++ b/packages/bbui/src/Button/Button.svelte @@ -3,7 +3,7 @@ import AbsTooltip from "../Tooltip/AbsTooltip.svelte" import { createEventDispatcher } from "svelte" - export let type + export let type = undefined export let disabled = false export let size = "M" export let cta = false @@ -16,8 +16,8 @@ export let active = false export let tooltip = undefined export let newStyles = true - export let id - export let ref + export let id = undefined + export let ref = undefined export let reverse = false const dispatch = createEventDispatcher() diff --git a/packages/bbui/src/Form/Core/DateRangePicker.svelte b/packages/bbui/src/Form/Core/DateRangePicker.svelte index 9084942ba7..72180a98d6 100644 --- a/packages/bbui/src/Form/Core/DateRangePicker.svelte +++ b/packages/bbui/src/Form/Core/DateRangePicker.svelte @@ -2,13 +2,6 @@ import CoreDatePicker from "./DatePicker/DatePicker.svelte" import Icon from "../../Icon/Icon.svelte" - export let value = null - export let disabled = false - export let readonly = false - export let error = null - export let appendTo = undefined - export let ignoreTimezones = false - let fromDate let toDate diff --git a/packages/bbui/src/Form/Search.svelte b/packages/bbui/src/Form/Search.svelte index 2fbda275eb..a085986d3e 100644 --- a/packages/bbui/src/Form/Search.svelte +++ b/packages/bbui/src/Form/Search.svelte @@ -10,7 +10,7 @@ export let disabled = false export let updateOnChange = true export let quiet = false - export let inputRef + export let inputRef = undefined export let helpText = null const dispatch = createEventDispatcher() diff --git a/packages/bbui/src/Form/Select.svelte b/packages/bbui/src/Form/Select.svelte index 260090c7b7..0e67a1f532 100644 --- a/packages/bbui/src/Form/Select.svelte +++ b/packages/bbui/src/Form/Select.svelte @@ -17,18 +17,18 @@ export let getOptionIcon = option => option?.icon export let getOptionColour = option => option?.colour export let useOptionIconImage = false - export let isOptionEnabled + export let isOptionEnabled = undefined export let quiet = false export let autoWidth = false export let sort = false export let tooltip = "" export let autocomplete = false - export let customPopoverHeight - export let align + export let customPopoverHeight = undefined + export let align = undefined export let footer = null export let tag = null export let helpText = null - export let compare + export let compare = undefined export let onOptionMouseenter = () => {} export let onOptionMouseleave = () => {} diff --git a/packages/bbui/src/Table/Table.svelte b/packages/bbui/src/Table/Table.svelte index 3916bec738..228838e477 100644 --- a/packages/bbui/src/Table/Table.svelte +++ b/packages/bbui/src/Table/Table.svelte @@ -43,7 +43,7 @@ export let showHeaderBorder = true export let placeholderText = "No rows found" export let snippets = [] - export let defaultSortColumn + export let defaultSortColumn = undefined export let defaultSortOrder = "Ascending" const dispatch = createEventDispatcher() diff --git a/packages/bbui/src/Typography/Heading.svelte b/packages/bbui/src/Typography/Heading.svelte index 50522fffc3..90d53fb208 100644 --- a/packages/bbui/src/Typography/Heading.svelte +++ b/packages/bbui/src/Typography/Heading.svelte @@ -1,9 +1,9 @@ - diff --git a/packages/builder/.gitignore b/packages/builder/.gitignore index abc5671984..41411ea16c 100644 --- a/packages/builder/.gitignore +++ b/packages/builder/.gitignore @@ -6,4 +6,4 @@ release/ dist/ routify .routify/ -svelte.config.js \ No newline at end of file +.rollup.cache \ No newline at end of file diff --git a/packages/builder/package.json b/packages/builder/package.json index 46e454f5b9..c98e817486 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -4,13 +4,14 @@ "license": "GPL-3.0", "private": true, "scripts": { - "build": "routify -b && vite build --emptyOutDir", + "build": "routify -b && NODE_OPTIONS=\"--max_old_space_size=4096\" vite build --emptyOutDir", "start": "routify -c rollup", "dev": "routify -c dev:vite", "dev:vite": "vite --host 0.0.0.0", "rollup": "rollup -c -w", "test": "vitest run", - "test:watch": "vitest" + "test:watch": "vitest", + "check:types": "yarn svelte-check" }, "jest": { "globals": { @@ -88,6 +89,7 @@ "@babel/plugin-transform-runtime": "^7.13.10", "@babel/preset-env": "^7.13.12", "@rollup/plugin-replace": "^5.0.3", + "@rollup/plugin-typescript": "8.3.0", "@roxi/routify": "2.18.12", "@sveltejs/vite-plugin-svelte": "1.4.0", "@testing-library/jest-dom": "6.4.2", @@ -97,6 +99,7 @@ "jest": "29.7.0", "jsdom": "^21.1.1", "resize-observer-polyfill": "^1.5.1", + "svelte-check": "^4.1.0", "svelte-jester": "^1.3.2", "vite": "^4.5.0", "vite-plugin-static-copy": "^0.17.0", diff --git a/packages/builder/src/api.js b/packages/builder/src/api.ts similarity index 87% rename from packages/builder/src/api.js rename to packages/builder/src/api.ts index 6441b4ff48..5d1a0beaeb 100644 --- a/packages/builder/src/api.js +++ b/packages/builder/src/api.ts @@ -8,7 +8,7 @@ import { get } from "svelte/store" import { auth, navigation } from "./stores/portal" export const API = createAPIClient({ - attachHeaders: headers => { + attachHeaders: (headers: Record) => { // Attach app ID header from store let appId = get(appStore).appId if (appId) { @@ -16,13 +16,13 @@ export const API = createAPIClient({ } // Add csrf token if authenticated - const user = get(auth).user + const user: any = get(auth).user if (user?.csrfToken) { headers["x-csrf-token"] = user.csrfToken } }, - onError: error => { + onError: (error: any) => { const { url, message, status, method, handled } = error || {} // Log any errors that we haven't manually handled @@ -45,14 +45,14 @@ export const API = createAPIClient({ } } }, - onMigrationDetected: appId => { + onMigrationDetected: (appId: string) => { const updatingUrl = `/builder/app/updating/${appId}` if (window.location.pathname === updatingUrl) { return } - get(navigation).goto( + get(navigation)?.goto( `${updatingUrl}?returnUrl=${encodeURIComponent(window.location.pathname)}` ) }, diff --git a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte index b16533c2ca..b901d21a6d 100644 --- a/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte +++ b/packages/builder/src/components/automation/SetupPanel/AutomationBlockSetup.svelte @@ -114,7 +114,7 @@ $: schemaFields = search.getFields( $tables.list, Object.values(schema || {}), - { allowLinks: true } + { allowLinks: false } ) $: queryLimit = tableId?.includes("datasource") ? "∞" : "1000" $: isTrigger = $memoBlock?.type === AutomationStepType.TRIGGER diff --git a/packages/builder/src/components/portal/licensing/DayPassWarningModal.svelte b/packages/builder/src/components/portal/licensing/DayPassWarningModal.svelte deleted file mode 100644 index 341e427bf0..0000000000 --- a/packages/builder/src/components/portal/licensing/DayPassWarningModal.svelte +++ /dev/null @@ -1,81 +0,0 @@ - - - - {#if $auth.user.accountPortalAccess} - { - window.location.href = upgradeUrl - }} - > - - You have used {dayPassesUsed}% of - your plans Day Passes with {daysRemaining} day{daysRemaining == 1 - ? "" - : "s"} remaining. - - - - - {dayPassesBody} - - {:else} - - - You have used {dayPassesUsed}% of - your plans Day Passes with {daysRemaining} day{daysRemaining == 1 - ? "" - : "s"} remaining. - - - - - Please contact your account holder to upgrade. - - {/if} - - - diff --git a/packages/builder/src/components/portal/licensing/LicensingOverlays.svelte b/packages/builder/src/components/portal/licensing/LicensingOverlays.svelte index ab80418b6e..e2c52e3448 100644 --- a/packages/builder/src/components/portal/licensing/LicensingOverlays.svelte +++ b/packages/builder/src/components/portal/licensing/LicensingOverlays.svelte @@ -1,7 +1,6 @@ - { - const appAuth = get(auth) - const appLicensing = get(licensing) - if (get(licensing)?.usageMetrics["dayPasses"] >= 100) { - return { - key: "max_dayPasses", - type: BANNER_TYPES.NEGATIVE, - criteria: () => { - return true - }, - message: `Your apps are currently offline. You have exceeded your plans limit for Day Passes. ${ - appAuth.user.accountPortalAccess - ? "" - : "Please contact your account holder to upgrade." - }`, - ...upgradeAction(), - showCloseButton: false, - } - } - - return buildUsageInfoBanner( - "dayPasses", - "Day Passes", - ExpiringKeys.LICENSING_DAYPASS_WARNING_BANNER, - 90, - `You have used ${ - appLicensing?.usageMetrics["dayPasses"] - }% of your monthly usage of Day Passes with ${ - appLicensing?.quotaResetDaysRemaining - } day${ - get(licensing).quotaResetDaysRemaining == 1 ? "" : "s" - } remaining. All apps will be taken offline if this limit is reached. ${ - appAuth.user.accountPortalAccess - ? "" - : "Please contact your account holder to upgrade." - }` - ) -} - const buildPaymentFailedBanner = () => { return { key: "payment_Failed", @@ -166,7 +127,6 @@ const buildUsersAboveLimitBanner = EXPIRY_KEY => { export const getBanners = () => { return [ buildPaymentFailedBanner(), - buildDayPassBanner(ExpiringKeys.LICENSING_DAYPASS_WARNING_BANNER), buildUsageInfoBanner( "rows", "Rows", diff --git a/packages/builder/src/constants/index.js b/packages/builder/src/constants/index.js index 0d51f57c3e..3498183c8e 100644 --- a/packages/builder/src/constants/index.js +++ b/packages/builder/src/constants/index.js @@ -68,7 +68,6 @@ export const OnboardingType = { export const PlanModel = { PER_USER: "perUser", - DAY_PASS: "dayPass", } export const ChangelogURL = "https://docs.budibase.com/changelog" diff --git a/packages/builder/src/dataBinding.js b/packages/builder/src/dataBinding.js index 8adc27ee59..c89221f163 100644 --- a/packages/builder/src/dataBinding.js +++ b/packages/builder/src/dataBinding.js @@ -1141,10 +1141,11 @@ export const buildFormSchema = (component, asset) => { const fieldSetting = settings.find( setting => setting.key === "field" && setting.type.startsWith("field/") ) - if (fieldSetting && component.field) { + if (fieldSetting) { const type = fieldSetting.type.split("field/")[1] - if (type) { - schema[component.field] = { type } + const key = component.field || component._instanceName + if (type && key) { + schema[key] = { type } } } component._children?.forEach(child => { diff --git a/packages/builder/src/index.d.ts b/packages/builder/src/index.d.ts new file mode 100644 index 0000000000..1cbad4f12c --- /dev/null +++ b/packages/builder/src/index.d.ts @@ -0,0 +1,8 @@ +declare module "api" { + const API: { + getPlugins: () => Promise + createPlugin: (plugin: object) => Promise + uploadPlugin: (plugin: FormData) => Promise + deletePlugin: (id: string) => Promise + } +} diff --git a/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/index.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/index.svelte index b723788695..3757ed7dee 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/index.svelte +++ b/packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/index.svelte @@ -117,7 +117,4 @@ align-items: center; margin-bottom: 12px; } - - .tabs { - } diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/DNDPositionIndicator.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/DNDPositionIndicator.svelte index 4612440a2c..45185d8e2d 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/DNDPositionIndicator.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/DNDPositionIndicator.svelte @@ -50,8 +50,6 @@ border-radius: 4px; pointer-events: none; } - .indicator.above { - } .indicator.below { margin-top: 32px; } diff --git a/packages/builder/src/pages/builder/apps/index.svelte b/packages/builder/src/pages/builder/apps/index.svelte index 095bf2023b..632478748d 100644 --- a/packages/builder/src/pages/builder/apps/index.svelte +++ b/packages/builder/src/pages/builder/apps/index.svelte @@ -136,7 +136,7 @@ - {#if $licensing.usageMetrics?.dayPasses >= 100 || $licensing.errUserLimit} + {#if $licensing.errUserLimit}
spaceman diff --git a/packages/builder/src/pages/builder/portal/account/usage.svelte b/packages/builder/src/pages/builder/portal/account/usage.svelte index 7a1b1f8e14..cb0f5ea512 100644 --- a/packages/builder/src/pages/builder/portal/account/usage.svelte +++ b/packages/builder/src/pages/builder/portal/account/usage.svelte @@ -28,7 +28,7 @@ const upgradeUrl = `${$admin.accountPortalUrl}/portal/upgrade` const manageUrl = `${$admin.accountPortalUrl}/portal/billing` - const WARN_USAGE = ["Queries", "Automations", "Rows", "Day Passes", "Users"] + const WARN_USAGE = ["Queries", "Automations", "Rows", "Users"] const oneDayInSeconds = 86400 const EXCLUDE_QUOTAS = { @@ -36,9 +36,6 @@ Users: license => { return license.plan.model !== PlanModel.PER_USER }, - "Day Passes": license => { - return license.plan.model !== PlanModel.DAY_PASS - }, } function excludeQuota(name) { diff --git a/packages/builder/src/pages/builder/portal/plugins/index.svelte b/packages/builder/src/pages/builder/portal/plugins/index.svelte index d8dd4eae11..e16da42e10 100644 --- a/packages/builder/src/pages/builder/portal/plugins/index.svelte +++ b/packages/builder/src/pages/builder/portal/plugins/index.svelte @@ -1,4 +1,4 @@ - -
- {#key $component.editing} - - {/key} -
- {#if !formContext} - - {:else if !fieldState} - - {:else if schemaType && schemaType !== type && !["options", "longform"].includes(type)} - - {:else} - - {#if fieldState.error} -
- - {fieldState.error} -
- {:else if helpText} -
- {helpText} -
- {/if} - {/if} -
-
+ + + + + {:else} +
+ {#key $component.editing} + + {/key} +
+ {#if !fieldState} + + {:else if schemaType && schemaType !== type && !["options", "longform"].includes(type)} + + {:else} + + {#if fieldState.error} +
+ + {fieldState.error} +
+ {:else if helpText} +
+ {helpText} +
+ {/if} + {/if} +
+
+ {/if} +