feat(journals): implement centralized export templates and bulk interop
- Added 'ae_journals_export_templates.ts' with Markdown, HTML, and JSON support - Refactored 'ae_comp__modal_journal_export.svelte' to use the new template system - Optimized bulk export with automated template selection based on Journal type - Integrated 'Import Entries' action directly into the Journal menu - Updated project documentation to reflect portability features and implementation status
This commit is contained in:
@@ -67,6 +67,7 @@
|
||||
// import Journal_entry_obj_qry from './../ae_comp__journal_entry_obj_qry.svelte';
|
||||
import Journal_obj_id_edit from '../ae_comp__journal_obj_id_edit.svelte';
|
||||
import AeCompModalJournalExport from '../ae_comp__modal_journal_export.svelte';
|
||||
import AeCompModalJournalImport from '../ae_comp__modal_journal_import.svelte';
|
||||
import { FileDown } from '@lucide/svelte';
|
||||
|
||||
// let ae_promises: key_val = {};
|
||||
@@ -77,6 +78,12 @@
|
||||
// *** Quickly pull out data from parent(s)
|
||||
let ae_acct = data[$slct.account_id];
|
||||
let show_export_modal = $state(false);
|
||||
let show_import_modal = $state(false);
|
||||
|
||||
function handle_import_complete() {
|
||||
// Trigger a refresh of the journal entry list
|
||||
$journals_trig.journal_entry_li = true;
|
||||
}
|
||||
|
||||
$effect(() => {
|
||||
if (log_lvl > 1) {
|
||||
@@ -329,7 +336,12 @@
|
||||
"
|
||||
> -->
|
||||
|
||||
<Journal_view {lq__journal_obj} {lq__journal_entry_obj_li} onShowExport={() => show_export_modal = true} />
|
||||
<Journal_view
|
||||
{lq__journal_obj}
|
||||
{lq__journal_entry_obj_li}
|
||||
onShowExport={() => show_export_modal = true}
|
||||
onShowImport={() => show_import_modal = true}
|
||||
/>
|
||||
|
||||
{#if $lq__journal_entry_obj_li && $lq__journal_entry_obj_li?.length}
|
||||
<Journal_entry_obj_li {lq__journal_obj} {lq__journal_entry_obj_li} />
|
||||
@@ -353,8 +365,16 @@
|
||||
<AeCompModalJournalExport
|
||||
bind:open={show_export_modal}
|
||||
entries={$lq__journal_entry_obj_li ?? []}
|
||||
journal={$lq__journal_obj}
|
||||
onClose={() => show_export_modal = false}
|
||||
/>
|
||||
|
||||
<!-- Modal: Bulk Import -->
|
||||
<AeCompModalJournalImport
|
||||
bind:open={show_import_modal}
|
||||
onClose={() => show_import_modal = false}
|
||||
onImportComplete={handle_import_complete}
|
||||
/>
|
||||
{:else}
|
||||
<section class="main_content grow px-1 md:px-2 pb-28 flex flex-col gap-1 items-center">
|
||||
<p class="text-center">You must be logged in as the owner to view this Journal.</p>
|
||||
|
||||
@@ -325,6 +325,7 @@
|
||||
<AeCompModalJournalExport
|
||||
bind:open={show_export_modal}
|
||||
entries={$lq__journal_entry_obj ? [$lq__journal_entry_obj] : []}
|
||||
journal={$lq__journal_obj}
|
||||
onClose={() => show_export_modal = false}
|
||||
/>
|
||||
{:else}
|
||||
|
||||
Reference in New Issue
Block a user