feat(journals): expose export functionality in UI

- Added 'Export Entries' button to Journal Index and Journal Detail views
- Wired buttons to trigger the new export modal
This commit is contained in:
Scott Idem
2026-01-13 23:43:50 -05:00
parent b3ac910832
commit b1e9902285
2 changed files with 37 additions and 1 deletions

View File

@@ -8,7 +8,7 @@
import { goto } from '$app/navigation';
// *** Import other supporting libraries
import { BookPlus, FolderPlus, Library, Loader, SquareLibrary, Wrench, FileUp } from '@lucide/svelte';
import { BookPlus, FolderPlus, Library, Loader, SquareLibrary, Wrench, FileUp, FileDown } from '@lucide/svelte';
import { liveQuery } from 'dexie';
import { Modal } from 'flowbite-svelte';
@@ -34,11 +34,13 @@
import Journal_obj_li from './ae_comp__journal_obj_li.svelte';
import AeCompJournalEntryQuickAdd from './ae_comp__journal_entry_quick_add.svelte';
import AeCompModalJournalImport from './ae_comp__modal_journal_import.svelte';
import AeCompModalJournalExport from './ae_comp__modal_journal_export.svelte';
// import Element_data_store from '$lib/element_data_store_v2.svelte';
let ae_acct = data[$slct.account_id];
let show_import_modal = $state(false);
let show_export_modal = $state(false);
function handle_import_complete() {
// Trigger a refresh of the journal list?
@@ -47,6 +49,20 @@
// $journals_trig.journal_entry_li = true;
}
// $journals_slct.journal_obj = ae_acct.slct.journal_obj;
// We need to access the currently filtered/displayed list of entries for export.
// The list is actually managed inside 'Journal_obj_li' (the list component) or via a store.
// However, looking at Journal_obj_li, it takes 'lq__journal_entry_obj_li' as a prop.
// BUT wait, this page (+page.svelte) seems to be the Journal INDEX (list of journals),
// NOT the list of entries within a journal.
// Ah, checking the code...
// The main page lists *Journals* (lq__journal_obj_li).
// The entries are listed in [journal_id]/+page.svelte.
// Correction: Bulk Export should probably be on the [journal_id] page, OR here if we want to export ALL journals?
// The user request was "export Journal Entries". Usually implies from a specific journal or context.
// Let's check [journal_id]/+page.svelte.
// $journals_slct.journal_obj_li = ae_acct.slct.journal_obj_li;
let lq__journal_obj_li = $derived(