From 089df798cec4cb139cb293099da915231d804112 Mon Sep 17 00:00:00 2001 From: Mike Erickson Date: Tue, 17 May 2022 17:33:03 -0700 Subject: [PATCH] release 1.2.0-beta.02, fix ` to prompt user of where new note should be created (@jgclark) + ## [1.2.0-beta.01] - 2022-05-15 (mikeerickson) - added `templateGroupTemplatesByFolder` setting (default: false) diff --git a/np.Templating/lib/TemplatingEngine.js b/np.Templating/lib/TemplatingEngine.js index 38d3f9cc6..355a57952 100644 --- a/np.Templating/lib/TemplatingEngine.js +++ b/np.Templating/lib/TemplatingEngine.js @@ -16,7 +16,6 @@ import FrontmatterModule from '@templatingModules/FrontmatterModule' import pluginJson from '../plugin.json' import { clo, log } from '@helpers/dev' -import { debug } from '../lib/helpers' // this is a customized version of `ejs` adding support for async actions (use await in template) // review `Test (Async)` template for example` diff --git a/np.Templating/plugin.json b/np.Templating/plugin.json index 187587efb..7d12b6e33 100644 --- a/np.Templating/plugin.json +++ b/np.Templating/plugin.json @@ -3,7 +3,7 @@ "noteplan.minAppVersion": "3.5.0", "plugin.id": "np.Templating", "plugin.name": " 📒 np.Templating -- New 🎉", - "plugin.version": "1.2.0-beta.01", + "plugin.version": "1.2.0-beta.02", "plugin.description": "Templating Plugin for NotePlan", "plugin.author": "Mike Erickson (@codedungeon)", "plugin.dependencies": [], diff --git a/np.Templating/src/Templating.js b/np.Templating/src/Templating.js index aeb04a4ba..925fd893f 100644 --- a/np.Templating/src/Templating.js +++ b/np.Templating/src/Templating.js @@ -311,8 +311,8 @@ export async function templateQuickNote(noteName: string = ''): Promise { const { frontmatterBody, frontmatterAttributes } = await NPTemplating.preRender(templateData) let folder = frontmatterAttributes?.folder.trim() ?? '' - if (folder === '') { - folder = await NPTemplating.getFolder(folder, 'Select Destination Folder') + if (frontmatterAttributes?.folder && frontmatterAttributes.folder.length > 0) { + folder = await NPTemplating.getFolder(frontmatterAttributes.folder, 'Select Destination Folder') } let newNoteTitle = '' @@ -387,8 +387,8 @@ export async function templateMeetingNote(noteName: string = '', templateData: a const { frontmatterBody, frontmatterAttributes } = await NPTemplating.preRender(templateData) let folder = frontmatterAttributes?.folder.trim() ?? '' - if (folder === '') { - folder = await NPTemplating.getFolder(folder, 'Select Destination Folder') + if (frontmatterAttributes?.folder && frontmatterAttributes.folder.length > 0) { + folder = await NPTemplating.getFolder(frontmatterAttributes.folder, 'Select Destination Folder') } let newNoteTitle = ''