style(idaa): apply expanded 80-width formatting and snake_case to Recovery Meetings
- Batch formatted all Recovery Meetings module files using Prettier with printWidth: 80. - Refactored preventDefault to prevent_default in editor and search components. - Standardized line breaks for long attribute lists and Svelte tags for better readability. - Ensured consistent snake_case naming for internal identifiers.
This commit is contained in:
@@ -56,16 +56,24 @@
|
||||
let lq__event_obj = $derived(
|
||||
liveQuery(async () => {
|
||||
if (log_lvl) {
|
||||
console.log(`lq__event_obj: event_id = ${$idaa_slct?.event_id}`);
|
||||
console.log(
|
||||
`lq__event_obj: event_id = ${$idaa_slct?.event_id}`
|
||||
);
|
||||
}
|
||||
let results = await db_events.event.get($idaa_slct?.event_id ?? ''); // null or undefined does not reset things like '' does
|
||||
|
||||
// Check if results are different than the current $idaa_slct.event_obj
|
||||
if ($idaa_slct.event_obj && results) {
|
||||
if (JSON.stringify($idaa_slct.event_obj) !== JSON.stringify(results)) {
|
||||
if (
|
||||
JSON.stringify($idaa_slct.event_obj) !==
|
||||
JSON.stringify(results)
|
||||
) {
|
||||
$idaa_slct.event_obj = { ...results };
|
||||
if (log_lvl) {
|
||||
console.log(`$idaa_slct.event_obj = `, $idaa_slct.event_obj);
|
||||
console.log(
|
||||
`$idaa_slct.event_obj = `,
|
||||
$idaa_slct.event_obj
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (log_lvl) {
|
||||
@@ -87,14 +95,18 @@
|
||||
window.parent.postMessage(message, '*');
|
||||
|
||||
if ($ae_loc?.iframe) {
|
||||
console.log('In iframe, sending message to parent window to scroll to top as well');
|
||||
console.log(
|
||||
'In iframe, sending message to parent window to scroll to top as well'
|
||||
);
|
||||
window.parent.postMessage({ scroll_to: 0 }, '*'); // This should be in pixels
|
||||
}
|
||||
}
|
||||
|
||||
onDestroy(() => {
|
||||
if (log_lvl) {
|
||||
console.log(`Destroying recovery meetings page for event_id: ${$idaa_slct?.event_id}`);
|
||||
console.log(
|
||||
`Destroying recovery meetings page for event_id: ${$idaa_slct?.event_id}`
|
||||
);
|
||||
}
|
||||
|
||||
let message = { event_id: null };
|
||||
@@ -120,7 +132,9 @@
|
||||
</title>
|
||||
</svelte:head>
|
||||
|
||||
<div class="ae_header flex flex-row flex-wrap gap-2 items-center justify-evenly w-full">
|
||||
<div
|
||||
class="ae_header flex flex-row flex-wrap gap-2 items-center justify-evenly w-full"
|
||||
>
|
||||
<h2
|
||||
class="
|
||||
ae_title event__title
|
||||
@@ -155,7 +169,9 @@
|
||||
</span>
|
||||
{/if}
|
||||
|
||||
<span class="float-right flex flex-row flex-wrap gap-1 items-center justify-end">
|
||||
<span
|
||||
class="float-right flex flex-row flex-wrap gap-1 items-center justify-end"
|
||||
>
|
||||
<span class="badge badge-info preset-tonal-tertiary">
|
||||
{#if $lq__event_obj?.physical && $lq__event_obj?.virtual}
|
||||
<span class="fas fa-home m-1"></span> F2F and
|
||||
@@ -168,7 +184,8 @@
|
||||
</span>
|
||||
{#if $lq__event_obj?.type}
|
||||
<span class="badge badge-info preset-tonal-secondary"
|
||||
><span class="fas fa-user-md m-1"></span> {$lq__event_obj?.type}</span
|
||||
><span class="fas fa-user-md m-1"></span>
|
||||
{$lq__event_obj?.type}</span
|
||||
>
|
||||
{/if}
|
||||
{#if $ae_loc.trusted_access && $lq__event_obj?.hide}
|
||||
@@ -215,13 +232,15 @@
|
||||
transition
|
||||
"
|
||||
>
|
||||
<span class="fas fa-arrow-left m-1 text-neutral-800/80"></span> Back to Meeting List
|
||||
<span class="fas fa-arrow-left m-1 text-neutral-800/80"></span> Back to
|
||||
Meeting List
|
||||
<!-- <span class="fas fa-times m-1"></span> View Other Meetings -->
|
||||
</a>
|
||||
|
||||
<!-- View (default)/Edit event_id toggle -->
|
||||
{#if $idaa_sess.recovery_meetings.edit__event_obj}
|
||||
<button type="button"
|
||||
<button
|
||||
type="button"
|
||||
class="
|
||||
novi_btn
|
||||
btn btn-sm
|
||||
@@ -245,14 +264,16 @@
|
||||
{:else}
|
||||
<!-- This checks if the currently logged in Novi user has a matching UUID or email address. -->
|
||||
{#if ($ae_loc.trusted_access && $ae_loc.edit_mode) || $lq__event_obj?.external_person_id === $idaa_loc.novi_uuid || ($lq__event_obj?.contact_li_json && $lq__event_obj.contact_li_json.length > 0 && $lq__event_obj.contact_li_json[0]?.email === $idaa_loc.novi_email)}
|
||||
<button type="button"
|
||||
<button
|
||||
type="button"
|
||||
class="
|
||||
novi_btn
|
||||
btn btn-sm preset-tonal-warning
|
||||
hover:preset-filled-warning-500 transition
|
||||
"
|
||||
onclick={() => {
|
||||
$idaa_sess.recovery_meetings.edit__event_obj = $idaa_slct.event_id;
|
||||
$idaa_sess.recovery_meetings.edit__event_obj =
|
||||
$idaa_slct.event_id;
|
||||
if (log_lvl) {
|
||||
console.log(
|
||||
`Toggle edit__event_obj: ${$idaa_sess.recovery_meetings.edit__event_obj}`
|
||||
|
||||
@@ -17,7 +17,9 @@ export const load = (async ({ params, parent }) => {
|
||||
let ae_acct = data[account_id];
|
||||
|
||||
if (!ae_acct) {
|
||||
console.warn(`ae IDAA Recovery Meeting [event_id] +page.ts: Account ${account_id} not found in data. Initializing ghost acct.`);
|
||||
console.warn(
|
||||
`ae IDAA Recovery Meeting [event_id] +page.ts: Account ${account_id} not found in data. Initializing ghost acct.`
|
||||
);
|
||||
ae_acct = {
|
||||
api: data.ae_api || {},
|
||||
slct: {
|
||||
@@ -32,31 +34,35 @@ export const load = (async ({ params, parent }) => {
|
||||
|
||||
if (browser) {
|
||||
if (log_lvl) {
|
||||
console.log(`ae_idaa_events events [event_id] +page.ts: event_id = `, event_id);
|
||||
console.log(
|
||||
`ae_idaa_events events [event_id] +page.ts: event_id = `,
|
||||
event_id
|
||||
);
|
||||
}
|
||||
// Load event object
|
||||
const load_event_obj = await events_func
|
||||
.load_ae_obj_id__event({
|
||||
api_cfg: ae_acct.api,
|
||||
event_id: event_id,
|
||||
log_lvl: log_lvl
|
||||
});
|
||||
// .then((results) => {
|
||||
// if (!results) {
|
||||
// error(404, {
|
||||
// message: 'IDAA Recovery Meetings - Event not found'
|
||||
// });
|
||||
// } else {
|
||||
// // ae_acct.slct.event_obj = results;
|
||||
// }
|
||||
// });
|
||||
const load_event_obj = await events_func.load_ae_obj_id__event({
|
||||
api_cfg: ae_acct.api,
|
||||
event_id: event_id,
|
||||
log_lvl: log_lvl
|
||||
});
|
||||
// .then((results) => {
|
||||
// if (!results) {
|
||||
// error(404, {
|
||||
// message: 'IDAA Recovery Meetings - Event not found'
|
||||
// });
|
||||
// } else {
|
||||
// // ae_acct.slct.event_obj = results;
|
||||
// }
|
||||
// });
|
||||
|
||||
if (log_lvl) {
|
||||
console.log(`load_event_obj = `, load_event_obj);
|
||||
}
|
||||
|
||||
|
||||
if (!load_event_obj) {
|
||||
console.warn(`ae IDAA Recovery Meeting [event_id] +page.ts: Event ${event_id} not found via API or Cache.`);
|
||||
console.warn(
|
||||
`ae IDAA Recovery Meeting [event_id] +page.ts: Event ${event_id} not found via API or Cache.`
|
||||
);
|
||||
} else {
|
||||
ae_acct.slct.event_obj = load_event_obj;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user