Minor improvements and fixes for Journals searching and styles.

This commit is contained in:
Scott Idem
2025-08-22 14:35:15 -04:00
parent f3ee4ee987
commit 8a9864771b
4 changed files with 421 additions and 429 deletions

727
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "osit-aether-app-svelte",
"version": "3.0.2",
"version": "3.0.3",
"description": "One Sky IT's Aether App created with Svelte, SvelteKit, Tailwind CSS, Lucide, Font Awesome, and Skeleton UI. -Scott Idem",
"homepage": "https://oneskyit.com/",
"private": true,

View File

@@ -181,9 +181,11 @@ let lq__journal_obj = $derived(liveQuery(async () => {
<a href="/journals"
class="
btn btn-sm
variant-outline-tertiary
hover:preset-filled-tertiary-500
transition
preset-tonal-tertiary
preset-outlined-tertiary-600-400
hover:preset-outlined-tertiary-700-300
hover:preset-filled-tertiary-100-900
transition-all
"
title="View all journals for this account: {$ae_loc.account_name}"
>
@@ -201,9 +203,10 @@ let lq__journal_obj = $derived(liveQuery(async () => {
href="/journals/{$journals_slct?.journal_id}"
class="
btn btn-sm
preset-tonal-tertiary border border-tertiary-500
hover:preset-filled-tertiary-500
transition
preset-tonal-tertiary
preset-outlined-tertiary-600-400
hover:preset-filled-tertiary-100-900
transition-all
"
title="View all journal entries for this journal: {$lq__journal_obj?.name}"
>
@@ -247,10 +250,14 @@ let lq__journal_obj = $derived(liveQuery(async () => {
Edit Journal
</span>
</button> -->
<Journal_entry_obj_qry
log_lvl={log_lvl}
lq__journal_obj={lq__journal_obj}
/>
{/if}
<!-- Add default journal entry -->
<span class="flex flex-row flex-wrap items-center justify-center gap-1">
<span class="flex flex-row flex-wrap items-center justify-center gap-2">
<!-- <span class="text-sm text-gray-500 hidden md:inline">
New entry:
</span> -->
@@ -294,9 +301,10 @@ let lq__journal_obj = $derived(liveQuery(async () => {
}}
class="
btn btn-sm
preset-tonal-secondary border border-secondary-500
hover:preset-filled-secondary-500
transition
preset-tonal-tertiary
preset-outlined-tertiary-600-400
hover:preset-filled-tertiary-100-900
transition-all
"
title="Create a new journal entry for this journal: {$lq__journal_obj?.name}"
>
@@ -307,10 +315,7 @@ let lq__journal_obj = $derived(liveQuery(async () => {
</span>
</button>
<Journal_entry_obj_qry
log_lvl={log_lvl}
lq__journal_obj={lq__journal_obj}
/>
</span>

View File

@@ -90,7 +90,7 @@ if ($journals_trig.journal_entry_qry) {
<!-- Search input form -->
<span class="flex flex-row items-center gap-2">
<span class="flex flex-row flex-wrap items-center justify-center gap-1">
<span class="text-sm text-gray-500 hidden lg:inline">
Search:
</span>
@@ -101,70 +101,41 @@ if ($journals_trig.journal_entry_qry) {
bind:value={$journals_loc.qry__search_text}
onkeyup={(event) => {
if (event.key === 'Enter') {
log_lvl = 1;
$journals_trig.journal_entry_qry = true;
// $journals_loc.qry__search_text = event.target.value;
// $journals_trig.journal_entry_li = true;
// console.log('Search query:', $journals_loc.qry__search_text);
// $journals_prom.load__journal_entry_obj_qry = await journals_func.qry__journal_entry({
// api_cfg: $ae_api,
// journal_id: $lq__journal_obj?.journal_id ?? '',
// qry_str: $journals_loc.qry__search_text,
// // qry_created_on: null,
// // qry_alert: null,
// // qry_priority: null,
// // qry_type: and_type,
// // enabled: $journals_loc.recovery_meetings.qry__enabled,
// // hidden: $journals_loc.recovery_meetings.qry__hidden,
// // order_by_li: $journals_loc.recovery_meetings.qry__order_by_li,
// // limit: $journals_loc.recovery_meetings.qry__limit,
// // try_cache: try_cache,
// log_lvl: log_lvl,
// });
// if ($journals_prom.load__journal_entry_obj_qry.length) {
// $journals_sess.entry_li = $journals_prom.load__journal_entry_obj_qry;
// $journals_sess = {
// ...$journals_sess }; // ensure session is updated
// // $journals_trig.journal_entry_li = true; // trigger the entry list to refresh
// // $journals_trig.journal_entry_li = $journals_prom.load__journal_entry_obj_qry;
// } else {
// console.log('Clear the search results: no entries found for that query.');
// // $journals_sess.entry_li = [''];
// $journals_sess.entry_li = null;
// // $journals_trig.journal_entry_li = true;
// // alert('No journal entries found for that search query.');
// // $journals_sess = $journals_sess;
// }
$journals_trig.journal_entry_qry = true;
}
}}
title="Search Journal Entries"
class="input input-sm input-bordered w-44 text-sm md:w-52"
title={`Search for Entries in "${$lq__journal_obj?.name}. Press Enter to search.`}
autocomplete="off"
class="
input input-sm input-bordered
w-44 md:w-52
text-sm
"
class:bg-red-200={$journals_sess.entry_li == null}
class:dark:bg-red-800={$journals_sess.entry_li == null}
/>
<!-- Clear search text button -->
<button
disabled={true}
type="button"
class:hidden={!$journals_loc.qry__search_text}
onclick={() => {
// $journals_loc.qry__search_text = '';
// $journals_trig.journal_entry_li = true;
// console.log('Cleared search query:', $journals_loc.qry__search_text);
console.log(`TESTING - 1 - Cleared search query: ${$journals_loc.qry__search_text}`);
$journals_loc.qry__search_text = '';
console.log(`TESTING - 2 - Cleared search query: ${$journals_loc.qry__search_text}`);
$journals_trig.journal_entry_qry = true;
}}
class="btn btn-sm p-1.5 text-sm text-gray-500 preset-tonal-tertiary border border-tertiary-500 hover:preset-filled-tertiary-500 transition"
title="Clear search text"
class="
btn btn-sm
preset-tonal-tertiary
preset-outlined-tertiary-100-900
hover:preset-filled-tertiary-100-900
transition-all
"
title="Clear search query text"
>
<!-- <X /> -->
<RemoveFormatting strokeWidth="1" color="gray" size="1.25em" />
<span class="hidden md:inline text-gray-500">
<RemoveFormatting size="1.25em" class="text-neutral-800/60 dark:text-neutral-50/60" />
<span class="hidden md:inline">
Clear
</span>
</button>
@@ -177,12 +148,13 @@ if ($journals_trig.journal_entry_qry) {
Category:
</span>
<select
class="btn btn-secondary btn-sm
preset-tonal-primary
hover:preset-filled-primary-500
transition
text-xs
"
class="
btn btn-sm
preset-tonal-tertiary
preset-outlined-tertiary-100-900
hover:preset-filled-tertiary-100-900
transition-all
"
bind:value={$journals_loc.qry__category_code}
onchange={(event) => {
// WARNING: This will cause pages to reset if the journal entry list is being filtered by category. This is a bug that should be fixed.