diff --git a/src/locales/en.json b/src/locales/en.json index ee740f57..1d6f7a77 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -1633,6 +1633,7 @@ "You have saved this template": "You have saved this template", "Show Hidden Templates": "Show Hidden Transaction Templates", "Hide Hidden Templates": "Hide Hidden Transaction Templates", + "Template name cannot be blank": "Template name cannot be blank", "Are you sure you want to logout from this session?": "Are you sure you want to logout from this session?", "Unable to logout from this session": "Unable to logout from this session", "Are you sure you want to logout all other sessions?": "Are you sure you want to logout all other sessions?", diff --git a/src/locales/zh_Hans.json b/src/locales/zh_Hans.json index 41f93cca..c182ca99 100644 --- a/src/locales/zh_Hans.json +++ b/src/locales/zh_Hans.json @@ -1633,6 +1633,7 @@ "You have saved this template": "您已经保存该模板", "Show Hidden Templates": "显示隐藏的模板", "Hide Hidden Templates": "不显示隐藏的模板", + "Template name cannot be blank": "模板名不能为空", "Are you sure you want to logout from this session?": "您确定要退出该会话?", "Unable to logout from this session": "无法退出该会话", "Are you sure you want to logout all other sessions?": "您确定要退出其他所有会话?", diff --git a/src/views/desktop/transactions/list/dialogs/EditDialog.vue b/src/views/desktop/transactions/list/dialogs/EditDialog.vue index aab4e0dc..99ddfc09 100644 --- a/src/views/desktop/transactions/list/dialogs/EditDialog.vue +++ b/src/views/desktop/transactions/list/dialogs/EditDialog.vue @@ -598,6 +598,12 @@ export default { return !!this.inputEmptyProblemMessage; }, inputEmptyProblemMessage() { + if (this.type === 'template') { + if (!this.transaction.name) { + return 'Template name cannot be blank'; + } + } + return null; } }, @@ -762,6 +768,13 @@ export default { save() { const self = this; + const problemMessage = self.inputEmptyProblemMessage; + + if (problemMessage) { + self.$refs.snackbar.showMessage(problemMessage); + return; + } + if (self.type === 'transaction' && (self.mode === 'add' || self.mode === 'edit')) { const doSubmit = function () { self.submitting = true;