1
0
Fork 0
mirror of synced 2024-07-07 07:15:43 +12:00

Merge pull request #444 from Budibase/Data-links-block-updated-to-linked-field

Data Link block updated to Linked Fields
This commit is contained in:
Joe 2020-07-14 16:14:47 +01:00 committed by GitHub
commit 1f09ac02d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 42 additions and 15 deletions

View file

@ -68,7 +68,7 @@
<ListItem <ListItem
selected={model._id === $backendUiStore.selectedModel._id && fieldName === $backendUiStore.selectedField} selected={model._id === $backendUiStore.selectedModel._id && fieldName === $backendUiStore.selectedField}
indented indented
icon="ri-layout-column-fill" icon="ri-layout-column-line"
title={model.schema[fieldName].name} title={model.schema[fieldName].name}
on:click={() => selectModel(model, fieldName)} /> on:click={() => selectModel(model, fieldName)} />
{/each} {/each}

View file

@ -15,12 +15,15 @@
const joinPath = join("/") const joinPath = join("/")
const normalizedName = name => const normalizedName = name =>
pipe(name, [ pipe(
name,
[
trimCharsStart("./"), trimCharsStart("./"),
trimCharsStart("~/"), trimCharsStart("~/"),
trimCharsStart("../"), trimCharsStart("../"),
trimChars(" "), trimChars(" "),
]) ]
)
const changeScreen = screen => { const changeScreen = screen => {
store.setCurrentScreen(screen.props._instanceName) store.setCurrentScreen(screen.props._instanceName)

View file

@ -19,7 +19,11 @@
const capitalise = s => s.substring(0, 1).toUpperCase() + s.substring(1) const capitalise = s => s.substring(0, 1).toUpperCase() + s.substring(1)
const get_name = s => (!s ? "" : last(s.split("/"))) const get_name = s => (!s ? "" : last(s.split("/")))
const get_capitalised_name = name => pipe(name, [get_name, capitalise]) const get_capitalised_name = name =>
pipe(
name,
[get_name, capitalise]
)
const isScreenslot = name => name === "##builtin/screenslot" const isScreenslot = name => name === "##builtin/screenslot"
const selectComponent = component => { const selectComponent = component => {
@ -42,7 +46,7 @@
class:selected={currentComponent === component} class:selected={currentComponent === component}
style="padding-left: {level * 20 + 40}px"> style="padding-left: {level * 20 + 40}px">
<div class="nav-item"> <div class="nav-item">
<i class="icon ri-arrow-right-circle-fill" /> <i class="icon ri-arrow-right-circle-line" />
{isScreenslot(component._component) ? 'Screenslot' : component._instanceName} {isScreenslot(component._component) ? 'Screenslot' : component._instanceName}
</div> </div>
<div class="actions"> <div class="actions">

View file

@ -65,8 +65,8 @@ export const FIELDS = {
// presence: false, // presence: false,
// }, // },
// }, // },
DATA_LINK: { LINKED_FIELDS: {
name: "Data Links", name: "Linked Fields",
icon: "ri-link", icon: "ri-link",
type: "link", type: "link",
modelId: null, modelId: null,
@ -89,7 +89,7 @@ export const BLOCKS = {
}, },
COMPANY: { COMPANY: {
name: "Company", name: "Company",
icon: "ri-text", icon: "ri-store-line",
type: "string", type: "string",
constraints: { constraints: {
type: "string", type: "string",
@ -99,7 +99,7 @@ export const BLOCKS = {
}, },
EMAIL: { EMAIL: {
name: "Email", name: "Email",
icon: "ri-text", icon: "ri-mail-line",
type: "string", type: "string",
constraints: { constraints: {
type: "string", type: "string",
@ -109,7 +109,7 @@ export const BLOCKS = {
}, },
PHONE_NUMBER: { PHONE_NUMBER: {
name: "Phone No.", name: "Phone No.",
icon: "ri-number-1", icon: "ri-phone-line",
type: "number", type: "number",
constraints: { constraints: {
type: "number", type: "number",
@ -119,7 +119,7 @@ export const BLOCKS = {
}, },
VALUE: { VALUE: {
name: "Value", name: "Value",
icon: "ri-number-1", icon: "ri-number-5",
type: "number", type: "number",
constraints: { constraints: {
type: "number", type: "number",
@ -136,6 +136,26 @@ export const BLOCKS = {
presence: false, presence: false,
}, },
}, },
URL: {
name: "URL",
icon: "ri-link",
type: "string",
constraints: {
type: "string",
length: {},
presence: false,
},
},
IMAGE: {
name: "Image URL",
icon: "ri-image-line",
type: "string",
constraints: {
type: "string",
length: {},
presence: false,
},
},
// PRIORITY: { // PRIORITY: {
// name: "Options", // name: "Options",
// icon: "ri-list-check-2", // icon: "ri-list-check-2",