change wording and remove console log

This commit is contained in:
Keviin Åberg Kultalahti 2021-02-16 12:50:12 +01:00
parent 7f95ae7b49
commit 11ee6e8b15
2 changed files with 11 additions and 5 deletions

View File

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

View File

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