diff --git a/.gitignore b/.gitignore index a84d25d46d..418c28d981 100644 --- a/.gitignore +++ b/.gitignore @@ -63,6 +63,7 @@ typings/ # dotenv environment variables file .env !hosting/.env +hosting/generated-envoy.dev.yaml # parcel-bundler cache (https://parceljs.org/) .cache diff --git a/hosting/docker-compose.dev.yaml b/hosting/docker-compose.dev.yaml index 8ee1753e11..5c6947a3e9 100644 --- a/hosting/docker-compose.dev.yaml +++ b/hosting/docker-compose.dev.yaml @@ -27,7 +27,7 @@ services: restart: always image: envoyproxy/envoy:v1.16-latest volumes: - - ./envoy.dev.yaml:/etc/envoy/envoy.yaml + - ./generated-envoy.dev.yaml:/etc/envoy/envoy.yaml ports: - "${MAIN_PORT}:10000" depends_on: diff --git a/hosting/envoy.dev.yaml b/hosting/envoy.dev.yaml.hbs similarity index 97% rename from hosting/envoy.dev.yaml rename to hosting/envoy.dev.yaml.hbs index 2ba08fe595..f7f642a244 100644 --- a/hosting/envoy.dev.yaml +++ b/hosting/envoy.dev.yaml.hbs @@ -106,7 +106,7 @@ static_resources: - endpoint: address: socket_address: - address: 172.17.0.1 + address: {{ address }} port_value: 4001 - name: builder-dev @@ -120,6 +120,6 @@ static_resources: - endpoint: address: socket_address: - address: 172.17.0.1 + address: {{ address }} port_value: 3000 diff --git a/package.json b/package.json index 42010f760a..8a0c629d94 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,9 @@ "publishdev": "lerna run publishdev", "publishnpm": "yarn build && lerna publish --force-publish", "restore": "npm run clean && npm run bootstrap && npm run build", - "nuke": "rimraf ~/.budibase && npm run restore && lerna run --parallel dev:stack:nuke", + "nuke": "npm run nuke:packages && npm run nuke:docker", + "nuke:packages": "npm run restore", + "nuke:docker": "lerna run --parallel dev:stack:nuke", "clean": "lerna clean", "kill-port": "kill-port 4001", "dev": "yarn run kill-port && lerna link && lerna run --parallel dev:builder --concurrency 1", diff --git a/packages/bbui/src/Actions/position_dropdown.js b/packages/bbui/src/Actions/position_dropdown.js index 01d0ec4553..9bf5a40a67 100644 --- a/packages/bbui/src/Actions/position_dropdown.js +++ b/packages/bbui/src/Actions/position_dropdown.js @@ -48,11 +48,11 @@ export default function positionDropdown(element, { anchor, align }) { element.style.left = `${calcLeftPosition(dimensions).toFixed(0)}px` const resizeObserver = new ResizeObserver(entries => { - for (let entry of entries) { + entries.forEach(() => { dimensions = getDimensions() element.style[positionSide] = `${dimensions[positionSide]}px` element.style.left = `${calcLeftPosition(dimensions).toFixed(0)}px` - } + }) }) resizeObserver.observe(anchor) diff --git a/packages/bbui/src/Stores/notifications.js b/packages/bbui/src/Stores/notifications.js index 481fb812e4..520e5c97b2 100644 --- a/packages/bbui/src/Stores/notifications.js +++ b/packages/bbui/src/Stores/notifications.js @@ -11,8 +11,6 @@ const createNotificationStore = () => { }) } - let timers = [] - const notifications = derived(_notifications, ($_notifications, set) => { set($_notifications) if ($_notifications.length > 0) { diff --git a/packages/builder/cypress/integration/createView.spec.js b/packages/builder/cypress/integration/createView.spec.js index a34f68422a..2d4bd121cb 100644 --- a/packages/builder/cypress/integration/createView.spec.js +++ b/packages/builder/cypress/integration/createView.spec.js @@ -109,15 +109,17 @@ context("Create a View", () => { .find(".ag-cell") .then($values => { const values = Array.from($values).map(value => value.textContent) - expect(values.sort()).to.deep.eq([ - "Students", - "23.333333333333332", - "1650", - "3", - "25", - "20", - "70", - ].sort()) + expect(values.sort()).to.deep.eq( + [ + "Students", + "23.333333333333332", + "1650", + "3", + "25", + "20", + "70", + ].sort() + ) }) }) diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index 4a8d0b39d3..7ac317142d 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -57,9 +57,9 @@ Cypress.Commands.add("createApp", name => { Cypress.Commands.add("deleteApp", name => { cy.visit(`localhost:${Cypress.env("PORT")}/builder`) - cy.get("body").then($body => { + cy.get(".apps").then($apps => { cy.wait(1000) - if ($body.find(`[data-cy="app-${name}"]`).length) { + if ($apps.find(`[data-cy="app-${name}"]`).length) { cy.get(`[data-cy="app-${name}"] a`).click() cy.get("[data-cy=settings-icon]").click() cy.get(".modal-content").within(() => { diff --git a/packages/builder/src/builderStore/api.js b/packages/builder/src/builderStore/api.js index 0202c5e8ab..8b5206da93 100644 --- a/packages/builder/src/builderStore/api.js +++ b/packages/builder/src/builderStore/api.js @@ -20,6 +20,9 @@ export const get = apiCall("GET") export const patch = apiCall("PATCH") export const del = apiCall("DELETE") export const put = apiCall("PUT") +export const getBuilderCookie = async () => { + await post("/api/builder/login", {}) +} export default { post: apiCall("POST"), @@ -27,4 +30,5 @@ export default { patch: apiCall("PATCH"), delete: apiCall("DELETE"), put: apiCall("PUT"), + getBuilderCookie, } diff --git a/packages/builder/src/builderStore/index.js b/packages/builder/src/builderStore/index.js index 6fecda84c0..48f466169b 100644 --- a/packages/builder/src/builderStore/index.js +++ b/packages/builder/src/builderStore/index.js @@ -6,6 +6,7 @@ import { derived, writable } from "svelte/store" import analytics from "analytics" import { FrontendTypes, LAYOUT_NAMES } from "../constants" import { findComponent } from "./storeUtils" +import { getBuilderCookie } from "./api" export const store = getFrontendStore() export const automationStore = getAutomationStore() @@ -57,6 +58,8 @@ export const selectedAccessRole = writable("BASIC") export const initialise = async () => { try { + // TODO this needs to be replaced by a real login + await getBuilderCookie() await analytics.activate() analytics.captureEvent("Builder Started") } catch (err) { diff --git a/packages/builder/src/components/backend/DataTable/popovers/CreateViewPopover.svelte b/packages/builder/src/components/backend/DataTable/popovers/CreateViewPopover.svelte index ab4aa9ecae..93ca7bb211 100644 --- a/packages/builder/src/components/backend/DataTable/popovers/CreateViewPopover.svelte +++ b/packages/builder/src/components/backend/DataTable/popovers/CreateViewPopover.svelte @@ -26,7 +26,7 @@ notifier.success(`View ${name} created`) onClosed() analytics.captureEvent("View Created", { name }) - $goto(`../../../view/${name}`) + $goto(`../../view/${name}`) } diff --git a/packages/builder/src/pages/builder/[application]/_reset.svelte b/packages/builder/src/pages/builder/[application]/_reset.svelte index 3be1942e44..2c066d28a5 100644 --- a/packages/builder/src/pages/builder/[application]/_reset.svelte +++ b/packages/builder/src/pages/builder/[application]/_reset.svelte @@ -45,65 +45,71 @@ } -
-
-
- +{#await promise} + +
+{:then _} +
+
+
+ - - {#each $layout.children as { path, title }} - - {title} - - {/each} -
-
- - -
- - - + + {#each $layout.children as { path, title }} + + {title} + + {/each}
- +
+ + +
+ + + +
+ + +
+
+
-
-
- -
- - {#await promise} - -
- {:then _} - {:catch error} -

Something went wrong: {error.message}

- {/await} -
+
+{:catch error} +

Something went wrong: {error.message}

+{/await}