From 29fe7ef1d86af55a8218c7282c936d99cf3294d2 Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Wed, 28 Sep 2022 13:49:35 +0100 Subject: [PATCH 01/15] Add screen input to CloseScreenModal --- .../actions/CloseScreenModal.svelte | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/CloseScreenModal.svelte b/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/CloseScreenModal.svelte index 873c9ccf65..5f3b3ef639 100644 --- a/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/CloseScreenModal.svelte +++ b/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/CloseScreenModal.svelte @@ -1,16 +1,31 @@ +Navigate To screen, or leave blank. +
- This action doesn't require any additional settings. - - This action won't do anything if there isn't a screen modal open. - + + (parameters.url = value.detail)} + {bindings} + />
From df5d609298d7686b8a18d34c397bc6cf6fecbd9f Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Wed, 28 Sep 2022 13:50:23 +0100 Subject: [PATCH 02/15] Handle navigation on close modal --- packages/client/src/utils/buttonActions.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/packages/client/src/utils/buttonActions.js b/packages/client/src/utils/buttonActions.js index a534ee8326..74c4504ca6 100644 --- a/packages/client/src/utils/buttonActions.js +++ b/packages/client/src/utils/buttonActions.js @@ -224,7 +224,27 @@ const changeFormStepHandler = async (action, context) => { ) } -const closeScreenModalHandler = () => { +const closeScreenModalHandler = action => { + let { url } = action.parameters + if (url) { + window.parent.addEventListener("message", event => { + const location = event.target.location + //remove any trailing slash + if (url.charAt(url.length - 1) === "/") { + url = url.substring(0, url.length - 1) + } + //need to reload if hash route has not changed + let shouldReload = + `#${url.substring(0, url.lastIndexOf("/"))}` === + location.hash?.substring(0, location.hash.lastIndexOf("/")) + + window.parent.location.href = `${location.origin}${location.pathname}#${url}` + if (shouldReload) { + window.parent.location.reload() + } + }) + } + // Emit this as a window event, so parent screens which are iframing us in // can close the modal window.parent.postMessage({ type: "close-screen-modal" }) From 9a9ea26cc4086bbf86d739f7770ce48b524b1599 Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Thu, 29 Sep 2022 14:10:34 +0100 Subject: [PATCH 03/15] Navigate in PeekScreenDisplay --- .../overlay/PeekScreenDisplay.svelte | 3 +++ packages/client/src/utils/buttonActions.js | 21 +------------------ 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/packages/client/src/components/overlay/PeekScreenDisplay.svelte b/packages/client/src/components/overlay/PeekScreenDisplay.svelte index d6da9ca3f0..b9f4914624 100644 --- a/packages/client/src/components/overlay/PeekScreenDisplay.svelte +++ b/packages/client/src/components/overlay/PeekScreenDisplay.svelte @@ -45,6 +45,9 @@ }, [MessageTypes.CLOSE_SCREEN_MODAL]: () => { peekStore.actions.hidePeek() + if (message.data?.url) { + routeStore.actions.navigate(message.data.url) + } }, [MessageTypes.INVALIDATE_DATASOURCE]: () => { proxyInvalidation(message.data) diff --git a/packages/client/src/utils/buttonActions.js b/packages/client/src/utils/buttonActions.js index 74c4504ca6..e44ed2451c 100644 --- a/packages/client/src/utils/buttonActions.js +++ b/packages/client/src/utils/buttonActions.js @@ -226,28 +226,9 @@ const changeFormStepHandler = async (action, context) => { const closeScreenModalHandler = action => { let { url } = action.parameters - if (url) { - window.parent.addEventListener("message", event => { - const location = event.target.location - //remove any trailing slash - if (url.charAt(url.length - 1) === "/") { - url = url.substring(0, url.length - 1) - } - //need to reload if hash route has not changed - let shouldReload = - `#${url.substring(0, url.lastIndexOf("/"))}` === - location.hash?.substring(0, location.hash.lastIndexOf("/")) - - window.parent.location.href = `${location.origin}${location.pathname}#${url}` - if (shouldReload) { - window.parent.location.reload() - } - }) - } - // Emit this as a window event, so parent screens which are iframing us in // can close the modal - window.parent.postMessage({ type: "close-screen-modal" }) + window.parent.postMessage({ type: "close-screen-modal", url }) } const updateStateHandler = action => { From a620b147dd97c967432ecca3c248fe36162cf749 Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Mon, 10 Oct 2022 15:39:02 +0100 Subject: [PATCH 04/15] API: Screens - Add and Delete Screen Screens API tests - This includes adding a basic screen and deleting a screen --- .../internal-api/TestConfiguration/index.ts | 3 ++ .../internal-api/TestConfiguration/screens.ts | 23 ++++++++ .../config/internal-api/fixtures/screens.ts | 34 ++++++++++++ .../internal-api/screens/screens.spec.ts | 52 +++++++++++++++++++ 4 files changed, 112 insertions(+) create mode 100644 qa-core/src/config/internal-api/TestConfiguration/screens.ts create mode 100644 qa-core/src/config/internal-api/fixtures/screens.ts create mode 100644 qa-core/src/tests/internal-api/screens/screens.spec.ts diff --git a/qa-core/src/config/internal-api/TestConfiguration/index.ts b/qa-core/src/config/internal-api/TestConfiguration/index.ts index b433fd98ea..d90c315849 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/index.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/index.ts @@ -1,15 +1,18 @@ import ApplicationApi from "./applications" import AuthApi from "./auth" import InternalAPIClient from "./InternalAPIClient" +import ScreenApi from "./screens" export default class TestConfiguration { applications: ApplicationApi auth: AuthApi + screen: ScreenApi context: T constructor(apiClient: InternalAPIClient) { this.applications = new ApplicationApi(apiClient) this.auth = new AuthApi(apiClient) + this.screen = new ScreenApi(apiClient) this.context = {} } diff --git a/qa-core/src/config/internal-api/TestConfiguration/screens.ts b/qa-core/src/config/internal-api/TestConfiguration/screens.ts new file mode 100644 index 0000000000..1b97d7f6bf --- /dev/null +++ b/qa-core/src/config/internal-api/TestConfiguration/screens.ts @@ -0,0 +1,23 @@ +import { Screen } from "@budibase/types" +import { Response } from "node-fetch" +import InternalAPIClient from "./InternalAPIClient" + + export default class ScreenApi { + api: InternalAPIClient + + constructor(apiClient: InternalAPIClient) { + this.api = apiClient + } + + async createScreen(body: any): Promise<[Response, Screen]> { + const response = await this.api.post(`/screens`, { body }) + const json = await response.json() + return [response, json] + } + + async deleteScreen(screenId: any, rev: any): Promise<[Response, Screen]> { + const response = await this.api.del(`/screens/${screenId}/${rev}`) + const json = await response.json() + return [response, json] + } + } diff --git a/qa-core/src/config/internal-api/fixtures/screens.ts b/qa-core/src/config/internal-api/fixtures/screens.ts new file mode 100644 index 0000000000..afd4faacad --- /dev/null +++ b/qa-core/src/config/internal-api/fixtures/screens.ts @@ -0,0 +1,34 @@ +import generator from "../../generator" + +const randomId = generator.guid() + +const generateScreen = (): any => ({ + showNavigation: true, + width: "Large", + name: randomId, + template: "createFromScratch", + props: { + _id: randomId, + _component: + "@budibase/standard-components/container", + _styles: { + normal: {}, + hover: {}, + active: {}, + selected: {} + }, + _children: [], + _instanceName: "New Screen", + direction: "column", + hAlign: "stretch", + vAlign: "top", + size: "grow", + gap: "M" + }, routing: { + route: "/test", + roleId: "BASIC", + homeScreen: false + }, +}) + +export default generateScreen diff --git a/qa-core/src/tests/internal-api/screens/screens.spec.ts b/qa-core/src/tests/internal-api/screens/screens.spec.ts new file mode 100644 index 0000000000..e43c241f7c --- /dev/null +++ b/qa-core/src/tests/internal-api/screens/screens.spec.ts @@ -0,0 +1,52 @@ +import TestConfiguration from "../../../config/internal-api/TestConfiguration" +import { App } from "@budibase/types" +import InternalAPIClient from "../../../config/internal-api/TestConfiguration/InternalAPIClient" +import generateApp from "../../../config/internal-api/fixtures/applications" +import { Screen } from "@budibase/types" +import generateScreen from "../../../config/internal-api/fixtures/screens" + + +describe("Internal API - /screens endpoints", () => { + const api = new InternalAPIClient() + const config = new TestConfiguration(api) + const appConfig = new TestConfiguration(api) + + beforeAll(async () => { + await config.beforeAll() + }) + + afterAll(async () => { + await config.afterAll() + }) + + it("POST - Create a BASIC screen", async () => { + // Create app + const [appResponse, app] = await appConfig.applications.create(generateApp()) + expect(appResponse).toHaveStatusCode(200) + expect(app._id).toBeDefined() + + // Create Screen + appConfig.applications.api.appId = app.appId + const [response, screen] = await config.screen.createScreen(generateScreen()) + expect(response).toHaveStatusCode(200) + expect(screen.routing.roleId).toEqual("BASIC") + + }) + + it("DELETE - Delete a screen", async () => { + // Create app + const [appResponse, app] = await appConfig.applications.create(generateApp()) + expect(appResponse).toHaveStatusCode(200) + expect(app._id).toBeDefined() + + // Create Screen + appConfig.applications.api.appId = app.appId + const [screenResponse, screen] = await config.screen.createScreen(generateScreen()) + expect(screenResponse).toHaveStatusCode(200) + expect(screen._id).toBeDefined() + + // Delete Screen + const [response] = await config.screen.deleteScreen(screen._id, screen._rev) + expect(response).toHaveStatusCode(200) + }) +}) From 44c9ef15685d4ded7021d22a6b362bfa6873718b Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Mon, 10 Oct 2022 17:27:55 +0100 Subject: [PATCH 05/15] API Screens - Fetch screens test Additional test to fetch screens. - To confirm the screen was created i am checking `routes` - It will then confirm the route with the screen exists - in this case the route is `/test` (as determined when the screen is created) --- .../TestConfiguration/applications.ts | 6 ++++++ .../tests/internal-api/screens/screens.spec.ts | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/qa-core/src/config/internal-api/TestConfiguration/applications.ts b/qa-core/src/config/internal-api/TestConfiguration/applications.ts index 0c51487122..d457e0c1b6 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/applications.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/applications.ts @@ -46,4 +46,10 @@ export default class AppApi { const json = await response.json() return [response, json.data] } + + async getRoutes(): Promise<[Response, any]> { + const response = await this.api.get(`/routing`) + const json = await response.json() + return [response, json] + } } diff --git a/qa-core/src/tests/internal-api/screens/screens.spec.ts b/qa-core/src/tests/internal-api/screens/screens.spec.ts index e43c241f7c..8774d48007 100644 --- a/qa-core/src/tests/internal-api/screens/screens.spec.ts +++ b/qa-core/src/tests/internal-api/screens/screens.spec.ts @@ -30,7 +30,23 @@ describe("Internal API - /screens endpoints", () => { const [response, screen] = await config.screen.createScreen(generateScreen()) expect(response).toHaveStatusCode(200) expect(screen.routing.roleId).toEqual("BASIC") + }) + it("GET - Fetch screens", async () => { + // Create app + const [appResponse, app] = await appConfig.applications.create(generateApp()) + expect(appResponse).toHaveStatusCode(200) + expect(app._id).toBeDefined() + + // Create Screen + appConfig.applications.api.appId = app.appId + const [response, screen] = await config.screen.createScreen(generateScreen()) + expect(response).toHaveStatusCode(200) + + // Check screen exists + const [routesResponse, routes] = await appConfig.applications.getRoutes() + expect(routesResponse).toHaveStatusCode(200) + expect(routes.routes["/test"]).toBeTruthy() }) it("DELETE - Delete a screen", async () => { From 013d29475f4201f224ae860a15a94932ee913714 Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Mon, 10 Oct 2022 17:44:19 +0100 Subject: [PATCH 06/15] API Screens - Updating create screen test The create screen tests will now create a screen with each available role type - The types are: BASIC, POWER, ADMIN, PUBLIC --- .../src/config/internal-api/fixtures/screens.ts | 4 ++-- .../tests/internal-api/screens/screens.spec.ts | 15 +++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/qa-core/src/config/internal-api/fixtures/screens.ts b/qa-core/src/config/internal-api/fixtures/screens.ts index afd4faacad..1ebc1eb5c8 100644 --- a/qa-core/src/config/internal-api/fixtures/screens.ts +++ b/qa-core/src/config/internal-api/fixtures/screens.ts @@ -2,7 +2,7 @@ import generator from "../../generator" const randomId = generator.guid() -const generateScreen = (): any => ({ +const generateScreen = (roleId: string): any => ({ showNavigation: true, width: "Large", name: randomId, @@ -26,7 +26,7 @@ const generateScreen = (): any => ({ gap: "M" }, routing: { route: "/test", - roleId: "BASIC", + roleId: roleId, homeScreen: false }, }) diff --git a/qa-core/src/tests/internal-api/screens/screens.spec.ts b/qa-core/src/tests/internal-api/screens/screens.spec.ts index 8774d48007..4d2c17177f 100644 --- a/qa-core/src/tests/internal-api/screens/screens.spec.ts +++ b/qa-core/src/tests/internal-api/screens/screens.spec.ts @@ -19,17 +19,20 @@ describe("Internal API - /screens endpoints", () => { await config.afterAll() }) - it("POST - Create a BASIC screen", async () => { + it("POST - Create a screen with each role type", async () => { // Create app const [appResponse, app] = await appConfig.applications.create(generateApp()) expect(appResponse).toHaveStatusCode(200) expect(app._id).toBeDefined() // Create Screen + const roleArray = ["BASIC", "POWER", "ADMIN", "PUBLIC"] appConfig.applications.api.appId = app.appId - const [response, screen] = await config.screen.createScreen(generateScreen()) - expect(response).toHaveStatusCode(200) - expect(screen.routing.roleId).toEqual("BASIC") + for (let i = 0; i < 4; i++) { + const [response, screen] = await config.screen.createScreen(generateScreen(roleArray[i])) + expect(response).toHaveStatusCode(200) + expect(screen.routing.roleId).toEqual(roleArray[i]) + } }) it("GET - Fetch screens", async () => { @@ -40,7 +43,7 @@ describe("Internal API - /screens endpoints", () => { // Create Screen appConfig.applications.api.appId = app.appId - const [response, screen] = await config.screen.createScreen(generateScreen()) + const [response, screen] = await config.screen.createScreen(generateScreen("BASIC")) expect(response).toHaveStatusCode(200) // Check screen exists @@ -57,7 +60,7 @@ describe("Internal API - /screens endpoints", () => { // Create Screen appConfig.applications.api.appId = app.appId - const [screenResponse, screen] = await config.screen.createScreen(generateScreen()) + const [screenResponse, screen] = await config.screen.createScreen(generateScreen("BASIC")) expect(screenResponse).toHaveStatusCode(200) expect(screen._id).toBeDefined() From 25f9a2043b4bc00ef205cca4d04e4ccf0ad7402e Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Wed, 12 Oct 2022 17:48:33 +0100 Subject: [PATCH 07/15] Small changes based on PR feedback As per some of the comments on the PR: - Renaming createScreen & deleteScreen to create & delete as they are on the screens namespace - Updating a test within create.spec.js (applications) for when a screen is generated - Improvements to the current screens tests (removing unnecessary `expect` lines & updating the for loop for the create screens test) --- .../internal-api/TestConfiguration/screens.ts | 4 ++-- .../internal-api/applications/create.spec.ts | 2 +- .../internal-api/screens/screens.spec.ts | 21 ++++++------------- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/qa-core/src/config/internal-api/TestConfiguration/screens.ts b/qa-core/src/config/internal-api/TestConfiguration/screens.ts index 1b97d7f6bf..30c688022a 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/screens.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/screens.ts @@ -9,13 +9,13 @@ import InternalAPIClient from "./InternalAPIClient" this.api = apiClient } - async createScreen(body: any): Promise<[Response, Screen]> { + async create(body: any): Promise<[Response, Screen]> { const response = await this.api.post(`/screens`, { body }) const json = await response.json() return [response, json] } - async deleteScreen(screenId: any, rev: any): Promise<[Response, Screen]> { + async delete(screenId: string, rev: string): Promise<[Response, Screen]> { const response = await this.api.del(`/screens/${screenId}/${rev}`) const json = await response.json() return [response, json] diff --git a/qa-core/src/tests/internal-api/applications/create.spec.ts b/qa-core/src/tests/internal-api/applications/create.spec.ts index c09af632de..aa71724cac 100644 --- a/qa-core/src/tests/internal-api/applications/create.spec.ts +++ b/qa-core/src/tests/internal-api/applications/create.spec.ts @@ -164,7 +164,7 @@ describe("Internal API - /applications endpoints", () => { // Change/add component to the app const [screenResponse, screen] = await config.applications.addScreentoApp( - generateScreen() + generateScreen("BASIC") ) expect(screenResponse).toHaveStatusCode(200) expect(screen._id).toBeDefined() diff --git a/qa-core/src/tests/internal-api/screens/screens.spec.ts b/qa-core/src/tests/internal-api/screens/screens.spec.ts index 4d2c17177f..68e1022cb4 100644 --- a/qa-core/src/tests/internal-api/screens/screens.spec.ts +++ b/qa-core/src/tests/internal-api/screens/screens.spec.ts @@ -22,29 +22,24 @@ describe("Internal API - /screens endpoints", () => { it("POST - Create a screen with each role type", async () => { // Create app const [appResponse, app] = await appConfig.applications.create(generateApp()) - expect(appResponse).toHaveStatusCode(200) - expect(app._id).toBeDefined() // Create Screen const roleArray = ["BASIC", "POWER", "ADMIN", "PUBLIC"] appConfig.applications.api.appId = app.appId - for (let i = 0; i < 4; i++) { - const [response, screen] = await config.screen.createScreen(generateScreen(roleArray[i])) + for (let role in roleArray) { + const [response, screen] = await config.screen.create(generateScreen(roleArray[role])) expect(response).toHaveStatusCode(200) - expect(screen.routing.roleId).toEqual(roleArray[i]) + expect(screen.routing.roleId).toEqual(roleArray[role]) } }) it("GET - Fetch screens", async () => { // Create app const [appResponse, app] = await appConfig.applications.create(generateApp()) - expect(appResponse).toHaveStatusCode(200) - expect(app._id).toBeDefined() // Create Screen appConfig.applications.api.appId = app.appId - const [response, screen] = await config.screen.createScreen(generateScreen("BASIC")) - expect(response).toHaveStatusCode(200) + const [response, screen] = await config.screen.create(generateScreen("BASIC")) // Check screen exists const [routesResponse, routes] = await appConfig.applications.getRoutes() @@ -55,17 +50,13 @@ describe("Internal API - /screens endpoints", () => { it("DELETE - Delete a screen", async () => { // Create app const [appResponse, app] = await appConfig.applications.create(generateApp()) - expect(appResponse).toHaveStatusCode(200) - expect(app._id).toBeDefined() // Create Screen appConfig.applications.api.appId = app.appId - const [screenResponse, screen] = await config.screen.createScreen(generateScreen("BASIC")) - expect(screenResponse).toHaveStatusCode(200) - expect(screen._id).toBeDefined() + const [screenResponse, screen] = await config.screen.create(generateScreen("BASIC")) // Delete Screen - const [response] = await config.screen.deleteScreen(screen._id, screen._rev) + const [response] = await config.screen.delete(screen._id!, screen._rev!) expect(response).toHaveStatusCode(200) }) }) From 6612cad91f0212fca77e82eed602d372437c54c4 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Thu, 13 Oct 2022 11:26:25 +0100 Subject: [PATCH 08/15] Add additional timeout configuration to nginx.dev.conf.hbs --- hosting/nginx.dev.conf.hbs | 66 ++++++++++++++++++++++++++++++++------ 1 file changed, 57 insertions(+), 9 deletions(-) diff --git a/hosting/nginx.dev.conf.hbs b/hosting/nginx.dev.conf.hbs index 14c32b1bba..39a8dc52af 100644 --- a/hosting/nginx.dev.conf.hbs +++ b/hosting/nginx.dev.conf.hbs @@ -24,6 +24,21 @@ http { default "upgrade"; } + upstream app-service { + server {{address}}:4001; + keepalive 32; + } + + upstream worker-service { + server {{address}}:4002; + keepalive 32; + } + + upstream builder { + server {{address}}:3000; + keepalive 32; + } + server { listen 10000 default_server; server_name _; @@ -43,45 +58,78 @@ http { } location ~ ^/api/(system|admin|global)/ { - proxy_pass http://{{ address }}:4002; + proxy_pass http://worker-service; + proxy_read_timeout 120s; + proxy_connect_timeout 120s; + proxy_send_timeout 120s; + proxy_http_version 1.1; + proxy_set_header Connection ""; } location /api/ { proxy_read_timeout 120s; proxy_connect_timeout 120s; proxy_send_timeout 120s; - proxy_pass http://{{ address }}:4001; + proxy_pass http://app-service; + proxy_http_version 1.1; + proxy_set_header Connection ""; } location = / { - proxy_pass http://{{ address }}:4001; + proxy_pass http://app-service; + proxy_read_timeout 120s; + proxy_connect_timeout 120s; + proxy_send_timeout 120s; + proxy_http_version 1.1; + proxy_set_header Connection ""; } location /app_ { - proxy_pass http://{{ address }}:4001; + proxy_pass http://app-service; + proxy_read_timeout 120s; + proxy_connect_timeout 120s; + proxy_send_timeout 120s; + proxy_http_version 1.1; + proxy_set_header Connection ""; } location /app { - proxy_pass http://{{ address }}:4001; + proxy_pass http://app-service; + proxy_read_timeout 120s; + proxy_connect_timeout 120s; + proxy_send_timeout 120s; + proxy_http_version 1.1; + proxy_set_header Connection ""; } location /builder { - proxy_pass http://{{ address }}:3000; + proxy_pass http://builder; + proxy_read_timeout 120s; + proxy_connect_timeout 120s; + proxy_send_timeout 120s; + proxy_http_version 1.1; + proxy_set_header Connection ""; rewrite ^/builder(.*)$ /builder/$1 break; } location /builder/ { - proxy_pass http://{{ address }}:3000; + proxy_pass http://builder; proxy_http_version 1.1; proxy_set_header Connection $connection_upgrade; proxy_set_header Upgrade $http_upgrade; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_read_timeout 120s; + proxy_connect_timeout 120s; + proxy_send_timeout 120s; } location /vite/ { - proxy_pass http://{{ address }}:3000; + proxy_pass http://builder; + proxy_read_timeout 120s; + proxy_connect_timeout 120s; + proxy_send_timeout 120s; rewrite ^/vite(.*)$ /$1 break; } @@ -91,7 +139,7 @@ http { proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; - proxy_pass http://{{ address }}:4001; + proxy_pass http://app-service; } location / { From 8c3617d89c4213aff60a1458a2f8b8624c2b9055 Mon Sep 17 00:00:00 2001 From: Gustav Weslien Date: Mon, 17 Oct 2022 20:56:30 +0200 Subject: [PATCH 09/15] Fix arangoDB connector : https://github.com/Budibase/budibase/issues/8294#issue-1412041907 --- packages/server/src/integrations/arangodb.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/server/src/integrations/arangodb.ts b/packages/server/src/integrations/arangodb.ts index 6df96501a4..e28940f36e 100644 --- a/packages/server/src/integrations/arangodb.ts +++ b/packages/server/src/integrations/arangodb.ts @@ -62,6 +62,8 @@ class ArangoDBIntegration implements IntegrationBase { constructor(config: ArangodbConfig) { const newConfig = { + url: config.url, + databaseName: config.databaseName, auth: { username: config.username, password: config.password, From dee36c056b7de0d7591650af55500fff11d462a9 Mon Sep 17 00:00:00 2001 From: Gerard Burns Date: Mon, 17 Oct 2022 19:58:43 +0100 Subject: [PATCH 10/15] Clicking the Toggle Button of an Open Action Menu Does Not Close It --- packages/bbui/src/Actions/click_outside.js | 6 +++--- packages/bbui/src/Popover/Popover.svelte | 9 ++++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/bbui/src/Actions/click_outside.js b/packages/bbui/src/Actions/click_outside.js index 49a15d36a3..7fd2879071 100644 --- a/packages/bbui/src/Actions/click_outside.js +++ b/packages/bbui/src/Actions/click_outside.js @@ -1,18 +1,18 @@ export default function clickOutside(element, callbackFunction) { function onClick(event) { if (!element.contains(event.target)) { - callbackFunction() + callbackFunction(event) } } - document.body.addEventListener("mousedown", onClick, true) + document.body.addEventListener("click", onClick, true) return { update(newCallbackFunction) { callbackFunction = newCallbackFunction }, destroy() { - document.body.removeEventListener("mousedown", onClick, true) + document.body.removeEventListener("click", onClick, true) }, } } diff --git a/packages/bbui/src/Popover/Popover.svelte b/packages/bbui/src/Popover/Popover.svelte index ded0ed6cfd..b81e76dc1f 100644 --- a/packages/bbui/src/Popover/Popover.svelte +++ b/packages/bbui/src/Popover/Popover.svelte @@ -33,6 +33,13 @@ open = false } + const handleOutsideClick = e => { + if (open) { + e.stopPropagation() + hide() + } + } + let open = null function handleEscape(e) { @@ -47,7 +54,7 @@