More general clean up. Making event queries easier to use and understand.

This commit is contained in:
Scott Idem
2024-10-01 16:59:08 -04:00
parent 47e9f9f5a1
commit fad58bf26f
5 changed files with 175 additions and 50 deletions

View File

@@ -1,7 +1,7 @@
<script lang="ts">
// *** Import Svelte core
import { onMount } from 'svelte';
import { Spinner } from 'flowbite-svelte';
// import { Spinner } from 'flowbite-svelte';
// *** Import Aether core variables and functions
import type { key_val } from '$lib/ae_stores';
@@ -57,9 +57,9 @@ async function handle_search__event(
search_delay = 0,
max_tries = 5,
params = {
'qry__enabled': $idaa_loc.recovery_meetings.qry_enabled ?? 'enabled',
'qry__hidden': $idaa_loc.recovery_meetings.qry_hidden ?? 'not_hidden',
'qry__limit': $idaa_loc.recovery_meetings.qry_limit ?? 35,
'qry__enabled': $idaa_loc.recovery_meetings.qry__enabled ?? 'enabled',
'qry__hidden': $idaa_loc.recovery_meetings.qry__hidden ?? 'not_hidden',
'qry__limit': $idaa_loc.recovery_meetings.qry__limit ?? 35,
},
try_cache=false,
log_lvl=1,
@@ -223,41 +223,57 @@ async function handle_search__event(
type="submit"
class="btn btn-lg variant-ghost-success hover:variant-filled-success text-2xl font-bold w-48 transition-all mx-1"
>
<span class="fas fa-search m-1"></span> Search
<!-- <span class="fas fa-search m-1"></span> -->
{#if $idaa_sess.recovery_meetings.qry__status == 'loading'}
<span class="fas fa-spinner fa-spin m-1"></span>
{:else}
<span class="fas fa-search m-1"></span>
<!-- {#if $idaa_sess.recovery_meetings.qry__status == 'done'}
<span class="fas fa-check m-1"></span>
{/if} -->
{/if}
Search
</button>
</div>
<fieldset class="flex flex-row gap-1 w-full">
<legend>Location?</legend>
<fieldset class="flex flex-row gap-1 w-full items-center justify-center">
<div class="legend inline-block">
Location?</div>
<!-- <div class="ae_row ae_flex_justify_around ae_width_md"> -->
<label>Virtual
<label class="inline-block flex flex-row gap-1 items-center justify-center">
Virtual
<input
name="qry_virtual"
type="checkbox"
bind:checked={$idaa_loc.recovery_meetings.qry_virtual}
bind:checked={$idaa_loc.recovery_meetings.qry__virtual}
on:change={() => {ae_trigger = 'load__event_obj_li';}}
class="checkbox"
>
</label>
<label>In-person
<label class="inline-block flex flex-row gap-1 items-center justify-center">
In-person
<input
name="qry_physical"
type="checkbox"
bind:checked={$idaa_loc.recovery_meetings.qry_physical}
bind:checked={$idaa_loc.recovery_meetings.qry__physical}
on:change={() => {ae_trigger = 'load__event_obj_li';}}
class="checkbox"
>
</label>
<!-- </div> -->
</fieldset>
<fieldset class="flex flex-row gap-1 w-full">
<legend>Type?</legend>
<fieldset class="flex flex-row gap-1 w-full items-center justify-center">
<div class="legend inline-block">
Type?
</div>
<!-- <div class="ae_row ae_flex_justify_around ae_width_100"> -->
<label>All
<input
name="qry_type"
type="radio"
value=""
bind:group={$idaa_loc.recovery_meetings.qry_type}
bind:group={$idaa_loc.recovery_meetings.qry__type}
on:change={() => {ae_trigger = 'load__event_obj_li';}}
title="Show all meeting types"
>
@@ -267,7 +283,7 @@ async function handle_search__event(
name="qry_type"
type="radio"
value="IDAA"
bind:group={$idaa_loc.recovery_meetings.qry_type}
bind:group={$idaa_loc.recovery_meetings.qry__type}
on:change={() => {ae_trigger = 'load__event_obj_li';}}
title="Open to IDAA members only"
>
@@ -277,7 +293,7 @@ async function handle_search__event(
name="qry_type"
type="radio"
value="Caduceus"
bind:group={$idaa_loc.recovery_meetings.qry_type}
bind:group={$idaa_loc.recovery_meetings.qry__type}
on:change={() => {ae_trigger = 'load__event_obj_li';}}
title="Open to all healthcare workers including those who do not qualify for IDAA"
>
@@ -287,7 +303,7 @@ async function handle_search__event(
name="qry_type"
type="radio"
value="Family Recovery"
bind:group={$idaa_loc.recovery_meetings.qry_type}
bind:group={$idaa_loc.recovery_meetings.qry__type}
on:change={() => {ae_trigger = 'load__event_obj_li';}}
title="Open to spouses, parents, and children of medical professionals who have substance use disorder."
>
@@ -298,7 +314,7 @@ async function handle_search__event(
name="qry_type"
type="radio"
value="Al-Anon"
bind:group={$idaa_loc.recovery_meetings.qry_type}
bind:group={$idaa_loc.recovery_meetings.qry__type}
on:change={() => {ae_trigger = 'load__event_obj_li';}}
>
</label>
@@ -307,7 +323,7 @@ async function handle_search__event(
name="qry_type"
type="radio"
value="Other"
bind:group={$idaa_loc.recovery_meetings.qry_type}
bind:group={$idaa_loc.recovery_meetings.qry__type}
on:change={() => {ae_trigger = 'load__event_obj_li';}}
>
</label>
@@ -336,7 +352,7 @@ async function handle_search__event(
</label>
<select
id="qry_limit__events"
bind:value={$idaa_loc.recovery_meetings.qry_limit}
bind:value={$idaa_loc.recovery_meetings.qry__limit}
on:change={() => {
// search__event_presenter({
// api_cfg: $ae_api,
@@ -348,7 +364,7 @@ async function handle_search__event(
// params: {
// 'qry__enabled': 'enabled',
// 'qry__hidden': 'not_hidden',
// 'qry__limit': $idaa_loc.recovery_meetings.qry_limit__events,},
// 'qry__limit': $idaa_loc.recovery_meetings.qry__limit__events,},
// try_cache: false,
// log_lvl: log_lvl,
// });