diff --git a/apps/client/src/services/note_autocomplete.ts b/apps/client/src/services/note_autocomplete.ts index 4ffff8594..d6eb4df0e 100644 --- a/apps/client/src/services/note_autocomplete.ts +++ b/apps/client/src/services/note_autocomplete.ts @@ -289,13 +289,11 @@ function initNoteAutocomplete($el: JQuery, options?: Options) { } if (suggestion.action === "create-note") { - const { success, noteType, templateNoteId } = await noteCreateService.chooseNoteType(); - + const { success, noteType, templateNoteId, notePath } = await noteCreateService.chooseNoteType(); if (!success) { return; } - - const { note } = await noteCreateService.createNote(suggestion.parentNoteId, { + const { note } = await noteCreateService.createNote( notePath || suggestion.parentNoteId, { title: suggestion.noteTitle, activate: false, type: noteType, diff --git a/apps/client/src/services/note_create.ts b/apps/client/src/services/note_create.ts index 5fa262553..6ce92bc0d 100644 --- a/apps/client/src/services/note_create.ts +++ b/apps/client/src/services/note_create.ts @@ -116,7 +116,7 @@ async function chooseNoteType() { } async function createNoteWithTypePrompt(parentNotePath: string, options: CreateNoteOpts = {}) { - const { success, noteType, templateNoteId } = await chooseNoteType(); + const { success, noteType, templateNoteId, notePath } = await chooseNoteType(); if (!success) { return; @@ -125,7 +125,7 @@ async function createNoteWithTypePrompt(parentNotePath: string, options: CreateN options.type = noteType; options.templateNoteId = templateNoteId; - return await createNote(parentNotePath, options); + return await createNote(notePath || parentNotePath, options); } /* If the first element is heading, parse it out and use it as a new heading. */ diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json index ab7933617..251819807 100644 --- a/apps/client/src/translations/en/translation.json +++ b/apps/client/src/translations/en/translation.json @@ -233,6 +233,8 @@ "move_success_message": "Selected notes have been moved into " }, "note_type_chooser": { + "change_path_prompt": "Change where to create the new note:", + "search_placeholder": "search path by name (default if empty)", "modal_title": "Choose note type", "close": "Close", "modal_body": "Choose note type / template of the new note:", diff --git a/apps/client/src/widgets/dialogs/note_type_chooser.ts b/apps/client/src/widgets/dialogs/note_type_chooser.ts index ff4442826..02b960308 100644 --- a/apps/client/src/widgets/dialogs/note_type_chooser.ts +++ b/apps/client/src/widgets/dialogs/note_type_chooser.ts @@ -2,6 +2,7 @@ import type { CommandNames } from "../../components/app_context.js"; import type { MenuCommandItem } from "../../menus/context_menu.js"; import { t } from "../../services/i18n.js"; import noteTypesService from "../../services/note_types.js"; +import noteAutocompleteService from "../../services/note_autocomplete.js"; import BasicWidget from "../basic_widget.js"; import { Dropdown, Modal } from "bootstrap"; @@ -13,6 +14,11 @@ const TPL = /*html*/` z-index: 1100 !important; } + .note-type-chooser-dialog .input-group { + margin-top: 15px; + margin-bottom: 15px; + } + .note-type-chooser-dialog .note-type-dropdown { position: relative; font-size: large; @@ -30,6 +36,12 @@ const TPL = /*html*/`