From 02dcc07f84ec49324789053c11cc47342f2571af Mon Sep 17 00:00:00 2001 From: Michael Shanks Date: Mon, 12 Oct 2020 10:50:19 +0100 Subject: [PATCH] review: better naming of screen templates --- .../store/screenTemplates/emptyContainerScreen.js | 2 +- .../store/screenTemplates/emptyNewRecordScreen.js | 2 +- .../store/screenTemplates/emptyRecordDetailScreen.js | 2 +- .../builder/src/builderStore/store/screenTemplates/index.js | 4 ++-- .../src/builderStore/store/screenTemplates/newRecordScreen.js | 2 +- .../builderStore/store/screenTemplates/recordDetailScreen.js | 4 ++-- .../builderStore/store/screenTemplates/recordListScreen.js | 4 ++-- .../src/components/userInterface/temporaryPanelStructure.js | 4 ++-- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/builder/src/builderStore/store/screenTemplates/emptyContainerScreen.js b/packages/builder/src/builderStore/store/screenTemplates/emptyContainerScreen.js index c567c31026..a8ab27df3d 100644 --- a/packages/builder/src/builderStore/store/screenTemplates/emptyContainerScreen.js +++ b/packages/builder/src/builderStore/store/screenTemplates/emptyContainerScreen.js @@ -1,5 +1,5 @@ export default { - name: `Create from Scratch`, + name: `Create from scratch`, create: () => createScreen(), } diff --git a/packages/builder/src/builderStore/store/screenTemplates/emptyNewRecordScreen.js b/packages/builder/src/builderStore/store/screenTemplates/emptyNewRecordScreen.js index a9b73a2cf0..db6910809f 100644 --- a/packages/builder/src/builderStore/store/screenTemplates/emptyNewRecordScreen.js +++ b/packages/builder/src/builderStore/store/screenTemplates/emptyNewRecordScreen.js @@ -1,5 +1,5 @@ export default { - name: `New Record (Empty)`, + name: `New Row (Empty)`, create: () => createScreen(), } diff --git a/packages/builder/src/builderStore/store/screenTemplates/emptyRecordDetailScreen.js b/packages/builder/src/builderStore/store/screenTemplates/emptyRecordDetailScreen.js index 8a47571288..5c0b31a2df 100644 --- a/packages/builder/src/builderStore/store/screenTemplates/emptyRecordDetailScreen.js +++ b/packages/builder/src/builderStore/store/screenTemplates/emptyRecordDetailScreen.js @@ -1,5 +1,5 @@ export default { - name: `Record Detail (Empty)`, + name: `Row Detail (Empty)`, create: () => createScreen(), } diff --git a/packages/builder/src/builderStore/store/screenTemplates/index.js b/packages/builder/src/builderStore/store/screenTemplates/index.js index c7e0c52969..519a5e1a36 100644 --- a/packages/builder/src/builderStore/store/screenTemplates/index.js +++ b/packages/builder/src/builderStore/store/screenTemplates/index.js @@ -10,10 +10,10 @@ import { uuid } from "builderStore/uuid" const allTemplates = models => [ emptyContainerScreen, ...newRecordScreen(models), - emptyNewRecordScreen, ...recordDetailScreen(models), - emptyRecordDetailScreen, ...recordListScreen(models), + emptyNewRecordScreen, + emptyRecordDetailScreen, ] // allows us to apply common behaviour to all create() functions diff --git a/packages/builder/src/builderStore/store/screenTemplates/newRecordScreen.js b/packages/builder/src/builderStore/store/screenTemplates/newRecordScreen.js index 3c03573f28..bbe9b0d911 100644 --- a/packages/builder/src/builderStore/store/screenTemplates/newRecordScreen.js +++ b/packages/builder/src/builderStore/store/screenTemplates/newRecordScreen.js @@ -3,7 +3,7 @@ export default function(models) { const fields = Object.keys(model.schema) const heading = fields.length > 0 ? `{{ data.${fields[0]} }}` : "Add Row" return { - name: `New Row - ${model.name}`, + name: `${model.name} - New`, create: () => createScreen(model, heading), id: NEW_RECORD_TEMPLATE, } diff --git a/packages/builder/src/builderStore/store/screenTemplates/recordDetailScreen.js b/packages/builder/src/builderStore/store/screenTemplates/recordDetailScreen.js index 43c93538b5..fb4c3230ee 100644 --- a/packages/builder/src/builderStore/store/screenTemplates/recordDetailScreen.js +++ b/packages/builder/src/builderStore/store/screenTemplates/recordDetailScreen.js @@ -3,7 +3,7 @@ export default function(models) { const fields = Object.keys(model.schema) const heading = fields.length > 0 ? `{{ data.${fields[0]} }}` : "Detail" return { - name: `Row Detail - ${model.name}`, + name: `${model.name} - Detail`, create: () => createScreen(model, heading), id: RECORD_DETAIL_TEMPLATE, } @@ -127,7 +127,7 @@ const createScreen = (model, heading) => ({ ], }, ], - _instanceName: `${model.name} Detail`, + _instanceName: `${model.name} - Detail`, _code: "", }, route: `/${model.name.toLowerCase()}/:id`, diff --git a/packages/builder/src/builderStore/store/screenTemplates/recordListScreen.js b/packages/builder/src/builderStore/store/screenTemplates/recordListScreen.js index 5162df5be2..32f4d0696b 100644 --- a/packages/builder/src/builderStore/store/screenTemplates/recordListScreen.js +++ b/packages/builder/src/builderStore/store/screenTemplates/recordListScreen.js @@ -1,7 +1,7 @@ export default function(models) { return models.map(model => { return { - name: `List - ${model.name}`, + name: `${model.name} - List`, create: () => createScreen(model), id: RECORD_LIST_TEMPLATE, } @@ -108,7 +108,7 @@ const createScreen = model => ({ _children: [], }, ], - _instanceName: `${model.name} List`, + _instanceName: `${model.name} - List`, _code: "", className: "", onLoad: [], diff --git a/packages/builder/src/components/userInterface/temporaryPanelStructure.js b/packages/builder/src/components/userInterface/temporaryPanelStructure.js index 0329f296d3..3f853efcfb 100644 --- a/packages/builder/src/components/userInterface/temporaryPanelStructure.js +++ b/packages/builder/src/components/userInterface/temporaryPanelStructure.js @@ -1093,7 +1093,7 @@ export default { // children: [], // }, { - name: "Record Detail", + name: "Row Detail", _component: "@budibase/standard-components/rowdetail", description: "Loads a record, using an id from the URL, which can be used with {{ context }}, in children", @@ -1105,7 +1105,7 @@ export default { children: [], }, { - name: "Record Detail", + name: "New Row", _component: "@budibase/standard-components/newrow", description: "Sets up a new record for creation, which can be used with {{ context }}, in children",