diff --git a/packages/builder/src/components/userInterface/EventsEditor/StateBindingCascader.svelte b/packages/builder/src/components/userInterface/EventsEditor/StateBindingCascader.svelte
index 7aff1e366e..0d996d539b 100644
--- a/packages/builder/src/components/userInterface/EventsEditor/StateBindingCascader.svelte
+++ b/packages/builder/src/components/userInterface/EventsEditor/StateBindingCascader.svelte
@@ -1,5 +1,5 @@
-
+
diff --git a/packages/builder/src/components/userInterface/SettingsView.svelte b/packages/builder/src/components/userInterface/SettingsView.svelte
index 326abc5683..159093fe8e 100644
--- a/packages/builder/src/components/userInterface/SettingsView.svelte
+++ b/packages/builder/src/components/userInterface/SettingsView.svelte
@@ -116,7 +116,7 @@
control={definition.control}
label={definition.label}
key={definition.key}
- value={componentInstance[definition.key]}
+ value={componentInstance[definition.key] || componentInstance[definition.key].defaultValue}
{componentInstance}
{onChange}
props={{ ...excludeProps(definition, ['control', 'label']) }} />
diff --git a/packages/builder/src/components/userInterface/temporaryPanelStructure.js b/packages/builder/src/components/userInterface/temporaryPanelStructure.js
index 8943ef8e09..cb52881017 100644
--- a/packages/builder/src/components/userInterface/temporaryPanelStructure.js
+++ b/packages/builder/src/components/userInterface/temporaryPanelStructure.js
@@ -6,6 +6,7 @@ import ModelViewSelect from "components/userInterface/ModelViewSelect.svelte"
import ModelViewFieldSelect from "components/userInterface/ModelViewFieldSelect.svelte"
import Event from "components/userInterface/EventsEditor/EventPropertyControl.svelte"
import ScreenSelect from "components/userInterface/ScreenSelect.svelte"
+import Colorpicker from "@budibase/colorpicker"
import { all } from "./propertyCategories.js"
/*
@@ -515,10 +516,30 @@ export default {
key: "datasource",
control: ModelViewSelect,
},
- { label: "Stripe Color", key: "stripeColor", control: Input },
- { label: "Border Color", key: "borderColor", control: Input },
- { label: "TH Color", key: "backgroundColor", control: Input },
- { label: "TH Font Color", key: "color", control: Input },
+ {
+ label: "Stripe Color",
+ key: "stripeColor",
+ control: Colorpicker,
+ defaultValue: "#FFFFFF",
+ },
+ {
+ label: "Border Color",
+ key: "borderColor",
+ control: Colorpicker,
+ defaultValue: "#FFFFFF",
+ },
+ {
+ label: "TH Color",
+ key: "backgroundColor",
+ control: Colorpicker,
+ defaultValue: "#FFFFFF",
+ },
+ {
+ label: "TH Font Color",
+ key: "color",
+ control: Colorpicker,
+ defaultValue: "#FFFFFF",
+ },
{ label: "Table", key: "model", control: ModelSelect },
],
},
diff --git a/packages/server/src/api/controllers/model.js b/packages/server/src/api/controllers/model.js
index f8c5ebefd7..0f38056753 100644
--- a/packages/server/src/api/controllers/model.js
+++ b/packages/server/src/api/controllers/model.js
@@ -25,7 +25,7 @@ exports.save = async function(ctx) {
...ctx.request.body,
}
- // update renamed record fields when model is updated
+ // rename record fields when table column is renamed
const { _rename } = modelToSave
if (_rename) {
const records = await db.query(`database/all_${modelToSave._id}`, {
@@ -41,6 +41,15 @@ exports.save = async function(ctx) {
delete modelToSave._rename
}
+ // update schema of non-statistics views when new columns are added
+ for (let view in modelToSave.views) {
+ const modelView = modelToSave.views[view]
+ if (!modelView) continue
+
+ if (modelView.schema.group || modelView.schema.field) continue
+ modelView.schema = modelToSave.schema
+ }
+
const result = await db.post(modelToSave)
modelToSave._rev = result.rev
diff --git a/packages/server/src/api/controllers/view/viewBuilder.js b/packages/server/src/api/controllers/view/viewBuilder.js
index b5f9638115..6ac3fdb0f2 100644
--- a/packages/server/src/api/controllers/view/viewBuilder.js
+++ b/packages/server/src/api/controllers/view/viewBuilder.js
@@ -103,9 +103,10 @@ function viewTemplate({ field, modelId, groupBy, filters = [], calculation }) {
let schema = null
if (calculation) {
- schema = groupBy
- ? { ...GROUP_PROPERTY, ...SCHEMA_MAP[calculation] }
- : { ...FIELD_PROPERTY, ...SCHEMA_MAP[calculation] }
+ schema = {
+ ...(groupBy ? GROUP_PROPERTY : FIELD_PROPERTY),
+ ...SCHEMA_MAP[calculation],
+ }
}
return {
diff --git a/packages/standard-components/src/index.js b/packages/standard-components/src/index.js
index 91498002c0..63c6b7c02e 100644
--- a/packages/standard-components/src/index.js
+++ b/packages/standard-components/src/index.js
@@ -1,3 +1,5 @@
+import "@budibase/bbui/dist/bbui.css"
+
export { default as container } from "./Container.svelte"
export { default as text } from "./Text.svelte"
export { default as heading } from "./Heading.svelte"