Removing console logs and simplifying the relationship name.

This commit is contained in:
mike12345567 2021-07-02 14:35:05 +01:00
parent 10730d8053
commit a8ff2cc7bd
1 changed files with 4 additions and 8 deletions

View File

@ -31,7 +31,6 @@
if (column.type !== "link") { if (column.type !== "link") {
continue continue
} }
console.log(`table - ${table.name} - ${column.name} - id: ${column._id} - ${column.main}`)
// these relationships have an id to pair them to each other // these relationships have an id to pair them to each other
// one has a main for the from side // one has a main for the from side
const key = column.main ? "from" : "to" const key = column.main ? "from" : "to"
@ -57,15 +56,12 @@
const fromTableName = getTableName(toCol.tableId) const fromTableName = getTableName(toCol.tableId)
const toTableName = getTableName(fromCol.tableId) const toTableName = getTableName(fromCol.tableId)
const throughTableName = getTableName(fromCol.through) const throughTableName = getTableName(fromCol.through)
console.log(throughTableName)
let displayFrom = `${fromTableName} (${fromCol.name})`
let displayTo = `${toTableName} (${toCol.name})`
let displayString let displayString
if (throughTableName) { if (throughTableName) {
displayString = `${displayFrom} through ${throughTableName} → ${displayTo}` displayString = `${fromTableName} through ${throughTableName} → ${toTableName}`
} else { } else {
displayString = `${displayFrom} → ${displayTo}` displayString = `${fromTableName} → ${toTableName}`
} }
return displayString return displayString
} }
@ -219,13 +215,13 @@
on:click={() => on:click={() =>
openRelationshipModal(relationship.from, relationship.to)} openRelationshipModal(relationship.from, relationship.to)}
> >
<p> <p class="query-name">
{buildRelationshipDisplayString( {buildRelationshipDisplayString(
relationship.from, relationship.from,
relationship.to relationship.to
)} )}
</p> </p>
<p class="query-name">{relationship.from?.name} to {relationship.to?.name}</p> <p>{relationship.from?.name} to {relationship.to?.name}</p>
<p></p> <p></p>
</div> </div>
{/each} {/each}