Formatting.

This commit is contained in:
mike12345567 2021-03-01 18:03:33 +00:00
parent 7b90566769
commit e75e96891f
1 changed files with 24 additions and 11 deletions

View File

@ -11,7 +11,11 @@
import { cloneDeep } from "lodash/fp" import { cloneDeep } from "lodash/fp"
import { backendUiStore } from "builderStore" import { backendUiStore } from "builderStore"
import { TableNames, UNEDITABLE_USER_FIELDS } from "constants" import { TableNames, UNEDITABLE_USER_FIELDS } from "constants"
import { FIELDS, AUTO_COLUMN_SUB_TYPES, RelationshipTypes } from "constants/backend" import {
FIELDS,
AUTO_COLUMN_SUB_TYPES,
RelationshipTypes,
} from "constants/backend"
import { getAutoColumnInformation, buildAutoColumn } from "builderStore/utils" import { getAutoColumnInformation, buildAutoColumn } from "builderStore/utils"
import { notifier } from "builderStore/store/notifications" import { notifier } from "builderStore/store/notifications"
import ValuesList from "components/common/ValuesList.svelte" import ValuesList from "components/common/ValuesList.svelte"
@ -157,9 +161,18 @@
const thisName = truncate(table.name, { length: 20 }), const thisName = truncate(table.name, { length: 20 }),
linkName = truncate(linkTable.name, { length: 20 }) linkName = truncate(linkTable.name, { length: 20 })
return [ return [
{ name: `Many ${thisName} has many ${linkName}`, value: RelationshipTypes.MANY_TO_MANY }, {
{ name: `One ${thisName} has many ${linkName}`, value: RelationshipTypes.ONE_TO_MANY }, name: `Many ${thisName} has many ${linkName}`,
{ name: `Many ${thisName} has one ${linkName}`, value: RelationshipTypes.MANY_TO_ONE }, value: RelationshipTypes.MANY_TO_MANY,
},
{
name: `One ${thisName} has many ${linkName}`,
value: RelationshipTypes.ONE_TO_MANY,
},
{
name: `Many ${thisName} has one ${linkName}`,
value: RelationshipTypes.MANY_TO_ONE,
},
] ]
} }
</script> </script>
@ -254,12 +267,12 @@
<Radio <Radio
disabled={originalName} disabled={originalName}
name="Relationship type" name="Relationship type"
value={value} {value}
bind:group={field.relationshipType}> bind:group={field.relationshipType}>
<div class="radio-button-labels"> <div class="radio-button-labels">
<label for={value}>{name.split("has")[0]}</label> <label for={value}>{name.split('has')[0]}</label>
<label class="rel-type-center" for={value}>has</label> <label class="rel-type-center" for={value}>has</label>
<label for={value}>{name.split("has")[1]}</label> <label for={value}>{name.split('has')[1]}</label>
</div> </div>
</Radio> </Radio>
{/each} {/each}