From 84d221aaa7d75fdaf12c65fbc963c92df9dba8bb Mon Sep 17 00:00:00 2001 From: Fabio Di Stasio Date: Wed, 13 Dec 2023 18:29:45 +0100 Subject: [PATCH] chore: utility commit --- src/renderer/components/BaseSelect.vue | 1 - src/renderer/components/ModalNewNote.vue | 91 +++++++ src/renderer/components/TheScratchpad.vue | 308 ++++++++++++---------- src/renderer/components/TheSettingBar.vue | 13 +- src/renderer/i18n/en-US.ts | 10 +- src/renderer/stores/scratchpad.ts | 7 +- 6 files changed, 288 insertions(+), 142 deletions(-) create mode 100644 src/renderer/components/ModalNewNote.vue diff --git a/src/renderer/components/BaseSelect.vue b/src/renderer/components/BaseSelect.vue index 3f606f6d..d55411f6 100644 --- a/src/renderer/components/BaseSelect.vue +++ b/src/renderer/components/BaseSelect.vue @@ -280,7 +280,6 @@ export default defineComponent({ if (props.searchable) searchInput.value.focus(); - else el.value.focus(); diff --git a/src/renderer/components/ModalNewNote.vue b/src/renderer/components/ModalNewNote.vue new file mode 100644 index 00000000..b230faf3 --- /dev/null +++ b/src/renderer/components/ModalNewNote.vue @@ -0,0 +1,91 @@ + + + diff --git a/src/renderer/components/TheScratchpad.vue b/src/renderer/components/TheScratchpad.vue index cdaa59ea..a48656e6 100644 --- a/src/renderer/components/TheScratchpad.vue +++ b/src/renderer/components/TheScratchpad.vue @@ -4,6 +4,7 @@ :cancel-text="t('general.close')" size="medium" :hide-footer="true" + :disable-autofocus="true" @hide="hideScratchpad" > + + + diff --git a/src/renderer/components/TheSettingBar.vue b/src/renderer/components/TheSettingBar.vue index 97219ee9..1f56236e 100644 --- a/src/renderer/components/TheSettingBar.vue +++ b/src/renderer/components/TheSettingBar.vue @@ -83,12 +83,15 @@ @click="showSettingModal('general')" >
- + > + +
@@ -262,7 +265,7 @@ if (!connectionsArr.value.length) .settingbar-element-icon { &.badge::after { top: 10px; - right: -6px; + right: -3px; position: absolute; } diff --git a/src/renderer/i18n/en-US.ts b/src/renderer/i18n/en-US.ts index dd6925c8..1d594830 100644 --- a/src/renderer/i18n/en-US.ts +++ b/src/renderer/i18n/en-US.ts @@ -76,9 +76,11 @@ export const enUS = { singleFile: 'Single {ext} file', zipCompressedFile: 'ZIP compressed {ext} file', copyName: 'Copy name', - search: 'Search' + search: 'Search', + title: 'Title' }, connection: { // Database connection + connection: 'Connection', connectionName: 'Connection name', hostName: 'Host name', client: 'Client', @@ -385,7 +387,11 @@ export const enUS = { wrongFileFormat: 'Wrong file format', dataImportSuccess: 'Data successfully imported', note: 'Note | Notes', - thereIsNoNotesYet: 'There is no notes yet' + thereAreNoNotesYet: 'There are no notes yet', + addNote: 'Add note', + showArchivedNotes: 'Show archived notes', + hideArchivedNotes: 'Hide archived notes', + tag: 'Tag' // Note tag }, faker: { // Faker.js methods, used in random generated content address: 'Address', diff --git a/src/renderer/stores/scratchpad.ts b/src/renderer/stores/scratchpad.ts index e9406554..5ef12add 100644 --- a/src/renderer/stores/scratchpad.ts +++ b/src/renderer/stores/scratchpad.ts @@ -2,10 +2,13 @@ import * as Store from 'electron-store'; import { defineStore } from 'pinia'; const persistentStore = new Store({ name: 'notes' }); +export type TagCode = 'all' | 'note' | 'todo' | 'query' + export interface ConnectionNote { uid: string; - cUid: string; + cUid: string | null; title?: string; + type: TagCode; note: string; date: Date; } @@ -15,7 +18,7 @@ export const useScratchpadStore = defineStore('scratchpad', { /** Global notes */ notes: persistentStore.get('notes', '# HOW TO SUPPORT ANTARES\n\n- [ ] Leave a star to Antares [GitHub repo](https://github.com/antares-sql/antares)\n- [ ] Send feedbacks and advices\n- [ ] Report for bugs\n- [ ] If you enjoy, share Antares with friends\n\n# ABOUT SCRATCHPAD\n\nThis is a scratchpad where you can save your **personal notes**. It supports `markdown` format, but you are free to use plain text.\nThis content is just a placeholder, feel free to clear it to make space for your notes.\n') as string, /** Connection specific notes */ - connectionNotes: persistentStore.get('connectionNotes', {}) as ConnectionNote[] + connectionNotes: persistentStore.get('connectionNotes', []) as ConnectionNote[] }), actions: { changeNotes (notes: ConnectionNote[]) {