diff --git a/frontend/src/Editor/Components/components.js b/frontend/src/Editor/Components/components.js index 448ff8e22a..eba4bae603 100644 --- a/frontend/src/Editor/Components/components.js +++ b/frontend/src/Editor/Components/components.js @@ -20,6 +20,7 @@ export const componentTypes = [ backgroundColor: { type: 'color'}, textColor: { type: 'color'} }, + exposedVariables: {}, definition: { properties: { 'text': { value: 'Button' }, @@ -61,6 +62,9 @@ export const componentTypes = [ styles: { textColor: { type: 'color'} }, + exposedVariables: { + 'selectedRow': {}, + }, definition: { properties: { 'title': { value: 'Table' }, @@ -102,6 +106,7 @@ export const componentTypes = [ styles: { }, + exposedVariables: {}, definition: { properties: { 'placeholder': { value: 'Placeholder text' } @@ -132,6 +137,7 @@ export const componentTypes = [ styles: { }, + exposedVariables: {}, definition: { properties: { 'placeholder': { value: 'Placeholder text' } @@ -163,6 +169,7 @@ export const componentTypes = [ styles: { textColor: { type: 'color'} }, + exposedVariables: {}, definition: { properties: { 'text': { value: 'Text goes here !' }, @@ -195,6 +202,7 @@ export const componentTypes = [ styles: { }, + exposedVariables: {}, definition: { properties: { 'source': { value: 'https://www.svgrepo.com/show/34217/image.svg' }, @@ -224,6 +232,7 @@ export const componentTypes = [ styles: { }, + exposedVariables: {}, definition: { properties: { 'label': { value: 'Select' }, @@ -255,6 +264,7 @@ export const componentTypes = [ styles: { }, + exposedVariables: {}, definition: { properties: { 'label': { value: 'https://www.svgrepo.com/show/46775/drop-down-list.svg' }, diff --git a/frontend/src/Editor/Editor.jsx b/frontend/src/Editor/Editor.jsx index 054e31c70f..1ae458d6a7 100644 --- a/frontend/src/Editor/Editor.jsx +++ b/frontend/src/Editor/Editor.jsx @@ -177,6 +177,33 @@ class Editor extends React.Component { }) } + renderComponentVariables = (id, component) => { + const componentType = component.component.component; + const componentMeta = componentTypes.find(comp => componentType === comp.component); + const exposedVariables = Object.keys(componentMeta.exposedVariables); + + return ( +