From d951edad6155898f44fd660de916765c60568c1c Mon Sep 17 00:00:00 2001 From: Michael Shanks Date: Fri, 11 Sep 2020 09:53:02 +0100 Subject: [PATCH] some comments --- packages/builder/src/builderStore/fetchBindableProperties.js | 2 ++ packages/builder/src/builderStore/replaceBindings.js | 4 ++-- .../userInterface/EventsEditor/actions/SaveFields.svelte | 2 ++ .../components/userInterface/EventsEditor/actions/index.js | 5 +++++ packages/client/src/state/eventHandlers.js | 3 +++ 5 files changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/builderStore/fetchBindableProperties.js b/packages/builder/src/builderStore/fetchBindableProperties.js index 469c357212..65cc861c50 100644 --- a/packages/builder/src/builderStore/fetchBindableProperties.js +++ b/packages/builder/src/builderStore/fetchBindableProperties.js @@ -83,6 +83,8 @@ const contextToBindables = (models, walkResult) => context => { readableBinding: `${context.instance._instanceName}.${context.model.label}.${key}`, }) + // see ModelViewSelect.svelte for the format of context.model + // ... this allows us to bind to Model scheams, or View schemas const model = models.find(m => m._id === context.model.modelId) const schema = context.model.isModel ? model.schema diff --git a/packages/builder/src/builderStore/replaceBindings.js b/packages/builder/src/builderStore/replaceBindings.js index 38cb67951d..ce2d5fe163 100644 --- a/packages/builder/src/builderStore/replaceBindings.js +++ b/packages/builder/src/builderStore/replaceBindings.js @@ -4,7 +4,7 @@ export function readableToRuntimeBinding(bindableProperties, textWithBindings) { // Find all instances of mustasche const boundValues = textWithBindings.match(CAPTURE_VAR_INSIDE_MUSTACHE) - // Replace with names: + // Replace readableBindings with runtimeBindings boundValues && boundValues.forEach(boundValue => { const binding = bindableProperties.find(({ readableBinding }) => { @@ -27,7 +27,7 @@ export function runtimeToReadableBinding(bindableProperties, textWithBindings) { textWithBindings.match(CAPTURE_VAR_INSIDE_MUSTACHE)) || [] - // Replace with names: + // Replace runtimeBindings with readableBindings: boundValues.forEach(v => { const binding = bindableProperties.find(({ runtimeBinding }) => { return v === `{{ ${runtimeBinding} }}` diff --git a/packages/builder/src/components/userInterface/EventsEditor/actions/SaveFields.svelte b/packages/builder/src/components/userInterface/EventsEditor/actions/SaveFields.svelte index d8870e6f18..230416fede 100644 --- a/packages/builder/src/components/userInterface/EventsEditor/actions/SaveFields.svelte +++ b/packages/builder/src/components/userInterface/EventsEditor/actions/SaveFields.svelte @@ -1,4 +1,5 @@