From 98050f4c2a68201e24d4c636f5e224a7e4e4545a Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Wed, 3 Jun 2020 21:10:48 +0100 Subject: [PATCH] Revert "Settings for Pages and Screens" --- .../builder/src/builderStore/store/index.js | 10 ---- .../ComponentPropertiesPanel.svelte | 51 +++++-------------- .../userInterface/FrontendNavigatePane.svelte | 1 - .../userInterface/SettingsView.svelte | 7 +-- .../userInterface/propertyCategories.js | 15 ++---- 5 files changed, 19 insertions(+), 65 deletions(-) diff --git a/packages/builder/src/builderStore/store/index.js b/packages/builder/src/builderStore/store/index.js index 3572e4e344..9f91550bca 100644 --- a/packages/builder/src/builderStore/store/index.js +++ b/packages/builder/src/builderStore/store/index.js @@ -69,7 +69,6 @@ export const getStore = () => { store.getPathToComponent = getPathToComponent(store) store.addTemplatedComponent = addTemplatedComponent(store) store.setMetadataProp = setMetadataProp(store) - store.editPageOrScreen = editPageOrScreen(store) return store } @@ -172,15 +171,6 @@ const createScreen = store => (screenName, route, layoutComponentName) => { }) } -const editPageOrScreen = store => (key, value) => { - store.update(state => { - state.currentPreviewItem[key] = value - _saveCurrentPreviewItem(state) - - return state - }) -} - const setCurrentScreen = store => screenName => { store.update(s => { const screen = getExactComponent(s.screens, screenName) diff --git a/packages/builder/src/components/userInterface/ComponentPropertiesPanel.svelte b/packages/builder/src/components/userInterface/ComponentPropertiesPanel.svelte index 48d7bb0835..60279aa9a1 100644 --- a/packages/builder/src/components/userInterface/ComponentPropertiesPanel.svelte +++ b/packages/builder/src/components/userInterface/ComponentPropertiesPanel.svelte @@ -1,6 +1,5 @@ diff --git a/packages/builder/src/components/userInterface/SettingsView.svelte b/packages/builder/src/components/userInterface/SettingsView.svelte index 7e79883a2b..99e704d1d9 100644 --- a/packages/builder/src/components/userInterface/SettingsView.svelte +++ b/packages/builder/src/components/userInterface/SettingsView.svelte @@ -9,13 +9,10 @@ export let componentInstance = {} export let onChange = () => {} - let pageScreenProps = ["title", "favicon", "description", "route"] - - const propExistsOnComponentDef = prop => pageScreenProps.includes(prop) || prop in componentDefinition.props + const propExistsOnComponentDef = prop => prop in componentDefinition.props function handleChange(key, data) { - const value = data.target ? data.target.value : data - onChange(key, value) + data.target ? onChange(key, data.target.value) : onChange(key, data) } diff --git a/packages/builder/src/components/userInterface/propertyCategories.js b/packages/builder/src/components/userInterface/propertyCategories.js index f9d9e6b892..59458edd49 100644 --- a/packages/builder/src/components/userInterface/propertyCategories.js +++ b/packages/builder/src/components/userInterface/propertyCategories.js @@ -2,17 +2,10 @@ import Input from "../common/Input.svelte" import OptionSelect from "./OptionSelect.svelte" import InputGroup from "../common/Inputs/InputGroup.svelte" import FlatButtonGroup from "./FlatButtonGroup.svelte" - -export const screen = [ - { label: "Name", key: "name", control: Input }, - { label: "Description", key: "description", control: Input }, - { label: "Route", key: "route", control: Input }, -] - -export const page = [ - { label: "Title", key: "title", control: Input }, - { label: "Favicon", key: "favicon", control: Input }, -] +// import Colorpicker from "../common/Colorpicker.svelte" +/* + TODO: Allow for default values for all properties +*/ export const layout = [ {