diff --git a/charts/budibase/templates/app-service-deployment.yaml b/charts/budibase/templates/app-service-deployment.yaml index a9bf714c45..6517133a58 100644 --- a/charts/budibase/templates/app-service-deployment.yaml +++ b/charts/budibase/templates/app-service-deployment.yaml @@ -162,7 +162,10 @@ spec: name: bbapps ports: - containerPort: {{ .Values.services.apps.port }} - resources: {} + {{ with .Values.services.apps.resources }} + resources: + {{- toYaml . | nindent 10 }} + {{ end }} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} diff --git a/charts/budibase/templates/couchdb-backup.yaml b/charts/budibase/templates/couchdb-backup.yaml index ae062475ce..68e5eab617 100644 --- a/charts/budibase/templates/couchdb-backup.yaml +++ b/charts/budibase/templates/couchdb-backup.yaml @@ -38,7 +38,10 @@ spec: image: redgeoff/replicate-couchdb-cluster imagePullPolicy: Always name: couchdb-backup - resources: {} + {{ with .Values.services.couchdb.backup.resources }} + resources: + {{- toYaml . | nindent 10 }} + {{ end }} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} diff --git a/charts/budibase/templates/minio-service-deployment.yaml b/charts/budibase/templates/minio-service-deployment.yaml index 103f9e3ed2..144dbe539a 100644 --- a/charts/budibase/templates/minio-service-deployment.yaml +++ b/charts/budibase/templates/minio-service-deployment.yaml @@ -56,7 +56,10 @@ spec: name: minio-service ports: - containerPort: {{ .Values.services.objectStore.port }} - resources: {} + {{ with .Values.services.objectStore.resources }} + resources: + {{- toYaml . | nindent 10 }} + {{ end }} volumeMounts: - mountPath: /data name: minio-data diff --git a/charts/budibase/templates/proxy-service-deployment.yaml b/charts/budibase/templates/proxy-service-deployment.yaml index 505a46f1e8..5588022032 100644 --- a/charts/budibase/templates/proxy-service-deployment.yaml +++ b/charts/budibase/templates/proxy-service-deployment.yaml @@ -30,7 +30,10 @@ spec: name: proxy-service ports: - containerPort: {{ .Values.services.proxy.port }} - resources: {} + {{ with .Values.services.proxy.resources }} + resources: + {{- toYaml . | nindent 10 }} + {{ end }} volumeMounts: {{- with .Values.affinity }} affinity: diff --git a/charts/budibase/templates/redis-service-deployment.yaml b/charts/budibase/templates/redis-service-deployment.yaml index 6e09346cad..d94e4d70f8 100644 --- a/charts/budibase/templates/redis-service-deployment.yaml +++ b/charts/budibase/templates/redis-service-deployment.yaml @@ -35,7 +35,10 @@ spec: name: redis-service ports: - containerPort: {{ .Values.services.redis.port }} - resources: {} + {{ with .Values.services.redis.resources }} + resources: + {{- toYaml . | nindent 10 }} + {{ end }} volumeMounts: - mountPath: /data name: redis-data diff --git a/charts/budibase/templates/worker-service-deployment.yaml b/charts/budibase/templates/worker-service-deployment.yaml index 083231eeff..902e9ac03d 100644 --- a/charts/budibase/templates/worker-service-deployment.yaml +++ b/charts/budibase/templates/worker-service-deployment.yaml @@ -151,7 +151,10 @@ spec: name: bbworker ports: - containerPort: {{ .Values.services.worker.port }} - resources: {} + {{ with .Values.services.worker.resources }} + resources: + {{- toYaml . | nindent 10 }} + {{ end }} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} diff --git a/charts/budibase/values.yaml b/charts/budibase/values.yaml index 9b5e76d0d7..a15504d58c 100644 --- a/charts/budibase/values.yaml +++ b/charts/budibase/values.yaml @@ -60,19 +60,6 @@ ingress: port: number: 10000 -resources: - {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - autoscaling: enabled: false minReplicas: 1 @@ -125,16 +112,19 @@ services: proxy: port: 10000 replicaCount: 1 + resources: {} apps: port: 4002 replicaCount: 1 logLevel: info + resources: {} # nodeDebug: "" # set the value of NODE_DEBUG worker: port: 4003 replicaCount: 1 + resources: {} couchdb: enabled: true @@ -148,6 +138,7 @@ services: target: "" # backup interval in seconds interval: "" + resources: {} redis: enabled: true # disable if using external redis @@ -161,6 +152,7 @@ services: ## If undefined (the default) or set to null, no storageClassName spec is ## set, choosing the default provisioner. storageClass: "" + resources: {} objectStore: minio: true @@ -177,6 +169,7 @@ services: ## If undefined (the default) or set to null, no storageClassName spec is ## set, choosing the default provisioner. storageClass: "" + resources: {} # Override values in couchDB subchart couchdb: diff --git a/examples/nextjs-api-sales/package.json b/examples/nextjs-api-sales/package.json index 6d75c85f01..41ce52e952 100644 --- a/examples/nextjs-api-sales/package.json +++ b/examples/nextjs-api-sales/package.json @@ -11,8 +11,8 @@ "dependencies": { "bulma": "^0.9.3", "next": "12.1.0", - "node-fetch": "^3.2.2", - "node-sass": "^7.0.1", + "node-fetch": "^3.2.10", + "sass": "^1.52.3", "react": "17.0.2", "react-dom": "17.0.2", "react-notifications-component": "^3.4.1" @@ -24,4 +24,4 @@ "eslint-config-next": "12.1.0", "typescript": "4.6.2" } -} +} \ No newline at end of file diff --git a/examples/nextjs-api-sales/yarn.lock b/examples/nextjs-api-sales/yarn.lock index 52c89967b2..f47fb84e33 100644 --- a/examples/nextjs-api-sales/yarn.lock +++ b/examples/nextjs-api-sales/yarn.lock @@ -2020,10 +2020,10 @@ node-domexception@^1.0.0: resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5" integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== -node-fetch@^3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.2.2.tgz#16d33fbe32ca7c6ca1ca8ba5dfea1dd885c59f04" - integrity sha512-Cwhq1JFIoon15wcIkFzubVNFE5GvXGV82pKf4knXXjvGmn7RJKcypeuqcVNZMGDZsAFWyIRya/anwAJr7TWJ7w== +node-fetch@^3.2.10: + version "3.2.10" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.2.10.tgz#e8347f94b54ae18b57c9c049ef641cef398a85c8" + integrity sha512-MhuzNwdURnZ1Cp4XTazr69K0BTizsBroX7Zx3UgDSVcZYKF/6p0CBe4EUb/hLqmzVhl0UpYfgRljQ4yxE+iCxA== dependencies: data-uri-to-buffer "^4.0.0" fetch-blob "^3.1.4" diff --git a/hosting/nginx.dev.conf.hbs b/hosting/nginx.dev.conf.hbs index 430ea75398..6f12303eec 100644 --- a/hosting/nginx.dev.conf.hbs +++ b/hosting/nginx.dev.conf.hbs @@ -65,10 +65,6 @@ http { proxy_pass http://{{ address }}:4001; } - location /preview { - proxy_pass http://{{ address }}:4001; - } - location /builder { proxy_pass http://{{ address }}:3000; rewrite ^/builder(.*)$ /builder/$1 break; diff --git a/hosting/nginx.prod.conf.hbs b/hosting/nginx.prod.conf.hbs index 0ff986d0a7..c57fce291c 100644 --- a/hosting/nginx.prod.conf.hbs +++ b/hosting/nginx.prod.conf.hbs @@ -88,10 +88,6 @@ http { proxy_pass http://$apps:4002; } - location /preview { - proxy_pass http://$apps:4002; - } - location = / { proxy_pass http://$apps:4002; } diff --git a/hosting/scripts/build-target-paths.sh b/hosting/scripts/build-target-paths.sh index ee314c1ce4..fce768e2ee 100644 --- a/hosting/scripts/build-target-paths.sh +++ b/hosting/scripts/build-target-paths.sh @@ -4,9 +4,9 @@ echo ${TARGETBUILD} > /buildtarget.txt if [[ "${TARGETBUILD}" = "aas" ]]; then # Azure AppService uses /home for persisent data & SSH on port 2222 DATA_DIR=/home - mkdir -p $DATA_DIR/{search,minio,couchdb} - mkdir -p $DATA_DIR/couchdb/{dbs,views} - chown -R couchdb:couchdb $DATA_DIR/couchdb/ + mkdir -p $DATA_DIR/{search,minio,couch} + mkdir -p $DATA_DIR/couch/{dbs,views} + chown -R couchdb:couchdb $DATA_DIR/couch/ apt update apt-get install -y openssh-server sed -i "s/#Port 22/Port 2222/" /etc/ssh/sshd_config @@ -16,5 +16,4 @@ if [[ "${TARGETBUILD}" = "aas" ]]; then else sed -i "s#DATA_DIR#/data#g" /opt/clouseau/clouseau.ini sed -i "s#DATA_DIR#/data#g" /opt/couchdb/etc/local.ini - fi \ No newline at end of file diff --git a/hosting/single/couch/local.ini b/hosting/single/couch/local.ini index 35f0383dfc..266c0d4b60 100644 --- a/hosting/single/couch/local.ini +++ b/hosting/single/couch/local.ini @@ -1,5 +1,5 @@ ; CouchDB Configuration Settings [couchdb] -database_dir = DATA_DIR/couchdb/dbs -view_index_dir = DATA_DIR/couchdb/views +database_dir = DATA_DIR/couch/dbs +view_index_dir = DATA_DIR/couch/views diff --git a/hosting/single/runner.sh b/hosting/single/runner.sh index 09387343ba..77015d75ee 100644 --- a/hosting/single/runner.sh +++ b/hosting/single/runner.sh @@ -36,10 +36,10 @@ fi export COUCH_DB_URL=http://$COUCHDB_USER:$COUCHDB_PASSWORD@localhost:5984 # make these directories in runner, incase of mount -mkdir -p ${DATA_DIR}/couchdb/{dbs,views} +mkdir -p ${DATA_DIR}/couch/{dbs,views} mkdir -p ${DATA_DIR}/minio mkdir -p ${DATA_DIR}/search -chown -R couchdb:couchdb ${DATA_DIR}/couchdb +chown -R couchdb:couchdb ${DATA_DIR}/couch redis-server --requirepass $REDIS_PASSWORD & /opt/clouseau/bin/clouseau & /minio/minio server ${DATA_DIR}/minio & diff --git a/lerna.json b/lerna.json index 70a4e77a28..a276af2caf 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.3.4-alpha.1", + "version": "1.3.15-alpha.0", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index b5765805cd..32c8d3e1f2 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.3.4-alpha.1", + "version": "1.3.15-alpha.0", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -20,7 +20,8 @@ "test:watch": "jest --watchAll" }, "dependencies": { - "@budibase/types": "1.3.4-alpha.1", + "@budibase/types": "1.3.15-alpha.0", + "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", "bcrypt": "5.0.1", @@ -60,7 +61,6 @@ ] }, "devDependencies": { - "@shopify/jest-koa-mocks": "3.1.5", "@types/jest": "27.5.1", "@types/koa": "2.0.52", "@types/lodash": "4.14.180", diff --git a/packages/backend-core/src/db/Replication.ts b/packages/backend-core/src/db/Replication.ts index b46f6072be..e0bd3c7a43 100644 --- a/packages/backend-core/src/db/Replication.ts +++ b/packages/backend-core/src/db/Replication.ts @@ -1,4 +1,5 @@ import { dangerousGetDB, closeDB } from "." +import { DocumentType } from "./constants" class Replication { source: any @@ -53,6 +54,14 @@ class Replication { return this.replication } + appReplicateOpts() { + return { + filter: (doc: any) => { + return doc._id !== DocumentType.APP_METADATA + }, + } + } + /** * Rollback the target DB back to the state of the source DB */ @@ -60,6 +69,7 @@ class Replication { await this.target.destroy() // Recreate the DB again this.target = dangerousGetDB(this.target.name) + // take the opportunity to remove deleted tombstones await this.replicate() } diff --git a/packages/backend-core/src/db/utils.ts b/packages/backend-core/src/db/utils.ts index 321ebd7f58..4926a60150 100644 --- a/packages/backend-core/src/db/utils.ts +++ b/packages/backend-core/src/db/utils.ts @@ -254,7 +254,16 @@ export async function getAllApps({ dev, all, idsOnly, efficient }: any = {}) { return false }) if (idsOnly) { - return appDbNames + const devAppIds = appDbNames.filter(appId => isDevAppID(appId)) + const prodAppIds = appDbNames.filter(appId => !isDevAppID(appId)) + switch (dev) { + case true: + return devAppIds + case false: + return prodAppIds + default: + return appDbNames + } } const appPromises = appDbNames.map((app: any) => // skip setup otherwise databases could be re-created diff --git a/packages/backend-core/yarn.lock b/packages/backend-core/yarn.lock index 9f71691f44..22c17a9444 100644 --- a/packages/backend-core/yarn.lock +++ b/packages/backend-core/yarn.lock @@ -543,13 +543,13 @@ semver "^7.3.5" tar "^6.1.11" -"@shopify/jest-koa-mocks@3.1.5": - version "3.1.5" - resolved "https://registry.yarnpkg.com/@shopify/jest-koa-mocks/-/jest-koa-mocks-3.1.5.tgz#11f77ccfbcaf35cf5ee2c6108a286e61e6bea084" - integrity sha512-gQ3/7ELerv00TWO37AGFX5mT9CsFCS+3/UbKMuoIlKEU0QH2OX8BV9WBf/EKw7adCDNlxss0lqV6J8kf5pgr4A== +"@shopify/jest-koa-mocks@5.0.1": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@shopify/jest-koa-mocks/-/jest-koa-mocks-5.0.1.tgz#fba490b6b7985fbb571eb9974897d396a3642e94" + integrity sha512-4YskS9q8+TEHNoyopmuoy2XyhInyqeOl7CF5ShJs19sm6m0EA/jGGvgf/osv2PeTfuf42/L2G9CzWUSg49yTSg== dependencies: koa "^2.13.4" - node-mocks-http "^1.5.8" + node-mocks-http "^1.11.0" "@sideway/address@^4.1.3": version "4.1.4" @@ -3914,7 +3914,7 @@ node-int64@^0.4.0: resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== -node-mocks-http@^1.5.8: +node-mocks-http@^1.11.0: version "1.11.0" resolved "https://registry.yarnpkg.com/node-mocks-http/-/node-mocks-http-1.11.0.tgz#defc0febf6b935f08245397d47534a8de592996e" integrity sha512-jS/WzSOcKbOeGrcgKbenZeNhxUNnP36Yw11+hL4TTxQXErGfqYZ+MaYNNvhaTiGIJlzNSqgQkk9j8dSu1YWSuw== diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 181c2ac0a8..081f6471af 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": "1.3.4-alpha.1", + "version": "1.3.15-alpha.0", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "1.3.4-alpha.1", + "@budibase/string-templates": "1.3.15-alpha.0", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/bbui/src/Tabs/Tabs.svelte b/packages/bbui/src/Tabs/Tabs.svelte index 74edc9cd02..7184aedbaf 100644 --- a/packages/bbui/src/Tabs/Tabs.svelte +++ b/packages/bbui/src/Tabs/Tabs.svelte @@ -10,6 +10,7 @@ export let noHorizPadding = false export let quiet = false export let emphasized = false + export let onTop = false export let size = "M" let thisSelected = undefined @@ -75,6 +76,7 @@ bind:this={container} class:spectrum-Tabs--quiet={quiet} class:noHorizPadding + class:onTop class:spectrum-Tabs--vertical={vertical} class:spectrum-Tabs--horizontal={!vertical} class="spectrum-Tabs spectrum-Tabs--size{size}" @@ -122,4 +124,7 @@ .noPadding { margin: 0; } + .onTop { + z-index: 100; + } diff --git a/packages/builder/cypress/integration/adminAndManagement/userManagement.spec.js b/packages/builder/cypress/integration/adminAndManagement/userManagement.spec.js index 5a864e3bb3..000ca7cb54 100644 --- a/packages/builder/cypress/integration/adminAndManagement/userManagement.spec.js +++ b/packages/builder/cypress/integration/adminAndManagement/userManagement.spec.js @@ -74,11 +74,11 @@ filterTests(["smoke", "all"], () => { .contains("Update role") .click({ force: true }) }) - cy.reload({ timeout: 5000 }) + cy.reload() cy.wait(1000) } // Confirm roles exist within Configure roles table - cy.get(interact.SPECTRUM_TABLE, { timeout: 2000 }) + cy.get(interact.SPECTRUM_TABLE, { timeout: 20000 }) .eq(0) .within(assginedRoles => { expect(assginedRoles).to.contain("Admin") @@ -180,7 +180,7 @@ filterTests(["smoke", "all"], () => { cy.reload() // Confirm details have been saved - cy.get(interact.FIELD, { timeout: 1000 }).eq(1).within(() => { + cy.get(interact.FIELD, { timeout: 20000 }).eq(1).within(() => { cy.get(interact.SPECTRUM_TEXTFIELD_INPUT).should('have.value', "bb") }) cy.get(interact.FIELD, { timeout: 1000 }).eq(2).within(() => { diff --git a/packages/builder/cypress/integration/createComponents.spec.js b/packages/builder/cypress/integration/createComponents.spec.js index 649a77e442..e39ce4a4a8 100644 --- a/packages/builder/cypress/integration/createComponents.spec.js +++ b/packages/builder/cypress/integration/createComponents.spec.js @@ -20,7 +20,7 @@ filterTests(["all"], () => { //Use the tree to delete a selected component const deleteSelectedComponent = () => { cy.get( - ".nav-items-container .nav-item.selected .actions > div > .icon" + ".nav-item.selected .actions > div > .icon" ).click({ force: true, }) @@ -91,7 +91,7 @@ filterTests(["all"], () => { cy.searchAndAddComponent("Paragraph").then(componentId => { cy.get("[data-cy=setting-_instanceName] input").type(componentId).blur() cy.get( - ".nav-items-container .nav-item.selected .actions > div > .icon" + ".nav-item.selected .actions > div > .icon" ).click({ force: true, }) @@ -145,7 +145,7 @@ filterTests(["all"], () => { return testFieldFocusOnCreate(label) }) .then(() => { - cy.get(".nav-items-container .nav-item") + cy.get(".nav-item") .contains(formId) .click({ force: true }) deleteSelectedComponent() @@ -195,7 +195,7 @@ filterTests(["all"], () => { return testFocusOnCreate(label) }) .then(() => { - cy.get(".nav-items-container .nav-item") + cy.get(".nav-item") .contains(providerId) .click({ force: true }) deleteSelectedComponent() @@ -218,7 +218,7 @@ filterTests(["all"], () => { .find(".component-placeholder") .should("not.exist") cy.getComponent(imageId).find(`img[alt=${imageId}]`).should("exist") - cy.get(".nav-items-container .nav-item") + cy.get(".nav-item") .contains(imageId) .click({ force: true }) deleteSelectedComponent() @@ -242,7 +242,7 @@ filterTests(["all"], () => { cy.getComponent(markdownId) .find(".editor-preview-full h1") .contains("Hi") - cy.get(".nav-items-container .nav-item") + cy.get(".nav-item") .contains(markdownId) .click({ force: true }) deleteSelectedComponent() @@ -265,7 +265,7 @@ filterTests(["all"], () => { .find(".component-placeholder") .should("not.exist") cy.getComponent(iconId).find("i.ri-save-fill").should("exist") - cy.get(".nav-items-container .nav-item") + cy.get(".nav-item") .contains(iconId) .click({ force: true }) deleteSelectedComponent() diff --git a/packages/builder/cypress/integration/datasources/datasourceWizard.spec.js b/packages/builder/cypress/integration/datasources/datasourceWizard.spec.js index 14653d8286..837a433951 100644 --- a/packages/builder/cypress/integration/datasources/datasourceWizard.spec.js +++ b/packages/builder/cypress/integration/datasources/datasourceWizard.spec.js @@ -1,7 +1,7 @@ import filterTests from "../../support/filterTests" filterTests(['all'], () => { - context("Datasource Wizard", () => { + xcontext("Datasource Wizard", () => { if (Cypress.env("TEST_ENV")) { before(() => { cy.login() diff --git a/packages/builder/cypress/integration/datasources/oracle.spec.js b/packages/builder/cypress/integration/datasources/oracle.spec.js index 92a5737ff9..5d92d6b217 100644 --- a/packages/builder/cypress/integration/datasources/oracle.spec.js +++ b/packages/builder/cypress/integration/datasources/oracle.spec.js @@ -1,7 +1,7 @@ import filterTests from "../../support/filterTests" filterTests(["all"], () => { - context("Oracle Datasource Testing", () => { + xcontext("Oracle Datasource Testing", () => { if (Cypress.env("TEST_ENV")) { before(() => { cy.login() diff --git a/packages/builder/cypress/integration/datasources/postgreSql.spec.js b/packages/builder/cypress/integration/datasources/postgreSql.spec.js index bfb312a0c8..622c3ade73 100644 --- a/packages/builder/cypress/integration/datasources/postgreSql.spec.js +++ b/packages/builder/cypress/integration/datasources/postgreSql.spec.js @@ -162,7 +162,7 @@ filterTests(["all"], () => { switchSchema("randomText") // No tables displayed - cy.get(".spectrum-Body", { timeout: 5000 }).eq(2).should("contain", "No tables found") + cy.get(".spectrum-Body", { timeout: 10000 }).eq(2, { timeout: 10000 }).should("contain", "No tables found") // Previously created query should be visible cy.get(".spectrum-Table").should("contain", queryName) @@ -173,7 +173,7 @@ filterTests(["all"], () => { switchSchema("1") // Confirm tables exist - Check for specific one - cy.get(".spectrum-Table", { timeout: 5000 }).eq(0).should("contain", "test") + cy.get(".spectrum-Table", { timeout: 20000 }).eq(0).should("contain", "test") cy.get(".spectrum-Table") .eq(0) .find(".spectrum-Table-row") @@ -187,7 +187,7 @@ filterTests(["all"], () => { switchSchema("public") // Confirm tables exist - again - cy.get(".spectrum-Table", { timeout: 5000 }).eq(0).should("contain", "REGIONS") + cy.get(".spectrum-Table", { timeout: 20000 }).eq(0).should("contain", "REGIONS") cy.get(".spectrum-Table") .eq(0) .find(".spectrum-Table-row") diff --git a/packages/builder/cypress/integration/datasources/rest.spec.js b/packages/builder/cypress/integration/datasources/rest.spec.js index 488c30c0cf..7a145049e2 100644 --- a/packages/builder/cypress/integration/datasources/rest.spec.js +++ b/packages/builder/cypress/integration/datasources/rest.spec.js @@ -14,7 +14,7 @@ filterTests(["smoke", "all"], () => { // Select REST data source cy.selectExternalDatasource(datasource) // Enter incorrect api & attempt to send query - cy.get(".spectrum-Button", { timeout: 500 }).contains("Add query").click({ force: true }) + cy.get(".query-buttons", { timeout: 1000 }).contains("Add query").click({ force: true }) cy.intercept("**/preview").as("queryError") cy.get("input").clear().type("random text") cy.get(".spectrum-Button").contains("Send").click({ force: true }) diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index d4b0ec80e8..a07a22188f 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -4,7 +4,7 @@ Cypress.on("uncaught:exception", () => { // ACCOUNTS & USERS Cypress.Commands.add("login", (email, password) => { - cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 10000 }) + cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 30000 }) cy.url() .should("include", "/builder/") .then(url => { @@ -33,7 +33,7 @@ Cypress.Commands.add("login", (email, password) => { }) Cypress.Commands.add("logOut", () => { - cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 2000 }) + cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 30000 }) cy.get(".user-dropdown .avatar > .icon").click({ force: true }) cy.get(".spectrum-Popover[data-cy='user-menu']").within(() => { cy.get("li[data-cy='user-logout']").click({ force: true }) @@ -43,7 +43,7 @@ Cypress.Commands.add("logOut", () => { Cypress.Commands.add("logoutNoAppGrid", () => { // Logs user out when app grid is not present - cy.visit(`${Cypress.config().baseUrl}/builder`) + cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 30000 }) cy.get(".avatar > .icon").click({ force: true }) cy.get(".spectrum-Popover[data-cy='user-menu']").within(() => { cy.get(".spectrum-Menu-item").contains("Log out").click({ force: true }) @@ -68,11 +68,14 @@ Cypress.Commands.add("createUser", (email, permission) => { .click({ force: true }) }) } - // Add user and wait for modal to change - cy.get(".spectrum-Button").contains("Add user").click({ force: true }) + // Add user + cy.get(".spectrum-Button").contains("Add users").click({ force: true }) cy.get(".spectrum-ActionButton").contains("Add email").should("not.exist") }) // Onboarding modal + cy.get(".spectrum-Dialog-grid", { timeout: 5000 }).contains( + "Choose your onboarding" + ) cy.get(".spectrum-Dialog-grid").within(() => { cy.get(".onboarding-type").eq(1).click() cy.get(".spectrum-Button").contains("Done").click({ force: true }) @@ -163,7 +166,7 @@ Cypress.Commands.add("createApp", (name, addDefaultTable) => { const shouldCreateDefaultTable = typeof addDefaultTable != "boolean" ? true : addDefaultTable - cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 10000 }) + cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 30000 }) cy.url({ timeout: 30000 }).should("include", "/apps") cy.get(`[data-cy="create-app-btn"]`, { timeout: 5000 }).click({ force: true }) @@ -197,7 +200,7 @@ Cypress.Commands.add("createApp", (name, addDefaultTable) => { }) Cypress.Commands.add("deleteApp", name => { - cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000 }) + cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 30000 }) cy.wait(2000) cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`) .its("body") @@ -254,7 +257,7 @@ Cypress.Commands.add("deleteApp", name => { }) Cypress.Commands.add("deleteAllApps", () => { - cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000 }) + cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 30000 }) cy.wait(500) cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`, { timeout: 5000, @@ -351,7 +354,7 @@ Cypress.Commands.add("alterAppVersion", (appId, version) => { }) Cypress.Commands.add("importApp", (exportFilePath, name) => { - cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000 }) + cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 30000 }) cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`) .its("body") @@ -386,7 +389,7 @@ Cypress.Commands.add("importApp", (exportFilePath, name) => { // Filters visible with 1 or more Cypress.Commands.add("searchForApplication", appName => { - cy.visit(`${Cypress.config().baseUrl}/builder`) + cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 30000 }) cy.wait(2000) // No app filter functionality if only 1 app exists @@ -409,7 +412,7 @@ Cypress.Commands.add("searchForApplication", appName => { // Assumes there are no others Cypress.Commands.add("applicationInAppTable", appName => { - cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 10000 }) + cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 30000 }) cy.get(".appTable", { timeout: 5000 }).within(() => { cy.get(".title").contains(appName).should("exist") }) @@ -454,8 +457,8 @@ Cypress.Commands.add("createTable", (tableName, initialTable) => { cy.get(".spectrum-ButtonGroup").contains("Create").click() }) // Ensure modal has closed and table is created - cy.get(".spectrum-Modal").should("not.exist") - cy.get(".spectrum-Tabs-content", { timeout: 1000 }).should( + cy.get(".spectrum-Modal", { timeout: 2000 }).should("not.exist") + cy.get(".spectrum-Tabs-content", { timeout: 2000 }).should( "contain", tableName ) @@ -634,30 +637,32 @@ Cypress.Commands.add( (datasourceNames, accessLevelLabel) => { cy.contains("Design").click() cy.get(".spectrum-Button").contains("Add screen").click({ force: true }) - cy.get(".spectrum-Modal").within(() => { - cy.get(".item").contains("Autogenerated screens").click() + cy.get(".spectrum-Dialog-grid").within(() => { + cy.get("[data-cy='autogenerated-screens']").click() + cy.intercept("**/api/datasources").as("autoScreens") cy.get(".spectrum-Button").contains("Continue").click({ force: true }) + cy.wait("@autoScreens") + cy.wait(5000) }) - cy.get(".spectrum-Modal [data-cy='data-source-modal']", { - timeout: 500, - }).within(() => { + cy.get("[data-cy='autogenerated-screens']").should("not.exist") + cy.get("[data-cy='data-source-modal']", { timeout: 10000 }).within(() => { for (let i = 0; i < datasourceNames.length; i++) { - cy.wait(500) - cy.get(".data-source-entry").contains(datasourceNames[i]).click() - //Ensure the check mark is visible + cy.get(".data-source-entry") + .contains(datasourceNames[i], { timeout: 20000 }) + .click({ force: true }) + // Ensure the check mark is visible cy.get(".data-source-entry") .contains(datasourceNames[i]) - .get(".data-source-check") + .get(".data-source-check", { timeout: 20000 }) .should("exist") } cy.get(".spectrum-Button").contains("Confirm").click({ force: true }) }) - cy.get(".spectrum-Modal").within(() => { + cy.get(".spectrum-Modal", { timeout: 10000 }).within(() => { if (accessLevelLabel) { - cy.get(".spectrum-Picker-label").click() - cy.wait(500) + cy.get(".spectrum-Picker-label", { timeout: 10000 }).click() cy.contains(accessLevelLabel).click() } cy.get(".spectrum-Button").contains("Done").click({ force: true }) @@ -912,8 +917,9 @@ Cypress.Commands.add("createRestQuery", (method, restUrl, queryPrettyName) => { Cypress.Commands.add("closeModal", () => { cy.get(".spectrum-Modal", { timeout: 2000 }).within(() => { cy.get(".close-icon").click() - cy.wait(1000) // Wait for modal to close }) + // Confirm modal has closed + cy.get(".spectrum-Modal", { timeout: 10000 }).should("not.exist") }) Cypress.Commands.add("expandBudibaseConnection", () => { diff --git a/packages/builder/package.json b/packages/builder/package.json index dd3400f3b0..862fd2d333 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.3.4-alpha.1", + "version": "1.3.15-alpha.0", "license": "GPL-3.0", "private": true, "scripts": { @@ -69,10 +69,10 @@ } }, "dependencies": { - "@budibase/bbui": "1.3.4-alpha.1", - "@budibase/client": "1.3.4-alpha.1", - "@budibase/frontend-core": "1.3.4-alpha.1", - "@budibase/string-templates": "1.3.4-alpha.1", + "@budibase/bbui": "1.3.15-alpha.0", + "@budibase/client": "1.3.15-alpha.0", + "@budibase/frontend-core": "1.3.15-alpha.0", + "@budibase/string-templates": "1.3.15-alpha.0", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/builder/src/components/automation/SetupPanel/CronBuilder.svelte b/packages/builder/src/components/automation/SetupPanel/CronBuilder.svelte index 93b8394b49..f2da863424 100644 --- a/packages/builder/src/components/automation/SetupPanel/CronBuilder.svelte +++ b/packages/builder/src/components/automation/SetupPanel/CronBuilder.svelte @@ -1,6 +1,7 @@