diff --git a/src/routes/journals/ae_comp__journal_obj_id_edit.svelte b/src/routes/journals/ae_comp__journal_obj_id_edit.svelte index 924a9af3..18a803e5 100644 --- a/src/routes/journals/ae_comp__journal_obj_id_edit.svelte +++ b/src/routes/journals/ae_comp__journal_obj_id_edit.svelte @@ -32,7 +32,9 @@ BetweenVerticalEnd, BetweenVerticalStart, X, - Settings + Settings, + CalendarClock, + MousePointerClick } from '@lucide/svelte'; import { Modal } from 'flowbite-svelte'; import { goto } from '$app/navigation'; @@ -65,15 +67,15 @@ // *** Internal State let tab: 'general' | 'security' | 'ui' | 'json' = $state('general'); - let tmp__journal_obj = $state($journals_slct.journal_obj ?? {}); + let tmp__journal_obj: any = $state({}); // Deep copy on mount or when lq changes to ensure we have a working copy $effect(() => { - if (show && lq__journal_obj) { - const source_id = lq__journal_obj.journal_id; + if (show && $lq__journal_obj) { + const source_id = $lq__journal_obj.journal_id; untrack(() => { if (!tmp__journal_obj.journal_id || tmp__journal_obj.journal_id !== source_id) { - tmp__journal_obj = JSON.parse(JSON.stringify(lq__journal_obj)); + tmp__journal_obj = JSON.parse(JSON.stringify($lq__journal_obj)); // Ensure cfg_json exists if (!tmp__journal_obj.cfg_json) tmp__journal_obj.cfg_json = {}; } @@ -88,10 +90,41 @@ } try { + // DEFINITIVE BASE TABLE COLUMNS ONLY + const data_kv = { + name: tmp__journal_obj.name, + short_name: tmp__journal_obj.short_name, + type_code: tmp__journal_obj.type_code, + description: tmp__journal_obj.description, + summary: tmp__journal_obj.summary, + outline: tmp__journal_obj.outline, + passcode: tmp__journal_obj.passcode, + private_passcode: tmp__journal_obj.private_passcode, + public_passcode: tmp__journal_obj.public_passcode, + passcode_timeout: tmp__journal_obj.passcode_timeout, + auth_key: tmp__journal_obj.auth_key, + allow_auth: tmp__journal_obj.allow_auth, + cfg_json: tmp__journal_obj.cfg_json, + data_json: tmp__journal_obj.data_json, + enable: tmp__journal_obj.enable, + hide: tmp__journal_obj.hide, + priority: tmp__journal_obj.priority, + sort: tmp__journal_obj.sort, + group: tmp__journal_obj.group, + notes: tmp__journal_obj.notes, + alert: tmp__journal_obj.alert, + alert_msg: tmp__journal_obj.alert_msg, + archive_on: tmp__journal_obj.archive_on, + default_private: tmp__journal_obj.default_private, + default_public: tmp__journal_obj.default_public, + default_personal: tmp__journal_obj.default_personal, + default_professional: tmp__journal_obj.default_professional + }; + await journals_func.update_ae_obj__journal({ api_cfg: $ae_api, - journal_id: lq__journal_obj?.journal_id, - data_kv: tmp__journal_obj, + journal_id: $lq__journal_obj?.journal_id, + data_kv: data_kv, log_lvl: log_lvl }); show = false; @@ -102,11 +135,11 @@ } async function delete_journal() { - if (confirm(`CRITICAL WARNING: Are you sure you want to delete the journal "${lq__journal_obj.name}"? This will delete all entries associated with it.`)) { + if (confirm(`CRITICAL WARNING: Are you sure you want to delete the journal "${$lq__journal_obj.name}"? This will delete all entries associated with it.`)) { try { await journals_func.delete_ae_obj_id__journal({ api_cfg: $ae_api, - journal_id: lq__journal_obj?.journal_id, + journal_id: $lq__journal_obj?.journal_id, log_lvl: log_lvl }); alert('Journal deleted successfully!'); @@ -142,7 +175,7 @@ General (tab = 'security')}> - Security + Status & Security (tab = 'ui')}> UI/Visuals @@ -208,6 +241,49 @@ {:else if tab === 'security'} + + + + + Status & Lifecycle + + + + + + Enabled + Allow access to this journal + + + + + + Hidden + Hide from standard lists + + + + + + Priority Journal + Star or pin to top + + + + + Sort Order + Manual list position + + + { tmp__journal_obj.sort = (tmp__journal_obj.sort ?? 0) - 1; }}> + {tmp__journal_obj.sort ?? 0} + { tmp__journal_obj.sort = (tmp__journal_obj.sort ?? 0) + 1; }}> + + + + + + @@ -234,27 +310,6 @@ - - - - Status & Lifecycle - - - - - Enabled - - - - Hidden - - - - Priority Journal - - - - Delete Entire Journal diff --git a/src/routes/journals/modal_journal_entry_config.svelte b/src/routes/journals/modal_journal_entry_config.svelte index 25941534..2f062961 100644 --- a/src/routes/journals/modal_journal_entry_config.svelte +++ b/src/routes/journals/modal_journal_entry_config.svelte @@ -86,7 +86,7 @@ Metadata (tab = 'security')}> - Security + Status & Security (tab = 'json')}> JSON @@ -163,6 +163,47 @@ {:else if tab === 'security'} + + + + Status & Lifecycle + + + + + + Enabled + Allow access to this entry + + + + + + Hidden + Hide from standard lists + + + + + + Priority Entry + Star or pin to top + + + + + Sort Order + Manual list position + + + { tmp_entry_obj.sort = (tmp_entry_obj.sort ?? 0) - 1; }}> + {tmp_entry_obj.sort ?? 0} + { tmp_entry_obj.sort = (tmp_entry_obj.sort ?? 0) + 1; }}> + + + + + Privacy Flags