Browse Source

change wording and remove console log

pull/1122/head
Keviin Åberg Kultalahti 5 years ago
parent
commit
91ef114065
  1. 6
      packages/builder/src/builderStore/store/backend.js
  2. 10
      packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte

6
packages/builder/src/builderStore/store/backend.js

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

10
packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte

@ -60,7 +60,7 @@
originalName,
field,
primaryDisplay,
relationshipType: relationshipTypes.find(type => type.value === selectedRelationshipType),
relationshipType: relationshipTypes.find(type => type.text === selectedRelationshipType).value,
indexes,
})
return state
@ -200,7 +200,9 @@
<Label grey extraSmall>Select relationship type</Label>
<div class="radio-buttons">
{#each types as type}
<Radio name="Relationship type" value={type} bind:group={selectedRelationshipType} label={type} showLabel/>
<Radio name="Relationship type" value={type} bind:group={selectedRelationshipType}>
<label for={type}>{type}</label>
</Radio>
{/each}
</div>
</div>
@ -232,6 +234,10 @@
title="Confirm Deletion" />
<style>
label {
display: grid;
place-items: center;
}
.radio-buttons {
display: flex;
gap: var(--spacing-m);

Loading…
Cancel
Save