diff --git a/lerna.json b/lerna.json index afcb33918b..d9d9e01bef 100644 --- a/lerna.json +++ b/lerna.json @@ -1,6 +1,6 @@ { "$schema": "node_modules/lerna/schemas/lerna-schema.json", - "version": "3.4.9", + "version": "3.4.11", "npmClient": "yarn", "concurrency": 20, "command": { diff --git a/packages/backend-core/src/utils/tests/utils.spec.ts b/packages/backend-core/src/utils/tests/utils.spec.ts index b5c6283ce2..c7c1e4334f 100644 --- a/packages/backend-core/src/utils/tests/utils.spec.ts +++ b/packages/backend-core/src/utils/tests/utils.spec.ts @@ -67,6 +67,15 @@ describe("utils", () => { }) }) + it("gets appId from query params", async () => { + const ctx = structures.koa.newContext() + const expected = db.generateAppID() + ctx.query = { appId: expected } + + const actual = await utils.getAppIdFromCtx(ctx) + expect(actual).toBe(expected) + }) + it("doesn't get appId from url when previewing", async () => { const ctx = structures.koa.newContext() const appId = db.generateAppID() diff --git a/packages/backend-core/src/utils/utils.ts b/packages/backend-core/src/utils/utils.ts index 7f2e25b6d4..fcec61179f 100644 --- a/packages/backend-core/src/utils/utils.ts +++ b/packages/backend-core/src/utils/utils.ts @@ -101,6 +101,11 @@ export async function getAppIdFromCtx(ctx: Ctx) { appId = confirmAppId(pathId) } + // look in queryParams + if (!appId && ctx.query?.appId) { + appId = confirmAppId(ctx.query?.appId as string) + } + // lookup using custom url - prod apps only // filter out the builder preview path which collides with the prod app path // to ensure we don't load all apps excessively diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/dndStore.js b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/dndStore.js index 2361abce89..bfbcc9ea5b 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/dndStore.js +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/dndStore.js @@ -1,12 +1,8 @@ import { writable, get } from "svelte/store" import { findComponentParent, findComponentPath } from "@/helpers/components" import { selectedScreen, componentStore } from "@/stores/builder" - -export const DropPosition = { - ABOVE: "above", - BELOW: "below", - INSIDE: "inside", -} +import { DropPosition } from "@budibase/types" +export { DropPosition } from "@budibase/types" const initialState = { source: null, diff --git a/packages/builder/src/stores/builder/index.js b/packages/builder/src/stores/builder/index.js index 76679d8088..56c2d17cc3 100644 --- a/packages/builder/src/stores/builder/index.js +++ b/packages/builder/src/stores/builder/index.js @@ -1,20 +1,20 @@ -import { layoutStore } from "./layouts.js" -import { appStore } from "./app.js" +import { layoutStore } from "./layouts" +import { appStore } from "./app" import { componentStore, selectedComponent } from "./components" -import { navigationStore } from "./navigation.js" -import { themeStore } from "./theme.js" +import { navigationStore } from "./navigation" +import { themeStore } from "./theme" import { screenStore, selectedScreen, sortedScreens } from "./screens" -import { builderStore } from "./builder.js" -import { hoverStore } from "./hover.js" -import { previewStore } from "./preview.js" +import { builderStore } from "./builder" +import { hoverStore } from "./hover" +import { previewStore } from "./preview" import { automationStore, selectedAutomation, automationHistoryStore, -} from "./automations.js" -import { userStore, userSelectedResourceMap, isOnlyUser } from "./users.js" -import { deploymentStore } from "./deployments.js" -import { contextMenuStore } from "./contextMenu.js" +} from "./automations" +import { userStore, userSelectedResourceMap, isOnlyUser } from "./users" +import { deploymentStore } from "./deployments" +import { contextMenuStore } from "./contextMenu" import { snippets } from "./snippets" import { screenComponentsList, diff --git a/packages/client/src/components/Block.svelte b/packages/client/src/components/Block.svelte index 5f39f7eef1..5e16842f9a 100644 --- a/packages/client/src/components/Block.svelte +++ b/packages/client/src/components/Block.svelte @@ -1,6 +1,6 @@