From aba3b5cb194479857dcfeca2ea99ae9e59e18bf3 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Thu, 17 Jul 2025 21:07:44 +0300 Subject: [PATCH] feat(views/table): hide all buttons in relation editor --- apps/client/src/services/note_autocomplete.ts | 9 +++++++-- .../widgets/view_widgets/table_view/relation_editor.ts | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/client/src/services/note_autocomplete.ts b/apps/client/src/services/note_autocomplete.ts index d6eb4df0e..4cfc614f0 100644 --- a/apps/client/src/services/note_autocomplete.ts +++ b/apps/client/src/services/note_autocomplete.ts @@ -40,7 +40,10 @@ interface Options { allowCreatingNotes?: boolean; allowJumpToSearchNotes?: boolean; allowExternalLinks?: boolean; + /** If set, hides the right-side button corresponding to go to selected note. */ hideGoToSelectedNoteButton?: boolean; + /** If set, hides all right-side buttons in the autocomplete dropdown */ + hideAllButtons?: boolean; } async function autocompleteSourceForCKEditor(queryText: string) { @@ -190,9 +193,11 @@ function initNoteAutocomplete($el: JQuery, options?: Options) { const $goToSelectedNoteButton = $("").addClass("input-group-text go-to-selected-note-button bx bx-arrow-to-right"); - $el.after($clearTextButton).after($showRecentNotesButton).after($fullTextSearchButton); + if (!options.hideAllButtons) { + $el.after($clearTextButton).after($showRecentNotesButton).after($fullTextSearchButton); + } - if (!options.hideGoToSelectedNoteButton) { + if (!options.hideGoToSelectedNoteButton && !options.hideAllButtons) { $el.after($goToSelectedNoteButton); } 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 0bd1cb1f2..779659a8d 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 @@ -30,7 +30,8 @@ export function RelationEditor(cell: CellComponent, onRendered, success, cancel, //set focus on the select box when the editor is selected onRendered(function(){ note_autocomplete.initNoteAutocomplete($editor, { - allowCreatingNotes: true + allowCreatingNotes: true, + hideAllButtons: true }).on("autocomplete:noteselected", (event, suggestion, dataset) => { const notePath = suggestion.notePath; if (!notePath) {