review: better naming of screen templates

This commit is contained in:
Michael Shanks 2020-10-12 10:50:19 +01:00
parent 72774e7fe9
commit 02dcc07f84
8 changed files with 12 additions and 12 deletions

View File

@ -1,5 +1,5 @@
export default { export default {
name: `Create from Scratch`, name: `Create from scratch`,
create: () => createScreen(), create: () => createScreen(),
} }

View File

@ -1,5 +1,5 @@
export default { export default {
name: `New Record (Empty)`, name: `New Row (Empty)`,
create: () => createScreen(), create: () => createScreen(),
} }

View File

@ -1,5 +1,5 @@
export default { export default {
name: `Record Detail (Empty)`, name: `Row Detail (Empty)`,
create: () => createScreen(), create: () => createScreen(),
} }

View File

@ -10,10 +10,10 @@ import { uuid } from "builderStore/uuid"
const allTemplates = models => [ const allTemplates = models => [
emptyContainerScreen, emptyContainerScreen,
...newRecordScreen(models), ...newRecordScreen(models),
emptyNewRecordScreen,
...recordDetailScreen(models), ...recordDetailScreen(models),
emptyRecordDetailScreen,
...recordListScreen(models), ...recordListScreen(models),
emptyNewRecordScreen,
emptyRecordDetailScreen,
] ]
// allows us to apply common behaviour to all create() functions // allows us to apply common behaviour to all create() functions

View File

@ -3,7 +3,7 @@ export default function(models) {
const fields = Object.keys(model.schema) const fields = Object.keys(model.schema)
const heading = fields.length > 0 ? `{{ data.${fields[0]} }}` : "Add Row" const heading = fields.length > 0 ? `{{ data.${fields[0]} }}` : "Add Row"
return { return {
name: `New Row - ${model.name}`, name: `${model.name} - New`,
create: () => createScreen(model, heading), create: () => createScreen(model, heading),
id: NEW_RECORD_TEMPLATE, id: NEW_RECORD_TEMPLATE,
} }

View File

@ -3,7 +3,7 @@ export default function(models) {
const fields = Object.keys(model.schema) const fields = Object.keys(model.schema)
const heading = fields.length > 0 ? `{{ data.${fields[0]} }}` : "Detail" const heading = fields.length > 0 ? `{{ data.${fields[0]} }}` : "Detail"
return { return {
name: `Row Detail - ${model.name}`, name: `${model.name} - Detail`,
create: () => createScreen(model, heading), create: () => createScreen(model, heading),
id: RECORD_DETAIL_TEMPLATE, id: RECORD_DETAIL_TEMPLATE,
} }
@ -127,7 +127,7 @@ const createScreen = (model, heading) => ({
], ],
}, },
], ],
_instanceName: `${model.name} Detail`, _instanceName: `${model.name} - Detail`,
_code: "", _code: "",
}, },
route: `/${model.name.toLowerCase()}/:id`, route: `/${model.name.toLowerCase()}/:id`,

View File

@ -1,7 +1,7 @@
export default function(models) { export default function(models) {
return models.map(model => { return models.map(model => {
return { return {
name: `List - ${model.name}`, name: `${model.name} - List`,
create: () => createScreen(model), create: () => createScreen(model),
id: RECORD_LIST_TEMPLATE, id: RECORD_LIST_TEMPLATE,
} }
@ -108,7 +108,7 @@ const createScreen = model => ({
_children: [], _children: [],
}, },
], ],
_instanceName: `${model.name} List`, _instanceName: `${model.name} - List`,
_code: "", _code: "",
className: "", className: "",
onLoad: [], onLoad: [],

View File

@ -1093,7 +1093,7 @@ export default {
// children: [], // children: [],
// }, // },
{ {
name: "Record Detail", name: "Row Detail",
_component: "@budibase/standard-components/rowdetail", _component: "@budibase/standard-components/rowdetail",
description: description:
"Loads a record, using an id from the URL, which can be used with {{ context }}, in children", "Loads a record, using an id from the URL, which can be used with {{ context }}, in children",
@ -1105,7 +1105,7 @@ export default {
children: [], children: [],
}, },
{ {
name: "Record Detail", name: "New Row",
_component: "@budibase/standard-components/newrow", _component: "@budibase/standard-components/newrow",
description: description:
"Sets up a new record for creation, which can be used with {{ context }}, in children", "Sets up a new record for creation, which can be used with {{ context }}, in children",