1
0
Fork 0
mirror of synced 2024-08-17 11:01:26 +12:00

Merge branch 'develop' into fix/support-primary-foreign-keys

This commit is contained in:
Mel O'Hagan 2023-01-19 23:04:54 +00:00
commit 97c7f42fbe
29 changed files with 282 additions and 992 deletions

View file

@ -1,5 +1,5 @@
{ {
"version": "2.2.12-alpha.27", "version": "2.2.12-alpha.30",
"npmClient": "yarn", "npmClient": "yarn",
"packages": [ "packages": [
"packages/*" "packages/*"

View file

@ -1,6 +1,6 @@
{ {
"name": "@budibase/backend-core", "name": "@budibase/backend-core",
"version": "2.2.12-alpha.27", "version": "2.2.12-alpha.30",
"description": "Budibase backend core libraries used in server and worker", "description": "Budibase backend core libraries used in server and worker",
"main": "dist/src/index.js", "main": "dist/src/index.js",
"types": "dist/src/index.d.ts", "types": "dist/src/index.d.ts",
@ -23,7 +23,7 @@
}, },
"dependencies": { "dependencies": {
"@budibase/nano": "10.1.1", "@budibase/nano": "10.1.1",
"@budibase/types": "2.2.12-alpha.27", "@budibase/types": "2.2.12-alpha.30",
"@shopify/jest-koa-mocks": "5.0.1", "@shopify/jest-koa-mocks": "5.0.1",
"@techpass/passport-openidconnect": "0.3.2", "@techpass/passport-openidconnect": "0.3.2",
"aws-cloudfront-sign": "2.2.0", "aws-cloudfront-sign": "2.2.0",

View file

@ -1,7 +1,7 @@
{ {
"name": "@budibase/bbui", "name": "@budibase/bbui",
"description": "A UI solution used in the different Budibase projects.", "description": "A UI solution used in the different Budibase projects.",
"version": "2.2.12-alpha.27", "version": "2.2.12-alpha.30",
"license": "MPL-2.0", "license": "MPL-2.0",
"svelte": "src/index.js", "svelte": "src/index.js",
"module": "dist/bbui.es.js", "module": "dist/bbui.es.js",
@ -38,7 +38,7 @@
], ],
"dependencies": { "dependencies": {
"@adobe/spectrum-css-workflow-icons": "1.2.1", "@adobe/spectrum-css-workflow-icons": "1.2.1",
"@budibase/string-templates": "2.2.12-alpha.27", "@budibase/string-templates": "2.2.12-alpha.30",
"@spectrum-css/actionbutton": "1.0.1", "@spectrum-css/actionbutton": "1.0.1",
"@spectrum-css/actiongroup": "1.0.1", "@spectrum-css/actiongroup": "1.0.1",
"@spectrum-css/avatar": "3.0.2", "@spectrum-css/avatar": "3.0.2",

View file

@ -45,7 +45,9 @@
getOptionLabel getOptionLabel
) )
const onClick = () => { const onClick = e => {
e.preventDefault()
e.stopPropagation()
dispatch("click") dispatch("click")
if (readonly) { if (readonly) {
return return
@ -88,7 +90,6 @@
class:is-open={open} class:is-open={open}
aria-haspopup="listbox" aria-haspopup="listbox"
on:click={onClick} on:click={onClick}
use:clickOutside={() => (open = false)}
bind:this={button} bind:this={button}
> >
{#if fieldIcon} {#if fieldIcon}
@ -130,14 +131,17 @@
<Popover <Popover
anchor={button} anchor={button}
align="left" align="left"
portalTarget={document.documentElement}
bind:this={popover} bind:this={popover}
{open} {open}
on:close={() => (open = false)} on:close={() => (open = false)}
useAnchorWidth={!autoWidth} useAnchorWidth={!autoWidth}
maxWidth={autoWidth ? 400 : null} maxWidth={autoWidth ? 400 : null}
> >
<div class="popover-content" class:auto-width={autoWidth}> <div
class="popover-content"
class:auto-width={autoWidth}
use:clickOutside={() => (open = false)}
>
{#if autocomplete} {#if autocomplete}
<Search <Search
value={searchTerm} value={searchTerm}

View file

@ -5,6 +5,8 @@
import positionDropdown from "../Actions/position_dropdown" import positionDropdown from "../Actions/position_dropdown"
import clickOutside from "../Actions/click_outside" import clickOutside from "../Actions/click_outside"
import { fly } from "svelte/transition" import { fly } from "svelte/transition"
import { getContext } from "svelte"
import Context from "../context"
const dispatch = createEventDispatcher() const dispatch = createEventDispatcher()
@ -24,6 +26,7 @@
$: tooltipClasses = showTip $: tooltipClasses = showTip
? `spectrum-Popover--withTip spectrum-Popover--${direction}` ? `spectrum-Popover--withTip spectrum-Popover--${direction}`
: "" : ""
$: target = portalTarget || getContext(Context.PopoverRoot) || ".spectrum"
export const show = () => { export const show = () => {
dispatch("open") dispatch("open")
@ -61,7 +64,7 @@
</script> </script>
{#if open} {#if open}
<Portal target={portalTarget}> <Portal {target}>
<div <div
tabindex="0" tabindex="0"
use:positionDropdown={{ anchor, align, maxWidth, useAnchorWidth }} use:positionDropdown={{ anchor, align, maxWidth, useAnchorWidth }}

View file

@ -1,3 +1,4 @@
export default { export default {
Modal: "bbui-modal", Modal: "bbui-modal",
PopoverRoot: "bbui-popover-root",
} }

View file

@ -11,9 +11,5 @@
"WORKER_PORT": "4200", "WORKER_PORT": "4200",
"JWT_SECRET": "test", "JWT_SECRET": "test",
"HOST_IP": "" "HOST_IP": ""
},
"retries": {
"runMode": 1,
"openMode": 0
} }
} }

View file

@ -2,7 +2,7 @@ import filterTests from "../../support/filterTests"
// const interact = require("../support/interact") // const interact = require("../support/interact")
filterTests(["smoke", "all"], () => { filterTests(["smoke", "all"], () => {
context("Auth Configuration", () => { xcontext("Auth Configuration", () => {
before(() => { before(() => {
cy.login() cy.login()
}) })
@ -21,7 +21,7 @@ filterTests(["smoke", "all"], () => {
cy.get("[data-cy=oidc-active]").should('not.be.checked') cy.get("[data-cy=oidc-active]").should('not.be.checked')
cy.intercept("POST", "/api/global/configs").as("updateAuth") cy.intercept("POST", "/api/global/configs").as("updateAuth")
cy.get("button[data-cy=oidc-save]").contains("Save").click({force: true}) cy.get("button[data-cy=oidc-save]").contains("Save").click({ force: true })
cy.wait("@updateAuth") cy.wait("@updateAuth")
cy.get("@updateAuth").its("response.statusCode").should("eq", 200) cy.get("@updateAuth").its("response.statusCode").should("eq", 200)
@ -45,7 +45,7 @@ filterTests(["smoke", "all"], () => {
cy.get("button[data-cy=oidc-save]").should("not.be.disabled"); cy.get("button[data-cy=oidc-save]").should("not.be.disabled");
cy.intercept("POST", "/api/global/configs").as("updateAuth") cy.intercept("POST", "/api/global/configs").as("updateAuth")
cy.get("button[data-cy=oidc-save]").contains("Save").click({force: true}) cy.get("button[data-cy=oidc-save]").contains("Save").click({ force: true })
cy.wait("@updateAuth") cy.wait("@updateAuth")
cy.get("@updateAuth").its("response.statusCode").should("eq", 200) cy.get("@updateAuth").its("response.statusCode").should("eq", 200)
@ -89,7 +89,7 @@ filterTests(["smoke", "all"], () => {
cy.get("button[data-cy=oidc-save]").should("not.be.disabled"); cy.get("button[data-cy=oidc-save]").should("not.be.disabled");
cy.intercept("POST", "/api/global/configs").as("updateAuth") cy.intercept("POST", "/api/global/configs").as("updateAuth")
cy.get("button[data-cy=oidc-save]").contains("Save").click({force: true}) cy.get("button[data-cy=oidc-save]").contains("Save").click({ force: true })
cy.wait("@updateAuth") cy.wait("@updateAuth")
cy.get("@updateAuth").its("response.statusCode").should("eq", 200) cy.get("@updateAuth").its("response.statusCode").should("eq", 200)
@ -123,7 +123,7 @@ filterTests(["smoke", "all"], () => {
cy.get("button[data-cy=oidc-save]").should("not.be.disabled"); cy.get("button[data-cy=oidc-save]").should("not.be.disabled");
cy.intercept("POST", "/api/global/configs").as("updateAuth") cy.intercept("POST", "/api/global/configs").as("updateAuth")
cy.get("button[data-cy=oidc-save]").contains("Save").click({force: true}) cy.get("button[data-cy=oidc-save]").contains("Save").click({ force: true })
cy.wait("@updateAuth") cy.wait("@updateAuth")
cy.get("@updateAuth").its("response.statusCode").should("eq", 200) cy.get("@updateAuth").its("response.statusCode").should("eq", 200)
@ -144,7 +144,7 @@ filterTests(["smoke", "all"], () => {
cy.get("div.content").scrollTo("bottom") cy.get("div.content").scrollTo("bottom")
cy.get("[data-cy=restore-oidc-default-scopes]").click({force: true}) cy.get("[data-cy=restore-oidc-default-scopes]").click({ force: true })
cy.get(".spectrum-Tags").find(".spectrum-Tags-item").its("length").should("eq", 4) cy.get(".spectrum-Tags").find(".spectrum-Tags-item").its("length").should("eq", 4)

View file

@ -27,11 +27,11 @@ filterTests(["smoke", "all"], () => {
}) })
}) })
it("should allow copying of the users API key", () => { xit("should allow copying of the users API key", () => {
cy.get(".user-dropdown .avatar > .icon", { timeout: 2000 }).click({ force: true }) cy.get(".user-dropdown .avatar > .icon", { timeout: 2000 }).click({ force: true })
cy.get(interact.SPECTRUM_MENU_ITEM).contains("View API key").click({ force: true }) cy.get(interact.SPECTRUM_MENU_ITEM).contains("View API key").click({ force: true })
cy.get(interact.SPECTRUM_DIALOG_CONTENT).within(() => { cy.get(interact.SPECTRUM_DIALOG_CONTENT).within(() => {
cy.get(interact.SPECTRUM_ICON).click({force: true}) cy.get(interact.SPECTRUM_ICON).click({ force: true })
}) })
// There may be timing issues with this on the smoke build // There may be timing issues with this on the smoke build
cy.wait(500) cy.wait(500)
@ -41,12 +41,17 @@ filterTests(["smoke", "all"], () => {
}) })
it("should allow API key regeneration", () => { it("should allow API key regeneration", () => {
cy.get(".user-dropdown .icon", { timeout: 2000 }).click({ force: true })
cy.get(interact.SPECTRUM_MENU_ITEM).contains("View API key").click({ force: true })
cy.get(interact.SPECTRUM_DIALOG_CONTENT).within(() => {
cy.get(interact.SPECTRUM_ICON).click({ force: true })
})
// Get initial API key value // Get initial API key value
cy.get(interact.SPECTRUM_DIALOG_CONTENT) cy.get(interact.SPECTRUM_DIALOG_CONTENT)
.find(interact.SPECTRUM_TEXTFIELD_INPUT).invoke('val').as('keyOne') .find(interact.SPECTRUM_TEXTFIELD_INPUT).invoke('val').as('keyOne')
// Click re-generate key button // Click re-generate key button
cy.get("button").contains("Re-generate key").click({ force: true }) cy.get("button").contains("Regenerate key").click({ force: true })
// Verify API key was changed // Verify API key was changed
cy.get(interact.SPECTRUM_DIALOG_CONTENT).within(() => { cy.get(interact.SPECTRUM_DIALOG_CONTENT).within(() => {
@ -59,7 +64,7 @@ filterTests(["smoke", "all"], () => {
it("should update password", () => { it("should update password", () => {
// Access Update password modal // Access Update password modal
cy.get(".user-dropdown .avatar > .icon", { timeout: 2000 }).click({ force: true }) cy.get(".user-dropdown .icon", { timeout: 2000 }).click({ force: true })
cy.get(interact.SPECTRUM_MENU_ITEM).contains("Update password").click({ force: true }) cy.get(interact.SPECTRUM_MENU_ITEM).contains("Update password").click({ force: true })
// Enter new password and update // Enter new password and update
@ -76,8 +81,8 @@ filterTests(["smoke", "all"], () => {
cy.login("test@test.com", "newpwd") cy.login("test@test.com", "newpwd")
}) })
it("should open and close developer mode", () => { xit("should open and close developer mode", () => {
cy.get(".user-dropdown .avatar > .icon", { timeout: 2000 }).click({ force: true }) cy.get(".user-dropdown .icon", { timeout: 2000 }).click({ force: true })
// Close developer mode & verify // Close developer mode & verify
cy.get(interact.SPECTRUM_MENU_ITEM).contains("Close developer mode").click({ force: true }) cy.get(interact.SPECTRUM_MENU_ITEM).contains("Close developer mode").click({ force: true })
@ -88,13 +93,13 @@ filterTests(["smoke", "all"], () => {
// Open developer mode & verify // Open developer mode & verify
cy.get(".avatar > .icon").click({ force: true }) cy.get(".avatar > .icon").click({ force: true })
cy.get(interact.SPECTRUM_MENU_ITEM).contains("Open developer mode").click({ force: true }) cy.get(interact.SPECTRUM_MENU_ITEM).contains("Open developer mode").click({ force: true })
cy.get(interact.SPECTRUM_SIDENAV).should('exist') // config sections available cy.get(".app-table").should('exist') // config sections available
cy.get(interact.CREATE_APP_BUTTON).should('exist') // create app button available cy.get(interact.CREATE_APP_BUTTON).should('exist') // create app button available
}) })
after(() => { after(() => {
// Change password back to original value // Change password back to original value
cy.get(".user-dropdown .avatar > .icon", { timeout: 2000 }).click({ force: true }) cy.get(".user-dropdown .icon", { timeout: 2000 }).click({ force: true })
cy.get(interact.SPECTRUM_MENU_ITEM).contains("Update password").click({ force: true }) cy.get(interact.SPECTRUM_MENU_ITEM).contains("Update password").click({ force: true })
cy.get(interact.SPECTRUM_DIALOG_GRID).within(() => { cy.get(interact.SPECTRUM_DIALOG_GRID).within(() => {
for (let i = 0; i < 2; i++) { for (let i = 0; i < 2; i++) {

View file

@ -2,7 +2,7 @@ import filterTests from "../support/filterTests"
import clientPackage from "@budibase/client/package.json" import clientPackage from "@budibase/client/package.json"
filterTests(["all"], () => { filterTests(["all"], () => {
context("Application Overview screen", () => { xcontext("Application Overview screen", () => {
before(() => { before(() => {
cy.login() cy.login()
cy.deleteAllApps() cy.deleteAllApps()

View file

@ -22,7 +22,7 @@ filterTests(['smoke', 'all'], () => {
}) })
} }
it("should provide filterable templates", () => { xit("should provide filterable templates", () => {
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000 }) cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000 })
cy.wait(500) cy.wait(500)
@ -30,7 +30,7 @@ filterTests(['smoke', 'all'], () => {
.its("body") .its("body")
.then(val => { .then(val => {
if (val.length > 0) { if (val.length > 0) {
cy.get(interact.SPECTRUM_BUTTON).contains("Templates").click({force: true}) cy.get(interact.SPECTRUM_BUTTON).contains("View Templates").click({ force: true })
} }
}) })
@ -123,35 +123,49 @@ filterTests(['smoke', 'all'], () => {
const exportedApp = 'cypress/fixtures/exported-app.txt' const exportedApp = 'cypress/fixtures/exported-app.txt'
cy.importApp(exportedApp, "") cy.importApp(exportedApp, "")
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 2000 }) cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 2000 })
cy.applicationInAppTable("My app") cy.applicationInAppTable("My app")
cy.get(".app-table .name").eq(0).click()
cy.get(".appTable .name").eq(0).click() cy.closeModal()
cy.get(`[aria-label="ShowMenu"]`).click()
cy.deleteApp("My app") cy.get(".spectrum-Menu").within(() => {
cy.contains("Overview").click()
})
cy.get(".app-overview-actions-icon").within(() => {
cy.get(".spectrum-Icon").click({ force: true })
})
cy.get(".spectrum-Menu").contains("Delete").click({ force: true })
cy.get(".spectrum-Dialog-grid").within(() => {
cy.get("input").type("My app")
})
cy.get(".spectrum-Button--warning").click()
}) })
it("should create an application from an export, using the users first name as the default app name", () => { it("should create an application from an export, using the users first name as the default app name", () => {
const exportedApp = 'cypress/fixtures/exported-app.txt' const exportedApp = 'cypress/fixtures/exported-app.txt'
cy.updateUserInformation("Ted", "Userman") cy.updateUserInformation("Ted", "Userman")
cy.importApp(exportedApp, "") cy.importApp(exportedApp, "")
cy.visit(`${Cypress.config().baseUrl}/builder`) cy.visit(`${Cypress.config().baseUrl}/builder`)
cy.applicationInAppTable("Teds app") cy.applicationInAppTable("Teds app")
cy.get(".app-table .name").eq(0).click()
cy.get(".appTable .name").eq(0).click() cy.closeModal()
cy.get(`[aria-label="ShowMenu"]`).click()
cy.deleteApp("Teds app") cy.get(".spectrum-Menu").within(() => {
cy.contains("Overview").click()
})
cy.get(".app-overview-actions-icon").within(() => {
cy.get(".spectrum-Icon").click({ force: true })
})
cy.get(".spectrum-Menu").contains("Delete").click({ force: true })
cy.get(".spectrum-Dialog-grid").within(() => {
cy.get("input").type("Teds app")
})
cy.get(".spectrum-Button--warning").click()
cy.updateUserInformation("", "") cy.updateUserInformation("", "")
}) })
it("should generate the first application from a template", () => { xit("should generate the first application from a template", () => {
cy.visit(`${Cypress.config().baseUrl}/builder`) cy.visit(`${Cypress.config().baseUrl}/builder`)
cy.wait(500) cy.wait(500)
@ -172,7 +186,7 @@ filterTests(['smoke', 'all'], () => {
const card = cy.get('.template-card').eq(0).should("exist"); const card = cy.get('.template-card').eq(0).should("exist");
const cardOverlay = card.get('.template-thumbnail-action-overlay').should("exist") const cardOverlay = card.get('.template-thumbnail-action-overlay').should("exist")
cardOverlay.invoke("show") cardOverlay.invoke("show")
cardOverlay.get("button").contains("Use template").should("exist").click({force: true}) cardOverlay.get("button").contains("Use template").should("exist").click({ force: true })
}) })
// CMD Create app from theme card // CMD Create app from theme card
@ -181,7 +195,7 @@ filterTests(['smoke', 'all'], () => {
const templateName = cy.get(".spectrum-Modal .template-thumbnail-text") const templateName = cy.get(".spectrum-Modal .template-thumbnail-text")
templateName.invoke('text') templateName.invoke('text')
.then(templateNameText => { .then(templateNameText => {
const templateNameParsed = "/"+templateNameText.toLowerCase().replace(/\s+/g, "-") const templateNameParsed = "/" + templateNameText.toLowerCase().replace(/\s+/g, "-")
cy.get(interact.SPECTRUM_MODAL_INPUT).eq(0).should("have.value", templateNameText) cy.get(interact.SPECTRUM_MODAL_INPUT).eq(0).should("have.value", templateNameText)
cy.get(interact.SPECTRUM_MODAL_INPUT).eq(1).should("have.value", templateNameParsed) cy.get(interact.SPECTRUM_MODAL_INPUT).eq(1).should("have.value", templateNameParsed)

View file

@ -101,7 +101,7 @@ Cypress.Commands.add("deleteUser", email => {
}) })
Cypress.Commands.add("updateUserInformation", (firstName, lastName) => { Cypress.Commands.add("updateUserInformation", (firstName, lastName) => {
cy.get(".user-dropdown .avatar > .icon", { timeout: 2000 }).click({ cy.get(".user-dropdown .icon", { timeout: 2000 }).click({
force: true, force: true,
}) })
@ -132,7 +132,7 @@ Cypress.Commands.add("updateUserInformation", (firstName, lastName) => {
.blur() .blur()
} }
cy.get(".confirm-wrap").within(() => { cy.get(".confirm-wrap").within(() => {
cy.get("button").contains("Update information").click({ force: true }) cy.get("button").contains("Save").click({ force: true })
}) })
cy.get(".spectrum-Dialog-grid").should("not.exist") cy.get(".spectrum-Dialog-grid").should("not.exist")
}) })
@ -222,9 +222,12 @@ Cypress.Commands.add("deleteApp", name => {
// Go to app overview // Go to app overview
const appIdParsed = appId.split("_").pop() const appIdParsed = appId.split("_").pop()
const actionEleId = `[data-cy=row_actions_${appIdParsed}]` const actionEleId = `[data-cy=row_actions_${appIdParsed}]`
cy.get(actionEleId).within(() => { cy.get(actionEleId).click()
cy.contains("Manage").click({ force: true }) cy.get(`[aria-label="ShowMenu"]`).click()
cy.get(".spectrum-Menu").within(() => {
cy.contains("Overview").click()
}) })
cy.wait(500) cy.wait(500)
// Unpublish first if needed // Unpublish first if needed
@ -400,7 +403,7 @@ Cypress.Commands.add("searchForApplication", appName => {
return return
} else { } else {
// Searches for the app // Searches for the app
cy.get(".filter").then(() => { cy.get(".spectrum-Search").then(() => {
cy.get(".spectrum-Textfield").within(() => { cy.get(".spectrum-Textfield").within(() => {
cy.get("input").eq(0).clear({ force: true }) cy.get("input").eq(0).clear({ force: true })
cy.get("input").eq(0).type(appName, { force: true }) cy.get("input").eq(0).type(appName, { force: true })
@ -413,7 +416,7 @@ Cypress.Commands.add("searchForApplication", appName => {
// Assumes there are no others // Assumes there are no others
Cypress.Commands.add("applicationInAppTable", appName => { Cypress.Commands.add("applicationInAppTable", appName => {
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 30000 }) cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 30000 })
cy.get(".appTable", { timeout: 30000 }).within(() => { cy.get(".app-table", { timeout: 30000 }).within(() => {
cy.get(".title").contains(appName).should("exist") cy.get(".title").contains(appName).should("exist")
}) })
}) })

View file

@ -1,6 +1,6 @@
{ {
"name": "@budibase/builder", "name": "@budibase/builder",
"version": "2.2.12-alpha.27", "version": "2.2.12-alpha.30",
"license": "GPL-3.0", "license": "GPL-3.0",
"private": true, "private": true,
"scripts": { "scripts": {
@ -71,10 +71,10 @@
} }
}, },
"dependencies": { "dependencies": {
"@budibase/bbui": "2.2.12-alpha.27", "@budibase/bbui": "2.2.12-alpha.30",
"@budibase/client": "2.2.12-alpha.27", "@budibase/client": "2.2.12-alpha.30",
"@budibase/frontend-core": "2.2.12-alpha.27", "@budibase/frontend-core": "2.2.12-alpha.30",
"@budibase/string-templates": "2.2.12-alpha.27", "@budibase/string-templates": "2.2.12-alpha.30",
"@sentry/browser": "5.19.1", "@sentry/browser": "5.19.1",
"@spectrum-css/page": "^3.0.1", "@spectrum-css/page": "^3.0.1",
"@spectrum-css/vars": "^3.0.1", "@spectrum-css/vars": "^3.0.1",

View file

@ -26,9 +26,6 @@
<Avatar size="M" initials={$auth.initials} url={$auth.user.pictureUrl} /> <Avatar size="M" initials={$auth.initials} url={$auth.user.pictureUrl} />
<Icon size="XL" name="ChevronDown" /> <Icon size="XL" name="ChevronDown" />
</div> </div>
<MenuItem icon="Moon" on:click={() => themeModal.show()} dataCy="theme">
Theme
</MenuItem>
<MenuItem <MenuItem
icon="UserEdit" icon="UserEdit"
on:click={() => profileModal.show()} on:click={() => profileModal.show()}
@ -36,6 +33,9 @@
> >
My profile My profile
</MenuItem> </MenuItem>
<MenuItem icon="Moon" on:click={() => themeModal.show()} dataCy="theme">
Theme
</MenuItem>
<MenuItem icon="LockClosed" on:click={() => updatePasswordModal.show()}> <MenuItem icon="LockClosed" on:click={() => updatePasswordModal.show()}>
Update password Update password
</MenuItem> </MenuItem>

View file

@ -1,6 +1,6 @@
{ {
"name": "@budibase/cli", "name": "@budibase/cli",
"version": "2.2.12-alpha.27", "version": "2.2.12-alpha.30",
"description": "Budibase CLI, for developers, self hosting and migrations.", "description": "Budibase CLI, for developers, self hosting and migrations.",
"main": "src/index.js", "main": "src/index.js",
"bin": { "bin": {
@ -26,9 +26,9 @@
"outputPath": "build" "outputPath": "build"
}, },
"dependencies": { "dependencies": {
"@budibase/backend-core": "2.2.12-alpha.27", "@budibase/backend-core": "2.2.12-alpha.30",
"@budibase/string-templates": "2.2.12-alpha.27", "@budibase/string-templates": "2.2.12-alpha.30",
"@budibase/types": "2.2.12-alpha.27", "@budibase/types": "2.2.12-alpha.30",
"axios": "0.21.2", "axios": "0.21.2",
"chalk": "4.1.0", "chalk": "4.1.0",
"cli-progress": "3.11.2", "cli-progress": "3.11.2",

View file

@ -4019,7 +4019,8 @@
{ {
"type": "filter", "type": "filter",
"label": "Filtering", "label": "Filtering",
"key": "filter" "key": "filter",
"nested": true
}, },
{ {
"type": "field", "type": "field",
@ -4535,7 +4536,8 @@
{ {
"type": "filter", "type": "filter",
"label": "Filtering", "label": "Filtering",
"key": "filter" "key": "filter",
"nested": true
}, },
{ {
"type": "searchfield", "type": "searchfield",
@ -4665,7 +4667,8 @@
{ {
"type": "filter", "type": "filter",
"label": "Filtering", "label": "Filtering",
"key": "filter" "key": "filter",
"nested": true
}, },
{ {
"type": "field/sortable", "type": "field/sortable",
@ -4831,7 +4834,8 @@
{ {
"type": "filter", "type": "filter",
"label": "Filtering", "label": "Filtering",
"key": "filter" "key": "filter",
"nested": true
}, },
{ {
"type": "field/sortable", "type": "field/sortable",

View file

@ -1,6 +1,6 @@
{ {
"name": "@budibase/client", "name": "@budibase/client",
"version": "2.2.12-alpha.27", "version": "2.2.12-alpha.30",
"license": "MPL-2.0", "license": "MPL-2.0",
"module": "dist/budibase-client.js", "module": "dist/budibase-client.js",
"main": "dist/budibase-client.js", "main": "dist/budibase-client.js",
@ -19,9 +19,9 @@
"dev:builder": "rollup -cw" "dev:builder": "rollup -cw"
}, },
"dependencies": { "dependencies": {
"@budibase/bbui": "2.2.12-alpha.27", "@budibase/bbui": "2.2.12-alpha.30",
"@budibase/frontend-core": "2.2.12-alpha.27", "@budibase/frontend-core": "2.2.12-alpha.30",
"@budibase/string-templates": "2.2.12-alpha.27", "@budibase/string-templates": "2.2.12-alpha.30",
"@spectrum-css/button": "^3.0.3", "@spectrum-css/button": "^3.0.3",
"@spectrum-css/card": "^3.0.3", "@spectrum-css/card": "^3.0.3",
"@spectrum-css/divider": "^1.0.3", "@spectrum-css/divider": "^1.0.3",

View file

@ -1,5 +1,9 @@
<script> <script>
import { themeStore } from "stores" import { themeStore } from "stores"
import { setContext } from "svelte"
import { Context } from "@budibase/bbui"
setContext(Context.PopoverRoot, "#theme-root")
</script> </script>
<div style={$themeStore.customThemeCss} id="theme-root"> <div style={$themeStore.customThemeCss} id="theme-root">

View file

@ -36,9 +36,12 @@
let dataProviderId let dataProviderId
let repeaterId let repeaterId
let schema let schema
let enrichedSearchColumns
$: fetchSchema(dataSource) $: fetchSchema(dataSource)
$: enrichedSearchColumns = enrichSearchColumns(searchColumns, schema) $: enrichSearchColumns(searchColumns, schema).then(
val => (enrichedSearchColumns = val)
)
$: enrichedFilter = enrichFilter(filter, enrichedSearchColumns, formId) $: enrichedFilter = enrichFilter(filter, enrichedSearchColumns, formId)
$: cardWidth = cardHorizontal ? 420 : 300 $: cardWidth = cardHorizontal ? 420 : 300
$: fullCardURL = buildFullCardUrl( $: fullCardURL = buildFullCardUrl(

View file

@ -36,9 +36,12 @@
let newRowSidePanelId let newRowSidePanelId
let schema let schema
let primaryDisplay let primaryDisplay
let enrichedSearchColumns
$: fetchSchema(dataSource) $: fetchSchema(dataSource)
$: enrichedSearchColumns = enrichSearchColumns(searchColumns, schema) $: enrichSearchColumns(searchColumns, schema).then(
val => (enrichedSearchColumns = val)
)
$: enrichedFilter = enrichFilter(filter, enrichedSearchColumns, formId) $: enrichedFilter = enrichFilter(filter, enrichedSearchColumns, formId)
$: editTitle = getEditTitle(detailsFormBlockId, primaryDisplay) $: editTitle = getEditTitle(detailsFormBlockId, primaryDisplay)
$: normalFields = getNormalFields(schema) $: normalFields = getNormalFields(schema)

View file

@ -1,4 +1,5 @@
import { makePropSafe as safe } from "@budibase/string-templates" import { makePropSafe as safe } from "@budibase/string-templates"
import { API } from "../api/index.js"
// Map of data types to component types for search fields inside blocks // Map of data types to component types for search fields inside blocks
const schemaComponentMap = { const schemaComponentMap = {
@ -15,10 +16,28 @@ const schemaComponentMap = {
* @param searchColumns the search columns to use * @param searchColumns the search columns to use
* @param schema the datasource schema * @param schema the datasource schema
*/ */
export const enrichSearchColumns = (searchColumns, schema) => { export const enrichSearchColumns = async (searchColumns, schema) => {
if (!searchColumns?.length || !schema) {
return []
}
let enrichedColumns = [] let enrichedColumns = []
searchColumns?.forEach(column => { for (let column of searchColumns) {
const schemaType = schema?.[column]?.type let schemaType = schema[column]?.type
// Check if this is a field in another related table. The only way we can
// check this is checking for a "." inside the column, then checking if we
// have a link field named the same as that field prefix.
if (column.includes(".")) {
const split = column.split(".")
const sourceField = split[0]
const linkField = split.slice(1).join(".")
const linkSchema = schema[sourceField]
if (linkSchema?.type === "link") {
const linkedDef = await API.fetchTableDefinition(linkSchema.tableId)
schemaType = linkedDef?.schema?.[linkField]?.type
}
}
const componentType = schemaComponentMap[schemaType] const componentType = schemaComponentMap[schemaType]
if (componentType) { if (componentType) {
enrichedColumns.push({ enrichedColumns.push({
@ -27,7 +46,7 @@ export const enrichSearchColumns = (searchColumns, schema) => {
type: schemaType, type: schemaType,
}) })
} }
}) }
return enrichedColumns.slice(0, 5) return enrichedColumns.slice(0, 5)
} }
@ -57,12 +76,14 @@ export const enrichFilter = (filter, columns, formId) => {
value: `{{ ${binding} }}`, value: `{{ ${binding} }}`,
}) })
const format = "YYYY-MM-DDTHH:mm:ss.SSSZ" const format = "YYYY-MM-DDTHH:mm:ss.SSSZ"
let hbs = `{{ date (add (date ${binding} "x") 86399999) "${format}" }}`
hbs = `{{#if ${binding} }}${hbs}{{/if}}`
enrichedFilter.push({ enrichedFilter.push({
field: column.name, field: column.name,
type: column.type, type: column.type,
operator: "rangeHigh", operator: "rangeHigh",
valueType: "Binding", valueType: "Binding",
value: `{{ date (add (date ${binding} "x") 86399999) "${format}" }}`, value: hbs,
}) })
} }

View file

@ -1,12 +1,12 @@
{ {
"name": "@budibase/frontend-core", "name": "@budibase/frontend-core",
"version": "2.2.12-alpha.27", "version": "2.2.12-alpha.30",
"description": "Budibase frontend core libraries used in builder and client", "description": "Budibase frontend core libraries used in builder and client",
"author": "Budibase", "author": "Budibase",
"license": "MPL-2.0", "license": "MPL-2.0",
"svelte": "src/index.js", "svelte": "src/index.js",
"dependencies": { "dependencies": {
"@budibase/bbui": "2.2.12-alpha.27", "@budibase/bbui": "2.2.12-alpha.30",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"svelte": "^3.46.2" "svelte": "^3.46.2"
} }

View file

@ -1,6 +1,6 @@
{ {
"name": "@budibase/sdk", "name": "@budibase/sdk",
"version": "2.2.12-alpha.27", "version": "2.2.12-alpha.30",
"description": "Budibase Public API SDK", "description": "Budibase Public API SDK",
"author": "Budibase", "author": "Budibase",
"license": "MPL-2.0", "license": "MPL-2.0",

View file

@ -1,7 +1,7 @@
{ {
"name": "@budibase/server", "name": "@budibase/server",
"email": "hi@budibase.com", "email": "hi@budibase.com",
"version": "2.2.12-alpha.27", "version": "2.2.12-alpha.30",
"description": "Budibase Web Server", "description": "Budibase Web Server",
"main": "src/index.ts", "main": "src/index.ts",
"repository": { "repository": {
@ -43,11 +43,11 @@
"license": "GPL-3.0", "license": "GPL-3.0",
"dependencies": { "dependencies": {
"@apidevtools/swagger-parser": "10.0.3", "@apidevtools/swagger-parser": "10.0.3",
"@budibase/backend-core": "2.2.12-alpha.27", "@budibase/backend-core": "2.2.12-alpha.30",
"@budibase/client": "2.2.12-alpha.27", "@budibase/client": "2.2.12-alpha.30",
"@budibase/pro": "2.2.12-alpha.27", "@budibase/pro": "2.2.12-alpha.30",
"@budibase/string-templates": "2.2.12-alpha.27", "@budibase/string-templates": "2.2.12-alpha.30",
"@budibase/types": "2.2.12-alpha.27", "@budibase/types": "2.2.12-alpha.30",
"@bull-board/api": "3.7.0", "@bull-board/api": "3.7.0",
"@bull-board/koa": "3.9.4", "@bull-board/koa": "3.9.4",
"@elastic/elasticsearch": "7.10.0", "@elastic/elasticsearch": "7.10.0",

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{ {
"name": "@budibase/string-templates", "name": "@budibase/string-templates",
"version": "2.2.12-alpha.27", "version": "2.2.12-alpha.30",
"description": "Handlebars wrapper for Budibase templating.", "description": "Handlebars wrapper for Budibase templating.",
"main": "src/index.cjs", "main": "src/index.cjs",
"module": "dist/bundle.mjs", "module": "dist/bundle.mjs",

View file

@ -1,6 +1,6 @@
{ {
"name": "@budibase/types", "name": "@budibase/types",
"version": "2.2.12-alpha.27", "version": "2.2.12-alpha.30",
"description": "Budibase types", "description": "Budibase types",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",

View file

@ -1,7 +1,7 @@
{ {
"name": "@budibase/worker", "name": "@budibase/worker",
"email": "hi@budibase.com", "email": "hi@budibase.com",
"version": "2.2.12-alpha.27", "version": "2.2.12-alpha.30",
"description": "Budibase background service", "description": "Budibase background service",
"main": "src/index.ts", "main": "src/index.ts",
"repository": { "repository": {
@ -36,10 +36,10 @@
"author": "Budibase", "author": "Budibase",
"license": "GPL-3.0", "license": "GPL-3.0",
"dependencies": { "dependencies": {
"@budibase/backend-core": "2.2.12-alpha.27", "@budibase/backend-core": "2.2.12-alpha.30",
"@budibase/pro": "2.2.12-alpha.27", "@budibase/pro": "2.2.12-alpha.30",
"@budibase/string-templates": "2.2.12-alpha.27", "@budibase/string-templates": "2.2.12-alpha.30",
"@budibase/types": "2.2.12-alpha.27", "@budibase/types": "2.2.12-alpha.30",
"@koa/router": "8.0.8", "@koa/router": "8.0.8",
"@sentry/node": "6.17.7", "@sentry/node": "6.17.7",
"@techpass/passport-openidconnect": "0.3.2", "@techpass/passport-openidconnect": "0.3.2",

View file

@ -470,13 +470,13 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
"@budibase/backend-core@2.2.12-alpha.27": "@budibase/backend-core@2.2.12-alpha.30":
version "2.2.12-alpha.27" version "2.2.12-alpha.30"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.12-alpha.27.tgz#9c59fa0e2163fec672239887715003d32a36f9e8" resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.12-alpha.30.tgz#0adb36fb32914fa998b3c44f91442bda80c7de02"
integrity sha512-0+jJnT1VBwxo9FJlM7PT7SaC0Ikq0bQQBzqZONunJEA3xwj48YbBCqXYqRVR9EReeFhal87R3kmPxDObC4nN1g== integrity sha512-PJgitAwVS8heI7pxO3bwiNTrIuJnLJwtF0nNCconoklx8QZVXLLDMuusxICrDugilbGfWuOI2k4p5DgK22T+kA==
dependencies: dependencies:
"@budibase/nano" "10.1.1" "@budibase/nano" "10.1.1"
"@budibase/types" "2.2.12-alpha.27" "@budibase/types" "2.2.12-alpha.30"
"@shopify/jest-koa-mocks" "5.0.1" "@shopify/jest-koa-mocks" "5.0.1"
"@techpass/passport-openidconnect" "0.3.2" "@techpass/passport-openidconnect" "0.3.2"
aws-cloudfront-sign "2.2.0" aws-cloudfront-sign "2.2.0"
@ -521,23 +521,23 @@
qs "^6.11.0" qs "^6.11.0"
tough-cookie "^4.1.2" tough-cookie "^4.1.2"
"@budibase/pro@2.2.12-alpha.27": "@budibase/pro@2.2.12-alpha.30":
version "2.2.12-alpha.27" version "2.2.12-alpha.30"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.12-alpha.27.tgz#1892975760b10a3b18b4a8b3b4748d335011b09d" resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.12-alpha.30.tgz#bcf906828cfb9ce9ab6e2834c9465b426699f077"
integrity sha512-81lIWDe4xlebhjtBsrIiN3CAAOSLJMmgyU1j+DbTK5h65Qjg7ZhhMplkBew0icGMLqFMa3Zn9oyGkqiDsTeybA== integrity sha512-c8FbGk1Z9OAFtRE3PbjlZwju/5bUIEgYiGLavhR9dioo6o5H3j42SZX/1nnhfeykFbeMM9YUAzq7i8xmE5CtJA==
dependencies: dependencies:
"@budibase/backend-core" "2.2.12-alpha.27" "@budibase/backend-core" "2.2.12-alpha.30"
"@budibase/types" "2.2.12-alpha.27" "@budibase/types" "2.2.12-alpha.30"
"@koa/router" "8.0.8" "@koa/router" "8.0.8"
bull "4.10.1" bull "4.10.1"
joi "17.6.0" joi "17.6.0"
jsonwebtoken "8.5.1" jsonwebtoken "8.5.1"
node-fetch "^2.6.1" node-fetch "^2.6.1"
"@budibase/types@2.2.12-alpha.27": "@budibase/types@2.2.12-alpha.30":
version "2.2.12-alpha.27" version "2.2.12-alpha.30"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.12-alpha.27.tgz#bac49bec2da376d74dce38ba97dab6ace19a0db3" resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.12-alpha.30.tgz#e1d20adbb3a151c7935310bf03800e572b4498f6"
integrity sha512-90BQwBH36iYIUHPFWTt+Ygozj12zXoCs3HwRPZVcfyucNCe//1BgosFf8uNjxBwrqIDnM6D2yW9ZbiH339JrSA== integrity sha512-bShoMjQ1VqjrEfl5TeK94SCJUnnOCkWIB4AJOYIVr6thu+O0qyLwSP8YoTGtSKxXtJ2TAN3hIxx/EdDKMSrFqg==
"@cspotcode/source-map-support@^0.8.0": "@cspotcode/source-map-support@^0.8.0":
version "0.8.1" version "0.8.1"