Bug fix related to saving entries with mixed changes
This commit is contained in:
@@ -68,10 +68,10 @@ if (browser) {
|
|||||||
<!-- These are needed: h-full overflow-auto -->
|
<!-- These are needed: h-full overflow-auto -->
|
||||||
<div class="ae_journals">
|
<div class="ae_journals">
|
||||||
|
|
||||||
<nav class="submenu flex flex-row items-center justify-center gap-1">
|
<nav class="submenu flex flex-row flex-wrap items-center justify-center gap-1">
|
||||||
<a
|
<a
|
||||||
href="/"
|
href="/"
|
||||||
class="btn btn-sm variant-ghost-success hover:variant-filled-success"
|
class="btn btn-sm variant-ghost-surface hover:variant-filled-success"
|
||||||
>
|
>
|
||||||
<House />
|
<House />
|
||||||
Home
|
Home
|
||||||
@@ -82,7 +82,7 @@ if (browser) {
|
|||||||
|
|
||||||
onclick={() => {
|
onclick={() => {
|
||||||
// Confirm before clearing
|
// Confirm before clearing
|
||||||
if (!confirm("Are you sure you want to clear all app data and settings? This will reload the page.")) {
|
if (!confirm("Are you sure you want to clear all *local* app data and settings? This will also reload the page.")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log("Clearing local and session storage, and reloading the page...");
|
console.log("Clearing local and session storage, and reloading the page...");
|
||||||
@@ -102,19 +102,19 @@ if (browser) {
|
|||||||
window.location.reload(true); // true only works with Firefox
|
window.location.reload(true); // true only works with Firefox
|
||||||
// alert('Local and Session Storage cleared and Indexed DBs deleted. You will probably want to refresh the page.');
|
// alert('Local and Session Storage cleared and Indexed DBs deleted. You will probably want to refresh the page.');
|
||||||
}}
|
}}
|
||||||
class="btn btn-sm variant-ghost-success hover:variant-filled-success"
|
class="btn btn-sm variant-ghost-surface hover:variant-filled-warning"
|
||||||
title="Clear App Data & Settings - Reload: Clear the browser storage for this site"
|
title="Clear App Data & Settings - Reload: Clear the browser storage for this site"
|
||||||
>
|
>
|
||||||
<!-- <span class="fas fa-eraser mx-1"></span> -->
|
<!-- <span class="fas fa-eraser mx-1"></span> -->
|
||||||
<span class="fas fa-sync mx-1"></span>
|
<span class="fas fa-sync mx-1"></span>
|
||||||
Clear & Reload
|
<span class="hidden md:inline">Clear & Reload</span>
|
||||||
</button>
|
</button>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
|
||||||
{#if $ae_loc.administrator_access && 1==2}
|
{#if $ae_loc.administrator_access && 1==2}
|
||||||
<nav
|
<nav
|
||||||
class="submenu flex flex-row justify-center"
|
class="submenu flex flex-row items-center justify-center"
|
||||||
class:hidden={$ae_loc.iframe}
|
class:hidden={$ae_loc.iframe}
|
||||||
>
|
>
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { onMount } from 'svelte';
|
|||||||
import { goto } from '$app/navigation';
|
import { goto } from '$app/navigation';
|
||||||
|
|
||||||
// *** Import other supporting libraries
|
// *** Import other supporting libraries
|
||||||
import { FolderPlus } from '@lucide/svelte';
|
import { BookPlus, FolderPlus } from '@lucide/svelte';
|
||||||
import { liveQuery } from "dexie";
|
import { liveQuery } from "dexie";
|
||||||
import { Modal } from 'flowbite-svelte';
|
import { Modal } from 'flowbite-svelte';
|
||||||
|
|
||||||
@@ -137,8 +137,8 @@ async function create_journal() {
|
|||||||
<button
|
<button
|
||||||
class="
|
class="
|
||||||
btn btn-sm
|
btn btn-sm
|
||||||
variant-ghost-primary
|
variant-ghost-secondary
|
||||||
hover:variant-filled-primary
|
hover:variant-filled-secondary
|
||||||
transition
|
transition
|
||||||
"
|
"
|
||||||
onclick={
|
onclick={
|
||||||
@@ -146,8 +146,9 @@ async function create_journal() {
|
|||||||
$journals_sess.show__modal_new__journal_obj = true;
|
$journals_sess.show__modal_new__journal_obj = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<FolderPlus class="mx-1" />
|
<!-- <FolderPlus class="mx-1" /> -->
|
||||||
|
<BookPlus />
|
||||||
New Journal
|
New Journal
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,12 @@ let log_lvl: number = 0;
|
|||||||
let { data, children } = $props();
|
let { data, children } = $props();
|
||||||
|
|
||||||
import { goto } from '$app/navigation';
|
import { goto } from '$app/navigation';
|
||||||
import { BookHeart, Check, FilePlus, Minus, Notebook, Pencil, Plus, X } from '@lucide/svelte';
|
import {
|
||||||
|
BookHeart, Check,
|
||||||
|
FilePlus, Library,
|
||||||
|
Minus, Notebook, Pencil, Plus,
|
||||||
|
X
|
||||||
|
} from '@lucide/svelte';
|
||||||
|
|
||||||
import { liveQuery } from "dexie";
|
import { liveQuery } from "dexie";
|
||||||
import { Modal } from 'flowbite-svelte';
|
import { Modal } from 'flowbite-svelte';
|
||||||
@@ -121,10 +126,12 @@ async function handle_update_journal() {
|
|||||||
hover:variant-filled-tertiary
|
hover:variant-filled-tertiary
|
||||||
transition
|
transition
|
||||||
"
|
"
|
||||||
|
title="View all journals"
|
||||||
>
|
>
|
||||||
<BookHeart class="mx-1" />
|
<!-- <BookHeart /> -->
|
||||||
|
<Library />
|
||||||
<span class="hidden md:inline">
|
<span class="hidden md:inline">
|
||||||
View Other Journals
|
All Journals
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
</a>
|
</a>
|
||||||
@@ -166,9 +173,12 @@ async function handle_update_journal() {
|
|||||||
hover:variant-filled-warning
|
hover:variant-filled-warning
|
||||||
transition
|
transition
|
||||||
"
|
"
|
||||||
|
title="Edit Journal meta and configuration (name, type, passcode, categories, etc.)"
|
||||||
>
|
>
|
||||||
<Pencil />
|
<Pencil />
|
||||||
Edit Journal
|
<span class="hidden md:inline">
|
||||||
|
Edit Journal
|
||||||
|
</span>
|
||||||
</button>
|
</button>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
@@ -214,7 +224,7 @@ async function handle_update_journal() {
|
|||||||
transition
|
transition
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<FilePlus class="mx-1" />
|
<FilePlus />
|
||||||
<!-- <span class="fas fa-plus m-1"></span> -->
|
<!-- <span class="fas fa-plus m-1"></span> -->
|
||||||
<span class="hidden sm:inline">
|
<span class="hidden sm:inline">
|
||||||
New Journal Entry
|
New Journal Entry
|
||||||
|
|||||||
@@ -87,10 +87,12 @@ $effect(() => {
|
|||||||
if (tmp_entry_obj_changed && confirm('Would you like to save changes to this journal entry before exiting edit mode?')) {
|
if (tmp_entry_obj_changed && confirm('Would you like to save changes to this journal entry before exiting edit mode?')) {
|
||||||
// Call API to save the content
|
// Call API to save the content
|
||||||
let data_kv = {
|
let data_kv = {
|
||||||
name: tmp_entry_obj?.name,
|
alert_msg: tmp_entry_obj?.alert_msg,
|
||||||
category_code: tmp_entry_obj?.category_code,
|
category_code: tmp_entry_obj?.category_code,
|
||||||
|
content: tmp_entry_obj?.content,
|
||||||
|
group: tmp_entry_obj?.group,
|
||||||
|
name: tmp_entry_obj?.name,
|
||||||
tags: tmp_entry_obj?.tags,
|
tags: tmp_entry_obj?.tags,
|
||||||
content: tmp_entry_obj?.content
|
|
||||||
};
|
};
|
||||||
journals_func.update_ae_obj__journal_entry({
|
journals_func.update_ae_obj__journal_entry({
|
||||||
api_cfg: $ae_api,
|
api_cfg: $ae_api,
|
||||||
@@ -266,7 +268,12 @@ $effect(() => {
|
|||||||
|
|
||||||
// Call API to save the content
|
// Call API to save the content
|
||||||
let data_kv = {
|
let data_kv = {
|
||||||
category_code: tmp_entry_obj?.category_code
|
alert_msg: tmp_entry_obj?.alert_msg,
|
||||||
|
category_code: tmp_entry_obj?.category_code,
|
||||||
|
content: tmp_entry_obj?.content,
|
||||||
|
group: tmp_entry_obj?.group,
|
||||||
|
name: tmp_entry_obj?.name,
|
||||||
|
tags: tmp_entry_obj?.tags,
|
||||||
};
|
};
|
||||||
journals_func.update_ae_obj__journal_entry({
|
journals_func.update_ae_obj__journal_entry({
|
||||||
api_cfg: $ae_api,
|
api_cfg: $ae_api,
|
||||||
@@ -331,6 +338,13 @@ $effect(() => {
|
|||||||
onclick={() => {
|
onclick={() => {
|
||||||
if ($ae_loc.trusted_access) {
|
if ($ae_loc.trusted_access) {
|
||||||
let data_kv = {
|
let data_kv = {
|
||||||
|
alert_msg: tmp_entry_obj?.alert_msg,
|
||||||
|
category_code: tmp_entry_obj?.category_code,
|
||||||
|
content: tmp_entry_obj?.content,
|
||||||
|
group: tmp_entry_obj?.group,
|
||||||
|
name: tmp_entry_obj?.name,
|
||||||
|
tags: tmp_entry_obj?.tags,
|
||||||
|
|
||||||
alert: $lq__journal_entry_obj?.alert ? false : true
|
alert: $lq__journal_entry_obj?.alert ? false : true
|
||||||
};
|
};
|
||||||
journals_func.update_ae_obj__journal_entry({
|
journals_func.update_ae_obj__journal_entry({
|
||||||
@@ -363,6 +377,12 @@ $effect(() => {
|
|||||||
onclick={() => {
|
onclick={() => {
|
||||||
if ($ae_loc.trusted_access) {
|
if ($ae_loc.trusted_access) {
|
||||||
let data_kv = {
|
let data_kv = {
|
||||||
|
category_code: tmp_entry_obj?.category_code,
|
||||||
|
content: tmp_entry_obj?.content,
|
||||||
|
group: tmp_entry_obj?.group,
|
||||||
|
name: tmp_entry_obj?.name,
|
||||||
|
tags: tmp_entry_obj?.tags,
|
||||||
|
|
||||||
alert_msg: $lq__journal_entry_obj?.alert_msg ? false : true
|
alert_msg: $lq__journal_entry_obj?.alert_msg ? false : true
|
||||||
};
|
};
|
||||||
journals_func.update_ae_obj__journal_entry({
|
journals_func.update_ae_obj__journal_entry({
|
||||||
@@ -396,6 +416,13 @@ $effect(() => {
|
|||||||
onclick={() => {
|
onclick={() => {
|
||||||
if ($ae_loc.trusted_access) {
|
if ($ae_loc.trusted_access) {
|
||||||
let data_kv = {
|
let data_kv = {
|
||||||
|
alert_msg: tmp_entry_obj?.alert_msg,
|
||||||
|
category_code: tmp_entry_obj?.category_code,
|
||||||
|
content: tmp_entry_obj?.content,
|
||||||
|
group: tmp_entry_obj?.group,
|
||||||
|
name: tmp_entry_obj?.name,
|
||||||
|
tags: tmp_entry_obj?.tags,
|
||||||
|
|
||||||
private: $lq__journal_entry_obj?.private ? false : true
|
private: $lq__journal_entry_obj?.private ? false : true
|
||||||
};
|
};
|
||||||
journals_func.update_ae_obj__journal_entry({
|
journals_func.update_ae_obj__journal_entry({
|
||||||
@@ -427,6 +454,13 @@ $effect(() => {
|
|||||||
onclick={() => {
|
onclick={() => {
|
||||||
if ($ae_loc.trusted_access) {
|
if ($ae_loc.trusted_access) {
|
||||||
let data_kv = {
|
let data_kv = {
|
||||||
|
alert_msg: tmp_entry_obj?.alert_msg,
|
||||||
|
category_code: tmp_entry_obj?.category_code,
|
||||||
|
content: tmp_entry_obj?.content,
|
||||||
|
group: tmp_entry_obj?.group,
|
||||||
|
name: tmp_entry_obj?.name,
|
||||||
|
tags: tmp_entry_obj?.tags,
|
||||||
|
|
||||||
public: $lq__journal_entry_obj?.public ? false : true
|
public: $lq__journal_entry_obj?.public ? false : true
|
||||||
};
|
};
|
||||||
journals_func.update_ae_obj__journal_entry({
|
journals_func.update_ae_obj__journal_entry({
|
||||||
@@ -458,6 +492,13 @@ $effect(() => {
|
|||||||
onclick={() => {
|
onclick={() => {
|
||||||
if ($ae_loc.trusted_access) {
|
if ($ae_loc.trusted_access) {
|
||||||
let data_kv = {
|
let data_kv = {
|
||||||
|
alert_msg: tmp_entry_obj?.alert_msg,
|
||||||
|
category_code: tmp_entry_obj?.category_code,
|
||||||
|
content: tmp_entry_obj?.content,
|
||||||
|
group: tmp_entry_obj?.group,
|
||||||
|
name: tmp_entry_obj?.name,
|
||||||
|
tags: tmp_entry_obj?.tags,
|
||||||
|
|
||||||
personal: $lq__journal_entry_obj?.personal ? false : true
|
personal: $lq__journal_entry_obj?.personal ? false : true
|
||||||
};
|
};
|
||||||
journals_func.update_ae_obj__journal_entry({
|
journals_func.update_ae_obj__journal_entry({
|
||||||
@@ -489,6 +530,13 @@ $effect(() => {
|
|||||||
onclick={() => {
|
onclick={() => {
|
||||||
if ($ae_loc.trusted_access) {
|
if ($ae_loc.trusted_access) {
|
||||||
let data_kv = {
|
let data_kv = {
|
||||||
|
alert_msg: tmp_entry_obj?.alert_msg,
|
||||||
|
category_code: tmp_entry_obj?.category_code,
|
||||||
|
content: tmp_entry_obj?.content,
|
||||||
|
group: tmp_entry_obj?.group,
|
||||||
|
name: tmp_entry_obj?.name,
|
||||||
|
tags: tmp_entry_obj?.tags,
|
||||||
|
|
||||||
professional: $lq__journal_entry_obj?.professional ? false : true
|
professional: $lq__journal_entry_obj?.professional ? false : true
|
||||||
};
|
};
|
||||||
journals_func.update_ae_obj__journal_entry({
|
journals_func.update_ae_obj__journal_entry({
|
||||||
@@ -595,10 +643,12 @@ $effect(() => {
|
|||||||
if ($ae_loc.trusted_access) {
|
if ($ae_loc.trusted_access) {
|
||||||
// Call API to save the content
|
// Call API to save the content
|
||||||
let data_kv = {
|
let data_kv = {
|
||||||
name: tmp_entry_obj?.name,
|
alert_msg: tmp_entry_obj?.alert_msg,
|
||||||
category_code: tmp_entry_obj?.category_code,
|
category_code: tmp_entry_obj?.category_code,
|
||||||
|
content: tmp_entry_obj?.content,
|
||||||
|
group: tmp_entry_obj?.group,
|
||||||
|
name: tmp_entry_obj?.name,
|
||||||
tags: tmp_entry_obj?.tags,
|
tags: tmp_entry_obj?.tags,
|
||||||
content: tmp_entry_obj?.content
|
|
||||||
};
|
};
|
||||||
journals_func.update_ae_obj__journal_entry({
|
journals_func.update_ae_obj__journal_entry({
|
||||||
api_cfg: $ae_api,
|
api_cfg: $ae_api,
|
||||||
@@ -646,7 +696,13 @@ $effect(() => {
|
|||||||
onclick={() => {
|
onclick={() => {
|
||||||
if ($ae_loc.trusted_access) {
|
if ($ae_loc.trusted_access) {
|
||||||
let data_kv = {
|
let data_kv = {
|
||||||
priority: $lq__journal_entry_obj?.priority ? false : true
|
alert: $lq__journal_entry_obj?.alert,
|
||||||
|
alert_msg: $lq__journal_entry_obj?.alert_msg,
|
||||||
|
category_code: tmp_entry_obj?.category_code,
|
||||||
|
content: tmp_entry_obj?.content,
|
||||||
|
name: tmp_entry_obj?.name,
|
||||||
|
priority: $lq__journal_entry_obj?.priority ? false : true,
|
||||||
|
tags: tmp_entry_obj?.tags,
|
||||||
};
|
};
|
||||||
journals_func.update_ae_obj__journal_entry({
|
journals_func.update_ae_obj__journal_entry({
|
||||||
api_cfg: $ae_api,
|
api_cfg: $ae_api,
|
||||||
@@ -681,6 +737,13 @@ $effect(() => {
|
|||||||
type="button"
|
type="button"
|
||||||
onclick={() => {
|
onclick={() => {
|
||||||
let data_kv = {
|
let data_kv = {
|
||||||
|
alert_msg: tmp_entry_obj?.alert_msg,
|
||||||
|
category_code: tmp_entry_obj?.category_code,
|
||||||
|
content: tmp_entry_obj?.content,
|
||||||
|
group: tmp_entry_obj?.group,
|
||||||
|
name: tmp_entry_obj?.name,
|
||||||
|
tags: tmp_entry_obj?.tags,
|
||||||
|
|
||||||
sort: $lq__journal_entry_obj?.sort ? $lq__journal_entry_obj?.sort + 1 : 1
|
sort: $lq__journal_entry_obj?.sort ? $lq__journal_entry_obj?.sort + 1 : 1
|
||||||
};
|
};
|
||||||
journals_func.update_ae_obj__journal_entry({
|
journals_func.update_ae_obj__journal_entry({
|
||||||
@@ -713,7 +776,14 @@ $effect(() => {
|
|||||||
type="button"
|
type="button"
|
||||||
onclick={() => {
|
onclick={() => {
|
||||||
let data_kv = {
|
let data_kv = {
|
||||||
sort: $lq__journal_entry_obj?.sort ? $lq__journal_entry_obj?.sort - 1 : 0
|
alert_msg: tmp_entry_obj?.alert_msg,
|
||||||
|
category_code: tmp_entry_obj?.category_code,
|
||||||
|
content: tmp_entry_obj?.content,
|
||||||
|
group: tmp_entry_obj?.group,
|
||||||
|
name: tmp_entry_obj?.name,
|
||||||
|
tags: tmp_entry_obj?.tags,
|
||||||
|
|
||||||
|
sort: $lq__journal_entry_obj?.sort ? $lq__journal_entry_obj?.sort - 1 : 0,
|
||||||
};
|
};
|
||||||
journals_func.update_ae_obj__journal_entry({
|
journals_func.update_ae_obj__journal_entry({
|
||||||
api_cfg: $ae_api,
|
api_cfg: $ae_api,
|
||||||
@@ -768,6 +838,13 @@ $effect(() => {
|
|||||||
type="button"
|
type="button"
|
||||||
onclick={() => {
|
onclick={() => {
|
||||||
let data_kv = {
|
let data_kv = {
|
||||||
|
alert_msg: tmp_entry_obj?.alert_msg,
|
||||||
|
category_code: tmp_entry_obj?.category_code,
|
||||||
|
content: tmp_entry_obj?.content,
|
||||||
|
group: tmp_entry_obj?.group,
|
||||||
|
name: tmp_entry_obj?.name,
|
||||||
|
tags: tmp_entry_obj?.tags,
|
||||||
|
|
||||||
hide: $lq__journal_entry_obj?.hide ? false : true
|
hide: $lq__journal_entry_obj?.hide ? false : true
|
||||||
};
|
};
|
||||||
journals_func.update_ae_obj__journal_entry({
|
journals_func.update_ae_obj__journal_entry({
|
||||||
@@ -800,6 +877,13 @@ $effect(() => {
|
|||||||
type="button"
|
type="button"
|
||||||
onclick={() => {
|
onclick={() => {
|
||||||
let data_kv = {
|
let data_kv = {
|
||||||
|
alert_msg: tmp_entry_obj?.alert_msg,
|
||||||
|
category_code: tmp_entry_obj?.category_code,
|
||||||
|
content: tmp_entry_obj?.content,
|
||||||
|
group: tmp_entry_obj?.group,
|
||||||
|
name: tmp_entry_obj?.name,
|
||||||
|
tags: tmp_entry_obj?.tags,
|
||||||
|
|
||||||
enable: $lq__journal_entry_obj?.enable ? false : true
|
enable: $lq__journal_entry_obj?.enable ? false : true
|
||||||
};
|
};
|
||||||
journals_func.update_ae_obj__journal_entry({
|
journals_func.update_ae_obj__journal_entry({
|
||||||
|
|||||||
@@ -316,7 +316,7 @@ let tmp_entry_obj: key_val = $state({});
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
class:hidden={!$ae_loc.edit_mode}
|
class:hidden={!$ae_loc.edit_mode}
|
||||||
class="btn btn-sm variant-soft-warning hover:variant-filled-warning transition py-1 px-2"
|
class="btn btn-sm variant-soft-surface hover:variant-filled-warning transition py-1 px-2"
|
||||||
title={`Set entry as ${journals_journal_entry_obj.hide ? 'visible' : 'hidden'}`}
|
title={`Set entry as ${journals_journal_entry_obj.hide ? 'visible' : 'hidden'}`}
|
||||||
>
|
>
|
||||||
{#if journals_journal_entry_obj.hide}
|
{#if journals_journal_entry_obj.hide}
|
||||||
|
|||||||
Reference in New Issue
Block a user