tidy up
This commit is contained in:
parent
bcd9357218
commit
c6442efcab
|
@ -37,6 +37,9 @@
|
||||||
let relationshipOpts1 = Object.values(PrettyRelationshipDefinitions)
|
let relationshipOpts1 = Object.values(PrettyRelationshipDefinitions)
|
||||||
let relationshipOpts2 = Object.values(PrettyRelationshipDefinitions)
|
let relationshipOpts2 = Object.values(PrettyRelationshipDefinitions)
|
||||||
|
|
||||||
|
let relationshipPart1 = PrettyRelationshipDefinitions.MANY
|
||||||
|
let relationshipPart2 = PrettyRelationshipDefinitions.ONE
|
||||||
|
|
||||||
let originalFromColumnName = toRelationship.name,
|
let originalFromColumnName = toRelationship.name,
|
||||||
originalToColumnName = fromRelationship.name
|
originalToColumnName = fromRelationship.name
|
||||||
let originalFromTable = plusTables.find(
|
let originalFromTable = plusTables.find(
|
||||||
|
@ -53,13 +56,14 @@
|
||||||
)
|
)
|
||||||
let errors = {}
|
let errors = {}
|
||||||
let fromPrimary, fromForeign, fromColumn, toColumn
|
let fromPrimary, fromForeign, fromColumn, toColumn
|
||||||
$: fromId = null
|
|
||||||
$: toId = null
|
|
||||||
|
|
||||||
let throughId, throughToKey, throughFromKey
|
let throughId, throughToKey, throughFromKey
|
||||||
let isManyToMany, isManyToOne, relationshipType
|
let isManyToMany, isManyToOne, relationshipType
|
||||||
let hasValidated = false
|
let hasValidated = false
|
||||||
|
|
||||||
|
$: fromId = null
|
||||||
|
$: toId = null
|
||||||
|
|
||||||
$: tableOptions = plusTables.map(table => ({
|
$: tableOptions = plusTables.map(table => ({
|
||||||
label: table.name,
|
label: table.name,
|
||||||
value: table._id,
|
value: table._id,
|
||||||
|
@ -78,7 +82,6 @@
|
||||||
hasValidated = false
|
hasValidated = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
$: console.log(relationshipType)
|
|
||||||
$: valid = getErrorCount(errors) === 0 && allRequiredAttributesSet()
|
$: valid = getErrorCount(errors) === 0 && allRequiredAttributesSet()
|
||||||
$: isManyToMany = relationshipType === RelationshipType.MANY_TO_MANY
|
$: isManyToMany = relationshipType === RelationshipType.MANY_TO_MANY
|
||||||
$: isManyToOne = relationshipType === RelationshipType.MANY_TO_ONE
|
$: isManyToOne = relationshipType === RelationshipType.MANY_TO_ONE
|
||||||
|
@ -350,8 +353,6 @@
|
||||||
fromPrimary = selectedFromTable?.primary[0] || null
|
fromPrimary = selectedFromTable?.primary[0] || null
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
let relationshipPart1 = PrettyRelationshipDefinitions.MANY
|
|
||||||
let relationshipPart2 = PrettyRelationshipDefinitions.ONE
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ModalContent
|
<ModalContent
|
||||||
|
@ -367,10 +368,10 @@
|
||||||
<RelationshipSelector
|
<RelationshipSelector
|
||||||
bind:relationshipPart1
|
bind:relationshipPart1
|
||||||
bind:relationshipPart2
|
bind:relationshipPart2
|
||||||
{relationshipOpts1}
|
|
||||||
{relationshipOpts2}
|
|
||||||
bind:relationshipTableIdPrimary={fromId}
|
bind:relationshipTableIdPrimary={fromId}
|
||||||
bind:relationshipTableIdSecondary={toId}
|
bind:relationshipTableIdSecondary={toId}
|
||||||
|
{relationshipOpts1}
|
||||||
|
{relationshipOpts2}
|
||||||
{tableOptions}
|
{tableOptions}
|
||||||
{errors}
|
{errors}
|
||||||
primaryDisabled={selectedFromTable}
|
primaryDisabled={selectedFromTable}
|
||||||
|
|
Loading…
Reference in New Issue