renaming Record > Row
This commit is contained in:
parent
6ba65f56e5
commit
127ce3b59d
|
@ -6,7 +6,7 @@ export default {
|
|||
const createScreen = () => ({
|
||||
props: {
|
||||
_id: "",
|
||||
_component: "@budibase/standard-components/recorddetail",
|
||||
_component: "@budibase/standard-components/newrow",
|
||||
_styles: {
|
||||
normal: {},
|
||||
hover: {},
|
||||
|
|
|
@ -6,7 +6,7 @@ export default {
|
|||
const createScreen = () => ({
|
||||
props: {
|
||||
_id: "",
|
||||
_component: "@budibase/standard-components/recorddetail",
|
||||
_component: "@budibase/standard-components/rowdetail",
|
||||
_styles: {
|
||||
normal: {},
|
||||
hover: {},
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
export default function(models) {
|
||||
return models.map(model => {
|
||||
const fields = Object.keys(model.schema)
|
||||
const heading =
|
||||
fields.length > 0 ? `{{ data.${fields[0]} }}` : "Create Record"
|
||||
const heading = fields.length > 0 ? `{{ data.${fields[0]} }}` : "Add Row"
|
||||
return {
|
||||
name: `New Record - ${model.name}`,
|
||||
name: `New Row - ${model.name}`,
|
||||
create: () => createScreen(model, heading),
|
||||
id: NEW_RECORD_TEMPLATE,
|
||||
}
|
||||
|
@ -16,7 +15,7 @@ export const NEW_RECORD_TEMPLATE = "NEW_RECORD_TEMPLATE"
|
|||
const createScreen = (model, heading) => ({
|
||||
props: {
|
||||
_id: "",
|
||||
_component: "@budibase/standard-components/newrecord",
|
||||
_component: "@budibase/standard-components/newrow",
|
||||
_styles: {
|
||||
normal: {},
|
||||
hover: {},
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
export default function(models) {
|
||||
return models.map(model => {
|
||||
const fields = Object.keys(model.schema)
|
||||
const heading =
|
||||
fields.length > 0 ? `{{ data.${fields[0]} }}` : "Edit Record"
|
||||
const heading = fields.length > 0 ? `{{ data.${fields[0]} }}` : "Detail"
|
||||
return {
|
||||
name: `Record Detail - ${model.name}`,
|
||||
name: `Row Detail - ${model.name}`,
|
||||
create: () => createScreen(model, heading),
|
||||
id: RECORD_DETAIL_TEMPLATE,
|
||||
}
|
||||
|
@ -16,7 +15,7 @@ export const RECORD_DETAIL_TEMPLATE = "RECORD_DETAIL_TEMPLATE"
|
|||
const createScreen = (model, heading) => ({
|
||||
props: {
|
||||
_id: "",
|
||||
_component: "@budibase/standard-components/recorddetail",
|
||||
_component: "@budibase/standard-components/rowdetail",
|
||||
_styles: {
|
||||
normal: {},
|
||||
hover: {},
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
export default function(models) {
|
||||
return models.map(model => {
|
||||
return {
|
||||
name: `Record List - ${model.name}`,
|
||||
name: `List - ${model.name}`,
|
||||
create: () => createScreen(model),
|
||||
id: RECORD_LIST_TEMPLATE,
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
|
||||
{#if fields}
|
||||
{#each fields as field}
|
||||
<Label size="m" color="dark">Field</Label>
|
||||
<Label size="m" color="dark">Column</Label>
|
||||
<Select secondary bind:value={field.name} on:blur={rebuildParameters}>
|
||||
<option value="" />
|
||||
{#each schemaFields as schemaField}
|
||||
|
|
|
@ -84,16 +84,6 @@
|
|||
route = "/" + event.target.value
|
||||
}
|
||||
}
|
||||
|
||||
const componentShortName = fullname => {
|
||||
const parts = fullname.split("/")
|
||||
const shortName = parts[parts.length - 1]
|
||||
// make known ones a bit prettier
|
||||
if (shortName === "container") return "Container"
|
||||
if (shortName === "recorddetail") return "Record Detail"
|
||||
if (shortName === "newrecord") return "New Record"
|
||||
return shortName
|
||||
}
|
||||
</script>
|
||||
|
||||
<ModalContent title="New Screen" confirmText="Create Screen" onConfirm={save}>
|
||||
|
|
|
@ -1094,7 +1094,7 @@ export default {
|
|||
// },
|
||||
{
|
||||
name: "Record Detail",
|
||||
_component: "@budibase/standard-components/recorddetail",
|
||||
_component: "@budibase/standard-components/rowdetail",
|
||||
description:
|
||||
"Loads a record, using an id from the URL, which can be used with {{ context }}, in children",
|
||||
icon: "ri-profile-line",
|
||||
|
@ -1106,7 +1106,7 @@ export default {
|
|||
},
|
||||
{
|
||||
name: "Record Detail",
|
||||
_component: "@budibase/standard-components/newrecord",
|
||||
_component: "@budibase/standard-components/newrow",
|
||||
description:
|
||||
"Sets up a new record for creation, which can be used with {{ context }}, in children",
|
||||
icon: "ri-profile-line",
|
||||
|
|
|
@ -261,7 +261,7 @@
|
|||
"destinationUrl": "string"
|
||||
}
|
||||
},
|
||||
"recorddetail": {
|
||||
"rowdetail": {
|
||||
"description": "Loads a record, using an ID in the url",
|
||||
"context": "model",
|
||||
"children": true,
|
||||
|
@ -271,7 +271,7 @@
|
|||
"model": "models"
|
||||
}
|
||||
},
|
||||
"newrecord": {
|
||||
"newrow": {
|
||||
"description": "Prepares a new record for creation",
|
||||
"context": "model",
|
||||
"children": true,
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
throw new Error("Failed to fetch record.", response)
|
||||
}
|
||||
} else {
|
||||
throw new Exception("Record ID was not supplied to RecordDetail")
|
||||
throw new Exception("Record ID was not supplied to RowDetail")
|
||||
}
|
||||
|
||||
if (record) {
|
|
@ -26,8 +26,8 @@ export { default as embed } from "./Embed.svelte"
|
|||
export { default as stackedlist } from "./StackedList.svelte"
|
||||
export { default as card } from "./Card.svelte"
|
||||
export { default as cardhorizontal } from "./CardHorizontal.svelte"
|
||||
export { default as recorddetail } from "./RecordDetail.svelte"
|
||||
export { default as newrecord } from "./NewRecord.svelte"
|
||||
export { default as rowdetail } from "./RowDetail.svelte"
|
||||
export { default as newrow } from "./NewRow.svelte"
|
||||
export { default as datepicker } from "./DatePicker.svelte"
|
||||
export * from "./Chart"
|
||||
export { default as icon } from "./Icon.svelte"
|
||||
|
|
Loading…
Reference in New Issue