|
|
|
|
@ -20,15 +20,23 @@ async function getNoteTypeItems(command?: TreeCommandNames) {
|
|
|
|
|
{ title: t("note_types.web-view"), command, type: "webView", uiIcon: "bx bx-globe-alt" },
|
|
|
|
|
{ title: t("note_types.mind-map"), command, type: "mindMap", uiIcon: "bx bx-sitemap" },
|
|
|
|
|
{ title: t("note_types.geo-map"), command, type: "geoMap", uiIcon: "bx bx-map-alt" },
|
|
|
|
|
...await getBuiltInTemplates(command)
|
|
|
|
|
...await getBuiltInTemplates(command),
|
|
|
|
|
...await getUserTemplates(command)
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
return items;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function getUserTemplates(command?: TreeCommandNames) {
|
|
|
|
|
const templateNoteIds = await server.get<string[]>("search-templates");
|
|
|
|
|
const templateNotes = await froca.getNotes(templateNoteIds);
|
|
|
|
|
if (templateNotes.length === 0) {
|
|
|
|
|
return [];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (templateNotes.length > 0) {
|
|
|
|
|
items.push({ title: "----" });
|
|
|
|
|
|
|
|
|
|
const items: MenuItem<TreeCommandNames>[] = [
|
|
|
|
|
SEPARATOR
|
|
|
|
|
];
|
|
|
|
|
for (const templateNote of templateNotes) {
|
|
|
|
|
items.push({
|
|
|
|
|
title: templateNote.title,
|
|
|
|
|
@ -38,8 +46,6 @@ async function getNoteTypeItems(command?: TreeCommandNames) {
|
|
|
|
|
templateNoteId: templateNote.noteId
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return items;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|