From 784fac5018f6f3b95abe2fd37df0398cdc7ced95 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 14 Sep 2020 15:41:20 +0100 Subject: [PATCH] :sparkles: lint --- .../userInterface/PropertyControl.svelte | 2 +- .../userInterface/SettingsView.svelte | 2 +- .../userInterface/temporaryPanelStructure.js | 28 ++++++++++++++++--- packages/server/src/api/controllers/model.js | 4 +-- .../src/api/controllers/view/viewBuilder.js | 2 +- .../src/DataFormWide.svelte | 1 - 6 files changed, 29 insertions(+), 10 deletions(-) diff --git a/packages/builder/src/components/userInterface/PropertyControl.svelte b/packages/builder/src/components/userInterface/PropertyControl.svelte index 3e802c7008..f1d6fe54d1 100644 --- a/packages/builder/src/components/userInterface/PropertyControl.svelte +++ b/packages/builder/src/components/userInterface/PropertyControl.svelte @@ -93,7 +93,7 @@ {...props} name={key} /> - {#if control === Input && !key.startsWith("_")} + {#if control === Input && !key.startsWith('_')} diff --git a/packages/builder/src/components/userInterface/SettingsView.svelte b/packages/builder/src/components/userInterface/SettingsView.svelte index 684bccdc3d..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]|| componentInstance[definition.key].defaultValue} + 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 cfe03c1939..cb52881017 100644 --- a/packages/builder/src/components/userInterface/temporaryPanelStructure.js +++ b/packages/builder/src/components/userInterface/temporaryPanelStructure.js @@ -516,10 +516,30 @@ export default { key: "datasource", control: ModelViewSelect, }, - { 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: "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 aa038bf96b..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, } - // rename record fields when table column is renamed + // rename record fields when table column is renamed const { _rename } = modelToSave if (_rename) { const records = await db.query(`database/all_${modelToSave._id}`, { @@ -41,7 +41,7 @@ exports.save = async function(ctx) { delete modelToSave._rename } - // update schema of non-statistics views when new columns are added + // 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 diff --git a/packages/server/src/api/controllers/view/viewBuilder.js b/packages/server/src/api/controllers/view/viewBuilder.js index 497716f8e4..6ac3fdb0f2 100644 --- a/packages/server/src/api/controllers/view/viewBuilder.js +++ b/packages/server/src/api/controllers/view/viewBuilder.js @@ -105,7 +105,7 @@ function viewTemplate({ field, modelId, groupBy, filters = [], calculation }) { if (calculation) { schema = { ...(groupBy ? GROUP_PROPERTY : FIELD_PROPERTY), - ...SCHEMA_MAP[calculation] + ...SCHEMA_MAP[calculation], } } diff --git a/packages/standard-components/src/DataFormWide.svelte b/packages/standard-components/src/DataFormWide.svelte index fa14380634..41aa5443a2 100644 --- a/packages/standard-components/src/DataFormWide.svelte +++ b/packages/standard-components/src/DataFormWide.svelte @@ -41,7 +41,6 @@ ([field, message]) => `${field} ${message}` ) - async function fetchModel() { const FETCH_MODEL_URL = `/api/models/${model}` const response = await _bb.api.get(FETCH_MODEL_URL)