1
0
Fork 0
mirror of synced 2024-09-11 06:56:23 +12:00

Merge remote-tracking branch 'origin/develop' into feature/templates-home-screen

This commit is contained in:
Dean 2022-03-25 09:45:35 +00:00
commit 04aad3406d
30 changed files with 1219 additions and 7176 deletions

View file

@ -1,5 +1,5 @@
{ {
"version": "1.0.91-alpha.12", "version": "1.0.91-alpha.16",
"npmClient": "yarn", "npmClient": "yarn",
"packages": [ "packages": [
"packages/*" "packages/*"

View file

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

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": "1.0.91-alpha.12", "version": "1.0.91-alpha.16",
"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": "^1.0.91-alpha.12", "@budibase/string-templates": "^1.0.91-alpha.16",
"@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",

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{ {
"name": "@budibase/builder", "name": "@budibase/builder",
"version": "1.0.91-alpha.12", "version": "1.0.91-alpha.16",
"license": "GPL-3.0", "license": "GPL-3.0",
"private": true, "private": true,
"scripts": { "scripts": {
@ -65,10 +65,10 @@
} }
}, },
"dependencies": { "dependencies": {
"@budibase/bbui": "^1.0.91-alpha.12", "@budibase/bbui": "^1.0.91-alpha.16",
"@budibase/client": "^1.0.91-alpha.12", "@budibase/client": "^1.0.91-alpha.16",
"@budibase/frontend-core": "^1.0.91-alpha.12", "@budibase/frontend-core": "^1.0.91-alpha.16",
"@budibase/string-templates": "^1.0.91-alpha.12", "@budibase/string-templates": "^1.0.91-alpha.16",
"@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

@ -68,6 +68,7 @@
customTheme: $store.customTheme, customTheme: $store.customTheme,
previewDevice: $store.previewDevice, previewDevice: $store.previewDevice,
messagePassing: $store.clientFeatures.messagePassing, messagePassing: $store.clientFeatures.messagePassing,
isBudibaseEvent: true
} }
$: json = JSON.stringify(previewData) $: json = JSON.stringify(previewData)

View file

@ -52,7 +52,7 @@ export default `
console.error("Client received invalid JSON") console.error("Client received invalid JSON")
// Ignore // Ignore
} }
if (!parsed) { if (!parsed || !parsed.isBudibaseEvent) {
return return
} }

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{ {
"name": "@budibase/cli", "name": "@budibase/cli",
"version": "1.0.91-alpha.12", "version": "1.0.91-alpha.16",
"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": {

View file

@ -264,7 +264,8 @@
{ {
"label": "Primary", "label": "Primary",
"value": "primary" "value": "primary"
}, { },
{
"label": "Secondary", "label": "Secondary",
"value": "secondary" "value": "secondary"
}, },
@ -507,7 +508,7 @@
}, },
{ {
"type": "static", "type": "static",
"values": [ "values": [
{ {
"label": "Row Index", "label": "Row Index",
"key": "index" "key": "index"
@ -626,28 +627,36 @@
"defaultValue": "M", "defaultValue": "M",
"showInBar": true, "showInBar": true,
"barStyle": "picker", "barStyle": "picker",
"options": [{ "options": [
"label": "Extra Small", {
"value": "XS" "label": "Extra Small",
}, { "value": "XS"
"label": "Small", },
"value": "S" {
}, { "label": "Small",
"label": "Medium", "value": "S"
"value": "M" },
}, { {
"label": "Large", "label": "Medium",
"value": "L" "value": "M"
}, { },
"label": "Extra Large", {
"value": "XL" "label": "Large",
}, { "value": "L"
"label": "2XL", },
"value": "XXL" {
}, { "label": "Extra Large",
"label": "3XL", "value": "XL"
"value": "XXXL" },
}] {
"label": "2XL",
"value": "XXL"
},
{
"label": "3XL",
"value": "XXXL"
}
]
}, },
{ {
"type": "color", "type": "color",
@ -689,27 +698,32 @@
"defaultValue": "left", "defaultValue": "left",
"showInBar": true, "showInBar": true,
"barStyle": "buttons", "barStyle": "buttons",
"options": [{ "options": [
"label": "Left", {
"value": "left", "label": "Left",
"barIcon": "TextAlignLeft", "value": "left",
"barTitle": "Align left" "barIcon": "TextAlignLeft",
}, { "barTitle": "Align left"
"label": "Center", },
"value": "center", {
"barIcon": "TextAlignCenter", "label": "Center",
"barTitle": "Align center" "value": "center",
}, { "barIcon": "TextAlignCenter",
"label": "Right", "barTitle": "Align center"
"value": "right", },
"barIcon": "TextAlignRight", {
"barTitle": "Align right" "label": "Right",
}, { "value": "right",
"label": "Justify", "barIcon": "TextAlignRight",
"value": "justify", "barTitle": "Align right"
"barIcon": "TextAlignJustify", },
"barTitle": "Justify text" {
}] "label": "Justify",
"value": "justify",
"barIcon": "TextAlignJustify",
"barTitle": "Justify text"
}
]
} }
] ]
}, },
@ -733,28 +747,36 @@
"defaultValue": "M", "defaultValue": "M",
"showInBar": true, "showInBar": true,
"barStyle": "picker", "barStyle": "picker",
"options": [{ "options": [
"label": "Extra Small", {
"value": "XS" "label": "Extra Small",
}, { "value": "XS"
"label": "Small", },
"value": "S" {
}, { "label": "Small",
"label": "Medium", "value": "S"
"value": "M" },
}, { {
"label": "Large", "label": "Medium",
"value": "L" "value": "M"
}, { },
"label": "Extra Large", {
"value": "XL" "label": "Large",
}, { "value": "L"
"label": "2XL", },
"value": "XXL" {
}, { "label": "Extra Large",
"label": "3XL", "value": "XL"
"value": "XXXL" },
}] {
"label": "2XL",
"value": "XXL"
},
{
"label": "3XL",
"value": "XXXL"
}
]
}, },
{ {
"type": "color", "type": "color",
@ -796,27 +818,32 @@
"defaultValue": "left", "defaultValue": "left",
"showInBar": true, "showInBar": true,
"barStyle": "buttons", "barStyle": "buttons",
"options": [{ "options": [
"label": "Left", {
"value": "left", "label": "Left",
"barIcon": "TextAlignLeft", "value": "left",
"barTitle": "Align left" "barIcon": "TextAlignLeft",
}, { "barTitle": "Align left"
"label": "Center", },
"value": "center", {
"barIcon": "TextAlignCenter", "label": "Center",
"barTitle": "Align center" "value": "center",
}, { "barIcon": "TextAlignCenter",
"label": "Right", "barTitle": "Align center"
"value": "right", },
"barIcon": "TextAlignRight", {
"barTitle": "Align right" "label": "Right",
}, { "value": "right",
"label": "Justify", "barIcon": "TextAlignRight",
"value": "justify", "barTitle": "Align right"
"barIcon": "TextAlignJustify", },
"barTitle": "Justify text" {
}] "label": "Justify",
"value": "justify",
"barIcon": "TextAlignJustify",
"barTitle": "Justify text"
}
]
} }
] ]
}, },
@ -837,16 +864,20 @@
"defaultValue": "M", "defaultValue": "M",
"showInBar": true, "showInBar": true,
"barStyle": "picker", "barStyle": "picker",
"options": [{ "options": [
"label": "Small", {
"value": "S" "label": "Small",
}, { "value": "S"
"label": "Medium", },
"value": "M" {
}, { "label": "Medium",
"label": "Large", "value": "M"
"value": "L" },
}] {
"label": "Large",
"value": "L"
}
]
}, },
{ {
"type": "color", "type": "color",
@ -1037,16 +1068,20 @@
"defaultValue": "M", "defaultValue": "M",
"showInBar": true, "showInBar": true,
"barStyle": "picker", "barStyle": "picker",
"options": [{ "options": [
"label": "Small", {
"value": "S" "label": "Small",
}, { "value": "S"
"label": "Medium", },
"value": "M" {
}, { "label": "Medium",
"label": "Large", "value": "M"
"value": "L" },
}] {
"label": "Large",
"value": "L"
}
]
}, },
{ {
"type": "color", "type": "color",
@ -1088,27 +1123,32 @@
"defaultValue": "left", "defaultValue": "left",
"showInBar": true, "showInBar": true,
"barStyle": "buttons", "barStyle": "buttons",
"options": [{ "options": [
"label": "Left", {
"value": "left", "label": "Left",
"barIcon": "TextAlignLeft", "value": "left",
"barTitle": "Align left" "barIcon": "TextAlignLeft",
}, { "barTitle": "Align left"
"label": "Center", },
"value": "center", {
"barIcon": "TextAlignCenter", "label": "Center",
"barTitle": "Align center" "value": "center",
}, { "barIcon": "TextAlignCenter",
"label": "Right", "barTitle": "Align center"
"value": "right", },
"barIcon": "TextAlignRight", {
"barTitle": "Align right" "label": "Right",
}, { "value": "right",
"label": "Justify", "barIcon": "TextAlignRight",
"value": "justify", "barTitle": "Align right"
"barIcon": "TextAlignJustify", },
"barTitle": "Justify text" {
}] "label": "Justify",
"value": "justify",
"barIcon": "TextAlignJustify",
"barTitle": "Justify text"
}
]
} }
] ]
}, },
@ -1165,7 +1205,15 @@
"type": "select", "type": "select",
"label": "Card Width", "label": "Card Width",
"key": "cardWidth", "key": "cardWidth",
"options": ["24rem", "28rem", "32rem", "40rem", "48rem", "60rem", "100%"], "options": [
"24rem",
"28rem",
"32rem",
"40rem",
"48rem",
"60rem",
"100%"
],
"defaultValue": "32rem" "defaultValue": "32rem"
}, },
{ {
@ -1785,11 +1833,7 @@
"icon": "Form", "icon": "Form",
"hasChildren": true, "hasChildren": true,
"illegalChildren": ["section", "form"], "illegalChildren": ["section", "form"],
"actions": [ "actions": ["ValidateForm", "ClearForm", "ChangeFormStep"],
"ValidateForm",
"ClearForm",
"ChangeFormStep"
],
"styles": ["size"], "styles": ["size"],
"settings": [ "settings": [
{ {
@ -1816,7 +1860,8 @@
{ {
"label": "Medium", "label": "Medium",
"value": "spectrum--medium" "value": "spectrum--medium"
}, { },
{
"label": "Large", "label": "Large",
"value": "spectrum--large" "value": "spectrum--large"
} }
@ -1833,7 +1878,7 @@
"context": [ "context": [
{ {
"type": "static", "type": "static",
"values": [ "values": [
{ {
"label": "Value", "label": "Value",
"key": "__value" "key": "__value"
@ -1947,27 +1992,32 @@
"defaultValue": "left", "defaultValue": "left",
"showInBar": true, "showInBar": true,
"barStyle": "buttons", "barStyle": "buttons",
"options": [{ "options": [
"label": "Left", {
"value": "left", "label": "Left",
"barIcon": "TextAlignLeft", "value": "left",
"barTitle": "Align left" "barIcon": "TextAlignLeft",
}, { "barTitle": "Align left"
"label": "Center", },
"value": "center", {
"barIcon": "TextAlignCenter", "label": "Center",
"barTitle": "Align center" "value": "center",
}, { "barIcon": "TextAlignCenter",
"label": "Right", "barTitle": "Align center"
"value": "right", },
"barIcon": "TextAlignRight", {
"barTitle": "Align right" "label": "Right",
}, { "value": "right",
"label": "Justify", "barIcon": "TextAlignRight",
"value": "justify", "barTitle": "Align right"
"barIcon": "TextAlignJustify", },
"barTitle": "Justify text" {
}] "label": "Justify",
"value": "justify",
"barIcon": "TextAlignJustify",
"barTitle": "Justify text"
}
]
} }
] ]
}, },
@ -2634,15 +2684,15 @@
], ],
"context": { "context": {
"type": "static", "type": "static",
"values": [ "values": [
{ {
"label": "Rows", "label": "Rows",
"key": "rows" "key": "rows"
}, },
{ {
"label": "Extra Info", "label": "Extra Info",
"key": "info" "key": "info"
}, },
{ {
"label": "Rows Length", "label": "Rows Length",
"key": "rowsLength" "key": "rowsLength"
@ -2964,7 +3014,8 @@
"label": "Table Columns", "label": "Table Columns",
"key": "tableColumns", "key": "tableColumns",
"dependsOn": "dataSource", "dependsOn": "dataSource",
"placeholder": "All columns" "placeholder": "All columns",
"nested": true
}, },
{ {
"type": "boolean", "type": "boolean",
@ -3116,7 +3167,6 @@
"key": "cardDescription", "key": "cardDescription",
"label": "Description", "label": "Description",
"nested": true "nested": true
}, },
{ {
"type": "text", "type": "text",
@ -3381,12 +3431,12 @@
{ {
"type": "static", "type": "static",
"suffix": "provider", "suffix": "provider",
"values": [ "values": [
{ {
"label": "Rows", "label": "Rows",
"key": "rows" "key": "rows"
}, },
{ {
"label": "Extra Info", "label": "Extra Info",
"key": "info" "key": "info"
}, },
@ -3407,12 +3457,12 @@
{ {
"type": "static", "type": "static",
"suffix": "repeater", "suffix": "repeater",
"values": [ "values": [
{ {
"label": "Row Index", "label": "Row Index",
"key": "index" "key": "index"
} }
] ]
}, },
{ {
"type": "schema", "type": "schema",

View file

@ -1,6 +1,6 @@
{ {
"name": "@budibase/client", "name": "@budibase/client",
"version": "1.0.91-alpha.12", "version": "1.0.91-alpha.16",
"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": "^1.0.91-alpha.12", "@budibase/bbui": "^1.0.91-alpha.16",
"@budibase/frontend-core": "^1.0.91-alpha.12", "@budibase/frontend-core": "^1.0.91-alpha.16",
"@budibase/string-templates": "^1.0.91-alpha.12", "@budibase/string-templates": "^1.0.91-alpha.16",
"@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

@ -36,4 +36,13 @@
div :global(.apexcharts-datalabel) { div :global(.apexcharts-datalabel) {
fill: var(--spectrum-global-color-gray-800); fill: var(--spectrum-global-color-gray-800);
} }
div :global(.apexcharts-tooltip) {
background-color: var(--spectrum-global-color-gray-200) !important;
border-color: var(--spectrum-global-color-gray-300) !important;
box-shadow: 2px 2px 6px -4px rgba(0, 0, 0, 0.1) !important;
}
div :global(.apexcharts-tooltip-title) {
background-color: var(--spectrum-global-color-gray-100) !important;
border-color: var(--spectrum-global-color-gray-300) !important;
}
</style> </style>

View file

@ -18,16 +18,53 @@
export let palette export let palette
export let horizontal export let horizontal
$: options = setUpChart(dataProvider) $: options = setUpChart(
title,
dataProvider,
labelColumn,
valueColumns,
xAxisLabel,
yAxisLabel,
height,
width,
dataLabels,
animate,
legend,
stacked,
yAxisUnits,
palette,
horizontal
)
const setUpChart = provider => { const setUpChart = (
title,
dataProvider,
labelColumn,
valueColumns,
xAxisLabel,
yAxisLabel,
height,
width,
dataLabels,
animate,
legend,
stacked,
yAxisUnits,
palette,
horizontal
) => {
console.log("new chart")
const allCols = [labelColumn, ...(valueColumns || [null])] const allCols = [labelColumn, ...(valueColumns || [null])]
if (!provider || !provider.rows?.length || allCols.find(x => x == null)) { if (
!dataProvider ||
!dataProvider.rows?.length ||
allCols.find(x => x == null)
) {
return null return null
} }
// Fetch data // Fetch data
const { schema, rows } = provider const { schema, rows } = dataProvider
const reducer = row => (valid, column) => valid && row[column] != null const reducer = row => (valid, column) => valid && row[column] != null
const hasAllColumns = row => allCols.reduce(reducer(row), true) const hasAllColumns = row => allCols.reduce(reducer(row), true)
const data = rows.filter(row => hasAllColumns(row)).slice(0, 100) const data = rows.filter(row => hasAllColumns(row)).slice(0, 100)

View file

@ -16,17 +16,48 @@
export let animate export let animate
export let yAxisUnits export let yAxisUnits
$: options = setUpChart(dataProvider) $: options = setUpChart(
title,
dataProvider,
dateColumn,
openColumn,
highColumn,
lowColumn,
closeColumn,
xAxisLabel,
yAxisLabel,
height,
width,
animate,
yAxisUnits
)
// Fetch data on mount const setUpChart = (
const setUpChart = provider => { title,
dataProvider,
dateColumn,
openColumn,
highColumn,
lowColumn,
closeColumn,
xAxisLabel,
yAxisLabel,
height,
width,
animate,
yAxisUnits
) => {
const allCols = [dateColumn, openColumn, highColumn, lowColumn, closeColumn] const allCols = [dateColumn, openColumn, highColumn, lowColumn, closeColumn]
if (!provider || !provider.rows?.length || allCols.find(x => x == null)) { if (
!dataProvider ||
!dataProvider.rows?.length ||
allCols.find(x => x == null)
) {
return null return null
} }
// Fetch data // Fetch data
const { schema, rows } = provider const { schema, rows } = dataProvider
const reducer = row => (valid, column) => valid && row[column] != null const reducer = row => (valid, column) => valid && row[column] != null
const hasAllColumns = row => allCols.reduce(reducer(row), true) const hasAllColumns = row => allCols.reduce(reducer(row), true)
const data = rows.filter(row => hasAllColumns(row)) const data = rows.filter(row => hasAllColumns(row))

View file

@ -23,17 +23,56 @@
export let stacked export let stacked
export let gradient export let gradient
$: options = setUpChart(dataProvider) $: options = setUpChart(
title,
dataProvider,
labelColumn,
valueColumns,
xAxisLabel,
yAxisLabel,
height,
width,
animate,
dataLabels,
curve,
legend,
yAxisUnits,
palette,
area,
stacked,
gradient
)
// Fetch data on mount const setUpChart = (
const setUpChart = provider => { title,
dataProvider,
labelColumn,
valueColumns,
xAxisLabel,
yAxisLabel,
height,
width,
animate,
dataLabels,
curve,
legend,
yAxisUnits,
palette,
area,
stacked,
gradient
) => {
const allCols = [labelColumn, ...(valueColumns || [null])] const allCols = [labelColumn, ...(valueColumns || [null])]
if (!provider || !provider.rows?.length || allCols.find(x => x == null)) { if (
!dataProvider ||
!dataProvider.rows?.length ||
allCols.find(x => x == null)
) {
return null return null
} }
// Fetch, filter and sort data // Fetch, filter and sort data
const { schema, rows } = provider const { schema, rows } = dataProvider
const reducer = row => (valid, column) => valid && row[column] != null const reducer = row => (valid, column) => valid && row[column] != null
const hasAllColumns = row => allCols.reduce(reducer(row), true) const hasAllColumns = row => allCols.reduce(reducer(row), true)
const data = rows.filter(row => hasAllColumns(row)) const data = rows.filter(row => hasAllColumns(row))

View file

@ -14,16 +14,44 @@
export let donut export let donut
export let palette export let palette
$: options = setUpChart(dataProvider) $: options = setUpChart(
title,
dataProvider,
labelColumn,
valueColumn,
height,
width,
dataLabels,
animate,
legend,
donut,
palette
)
// Fetch data on mount const setUpChart = (
const setUpChart = provider => { title,
if (!provider || !provider.rows?.length || !labelColumn || !valueColumn) { dataProvider,
labelColumn,
valueColumn,
height,
width,
dataLabels,
animate,
legend,
donut,
palette
) => {
if (
!dataProvider ||
!dataProvider.rows?.length ||
!labelColumn ||
!valueColumn
) {
return null return null
} }
// Fetch, filter and sort data // Fetch, filter and sort data
const { schema, rows } = provider const { schema, rows } = dataProvider
const data = rows const data = rows
.filter(row => row[labelColumn] != null && row[valueColumn] != null) .filter(row => row[labelColumn] != null && row[valueColumn] != null)
.slice(0, 100) .slice(0, 100)

View file

@ -4,7 +4,6 @@
Button, Button,
Combobox, Combobox,
DatePicker, DatePicker,
DrawerContent,
Icon, Icon,
Input, Input,
Layout, Layout,
@ -12,10 +11,12 @@
} from "@budibase/bbui" } from "@budibase/bbui"
import { generate } from "shortid" import { generate } from "shortid"
import { LuceneUtils, Constants } from "@budibase/frontend-core" import { LuceneUtils, Constants } from "@budibase/frontend-core"
import { getContext } from "svelte"
export let schemaFields export let schemaFields
export let filters = [] export let filters = []
const context = getContext("context")
const BannedTypes = ["link", "attachment", "json"] const BannedTypes = ["link", "attachment", "json"]
$: fieldOptions = (schemaFields ?? []) $: fieldOptions = (schemaFields ?? [])
@ -89,55 +90,55 @@
} }
</script> </script>
<DrawerContent> <div class="container" class:mobile={$context.device.mobile}>
<div class="container"> <Layout noPadding>
<Layout noPadding> <Body size="S">
<Body size="S"> {#if !filters?.length}
{#if !filters?.length} Add your first filter expression.
Add your first filter expression. {:else}
{:else} Results are filtered to only those which match all of the following
Results are filtered to only those which match all of the following constraints.
constraints. {/if}
{/if} </Body>
</Body> {#if filters?.length}
{#if filters?.length} <div class="fields">
<div class="fields"> {#each filters as filter, idx}
{#each filters as filter, idx} <Select
<Select bind:value={filter.field}
bind:value={filter.field} options={fieldOptions}
options={fieldOptions} on:change={e => onFieldChange(filter, e.detail)}
on:change={e => onFieldChange(filter, e.detail)} placeholder="Column"
placeholder="Column" />
<Select
disabled={!filter.field}
options={LuceneUtils.getValidOperatorsForType(filter.type)}
bind:value={filter.operator}
on:change={e => onOperatorChange(filter, e.detail)}
placeholder={null}
/>
{#if ["string", "longform", "number", "formula"].includes(filter.type)}
<Input disabled={filter.noValue} bind:value={filter.value} />
{:else if ["options", "array"].includes(filter.type)}
<Combobox
disabled={filter.noValue}
options={getFieldOptions(filter.field)}
bind:value={filter.value}
/> />
<Select {:else if filter.type === "boolean"}
disabled={!filter.field} <Combobox
options={LuceneUtils.getValidOperatorsForType(filter.type)} disabled={filter.noValue}
bind:value={filter.operator} options={[
on:change={e => onOperatorChange(filter, e.detail)} { label: "True", value: "true" },
placeholder={null} { label: "False", value: "false" },
]}
bind:value={filter.value}
/> />
{#if ["string", "longform", "number", "formula"].includes(filter.type)} {:else if filter.type === "datetime"}
<Input disabled={filter.noValue} bind:value={filter.value} /> <DatePicker disabled={filter.noValue} bind:value={filter.value} />
{:else if ["options", "array"].includes(filter.type)} {:else}
<Combobox <Input disabled />
disabled={filter.noValue} {/if}
options={getFieldOptions(filter.field)} <div class="controls">
bind:value={filter.value}
/>
{:else if filter.type === "boolean"}
<Combobox
disabled={filter.noValue}
options={[
{ label: "True", value: "true" },
{ label: "False", value: "false" },
]}
bind:value={filter.value}
/>
{:else if filter.type === "datetime"}
<DatePicker disabled={filter.noValue} bind:value={filter.value} />
{:else}
<Input disabled />
{/if}
<Icon <Icon
name="Duplicate" name="Duplicate"
hoverable hoverable
@ -150,17 +151,17 @@
size="S" size="S"
on:click={() => removeFilter(filter.id)} on:click={() => removeFilter(filter.id)}
/> />
{/each} </div>
</div> {/each}
{/if}
<div>
<Button icon="AddCircle" size="M" secondary on:click={addFilter}>
Add filter
</Button>
</div> </div>
</Layout> {/if}
</div> <div>
</DrawerContent> <Button icon="AddCircle" size="M" secondary on:click={addFilter}>
Add filter
</Button>
</div>
</Layout>
</div>
<style> <style>
.container { .container {
@ -175,4 +176,19 @@
align-items: center; align-items: center;
grid-template-columns: 1fr 120px 1fr auto auto; grid-template-columns: 1fr 120px 1fr auto auto;
} }
.controls {
display: contents;
}
.container.mobile .fields {
grid-template-columns: 1fr;
}
.container.mobile .controls {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
padding: var(--spacing-s) 0;
gap: var(--spacing-s);
}
</style> </style>

View file

@ -157,13 +157,9 @@
const { fieldState } = get(existingField) const { fieldState } = get(existingField)
fieldId = fieldState.fieldId fieldId = fieldState.fieldId
// Use new default value if default value changed, // Determine the initial value for this field, reusing the current
// otherwise use the current value if possible // value if one exists
if (defaultValue !== fieldState.defaultValue) { initialValue = fieldState.value ?? initialValue
initialValue = defaultValue
} else {
initialValue = fieldState.value ?? initialValue
}
// If this field has already been registered and we previously had an // If this field has already been registered and we previously had an
// error set, then re-run the validator to see if we can unset it // error set, then re-run the validator to see if we can unset it

View file

@ -6,12 +6,26 @@ const createAuthStore = () => {
// Fetches the user object if someone is logged in and has reloaded the page // Fetches the user object if someone is logged in and has reloaded the page
const fetchUser = async () => { const fetchUser = async () => {
let globalSelf = null
let appSelf = null
// First try and get the global user, to see if we are logged in at all
try { try {
const user = await API.fetchSelf() globalSelf = await API.fetchBuilderSelf()
store.set(user)
} catch (error) { } catch (error) {
store.set(null) store.set(null)
return
} }
// Then try and get the user for this app to provide via context
try {
appSelf = await API.fetchSelf()
} catch (error) {
// Swallow
}
// Use the app self if present, otherwise fallback to the global self
store.set(appSelf || globalSelf || null)
} }
const logOut = async () => { const logOut = async () => {

File diff suppressed because it is too large Load diff

View file

@ -1,12 +1,12 @@
{ {
"name": "@budibase/frontend-core", "name": "@budibase/frontend-core",
"version": "1.0.91-alpha.12", "version": "1.0.91-alpha.16",
"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": "^1.0.91-alpha.12", "@budibase/bbui": "^1.0.91-alpha.16",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"svelte": "^3.46.2" "svelte": "^3.46.2"
} }

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,7 @@
{ {
"name": "@budibase/server", "name": "@budibase/server",
"email": "hi@budibase.com", "email": "hi@budibase.com",
"version": "1.0.91-alpha.12", "version": "1.0.91-alpha.16",
"description": "Budibase Web Server", "description": "Budibase Web Server",
"main": "src/index.ts", "main": "src/index.ts",
"repository": { "repository": {
@ -71,9 +71,9 @@
"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": "^1.0.91-alpha.12", "@budibase/backend-core": "^1.0.91-alpha.16",
"@budibase/client": "^1.0.91-alpha.12", "@budibase/client": "^1.0.91-alpha.16",
"@budibase/string-templates": "^1.0.91-alpha.12", "@budibase/string-templates": "^1.0.91-alpha.16",
"@bull-board/api": "^3.7.0", "@bull-board/api": "^3.7.0",
"@bull-board/koa": "^3.7.0", "@bull-board/koa": "^3.7.0",
"@elastic/elasticsearch": "7.10.0", "@elastic/elasticsearch": "7.10.0",
@ -149,6 +149,7 @@
"@types/jest": "^26.0.23", "@types/jest": "^26.0.23",
"@types/koa": "^2.13.3", "@types/koa": "^2.13.3",
"@types/koa-router": "^7.4.2", "@types/koa-router": "^7.4.2",
"@types/lodash": "4.14.180",
"@types/node": "^15.12.4", "@types/node": "^15.12.4",
"@types/oracledb": "^5.2.1", "@types/oracledb": "^5.2.1",
"@types/redis": "^4.0.11", "@types/redis": "^4.0.11",

View file

@ -52,16 +52,14 @@ export async function read(ctx: any, next: any) {
} }
export async function update(ctx: any, next: any) { export async function update(ctx: any, next: any) {
ctx.request.body = await addRev(fixRow(ctx.request.body, ctx.params.tableId)) ctx.request.body = await addRev(fixRow(ctx.request.body, ctx.params))
await rowController.save(ctx) await rowController.save(ctx)
await next() await next()
} }
export async function destroy(ctx: any, next: any) { export async function destroy(ctx: any, next: any) {
// set the body as expected, with the _id and _rev fields // set the body as expected, with the _id and _rev fields
ctx.request.body = await addRev( ctx.request.body = await addRev(fixRow({ _id: ctx.params.rowId }, ctx.params))
fixRow({ _id: ctx.params.rowId }, ctx.params.tableId)
)
await rowController.destroy(ctx) await rowController.destroy(ctx)
// destroy controller doesn't currently return the row as the body, need to adjust this // destroy controller doesn't currently return the row as the body, need to adjust this
// in the public API to be correct // in the public API to be correct

File diff suppressed because it is too large Load diff

View file

@ -11,6 +11,7 @@ import {
PaginationValues, PaginationValues,
} from "../definitions/datasource" } from "../definitions/datasource"
import { IntegrationBase } from "./base/IntegrationBase" import { IntegrationBase } from "./base/IntegrationBase"
import { get } from "lodash"
const BodyTypes = { const BodyTypes = {
NONE: "none", NONE: "none",
@ -163,7 +164,7 @@ module RestModule {
// Check if a pagination cursor exists in the response // Check if a pagination cursor exists in the response
let nextCursor = null let nextCursor = null
if (pagination?.responseParam) { if (pagination?.responseParam) {
nextCursor = data?.[pagination.responseParam] nextCursor = get(data, pagination.responseParam)
} }
return { return {

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": "1.0.91-alpha.12", "version": "1.0.91-alpha.16",
"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,7 +1,7 @@
{ {
"name": "@budibase/worker", "name": "@budibase/worker",
"email": "hi@budibase.com", "email": "hi@budibase.com",
"version": "1.0.91-alpha.12", "version": "1.0.91-alpha.16",
"description": "Budibase background service", "description": "Budibase background service",
"main": "src/index.ts", "main": "src/index.ts",
"repository": { "repository": {
@ -34,8 +34,8 @@
"author": "Budibase", "author": "Budibase",
"license": "GPL-3.0", "license": "GPL-3.0",
"dependencies": { "dependencies": {
"@budibase/backend-core": "^1.0.91-alpha.12", "@budibase/backend-core": "^1.0.91-alpha.16",
"@budibase/string-templates": "^1.0.91-alpha.12", "@budibase/string-templates": "^1.0.91-alpha.16",
"@koa/router": "^8.0.0", "@koa/router": "^8.0.0",
"@sentry/node": "^6.0.0", "@sentry/node": "^6.0.0",
"@techpass/passport-openidconnect": "^0.3.0", "@techpass/passport-openidconnect": "^0.3.0",

File diff suppressed because it is too large Load diff