From 2ad007fce0e0812b116f2224fd81560930a4d7be Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 7 May 2020 14:04:32 +0100 Subject: [PATCH] further simplification of server code --- .../ComponentSelectionList.svelte | 48 +------ packages/server/src/api/index.js | 121 +++++++++--------- packages/server/src/app.js | 18 ++- packages/server/src/electron.js | 2 +- packages/server/src/index.js | 13 +- .../server/src/middleware/authenticated.js | 10 +- packages/server/src/middleware/session.js | 24 ---- 7 files changed, 82 insertions(+), 154 deletions(-) delete mode 100644 packages/server/src/middleware/session.js diff --git a/packages/builder/src/components/userInterface/ComponentSelectionList.svelte b/packages/builder/src/components/userInterface/ComponentSelectionList.svelte index 66df3aa686..169c3ab284 100644 --- a/packages/builder/src/components/userInterface/ComponentSelectionList.svelte +++ b/packages/builder/src/components/userInterface/ComponentSelectionList.svelte @@ -30,34 +30,9 @@ let selectedCategory = categories[0] const onComponentChosen = component => { - if (component.template) { - // onTemplateChosen(component.template) - } else { - store.addChildComponent(component._component) - toggleTab() - } + store.addChildComponent(component._component) + toggleTab() } - - // const onTemplateInstanceChosen = () => { - // selectedComponent = null - // const instance = templateInstances.find( - // i => i.name === selectedTemplateInstance - // ) - // store.addTemplatedComponent(instance.props) - // toggleTab() - // } - - // $: templatesByComponent = groupBy(t => t.component)($store.templates) - // $: standaloneTemplates = pipe( - // templatesByComponent, - // [ - // values, - // flatten, - // filter(t => !$store.components.some(c => c.name === t.component)), - // map(t => ({ name: splitName(t.component).componentName, template: t })), - // uniqBy(t => t.name), - // ] - // )
@@ -78,25 +53,6 @@
- -