This commit is contained in:
Keviin Åberg Kultalahti 2021-02-19 13:56:24 +01:00
parent c6ad951fe5
commit 2bce2f05ce
2 changed files with 13 additions and 4 deletions

View File

@ -234,7 +234,13 @@ export const getBackendUiStore = () => {
return state
})
},
saveField: ({ originalName, field, primaryDisplay = false, indexes, relationshipType }) => {
saveField: ({
originalName,
field,
primaryDisplay = false,
indexes,
relationshipType,
}) => {
store.update(state => {
// delete the original if renaming
// need to handle if the column had no name, empty string
@ -250,9 +256,9 @@ export const getBackendUiStore = () => {
if (primaryDisplay) {
state.draftTable.primaryDisplay = field.name
}
// Set relationship type
if (field.type === 'link') {
if (field.type === "link") {
state.draftTable.relationshipType = relationshipType
}

View File

@ -199,7 +199,10 @@ export function makeDatasourceFormComponents(datasource) {
component.customProps({ placeholder: "Choose an option " })
}
if (fieldType === "link") {
let placeholder = fieldSchema.relationshipType === 'one-to-many' ? 'Choose an option' : 'Choose some options'
let placeholder =
fieldSchema.relationshipType === "one-to-many"
? "Choose an option"
: "Choose some options"
component.customProps({ placeholder })
}
if (fieldType === "boolean") {