1
0
Fork 0
mirror of synced 2024-07-07 15:25:52 +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",
"packages": [
"packages/*"

View file

@ -1,6 +1,6 @@
{
"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",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
@ -23,7 +23,7 @@
},
"dependencies": {
"@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",
"@techpass/passport-openidconnect": "0.3.2",
"aws-cloudfront-sign": "2.2.0",

View file

@ -1,7 +1,7 @@
{
"name": "@budibase/bbui",
"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",
"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": "2.2.12-alpha.27",
"@budibase/string-templates": "2.2.12-alpha.30",
"@spectrum-css/actionbutton": "1.0.1",
"@spectrum-css/actiongroup": "1.0.1",
"@spectrum-css/avatar": "3.0.2",

View file

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

View file

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

View file

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

View file

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

View file

@ -2,7 +2,7 @@ import filterTests from "../../support/filterTests"
// const interact = require("../support/interact")
filterTests(["smoke", "all"], () => {
context("Auth Configuration", () => {
xcontext("Auth Configuration", () => {
before(() => {
cy.login()
})
@ -21,7 +21,7 @@ filterTests(["smoke", "all"], () => {
cy.get("[data-cy=oidc-active]").should('not.be.checked')
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.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.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.get("@updateAuth").its("response.statusCode").should("eq", 200)
@ -85,11 +85,11 @@ filterTests(["smoke", "all"], () => {
cy.get(".auth-form input.spectrum-Textfield-input").type("Another ")
cy.get(".spectrum-Tags").find(".spectrum-Tags-item").its("length").should("eq", 6)
cy.get(".spectrum-Tags-item").contains("Another")
cy.get("button[data-cy=oidc-save]").should("not.be.disabled");
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.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.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.get("@updateAuth").its("response.statusCode").should("eq", 200)
@ -144,7 +144,7 @@ filterTests(["smoke", "all"], () => {
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)

View file

@ -3,107 +3,112 @@ const interact = require('../../support/interact')
filterTests(["smoke", "all"], () => {
context("User Settings Menu", () => {
before(() => {
cy.login()
})
it("should update user information via user settings menu", () => {
const fname = "test"
const lname = "user"
const fname = "test"
const lname = "user"
cy.visit(`${Cypress.config().baseUrl}/builder`)
cy.updateUserInformation(fname, lname)
cy.visit(`${Cypress.config().baseUrl}/builder`)
cy.updateUserInformation(fname, lname)
// Go to user info and confirm name update
cy.contains("Users").click()
cy.contains("test@test.com").click()
// Go to user info and confirm name update
cy.contains("Users").click()
cy.contains("test@test.com").click()
cy.get(interact.FIELD, { timeout: 1000 }).eq(1).within(() => {
cy.get(interact.SPECTRUM_TEXTFIELD_INPUT).should('have.value', fname)
})
cy.get(interact.FIELD).eq(2).within(() => {
cy.get(interact.SPECTRUM_TEXTFIELD_INPUT).should('have.value', lname)
})
cy.get(interact.FIELD, { timeout: 1000 }).eq(1).within(() => {
cy.get(interact.SPECTRUM_TEXTFIELD_INPUT).should('have.value', fname)
})
cy.get(interact.FIELD).eq(2).within(() => {
cy.get(interact.SPECTRUM_TEXTFIELD_INPUT).should('have.value', lname)
})
})
it("should allow copying of the users API key", () => {
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_DIALOG_CONTENT).within(() => {
cy.get(interact.SPECTRUM_ICON).click({force: true})
})
// There may be timing issues with this on the smoke build
cy.wait(500)
cy.get(".spectrum-Toast-content")
xit("should allow copying of the users API key", () => {
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_DIALOG_CONTENT).within(() => {
cy.get(interact.SPECTRUM_ICON).click({ force: true })
})
// There may be timing issues with this on the smoke build
cy.wait(500)
cy.get(".spectrum-Toast-content")
.contains("URL copied to clipboard")
.should("be.visible")
})
it("should allow API key regeneration", () => {
// Get initial API key value
cy.get(interact.SPECTRUM_DIALOG_CONTENT)
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
cy.get(interact.SPECTRUM_DIALOG_CONTENT)
.find(interact.SPECTRUM_TEXTFIELD_INPUT).invoke('val').as('keyOne')
// Click re-generate key button
cy.get("button").contains("Re-generate key").click({ force: true })
// Click re-generate key button
cy.get("button").contains("Regenerate key").click({ force: true })
// Verify API key was changed
cy.get(interact.SPECTRUM_DIALOG_CONTENT).within(() => {
cy.get('@keyOne').then((keyOne) => {
cy.get(interact.SPECTRUM_TEXTFIELD_INPUT).invoke('val').should('not.eq', keyOne)
})
// Verify API key was changed
cy.get(interact.SPECTRUM_DIALOG_CONTENT).within(() => {
cy.get('@keyOne').then((keyOne) => {
cy.get(interact.SPECTRUM_TEXTFIELD_INPUT).invoke('val').should('not.eq', keyOne)
})
cy.closeModal()
})
cy.closeModal()
})
it("should update password", () => {
// Access Update password modal
cy.get(".user-dropdown .avatar > .icon", { timeout: 2000 }).click({ force: true })
cy.get(interact.SPECTRUM_MENU_ITEM).contains("Update password").click({ force: true })
// Access Update password modal
cy.get(".user-dropdown .icon", { timeout: 2000 }).click({ force: true })
cy.get(interact.SPECTRUM_MENU_ITEM).contains("Update password").click({ force: true })
// Enter new password and update
cy.get(interact.SPECTRUM_DIALOG_GRID).within(() => {
for (let i = 0; i < 2; i++) {
// password set to 'newpwd'
cy.get(interact.SPECTRUM_TEXTFIELD_INPUT).eq(i).type("newpwd")
}
cy.get("button").contains("Update password").click({ force: true })
})
// Enter new password and update
cy.get(interact.SPECTRUM_DIALOG_GRID).within(() => {
for (let i = 0; i < 2; i++) {
// password set to 'newpwd'
cy.get(interact.SPECTRUM_TEXTFIELD_INPUT).eq(i).type("newpwd")
}
cy.get("button").contains("Update password").click({ force: true })
})
// Logout & in with new password
//cy.logOut()
cy.login("test@test.com", "newpwd")
// Logout & in with new password
//cy.logOut()
cy.login("test@test.com", "newpwd")
})
it("should open and close developer mode", () => {
cy.get(".user-dropdown .avatar > .icon", { timeout: 2000 }).click({ force: true })
// Close developer mode & verify
cy.get(interact.SPECTRUM_MENU_ITEM).contains("Close developer mode").click({ force: true })
cy.get(interact.SPECTRUM_SIDENAV).should('not.exist') // No config sections
cy.get(interact.CREATE_APP_BUTTON).should('not.exist') // No create app button
cy.get(".app").should('not.exist') // At least one app should be available
xit("should open and close developer mode", () => {
cy.get(".user-dropdown .icon", { timeout: 2000 }).click({ force: true })
// Open developer mode & verify
cy.get(".avatar > .icon").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(interact.CREATE_APP_BUTTON).should('exist') // create app button available
// Close developer mode & verify
cy.get(interact.SPECTRUM_MENU_ITEM).contains("Close developer mode").click({ force: true })
cy.get(interact.SPECTRUM_SIDENAV).should('not.exist') // No config sections
cy.get(interact.CREATE_APP_BUTTON).should('not.exist') // No create app button
cy.get(".app").should('not.exist') // At least one app should be available
// Open developer mode & verify
cy.get(".avatar > .icon").click({ force: true })
cy.get(interact.SPECTRUM_MENU_ITEM).contains("Open developer mode").click({ force: true })
cy.get(".app-table").should('exist') // config sections available
cy.get(interact.CREATE_APP_BUTTON).should('exist') // create app button available
})
after(() => {
// Change password back to original value
cy.get(".user-dropdown .avatar > .icon", { timeout: 2000 }).click({ force: true })
cy.get(interact.SPECTRUM_MENU_ITEM).contains("Update password").click({ force: true })
cy.get(interact.SPECTRUM_DIALOG_GRID).within(() => {
for (let i = 0; i < 2; i++) {
cy.get(interact.SPECTRUM_TEXTFIELD_INPUT).eq(i).type("test")
}
cy.get("button").contains("Update password").click({ force: true })
})
// Remove users name
cy.updateUserInformation()
// Change password back to original value
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_DIALOG_GRID).within(() => {
for (let i = 0; i < 2; i++) {
cy.get(interact.SPECTRUM_TEXTFIELD_INPUT).eq(i).type("test")
}
cy.get("button").contains("Update password").click({ force: true })
})
// Remove users name
cy.updateUserInformation()
})
})
})

View file

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

View file

@ -14,15 +14,15 @@ filterTests(['smoke', 'all'], () => {
cy.visit(`${Cypress.config().baseUrl}/builder/portal/apps/create`, { timeout: 5000 }) //added /portal/apps/create
cy.wait(1000)
cy.get(interact.CREATE_APP_BUTTON, { timeout: 10000 }).contains('Start from scratch').should("exist")
cy.get(interact.TEMPLATE_CATEGORY_FILTER).should("exist")
cy.get(interact.TEMPLATE_CATEGORY).should("exist")
cy.get(interact.APP_TABLE).should("not.exist")
})
}
it("should provide filterable templates", () => {
xit("should provide filterable templates", () => {
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000 })
cy.wait(500)
@ -30,16 +30,16 @@ filterTests(['smoke', 'all'], () => {
.its("body")
.then(val => {
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 })
}
})
cy.get(interact.TEMPLATE_CATEGORY_FILTER).should("exist")
cy.get(interact.TEMPLATE_CATEGORY).should("exist")
cy.get(interact.TEMPLATE_CATEGORY_ACTIONGROUP).its('length').should('be.gt', 1)
cy.get(interact.TEMPLATE_CATEGORY_FILTER_ACTIONBUTTON).its('length').should('be.gt', 2)
cy.get(interact.TEMPLATE_CATEGORY_FILTER_ACTIONBUTTON).eq(1).click()
cy.get(interact.TEMPLATE_CATEGORY_ACTIONGROUP).should('have.length', 1)
@ -104,14 +104,14 @@ filterTests(['smoke', 'all'], () => {
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 5000 })
cy.updateUserInformation("Ted", "Userman")
cy.createApp("", false)
cy.applicationInAppTable("Teds app")
cy.deleteApp("Teds app")
// Accomodate names that end in 'S'
cy.updateUserInformation("Chris", "Userman")
cy.createApp("", false)
cy.applicationInAppTable("Chris app")
cy.deleteApp("Chris app")
@ -123,35 +123,49 @@ filterTests(['smoke', 'all'], () => {
const exportedApp = 'cypress/fixtures/exported-app.txt'
cy.importApp(exportedApp, "")
cy.visit(`${Cypress.config().baseUrl}/builder`, { timeout: 2000 })
cy.applicationInAppTable("My app")
cy.get(".appTable .name").eq(0).click()
cy.deleteApp("My app")
cy.get(".app-table .name").eq(0).click()
cy.closeModal()
cy.get(`[aria-label="ShowMenu"]`).click()
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", () => {
const exportedApp = 'cypress/fixtures/exported-app.txt'
cy.updateUserInformation("Ted", "Userman")
cy.importApp(exportedApp, "")
cy.visit(`${Cypress.config().baseUrl}/builder`)
cy.applicationInAppTable("Teds app")
cy.get(".appTable .name").eq(0).click()
cy.deleteApp("Teds app")
cy.get(".app-table .name").eq(0).click()
cy.closeModal()
cy.get(`[aria-label="ShowMenu"]`).click()
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("", "")
})
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.wait(500)
@ -172,28 +186,28 @@ filterTests(['smoke', 'all'], () => {
const card = cy.get('.template-card').eq(0).should("exist");
const cardOverlay = card.get('.template-thumbnail-action-overlay').should("exist")
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
cy.get(".spectrum-Modal").should('be.visible')
const templateName = cy.get(".spectrum-Modal .template-thumbnail-text")
templateName.invoke('text')
.then(templateNameText => {
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(1).should("have.value", templateNameParsed)
.then(templateNameText => {
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(1).should("have.value", templateNameParsed)
cy.get(".spectrum-Modal .spectrum-ButtonGroup").contains("Create app").click()
cy.wait(5000)
cy.visit(`${Cypress.config().baseUrl}/builder`)
cy.wait(2000)
cy.get(".spectrum-Modal .spectrum-ButtonGroup").contains("Create app").click()
cy.wait(5000)
cy.applicationInAppTable(templateNameText)
cy.deleteApp(templateNameText)
});
cy.visit(`${Cypress.config().baseUrl}/builder`)
cy.wait(2000)
cy.applicationInAppTable(templateNameText)
cy.deleteApp(templateNameText)
});
})
@ -217,5 +231,5 @@ filterTests(['smoke', 'all'], () => {
cy.deleteApp(secondAppName)
})
})
})
})

View file

@ -101,7 +101,7 @@ Cypress.Commands.add("deleteUser", email => {
})
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,
})
@ -132,7 +132,7 @@ Cypress.Commands.add("updateUserInformation", (firstName, lastName) => {
.blur()
}
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")
})
@ -222,9 +222,12 @@ Cypress.Commands.add("deleteApp", name => {
// Go to app overview
const appIdParsed = appId.split("_").pop()
const actionEleId = `[data-cy=row_actions_${appIdParsed}]`
cy.get(actionEleId).within(() => {
cy.contains("Manage").click({ force: true })
cy.get(actionEleId).click()
cy.get(`[aria-label="ShowMenu"]`).click()
cy.get(".spectrum-Menu").within(() => {
cy.contains("Overview").click()
})
cy.wait(500)
// Unpublish first if needed
@ -400,7 +403,7 @@ Cypress.Commands.add("searchForApplication", appName => {
return
} else {
// Searches for the app
cy.get(".filter").then(() => {
cy.get(".spectrum-Search").then(() => {
cy.get(".spectrum-Textfield").within(() => {
cy.get("input").eq(0).clear({ 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
Cypress.Commands.add("applicationInAppTable", appName => {
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")
})
})

View file

@ -1,6 +1,6 @@
{
"name": "@budibase/builder",
"version": "2.2.12-alpha.27",
"version": "2.2.12-alpha.30",
"license": "GPL-3.0",
"private": true,
"scripts": {
@ -71,10 +71,10 @@
}
},
"dependencies": {
"@budibase/bbui": "2.2.12-alpha.27",
"@budibase/client": "2.2.12-alpha.27",
"@budibase/frontend-core": "2.2.12-alpha.27",
"@budibase/string-templates": "2.2.12-alpha.27",
"@budibase/bbui": "2.2.12-alpha.30",
"@budibase/client": "2.2.12-alpha.30",
"@budibase/frontend-core": "2.2.12-alpha.30",
"@budibase/string-templates": "2.2.12-alpha.30",
"@sentry/browser": "5.19.1",
"@spectrum-css/page": "^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} />
<Icon size="XL" name="ChevronDown" />
</div>
<MenuItem icon="Moon" on:click={() => themeModal.show()} dataCy="theme">
Theme
</MenuItem>
<MenuItem
icon="UserEdit"
on:click={() => profileModal.show()}
@ -36,6 +33,9 @@
>
My profile
</MenuItem>
<MenuItem icon="Moon" on:click={() => themeModal.show()} dataCy="theme">
Theme
</MenuItem>
<MenuItem icon="LockClosed" on:click={() => updatePasswordModal.show()}>
Update password
</MenuItem>

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,4 +1,5 @@
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
const schemaComponentMap = {
@ -15,10 +16,28 @@ const schemaComponentMap = {
* @param searchColumns the search columns to use
* @param schema the datasource schema
*/
export const enrichSearchColumns = (searchColumns, schema) => {
export const enrichSearchColumns = async (searchColumns, schema) => {
if (!searchColumns?.length || !schema) {
return []
}
let enrichedColumns = []
searchColumns?.forEach(column => {
const schemaType = schema?.[column]?.type
for (let column of searchColumns) {
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]
if (componentType) {
enrichedColumns.push({
@ -27,7 +46,7 @@ export const enrichSearchColumns = (searchColumns, schema) => {
type: schemaType,
})
}
})
}
return enrichedColumns.slice(0, 5)
}
@ -57,12 +76,14 @@ export const enrichFilter = (filter, columns, formId) => {
value: `{{ ${binding} }}`,
})
const format = "YYYY-MM-DDTHH:mm:ss.SSSZ"
let hbs = `{{ date (add (date ${binding} "x") 86399999) "${format}" }}`
hbs = `{{#if ${binding} }}${hbs}{{/if}}`
enrichedFilter.push({
field: column.name,
type: column.type,
operator: "rangeHigh",
valueType: "Binding",
value: `{{ date (add (date ${binding} "x") 86399999) "${format}" }}`,
value: hbs,
})
}

View file

@ -1,12 +1,12 @@
{
"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",
"author": "Budibase",
"license": "MPL-2.0",
"svelte": "src/index.js",
"dependencies": {
"@budibase/bbui": "2.2.12-alpha.27",
"@budibase/bbui": "2.2.12-alpha.30",
"lodash": "^4.17.21",
"svelte": "^3.46.2"
}

View file

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

View file

@ -1,7 +1,7 @@
{
"name": "@budibase/server",
"email": "hi@budibase.com",
"version": "2.2.12-alpha.27",
"version": "2.2.12-alpha.30",
"description": "Budibase Web Server",
"main": "src/index.ts",
"repository": {
@ -43,11 +43,11 @@
"license": "GPL-3.0",
"dependencies": {
"@apidevtools/swagger-parser": "10.0.3",
"@budibase/backend-core": "2.2.12-alpha.27",
"@budibase/client": "2.2.12-alpha.27",
"@budibase/pro": "2.2.12-alpha.27",
"@budibase/string-templates": "2.2.12-alpha.27",
"@budibase/types": "2.2.12-alpha.27",
"@budibase/backend-core": "2.2.12-alpha.30",
"@budibase/client": "2.2.12-alpha.30",
"@budibase/pro": "2.2.12-alpha.30",
"@budibase/string-templates": "2.2.12-alpha.30",
"@budibase/types": "2.2.12-alpha.30",
"@bull-board/api": "3.7.0",
"@bull-board/koa": "3.9.4",
"@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",
"version": "2.2.12-alpha.27",
"version": "2.2.12-alpha.30",
"description": "Handlebars wrapper for Budibase templating.",
"main": "src/index.cjs",
"module": "dist/bundle.mjs",

View file

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

View file

@ -1,7 +1,7 @@
{
"name": "@budibase/worker",
"email": "hi@budibase.com",
"version": "2.2.12-alpha.27",
"version": "2.2.12-alpha.30",
"description": "Budibase background service",
"main": "src/index.ts",
"repository": {
@ -36,10 +36,10 @@
"author": "Budibase",
"license": "GPL-3.0",
"dependencies": {
"@budibase/backend-core": "2.2.12-alpha.27",
"@budibase/pro": "2.2.12-alpha.27",
"@budibase/string-templates": "2.2.12-alpha.27",
"@budibase/types": "2.2.12-alpha.27",
"@budibase/backend-core": "2.2.12-alpha.30",
"@budibase/pro": "2.2.12-alpha.30",
"@budibase/string-templates": "2.2.12-alpha.30",
"@budibase/types": "2.2.12-alpha.30",
"@koa/router": "8.0.8",
"@sentry/node": "6.17.7",
"@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"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
"@budibase/backend-core@2.2.12-alpha.27":
version "2.2.12-alpha.27"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.12-alpha.27.tgz#9c59fa0e2163fec672239887715003d32a36f9e8"
integrity sha512-0+jJnT1VBwxo9FJlM7PT7SaC0Ikq0bQQBzqZONunJEA3xwj48YbBCqXYqRVR9EReeFhal87R3kmPxDObC4nN1g==
"@budibase/backend-core@2.2.12-alpha.30":
version "2.2.12-alpha.30"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.12-alpha.30.tgz#0adb36fb32914fa998b3c44f91442bda80c7de02"
integrity sha512-PJgitAwVS8heI7pxO3bwiNTrIuJnLJwtF0nNCconoklx8QZVXLLDMuusxICrDugilbGfWuOI2k4p5DgK22T+kA==
dependencies:
"@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"
"@techpass/passport-openidconnect" "0.3.2"
aws-cloudfront-sign "2.2.0"
@ -521,23 +521,23 @@
qs "^6.11.0"
tough-cookie "^4.1.2"
"@budibase/pro@2.2.12-alpha.27":
version "2.2.12-alpha.27"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.12-alpha.27.tgz#1892975760b10a3b18b4a8b3b4748d335011b09d"
integrity sha512-81lIWDe4xlebhjtBsrIiN3CAAOSLJMmgyU1j+DbTK5h65Qjg7ZhhMplkBew0icGMLqFMa3Zn9oyGkqiDsTeybA==
"@budibase/pro@2.2.12-alpha.30":
version "2.2.12-alpha.30"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.12-alpha.30.tgz#bcf906828cfb9ce9ab6e2834c9465b426699f077"
integrity sha512-c8FbGk1Z9OAFtRE3PbjlZwju/5bUIEgYiGLavhR9dioo6o5H3j42SZX/1nnhfeykFbeMM9YUAzq7i8xmE5CtJA==
dependencies:
"@budibase/backend-core" "2.2.12-alpha.27"
"@budibase/types" "2.2.12-alpha.27"
"@budibase/backend-core" "2.2.12-alpha.30"
"@budibase/types" "2.2.12-alpha.30"
"@koa/router" "8.0.8"
bull "4.10.1"
joi "17.6.0"
jsonwebtoken "8.5.1"
node-fetch "^2.6.1"
"@budibase/types@2.2.12-alpha.27":
version "2.2.12-alpha.27"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.12-alpha.27.tgz#bac49bec2da376d74dce38ba97dab6ace19a0db3"
integrity sha512-90BQwBH36iYIUHPFWTt+Ygozj12zXoCs3HwRPZVcfyucNCe//1BgosFf8uNjxBwrqIDnM6D2yW9ZbiH339JrSA==
"@budibase/types@2.2.12-alpha.30":
version "2.2.12-alpha.30"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.12-alpha.30.tgz#e1d20adbb3a151c7935310bf03800e572b4498f6"
integrity sha512-bShoMjQ1VqjrEfl5TeK94SCJUnnOCkWIB4AJOYIVr6thu+O0qyLwSP8YoTGtSKxXtJ2TAN3hIxx/EdDKMSrFqg==
"@cspotcode/source-map-support@^0.8.0":
version "0.8.1"