From f56a3fa1b64c96cfa98643286d7411757a9135a9 Mon Sep 17 00:00:00 2001 From: Cioraneanu Mihai Date: Tue, 17 Dec 2024 16:03:27 +0200 Subject: [PATCH] - add user defined substring, which when present in assistant automatically adds your todo tag (ex. "electricit 22 !!") - created new settings page for assistant configs --- front/assets/styles/theme-dark.css | 4 ++ front/assets/styles/theme.css | 2 +- .../transaction/transaction-assistant.vue | 22 +++++--- front/constants/RouteConstants.js | 1 + front/constants/TablerIconConstants.js | 2 + front/pages/settings/assistant.vue | 52 +++++++++++++++++++ front/pages/settings/formatting.vue | 2 +- front/pages/settings/index.vue | 1 + front/pages/transactions/[[id]].vue | 7 ++- front/plugins/register-tabler-icons.js | 4 +- front/stores/profileStore.js | 2 + 11 files changed, 87 insertions(+), 12 deletions(-) create mode 100644 front/pages/settings/assistant.vue diff --git a/front/assets/styles/theme-dark.css b/front/assets/styles/theme-dark.css index e6613da..f7db4ca 100644 --- a/front/assets/styles/theme-dark.css +++ b/front/assets/styles/theme-dark.css @@ -366,4 +366,8 @@ .van-theme-dark .split-transaction-badge { background: #B71C1C; +} + +.van-theme-dark .assistant-tag { + box-shadow: 0 2px 6px 0px rgba(0, 0, 0, 0.65); } \ No newline at end of file diff --git a/front/assets/styles/theme.css b/front/assets/styles/theme.css index 9774c87..f018f8f 100644 --- a/front/assets/styles/theme.css +++ b/front/assets/styles/theme.css @@ -725,7 +725,7 @@ body { .assistant-tag { padding: 10px; - box-shadow: 0 4px 15px 0 rgba(45, 54, 65, 0.75); + box-shadow: 0 2px 6px 0px rgba(45, 54, 65, 0.45); display: flex; align-items: center; gap: 5px; diff --git a/front/components/transaction/transaction-assistant.vue b/front/components/transaction/transaction-assistant.vue index 72f278a..85311e8 100644 --- a/front/components/transaction/transaction-assistant.vue +++ b/front/components/transaction/transaction-assistant.vue @@ -42,7 +42,6 @@ @@ -112,6 +115,7 @@ const foundTag = ref(null) const foundTemplate = ref(null) const foundAmount = ref(null) const foundDescription = ref(null) +const isTodo = ref(false) const hasAmount = computed(() => { return foundAmount.value && foundAmount.value > 0 @@ -179,12 +183,16 @@ const processAssistantText = () => { text = RomanianLanguageUtils.fixBadWordNumbers(text) text = text.replace(',', '.') - // let words = text.split(' ') + + isTodo.value = profileStore.assistantTodoTagMatcher && text.endsWith(profileStore.assistantTodoTagMatcher) + text = isTodo.value ? text.slice(0, text.length - profileStore.assistantTodoTagMatcher.length) : text // 3 groups: