diff --git a/apps/client/src/services/link.ts b/apps/client/src/services/link.ts index 116ca8a5b..41533647c 100644 --- a/apps/client/src/services/link.ts +++ b/apps/client/src/services/link.ts @@ -384,7 +384,7 @@ function linkContextMenu(e: PointerEvent) { linkContextMenuService.openContextMenu(notePath, e, viewScope, null); } -async function loadReferenceLinkTitle($el: JQuery, href: string | null | undefined = null) { +export async function loadReferenceLinkTitle($el: JQuery, href: string | null | undefined = null) { const $link = $el[0].tagName === "A" ? $el : $el.find("a"); href = href || $link.attr("href"); diff --git a/apps/client/src/widgets/view_widgets/table_view/relation_editor.ts b/apps/client/src/widgets/view_widgets/table_view/relation_editor.ts index 5b463afd1..fdc483b26 100644 --- a/apps/client/src/widgets/view_widgets/table_view/relation_editor.ts +++ b/apps/client/src/widgets/view_widgets/table_view/relation_editor.ts @@ -1,5 +1,6 @@ import { CellComponent } from "tabulator-tables"; import note_autocomplete from "../../../services/note_autocomplete"; +import { loadReferenceLinkTitle } from "../../../services/link"; export function RelationEditor(cell: CellComponent, onRendered, success, cancel, editorParams){ //cell - the cell component for the editable cell @@ -45,5 +46,12 @@ export function RelationFormatter(cell: CellComponent, formatterParams, onRender return ""; } - return `Title goes here`; + onRendered(async () => { + const $link = $(""); + $link.addClass("reference-link"); + $link.attr("href", `#root/${noteId}`); + await loadReferenceLinkTitle($link); + cell.getElement().appendChild($link[0]); + }); + return ""; }