Add proper names for all components and use these names when adding components

This commit is contained in:
Andrew Kingston 2020-10-28 19:38:11 +00:00
parent 214bd75ff7
commit 649cf18e45
3 changed files with 15 additions and 5 deletions

View File

@ -2,7 +2,9 @@ import { walkProps } from "./storeUtils"
import { get_capitalised_name } from "../helpers" import { get_capitalised_name } from "../helpers"
export default function(component, state) { export default function(component, state) {
const capitalised = get_capitalised_name(component) const capitalised = get_capitalised_name(
component.name || component._component
)
const matchingComponents = [] const matchingComponents = []

View File

@ -371,7 +371,7 @@ const addChildComponent = store => (componentToAdd, presetProps = {}) => {
const component = getComponentDefinition(state, componentToAdd) const component = getComponentDefinition(state, componentToAdd)
const instanceId = get(backendUiStore).selectedDatabase._id const instanceId = get(backendUiStore).selectedDatabase._id
const instanceName = getNewComponentName(componentToAdd, state) const instanceName = getNewComponentName(component, state)
const newComponent = createProps( const newComponent = createProps(
component, component,

View File

@ -92,7 +92,7 @@
] ]
}, },
"input": { "input": {
"name": "Input", "name": "Textfield",
"bindable": "value", "bindable": "value",
"description": "An HTML input", "description": "An HTML input",
"props": { "props": {
@ -222,6 +222,7 @@
} }
}, },
"datagrid": { "datagrid": {
"name": "Grid",
"description": "a datagrid component with functionality to add, remove and edit rows.", "description": "a datagrid component with functionality to add, remove and edit rows.",
"data": true, "data": true,
"props": { "props": {
@ -250,11 +251,13 @@
} }
}, },
"dataform": { "dataform": {
"name": "Form",
"description": "an HTML table that fetches data from a table or view and displays it.", "description": "an HTML table that fetches data from a table or view and displays it.",
"data": true, "data": true,
"props": {} "props": {}
}, },
"dataformwide": { "dataformwide": {
"name": "Form Wide",
"description": "an HTML table that fetches data from a table or view and displays it.", "description": "an HTML table that fetches data from a table or view and displays it.",
"data": true, "data": true,
"props": {} "props": {}
@ -275,6 +278,7 @@
} }
}, },
"list": { "list": {
"name": "Repeater",
"description": "A configurable data list that attaches to your backend tables.", "description": "A configurable data list that attaches to your backend tables.",
"context": "datasource", "context": "datasource",
"children": true, "children": true,
@ -296,6 +300,7 @@
} }
}, },
"rowdetail": { "rowdetail": {
"name": "Row Detail",
"description": "Loads a row, using an ID in the url", "description": "Loads a row, using an ID in the url",
"context": "table", "context": "table",
"children": true, "children": true,
@ -306,6 +311,7 @@
} }
}, },
"newrow": { "newrow": {
"name": "New Row",
"description": "Prepares a new row for creation", "description": "Prepares a new row for creation",
"context": "table", "context": "table",
"children": true, "children": true,
@ -673,6 +679,7 @@
} }
}, },
"datepicker": { "datepicker": {
"name": "Date Picker",
"description": "Date Picker", "description": "Date Picker",
"bindable": "value", "bindable": "value",
"props": { "props": {
@ -704,6 +711,7 @@
} }
}, },
"link": { "link": {
"name": "Link",
"description": "an HTML anchor <a> tag", "description": "an HTML anchor <a> tag",
"props": { "props": {
"url": "string", "url": "string",
@ -796,14 +804,14 @@
"tags": [] "tags": []
}, },
"thead": { "thead": {
"name": "TableHead", "name": "Table Head",
"description": "an HTML <thead> tab", "description": "an HTML <thead> tab",
"props": { "props": {
"className": "string" "className": "string"
} }
}, },
"tbody": { "tbody": {
"name": "TableBody", "name": "Table Body",
"description": "an HTML <tbody> tab", "description": "an HTML <tbody> tab",
"props": { "props": {
"className": "string" "className": "string"