Merge branch 'develop' into cypressTests

This commit is contained in:
MihailHadzhiev2022 2022-05-17 11:01:13 +03:00
commit 69ab518ac9
38 changed files with 479 additions and 254 deletions

View File

@ -1,4 +1,5 @@
name: Budibase Release Staging
concurrency: release-develop
on:
push:

View File

@ -87,3 +87,10 @@ jobs:
packages/cli/build/cli-macos
packages/server/specs/openapi.yaml
packages/server/specs/openapi.json
- name: Discord Webhook Action
uses: tsickert/discord-webhook@v4.0.0
with:
webhook-url: ${{ secrets.PROD_DEPLOY_WEBHOOK_URL }}
content: "Self Host Deployment Complete: ${{ env.RELEASE_VERSION }} deployed to Self Host."
embed-title: ${{ env.RELEASE_VERSION }}

View File

@ -1,4 +1,5 @@
name: Budibase Release
concurrency: release
on:
push:

View File

@ -1,5 +1,5 @@
{
"version": "1.0.155-alpha.3",
"version": "1.0.159-alpha.3",
"npmClient": "yarn",
"packages": [
"packages/*"

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/backend-core",
"version": "1.0.155-alpha.3",
"version": "1.0.159-alpha.3",
"description": "Budibase backend core libraries used in server and worker",
"main": "src/index.js",
"author": "Budibase",

View File

@ -96,6 +96,7 @@ const BUILTIN_PERMISSIONS = {
new Permission(PermissionTypes.QUERY, PermissionLevels.WRITE),
new Permission(PermissionTypes.TABLE, PermissionLevels.WRITE),
new Permission(PermissionTypes.VIEW, PermissionLevels.READ),
new Permission(PermissionTypes.AUTOMATION, PermissionLevels.EXECUTE),
],
},
POWER: {

View File

@ -805,13 +805,6 @@ ast-types@0.9.6:
resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.6.tgz#102c9e9e9005d3e7e3829bf0c4fa24ee862ee9b9"
integrity sha1-ECyenpAF0+fjgpvwxPok7oYu6bk=
async-hook-jl@^1.7.6:
version "1.7.6"
resolved "https://registry.yarnpkg.com/async-hook-jl/-/async-hook-jl-1.7.6.tgz#4fd25c2f864dbaf279c610d73bf97b1b28595e68"
integrity sha512-gFaHkFfSxTjvoxDMYqDuGHlcRyUuamF8s+ZTtJdDzqjws4mCt7v0vuV79/E2Wr2/riMQgtG4/yUtXWs1gZ7JMg==
dependencies:
stack-chain "^1.3.7"
async@~2.1.4:
version "2.1.5"
resolved "https://registry.yarnpkg.com/async/-/async-2.1.5.tgz#e587c68580994ac67fc56ff86d3ac56bdbe810bc"
@ -1205,15 +1198,6 @@ clone-buffer@1.0.0:
resolved "https://registry.yarnpkg.com/clone-buffer/-/clone-buffer-1.0.0.tgz#e3e25b207ac4e701af721e2cb5a16792cac3dc58"
integrity sha1-4+JbIHrE5wGvch4staFnksrD3Fg=
cls-hooked@^4.2.2:
version "4.2.2"
resolved "https://registry.yarnpkg.com/cls-hooked/-/cls-hooked-4.2.2.tgz#ad2e9a4092680cdaffeb2d3551da0e225eae1908"
integrity sha512-J4Xj5f5wq/4jAvcdgoGsL3G103BtWpZrMo8NEinRltN+xpTZdI+M38pyQqhuFU/P792xkMFvnKSf+Lm81U1bxw==
dependencies:
async-hook-jl "^1.7.6"
emitter-listener "^1.0.1"
semver "^5.4.1"
cluster-key-slot@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/cluster-key-slot/-/cluster-key-slot-1.1.0.tgz#30474b2a981fb12172695833052bc0d01336d10d"
@ -1533,7 +1517,7 @@ electron-to-chromium@^1.3.896:
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.900.tgz#5be2c5818a2a012c511b4b43e87b6ab7a296d4f5"
integrity sha512-SuXbQD8D4EjsaBaJJxySHbC+zq8JrFfxtb4GIr4E9n1BcROyMcRrJCYQNpJ9N+Wjf5mFp7Wp0OHykd14JNEzzQ==
emitter-listener@^1.0.1, emitter-listener@^1.1.2:
emitter-listener@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/emitter-listener/-/emitter-listener-1.1.2.tgz#56b140e8f6992375b3d7cb2cab1cc7432d9632e8"
integrity sha512-Bt1sBAGFHY9DKY+4/2cV6izcKJUf5T7/gkdmkxzX/qv9CcGH8xSwVRW5mtX03SWJtRTWSOpzCuWN9rBFYZepZQ==
@ -4466,7 +4450,7 @@ saxes@^5.0.1:
dependencies:
xmlchars "^2.2.0"
"semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.6.0:
"semver@2 || 3 || 4 || 5", semver@^5.5.0, semver@^5.6.0:
version "5.7.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
@ -4706,11 +4690,6 @@ sshpk@^1.7.0:
jsbn "~0.1.0"
tweetnacl "~0.14.0"
stack-chain@^1.3.7:
version "1.3.7"
resolved "https://registry.yarnpkg.com/stack-chain/-/stack-chain-1.3.7.tgz#d192c9ff4ea6a22c94c4dd459171e3f00cea1285"
integrity sha1-0ZLJ/06moiyUxN1FkXHj8AzqEoU=
stack-utils@^2.0.2:
version "2.0.5"
resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.5.tgz#d25265fca995154659dbbfba3b49254778d2fdd5"

View File

@ -1,7 +1,7 @@
{
"name": "@budibase/bbui",
"description": "A UI solution used in the different Budibase projects.",
"version": "1.0.155-alpha.3",
"version": "1.0.159-alpha.3",
"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.0.155-alpha.3",
"@budibase/string-templates": "^1.0.159-alpha.3",
"@spectrum-css/actionbutton": "^1.0.1",
"@spectrum-css/actiongroup": "^1.0.1",
"@spectrum-css/avatar": "^3.0.2",

View File

@ -0,0 +1,68 @@
<script>
import "@spectrum-css/fieldgroup/dist/index-vars.css"
import "@spectrum-css/radio/dist/index-vars.css"
import { createEventDispatcher } from "svelte"
export let direction = "vertical"
export let value = []
export let options = []
export let error = null
export let disabled = false
export let getOptionLabel = option => option
export let getOptionValue = option => option
const dispatch = createEventDispatcher()
const onChange = e => {
let tempValue = value
let isChecked = e.target.checked
if (!tempValue.includes(e.target.value) && isChecked) {
tempValue.push(e.target.value)
}
value = tempValue
dispatch(
"change",
tempValue.filter(val => val !== e.target.value || isChecked)
)
}
</script>
<div class={`spectrum-FieldGroup spectrum-FieldGroup--${direction}`}>
{#if options && Array.isArray(options)}
{#each options as option}
<div
title={getOptionLabel(option)}
class="spectrum-Checkbox spectrum-FieldGroup-item"
class:is-invalid={!!error}
>
<label
class="spectrum-Checkbox spectrum-Checkbox--sizeM spectrum-FieldGroup-item"
>
<input
on:change={onChange}
value={getOptionValue(option)}
type="checkbox"
class="spectrum-Checkbox-input"
{disabled}
checked={value.includes(getOptionValue(option))}
/>
<span class="spectrum-Checkbox-box">
<svg
class="spectrum-Icon spectrum-UIIcon-Checkmark100 spectrum-Checkbox-checkmark"
focusable="false"
aria-hidden="true"
>
<use xlink:href="#spectrum-css-icon-Checkmark100" />
</svg>
</span>
<span class="spectrum-Checkbox-label">{getOptionLabel(option)}</span>
</label>
</div>
{/each}
{/if}
</div>
<style>
.spectrum-Checkbox-input {
opacity: 0;
}
</style>

View File

@ -43,7 +43,7 @@
return
}
searchTerm = null
open = true
open = !open
}
const getSortedOptions = (options, getLabel, sort) => {
@ -71,105 +71,73 @@
}
</script>
<button
{id}
class="spectrum-Picker spectrum-Picker--sizeM"
class:spectrum-Picker--quiet={quiet}
{disabled}
class:is-invalid={!!error}
class:is-open={open}
aria-haspopup="listbox"
on:mousedown={onClick}
>
{#if fieldIcon}
<span class="icon-Placeholder-Padding">
<img src={fieldIcon} alt="icon" width="20" height="15" />
</span>
{/if}
<span
class="spectrum-Picker-label"
class:is-placeholder={isPlaceholder}
class:auto-width={autoWidth}
<div use:clickOutside={() => (open = false)}>
<button
{id}
class="spectrum-Picker spectrum-Picker--sizeM"
class:spectrum-Picker--quiet={quiet}
{disabled}
class:is-invalid={!!error}
class:is-open={open}
aria-haspopup="listbox"
on:mousedown={onClick}
>
{fieldText}
</span>
{#if error}
{#if fieldIcon}
<span class="icon-Placeholder-Padding">
<img src={fieldIcon} alt="icon" width="20" height="15" />
</span>
{/if}
<span
class="spectrum-Picker-label"
class:is-placeholder={isPlaceholder}
class:auto-width={autoWidth}
>
{fieldText}
</span>
{#if error}
<svg
class="spectrum-Icon spectrum-Icon--sizeM spectrum-Picker-validationIcon"
focusable="false"
aria-hidden="true"
aria-label="Folder"
>
<use xlink:href="#spectrum-icon-18-Alert" />
</svg>
{/if}
<svg
class="spectrum-Icon spectrum-Icon--sizeM spectrum-Picker-validationIcon"
class="spectrum-Icon spectrum-UIIcon-ChevronDown100 spectrum-Picker-menuIcon"
focusable="false"
aria-hidden="true"
aria-label="Folder"
>
<use xlink:href="#spectrum-icon-18-Alert" />
<use xlink:href="#spectrum-css-icon-Chevron100" />
</svg>
{/if}
<svg
class="spectrum-Icon spectrum-UIIcon-ChevronDown100 spectrum-Picker-menuIcon"
focusable="false"
aria-hidden="true"
>
<use xlink:href="#spectrum-css-icon-Chevron100" />
</svg>
</button>
{#if open}
<div
use:clickOutside={() => (open = false)}
transition:fly|local={{ y: -20, duration: 200 }}
class="spectrum-Popover spectrum-Popover--bottom spectrum-Picker-popover is-open"
class:auto-width={autoWidth}
>
{#if autocomplete}
<Search
value={searchTerm}
on:change={event => (searchTerm = event.detail)}
{disabled}
placeholder="Search"
/>
{/if}
<ul class="spectrum-Menu" role="listbox">
{#if placeholderOption}
<li
class="spectrum-Menu-item placeholder"
class:is-selected={isPlaceholder}
role="option"
aria-selected="true"
tabindex="0"
on:click={() => onSelectOption(null)}
>
<span class="spectrum-Menu-itemLabel">{placeholderOption}</span>
<svg
class="spectrum-Icon spectrum-UIIcon-Checkmark100 spectrum-Menu-checkmark spectrum-Menu-itemIcon"
focusable="false"
aria-hidden="true"
>
<use xlink:href="#spectrum-css-icon-Checkmark100" />
</svg>
</li>
</button>
{#if open}
<div
transition:fly|local={{ y: -20, duration: 200 }}
class="spectrum-Popover spectrum-Popover--bottom spectrum-Picker-popover is-open"
class:auto-width={autoWidth}
>
{#if autocomplete}
<Search
value={searchTerm}
on:change={event => (searchTerm = event.detail)}
{disabled}
placeholder="Search"
/>
{/if}
{#if filteredOptions.length}
{#each filteredOptions as option, idx}
<ul class="spectrum-Menu" role="listbox">
{#if placeholderOption}
<li
class="spectrum-Menu-item"
class:is-selected={isOptionSelected(getOptionValue(option, idx))}
class="spectrum-Menu-item placeholder"
class:is-selected={isPlaceholder}
role="option"
aria-selected="true"
tabindex="0"
on:click={() => onSelectOption(getOptionValue(option, idx))}
on:click={() => onSelectOption(null)}
>
{#if getOptionIcon(option, idx)}
<span class="icon-Padding">
<img
src={getOptionIcon(option, idx)}
alt="icon"
width="20"
height="15"
/>
</span>
{/if}
<span class="spectrum-Menu-itemLabel">
{getOptionLabel(option, idx)}
</span>
<span class="spectrum-Menu-itemLabel">{placeholderOption}</span>
<svg
class="spectrum-Icon spectrum-UIIcon-Checkmark100 spectrum-Menu-checkmark spectrum-Menu-itemIcon"
focusable="false"
@ -178,11 +146,44 @@
<use xlink:href="#spectrum-css-icon-Checkmark100" />
</svg>
</li>
{/each}
{/if}
</ul>
</div>
{/if}
{/if}
{#if filteredOptions.length}
{#each filteredOptions as option, idx}
<li
class="spectrum-Menu-item"
class:is-selected={isOptionSelected(getOptionValue(option, idx))}
role="option"
aria-selected="true"
tabindex="0"
on:click={() => onSelectOption(getOptionValue(option, idx))}
>
{#if getOptionIcon(option, idx)}
<span class="icon-Padding">
<img
src={getOptionIcon(option, idx)}
alt="icon"
width="20"
height="15"
/>
</span>
{/if}
<span class="spectrum-Menu-itemLabel">
{getOptionLabel(option, idx)}
</span>
<svg
class="spectrum-Icon spectrum-UIIcon-Checkmark100 spectrum-Menu-checkmark spectrum-Menu-itemIcon"
focusable="false"
aria-hidden="true"
>
<use xlink:href="#spectrum-css-icon-Checkmark100" />
</svg>
</li>
{/each}
{/if}
</ul>
</div>
{/if}
</div>
<style>
.spectrum-Popover {

View File

@ -1,6 +1,6 @@
<script>
import "@spectrum-css/textfield/dist/index-vars.css"
import { createEventDispatcher } from "svelte"
import { createEventDispatcher, onMount } from "svelte"
export let value = null
export let placeholder = null
@ -13,8 +13,11 @@
export let quiet = false
export let dataCy
export let align
export let autofocus = false
const dispatch = createEventDispatcher()
let field
let focus = false
const updateValue = newValue => {
@ -58,6 +61,11 @@
updateValue(event.target.value)
}
}
onMount(() => {
focus = autofocus
if (focus) field.focus()
})
</script>
<div
@ -77,6 +85,7 @@
</svg>
{/if}
<input
bind:this={field}
{disabled}
{readonly}
{id}

View File

@ -3,6 +3,7 @@ export { default as CoreSelect } from "./Select.svelte"
export { default as CoreMultiselect } from "./Multiselect.svelte"
export { default as CoreCheckbox } from "./Checkbox.svelte"
export { default as CoreRadioGroup } from "./RadioGroup.svelte"
export { default as CoreCheckboxGroup } from "./CheckboxGroup.svelte"
export { default as CoreTextArea } from "./TextArea.svelte"
export { default as CoreCombobox } from "./Combobox.svelte"
export { default as CoreSwitch } from "./Switch.svelte"

View File

@ -14,6 +14,7 @@
export let updateOnChange = true
export let quiet = false
export let dataCy
export let autofocus
const dispatch = createEventDispatcher()
const onChange = e => {
@ -33,6 +34,7 @@
{placeholder}
{type}
{quiet}
{autofocus}
on:change={onChange}
on:click
on:input

View File

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

File diff suppressed because one or more lines are too long

View File

@ -39,6 +39,71 @@ Cypress.Commands.add("closeModal", () => {
})
})
Cypress.Commands.add("importApp", (exportFilePath, name) => {
cy.visit(`${Cypress.config().baseUrl}/builder`)
cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`)
.its("body")
.then(val => {
if (val.length > 0) {
cy.get(`[data-cy="create-app-btn"]`).click({ force: true })
cy.wait(500)
}
cy.get(`[data-cy="import-app-btn"]`).click({ force: true })
})
cy.get(".spectrum-Modal").within(() => {
cy.get("input").eq(1).should("have.focus")
cy.get(".spectrum-Dropzone").selectFile(exportFilePath, {
action: "drag-drop",
})
cy.get(".gallery .filename").contains("exported-app.txt")
if (name && name != "") {
cy.get("input").eq(0).type(name).should("have.value", name).blur()
}
cy.get(".confirm-wrap button")
.should("not.be.disabled")
.click({ force: true })
cy.wait(5000)
})
})
Cypress.Commands.add("updateUserInformation", (firstName, lastName) => {
cy.get(".user-dropdown .avatar > .icon").click({ force: true })
cy.get(".spectrum-Popover[data-cy='user-menu']").within(() => {
cy.get("li[data-cy='user-info']").click({ force: true })
})
cy.get(".spectrum-Modal.is-open").within(() => {
cy.get("[data-cy='user-first-name']").clear()
if (!firstName || firstName == "") {
cy.get("[data-cy='user-first-name']").invoke("val").should("be.empty")
} else {
cy.get("[data-cy='user-first-name']")
.type(firstName)
.should("have.value", firstName)
.blur()
}
cy.get("[data-cy='user-last-name']").clear()
if (!lastName || lastName == "") {
cy.get("[data-cy='user-last-name']").invoke("val").should("be.empty")
} else {
cy.get("[data-cy='user-last-name']")
.type(lastName)
.should("have.value", lastName)
.blur()
}
cy.get("button").contains("Update information").click({ force: true })
})
})
Cypress.Commands.add("createApp", (name, addDefaultTable) => {
const shouldCreateDefaultTable =
typeof addDefaultTable != "boolean" ? true : addDefaultTable
@ -57,7 +122,11 @@ Cypress.Commands.add("createApp", (name, addDefaultTable) => {
})
cy.get(".spectrum-Modal").within(() => {
cy.get("input").eq(0).type(name).should("have.value", name).blur()
cy.get("input").eq(0).should("have.focus")
if (name && name != "") {
cy.get("input").eq(0).clear()
cy.get("input").eq(0).type(name).should("have.value", name).blur()
}
cy.get(".spectrum-ButtonGroup")
.contains("Create app")
.click({ force: true })
@ -573,7 +642,7 @@ Cypress.Commands.add("addDatasourceConfig", (datasource, skipFetch) => {
cy.get(".spectrum-Button")
.contains("Save and fetch tables")
.click({ force: true })
cy.wait(1000)
cy.wait(3000)
})
}
})

View File

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

View File

@ -60,7 +60,7 @@ export function getBindings({
)
const label = path == null ? column : `${path}.0.${column}`
const binding = path == null ? `[${column}]` : `${path}.0.[${column}]`
const binding = path == null ? `[${column}]` : `[${path}].0.[${column}]`
// only supply a description for relationship paths
const description =
path == null

View File

@ -27,6 +27,14 @@
Personalise the platform by adding your first name and last name.
</Body>
<Input disabled bind:value={$auth.user.email} label="Email" />
<Input bind:value={$values.firstName} label="First name" />
<Input bind:value={$values.lastName} label="Last name" />
<Input
bind:value={$values.firstName}
label="First name"
dataCy="user-first-name"
/>
<Input
bind:value={$values.lastName}
label="Last name"
dataCy="user-last-name"
/>
</ModalContent>

View File

@ -16,13 +16,26 @@
export let template
let creating = false
let defaultAppName
const values = writable({ name: "", url: null })
const validation = createValidationStore()
$: validation.check($values)
onMount(async () => {
$values.name = resolveAppName(template, $values.name)
const lastChar = $auth.user?.firstName
? $auth.user?.firstName[$auth.user?.firstName.length - 1]
: null
defaultAppName =
lastChar && lastChar.toLowerCase() == "s"
? `${$auth.user?.firstName} app`
: `${$auth.user.firstName}s app`
$values.name = resolveAppName(
template,
!$auth.user?.firstName ? "My app" : defaultAppName
)
nameToUrl($values.name)
await setupValidation()
})
@ -44,7 +57,7 @@
}
const resolveAppName = (template, name) => {
if (template && !name) {
if (template && !template.fromFile) {
return template.name
}
return name ? name.trim() : null
@ -83,7 +96,7 @@
}
data.append("useTemplate", template != null)
if (template) {
data.append("templateName", template.name) //or here?
data.append("templateName", template.name)
data.append("templateKey", template.key)
data.append("templateFile", $values.file)
}
@ -159,15 +172,14 @@
/>
{/if}
<Input
autofocus={true}
bind:value={$values.name}
disabled={creating}
error={$validation.touched.name && $validation.errors.name}
on:blur={() => ($validation.touched.name = true)}
on:change={nameToUrl($values.name)}
label="Name"
placeholder={$auth.user?.firstName
? `${$auth.user.firstName}s app`
: "My app"}
placeholder={defaultAppName}
/>
<span>
<Input

View File

@ -37,7 +37,7 @@
import AccessLevelSelect from "components/integration/AccessLevelSelect.svelte"
import DynamicVariableModal from "../../_components/DynamicVariableModal.svelte"
import Placeholder from "assets/bb-spaceship.svg"
import { cloneDeep, isEqual } from "lodash/fp"
import { cloneDeep } from "lodash/fp"
import { RawRestBodyTypes } from "constants/backend"
let query, datasource
@ -47,7 +47,6 @@
let response, schema, enabledHeaders
let authConfigId
let dynamicVariables, addVariableModal, varBinding
let baseQuery, baseDatasource, baseVariables
$: datasourceType = datasource?.source
$: integrationInfo = $integrations[datasourceType]
@ -63,15 +62,6 @@
$: hasSchema =
Object.keys(schema || {}).length !== 0 ||
Object.keys(query?.schema || {}).length !== 0
$: baseQuery = !baseQuery ? cloneDeep(query) : baseQuery
$: baseDatasource = !baseDatasource ? cloneDeep(datasource) : baseDatasource
$: baseVariables = !baseVariables
? cloneDeep(dynamicVariables)
: baseVariables
$: hasChanged =
!isEqual(baseQuery, query) ||
!isEqual(baseDatasource, datasource) ||
!isEqual(baseVariables, dynamicVariables)
function getSelectedQuery() {
return cloneDeep(
@ -130,9 +120,6 @@
datasource.config.dynamicVariables = rebuildVariables(saveId)
datasource = await datasources.save(datasource)
}
baseQuery = query
baseDatasource = datasource
baseVariables = dynamicVariables
} catch (err) {
notifications.error(`Error saving query`)
}
@ -346,7 +333,7 @@
</div>
<Button primary disabled={!url} on:click={runQuery}>Send</Button>
<Button
disabled={!query.name || !hasChanged}
disabled={!query.name}
cta
on:click={saveQuery}
tooltip={!hasSchema

View File

@ -69,7 +69,7 @@
<Layout noPadding>
<div class="header">
<img alt="logo" src={$organisation.logoUrl || Logo} />
<ActionMenu align="right">
<ActionMenu align="right" dataCy="user-menu">
<div slot="control" class="avatar">
<Avatar
size="M"

View File

@ -160,7 +160,7 @@
/>
</div>
<div class="user-dropdown">
<ActionMenu align="right">
<ActionMenu align="right" dataCy="user-menu">
<div slot="control" class="avatar">
<Avatar
size="M"
@ -169,7 +169,11 @@
/>
<Icon size="XL" name="ChevronDown" />
</div>
<MenuItem icon="UserEdit" on:click={() => userInfoModal.show()}>
<MenuItem
icon="UserEdit"
on:click={() => userInfoModal.show()}
dataCy={"user-info"}
>
Update user information
</MenuItem>
{#if $auth.isBuilder}

View File

@ -68,6 +68,26 @@
}
}
async function deleteSmtp() {
// Delete the SMTP config
try {
await API.deleteConfig({
id: smtpConfig._id,
rev: smtpConfig._rev,
})
smtpConfig = {
config: {},
}
await admin.getChecklist()
notifications.success(`Settings cleared`)
analytics.captureEvent(Events.SMTP.SAVED)
} catch (error) {
notifications.error(
`Failed to clear email settings, reason: ${error?.message || "Unknown"}`
)
}
}
async function fetchSmtp() {
loading = true
try {
@ -156,8 +176,15 @@
</div>
{/if}
</Layout>
<div>
<div class="spectrum-ButtonGroup spectrum-Settings-buttonGroup">
<Button cta on:click={saveSmtp}>Save</Button>
<Button
secondary
on:click={deleteSmtp}
disabled={!$admin.checklist.smtp.checked}
>
Reset
</Button>
</div>
<Divider />
<Layout gap="XS" noPadding>
@ -186,4 +213,8 @@
grid-gap: var(--spacing-l);
align-items: center;
}
.spectrum-Settings-buttonGroup {
gap: var(--spectrum-global-dimension-static-size-200);
align-items: flex-end;
}
</style>

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/cli",
"version": "1.0.155-alpha.3",
"version": "1.0.159-alpha.3",
"description": "Budibase CLI, for developers, self hosting and migrations.",
"main": "src/index.js",
"bin": {

View File

@ -2338,7 +2338,11 @@
"type": "boolean",
"label": "Autocomplete",
"key": "autocomplete",
"defaultValue": false
"defaultValue": false,
"dependsOn": {
"setting": "optionsType",
"value": "select"
}
},
{
"type": "boolean",
@ -2346,6 +2350,43 @@
"key": "disabled",
"defaultValue": false
},
{
"type": "select",
"label": "Type",
"key": "optionsType",
"defaultValue": "select",
"placeholder": "Pick an options type",
"options": [
{
"label": "Select",
"value": "select"
},
{
"label": "Checkboxes",
"value": "checkbox"
}
]
},
{
"type": "select",
"label": "Direction",
"key": "direction",
"defaultValue": "vertical",
"options": [
{
"label": "Horizontal",
"value": "horizontal"
},
{
"label": "Vertical",
"value": "vertical"
}
],
"dependsOn": {
"setting": "optionsType",
"value": "checkbox"
}
},
{
"type": "select",
"label": "Options source",

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/client",
"version": "1.0.155-alpha.3",
"version": "1.0.159-alpha.3",
"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": "^1.0.155-alpha.3",
"@budibase/frontend-core": "^1.0.155-alpha.3",
"@budibase/string-templates": "^1.0.155-alpha.3",
"@budibase/bbui": "^1.0.159-alpha.3",
"@budibase/frontend-core": "^1.0.159-alpha.3",
"@budibase/string-templates": "^1.0.159-alpha.3",
"@spectrum-css/button": "^3.0.3",
"@spectrum-css/card": "^3.0.3",
"@spectrum-css/divider": "^1.0.3",

View File

@ -283,7 +283,8 @@
@media print {
#spectrum-root,
#clip-root,
#app-root {
#app-root,
#app-body {
overflow: visible !important;
}
}

View File

@ -1,5 +1,5 @@
<script>
import { CoreMultiselect } from "@budibase/bbui"
import { CoreMultiselect, CoreCheckboxGroup } from "@budibase/bbui"
import Field from "./Field.svelte"
import { getOptions } from "./optionsParser"
export let field
@ -15,6 +15,8 @@
export let customOptions
export let autocomplete = false
export let onChange
export let optionsType = "select"
export let direction = "vertical"
let fieldState
let fieldApi
@ -61,17 +63,31 @@
bind:fieldSchema
>
{#if fieldState}
<CoreMultiselect
value={fieldState.value || []}
error={fieldState.error}
getOptionLabel={flatOptions ? x => x : x => x.label}
getOptionValue={flatOptions ? x => x : x => x.value}
id={fieldState.fieldId}
disabled={fieldState.disabled}
on:change={handleChange}
{placeholder}
{options}
{autocomplete}
/>
{#if !optionsType || optionsType === "select"}
<CoreMultiselect
value={fieldState.value || []}
error={fieldState.error}
getOptionLabel={flatOptions ? x => x : x => x.label}
getOptionValue={flatOptions ? x => x : x => x.value}
id={fieldState.fieldId}
disabled={fieldState.disabled}
on:change={handleChange}
{placeholder}
{options}
{autocomplete}
/>
{:else if optionsType === "checkbox"}
<CoreCheckboxGroup
value={fieldState.value || []}
id={fieldState.fieldId}
disabled={fieldState.disabled}
error={fieldState.error}
{options}
{direction}
on:change={handleChange}
getOptionLabel={flatOptions ? x => x : x => x.label}
getOptionValue={flatOptions ? x => x : x => x.value}
/>
{/if}
{/if}
</Field>

View File

@ -66,4 +66,9 @@
.tab-content {
padding: 0 var(--spacing-xl);
}
@media print {
.devtools {
display: none;
}
}
</style>

View File

@ -71,4 +71,9 @@
.dev-preview-header :global(.spectrum-Picker-label) {
color: white !important;
}
@media print {
.dev-preview-header {
display: none;
}
}
</style>

View File

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

View File

@ -20,6 +20,17 @@ export const buildConfigEndpoints = API => ({
})
},
/**
* Deletes a global config
* @param id the id of the config to delete
* @param rev the revision of the config to delete
*/
deleteConfig: async ({ id, rev }) => {
return await API.delete({
url: `/api/global/configs/${id}/${rev}`,
})
},
/**
* Gets the config for a certain tenant.
* @param tenantId the tenant ID to get the config for

View File

@ -1,7 +1,7 @@
{
"name": "@budibase/server",
"email": "hi@budibase.com",
"version": "1.0.155-alpha.3",
"version": "1.0.159-alpha.3",
"description": "Budibase Web Server",
"main": "src/index.ts",
"repository": {
@ -69,10 +69,10 @@
"license": "GPL-3.0",
"dependencies": {
"@apidevtools/swagger-parser": "^10.0.3",
"@budibase/backend-core": "^1.0.155-alpha.3",
"@budibase/client": "^1.0.155-alpha.3",
"@budibase/pro": "1.0.155-alpha.3",
"@budibase/string-templates": "^1.0.155-alpha.3",
"@budibase/backend-core": "^1.0.159-alpha.3",
"@budibase/client": "^1.0.159-alpha.3",
"@budibase/pro": "1.0.159-alpha.3",
"@budibase/string-templates": "^1.0.159-alpha.3",
"@bull-board/api": "^3.7.0",
"@bull-board/koa": "^3.7.0",
"@elastic/elasticsearch": "7.10.0",

View File

@ -1014,15 +1014,15 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
"@budibase/backend-core@1.0.150":
version "1.0.150"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.150.tgz#a48beb1e38f5e3e09473235fd2b7f35a05a15342"
integrity sha512-ceQVPnypKFurQMJgghky+MxtiF3x4b7rIzYhXv6Y+QfIb7IdY6wvv9o+dD3GPwNZJCRFSFizPR4YLBXdL+2+yw==
"@budibase/backend-core@1.0.154":
version "1.0.154"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.154.tgz#c310834892e7621778b07579464955487c5c9830"
integrity sha512-mcZxt8XhGgOB4XRHKkWTvBEI4HGp2bo8qyzOJRCvDqlg56S9zqGJDl75Z0N/Wc8N3I53QRcxISerj48odX172A==
dependencies:
"@techpass/passport-openidconnect" "^0.3.0"
aws-sdk "^2.901.0"
bcryptjs "^2.4.3"
cls-hooked "^4.2.2"
emitter-listener "^1.1.2"
ioredis "^4.27.1"
jsonwebtoken "^8.5.1"
koa-passport "^4.1.4"
@ -1091,12 +1091,12 @@
svelte-flatpickr "^3.2.3"
svelte-portal "^1.0.0"
"@budibase/pro@1.0.150":
version "1.0.150"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.150.tgz#06384561b67130bb2a93f0119921bd35d2be245c"
integrity sha512-Wlam8b5nhSeuNEj5Bb3ro1DKGX81mxxsjKMmxT4rbTqZrzuHSlTkxJ59IvUQqKuyp+cqfP6Rq/i4UXrhK0cg9Q==
"@budibase/pro@1.0.154":
version "1.0.154"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.154.tgz#f4e31e30376b206159b711224038141d73a1118e"
integrity sha512-+O6bemrcgyWG4a+D5dIOoZ+LGjW4aN7tRdFeZqoaIPCc1pA6zNtLUkM1nb+Laafuwq2Aht37vEuaRy7jfzVprA==
dependencies:
"@budibase/backend-core" "1.0.150"
"@budibase/backend-core" "1.0.154"
node-fetch "^2.6.1"
"@budibase/standard-components@^0.9.139":
@ -3493,13 +3493,6 @@ astral-regex@^1.0.0:
resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9"
integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==
async-hook-jl@^1.7.6:
version "1.7.6"
resolved "https://registry.yarnpkg.com/async-hook-jl/-/async-hook-jl-1.7.6.tgz#4fd25c2f864dbaf279c610d73bf97b1b28595e68"
integrity sha512-gFaHkFfSxTjvoxDMYqDuGHlcRyUuamF8s+ZTtJdDzqjws4mCt7v0vuV79/E2Wr2/riMQgtG4/yUtXWs1gZ7JMg==
dependencies:
stack-chain "^1.3.7"
async-limiter@~1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd"
@ -4302,15 +4295,6 @@ clone-response@1.0.2, clone-response@^1.0.2:
dependencies:
mimic-response "^1.0.0"
cls-hooked@^4.2.2:
version "4.2.2"
resolved "https://registry.yarnpkg.com/cls-hooked/-/cls-hooked-4.2.2.tgz#ad2e9a4092680cdaffeb2d3551da0e225eae1908"
integrity sha512-J4Xj5f5wq/4jAvcdgoGsL3G103BtWpZrMo8NEinRltN+xpTZdI+M38pyQqhuFU/P792xkMFvnKSf+Lm81U1bxw==
dependencies:
async-hook-jl "^1.7.6"
emitter-listener "^1.0.1"
semver "^5.4.1"
cluster-key-slot@1.1.0, cluster-key-slot@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/cluster-key-slot/-/cluster-key-slot-1.1.0.tgz#30474b2a981fb12172695833052bc0d01336d10d"
@ -5220,7 +5204,7 @@ electron-to-chromium@^1.4.17:
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.71.tgz#17056914465da0890ce00351a3b946fd4cd51ff6"
integrity sha512-Hk61vXXKRb2cd3znPE9F+2pLWdIOmP7GjiTj45y6L3W/lO+hSnUSUhq+6lEaERWBdZOHbk2s3YV5c9xVl3boVw==
emitter-listener@^1.0.1:
emitter-listener@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/emitter-listener/-/emitter-listener-1.1.2.tgz#56b140e8f6992375b3d7cb2cab1cc7432d9632e8"
integrity sha512-Bt1sBAGFHY9DKY+4/2cV6izcKJUf5T7/gkdmkxzX/qv9CcGH8xSwVRW5mtX03SWJtRTWSOpzCuWN9rBFYZepZQ==
@ -12009,7 +11993,7 @@ semver-diff@^3.1.1:
dependencies:
semver "^6.3.0"
"semver@2 || 3 || 4 || 5", semver@^5.1.0, semver@^5.4.1, semver@^5.5.0, semver@^5.6.0, semver@^5.7.1:
"semver@2 || 3 || 4 || 5", semver@^5.1.0, semver@^5.5.0, semver@^5.6.0, semver@^5.7.1:
version "5.7.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
@ -12420,11 +12404,6 @@ sshpk@^1.7.0:
safer-buffer "^2.0.2"
tweetnacl "~0.14.0"
stack-chain@^1.3.7:
version "1.3.7"
resolved "https://registry.yarnpkg.com/stack-chain/-/stack-chain-1.3.7.tgz#d192c9ff4ea6a22c94c4dd459171e3f00cea1285"
integrity sha1-0ZLJ/06moiyUxN1FkXHj8AzqEoU=
stack-trace@0.0.x:
version "0.0.10"
resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0"

View File

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

View File

@ -1,7 +1,7 @@
{
"name": "@budibase/worker",
"email": "hi@budibase.com",
"version": "1.0.155-alpha.3",
"version": "1.0.159-alpha.3",
"description": "Budibase background service",
"main": "src/index.ts",
"repository": {
@ -31,9 +31,9 @@
"author": "Budibase",
"license": "GPL-3.0",
"dependencies": {
"@budibase/backend-core": "^1.0.155-alpha.3",
"@budibase/pro": "1.0.155-alpha.3",
"@budibase/string-templates": "^1.0.155-alpha.3",
"@budibase/backend-core": "^1.0.159-alpha.3",
"@budibase/pro": "1.0.159-alpha.3",
"@budibase/string-templates": "^1.0.159-alpha.3",
"@koa/router": "^8.0.0",
"@sentry/node": "6.17.7",
"@techpass/passport-openidconnect": "^0.3.0",

View File

@ -293,15 +293,15 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
"@budibase/backend-core@1.0.150":
version "1.0.150"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.150.tgz#a48beb1e38f5e3e09473235fd2b7f35a05a15342"
integrity sha512-ceQVPnypKFurQMJgghky+MxtiF3x4b7rIzYhXv6Y+QfIb7IdY6wvv9o+dD3GPwNZJCRFSFizPR4YLBXdL+2+yw==
"@budibase/backend-core@1.0.154":
version "1.0.154"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.154.tgz#c310834892e7621778b07579464955487c5c9830"
integrity sha512-mcZxt8XhGgOB4XRHKkWTvBEI4HGp2bo8qyzOJRCvDqlg56S9zqGJDl75Z0N/Wc8N3I53QRcxISerj48odX172A==
dependencies:
"@techpass/passport-openidconnect" "^0.3.0"
aws-sdk "^2.901.0"
bcryptjs "^2.4.3"
cls-hooked "^4.2.2"
emitter-listener "^1.1.2"
ioredis "^4.27.1"
jsonwebtoken "^8.5.1"
koa-passport "^4.1.4"
@ -321,12 +321,12 @@
uuid "^8.3.2"
zlib "^1.0.5"
"@budibase/pro@1.0.150":
version "1.0.150"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.150.tgz#06384561b67130bb2a93f0119921bd35d2be245c"
integrity sha512-Wlam8b5nhSeuNEj5Bb3ro1DKGX81mxxsjKMmxT4rbTqZrzuHSlTkxJ59IvUQqKuyp+cqfP6Rq/i4UXrhK0cg9Q==
"@budibase/pro@1.0.154":
version "1.0.154"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.154.tgz#f4e31e30376b206159b711224038141d73a1118e"
integrity sha512-+O6bemrcgyWG4a+D5dIOoZ+LGjW4aN7tRdFeZqoaIPCc1pA6zNtLUkM1nb+Laafuwq2Aht37vEuaRy7jfzVprA==
dependencies:
"@budibase/backend-core" "1.0.150"
"@budibase/backend-core" "1.0.154"
node-fetch "^2.6.1"
"@cspotcode/source-map-consumer@0.8.0":
@ -1290,13 +1290,6 @@ astral-regex@^1.0.0:
resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9"
integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==
async-hook-jl@^1.7.6:
version "1.7.6"
resolved "https://registry.yarnpkg.com/async-hook-jl/-/async-hook-jl-1.7.6.tgz#4fd25c2f864dbaf279c610d73bf97b1b28595e68"
integrity sha512-gFaHkFfSxTjvoxDMYqDuGHlcRyUuamF8s+ZTtJdDzqjws4mCt7v0vuV79/E2Wr2/riMQgtG4/yUtXWs1gZ7JMg==
dependencies:
stack-chain "^1.3.7"
async@~2.1.4:
version "2.1.5"
resolved "https://registry.yarnpkg.com/async/-/async-2.1.5.tgz#e587c68580994ac67fc56ff86d3ac56bdbe810bc"
@ -1764,15 +1757,6 @@ clone-response@^1.0.2:
dependencies:
mimic-response "^1.0.0"
cls-hooked@^4.2.2:
version "4.2.2"
resolved "https://registry.yarnpkg.com/cls-hooked/-/cls-hooked-4.2.2.tgz#ad2e9a4092680cdaffeb2d3551da0e225eae1908"
integrity sha512-J4Xj5f5wq/4jAvcdgoGsL3G103BtWpZrMo8NEinRltN+xpTZdI+M38pyQqhuFU/P792xkMFvnKSf+Lm81U1bxw==
dependencies:
async-hook-jl "^1.7.6"
emitter-listener "^1.0.1"
semver "^5.4.1"
cluster-key-slot@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/cluster-key-slot/-/cluster-key-slot-1.1.0.tgz#30474b2a981fb12172695833052bc0d01336d10d"
@ -2258,7 +2242,7 @@ electron-to-chromium@^1.4.17:
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.58.tgz#cd980b08338210b591c25492857a518fe286b1d4"
integrity sha512-7LXwnKyqcEaMFVXOer+2JPfFs1D+ej7yRRrfZoIH1YlLQZ81OvBNwSCBBLtExVkoMQQgOWwO0FbZVge6U/8rhQ==
emitter-listener@^1.0.1:
emitter-listener@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/emitter-listener/-/emitter-listener-1.1.2.tgz#56b140e8f6992375b3d7cb2cab1cc7432d9632e8"
integrity sha512-Bt1sBAGFHY9DKY+4/2cV6izcKJUf5T7/gkdmkxzX/qv9CcGH8xSwVRW5mtX03SWJtRTWSOpzCuWN9rBFYZepZQ==
@ -5759,7 +5743,7 @@ semver@7.x, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5:
dependencies:
lru-cache "^6.0.0"
semver@^5.4.1, semver@^5.5.0, semver@^5.6.0, semver@^5.7.1:
semver@^5.5.0, semver@^5.6.0, semver@^5.7.1:
version "5.7.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
@ -5940,11 +5924,6 @@ sshpk@^1.7.0:
safer-buffer "^2.0.2"
tweetnacl "~0.14.0"
stack-chain@^1.3.7:
version "1.3.7"
resolved "https://registry.yarnpkg.com/stack-chain/-/stack-chain-1.3.7.tgz#d192c9ff4ea6a22c94c4dd459171e3f00cea1285"
integrity sha1-0ZLJ/06moiyUxN1FkXHj8AzqEoU=
stack-utils@^2.0.3:
version "2.0.5"
resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.5.tgz#d25265fca995154659dbbfba3b49254778d2fdd5"