fix: better default naming of relationships

This commit is contained in:
Per Stark
2025-10-27 20:45:53 +01:00
parent 75c200b2ba
commit f13791cfcf
4 changed files with 159 additions and 35 deletions

View File

@@ -45,8 +45,13 @@ hx-swap="outerHTML"
<label class="flex items-center gap-2">
<span class="text-xs uppercase tracking-wide opacity-70">Type</span>
<input type="text" name="relationship_type" value="{{ relationship_list.relationship_type }}"
class="nb-input w-28" placeholder="relates_to">
class="nb-input w-32" placeholder="RelatedTo" list="relationship-type-options">
</label>
<datalist id="relationship-type-options">
{% for rel_type in relationship_type_options %}
<option value="{{ rel_type }}"></option>
{% endfor %}
</datalist>
<button type="button" class="nb-btn btn-sm nb-cta sm:ml-2" hx-post="/knowledge-entity/suggestions"
hx-target="#relationship-list" hx-swap="outerHTML" hx-include="#modal_form">
Suggest Relationships
@@ -71,4 +76,4 @@ hx-swap="outerHTML"
<button type="submit" class="nb-btn nb-cta">
Create Entity
</button>
{% endblock %}
{% endblock %}

View File

@@ -9,7 +9,8 @@
</tr>
</thead>
<tbody>
{% for relationship in relationships %}
{% for row in relationships %}
{% set relationship = row.relationship %}
<tr>
<!-- Origin column -->
<td>
@@ -30,7 +31,7 @@
{{ relationship.out }}
{% endfor %}
</td>
<td class="uppercase tracking-wide text-xs">{{ relationship.metadata.relationship_type }}</td>
<td class="uppercase tracking-wide text-xs">{{ row.relationship_type_label }}</td>
<td>
<button class="nb-btn btn-xs" hx-delete="/knowledge-relationship/{{ relationship.id }}"
hx-target="#relationship_table_section" hx-swap="outerHTML">
@@ -61,7 +62,7 @@
</td>
<td>
<input id="relationship_type_input" name="relationship_type" type="text" placeholder="RelatedTo"
class="nb-input w-full new_relationship_input" />
class="nb-input w-full new_relationship_input" value="{{ default_relationship_type }}" />
</td>
<td>
<button id="save_relationship_button" type="button" class="nb-btn btn-sm" hx-post="/knowledge-relationship"
@@ -80,4 +81,4 @@
document.getElementById('save_relationship_button').click();
}
});
</script>
</script>