Things are 98% ready to go for the new IDAA BB.

This commit is contained in:
Scott Idem
2024-12-11 13:16:00 -05:00
parent c63ef94b77
commit 3946e17300
3 changed files with 29 additions and 12 deletions

View File

@@ -27,12 +27,12 @@ async function handle_submit_form(event: any) {
disable_submit_btn = true;
let form_data = new FormData(event.target);
if (log_lvl) {
if (log_lvl > 1) {
console.log(form_data);
}
// Form Post object data incoming
let post_comment_di = ae_util.extract_prefixed_form_data({prefix: null, form_data: form_data, trim_values: true, bool_tf_str: true, log_lvl: 2});
let post_comment_di = ae_util.extract_prefixed_form_data({prefix: null, form_data: form_data, trim_values: true, bool_tf_str: true, log_lvl: log_lvl});
// console.log(post_comment_di);
// Form Post object data outgoing
@@ -90,14 +90,18 @@ async function handle_submit_form(event: any) {
// // post_comment_do['notes'] = event_meeting_fd.notes;
// }
console.log(post_comment_do);
log_lvl = 1;
if (log_lvl) {
console.log(post_comment_do);
}
if (!$idaa_slct.post_comment_id) {
prom_api__post_comment_obj = posts_func.create_ae_obj__post_comment({
api_cfg: $ae_api,
post_id: $idaa_slct.post_id,
data_kv: post_comment_do,
log_lvl: 2
log_lvl: log_lvl
})
.then(function (post_comment_obj_create_result) {
if (!post_comment_obj_create_result) {
@@ -129,12 +133,14 @@ async function handle_submit_form(event: any) {
});
return prom_api__post_comment_obj;
} else {
prom_api__post_comment_obj = posts_func.update_ae_obj__post_comment({
api_cfg: $ae_api,
post_comment_id: $idaa_slct.post_comment_id,
data_kv: post_comment_do,
log_lvl: 1
log_lvl: log_lvl
})
.then(function (post_comment_obj_update_result) {
if (!post_comment_obj_update_result) {
@@ -153,7 +159,7 @@ async function handle_submit_form(event: any) {
})
.finally(() => {
// We need to do this since the comment has changed and the idaa_slct object does automatically update (yet...???).
$idaa_slct.post_comment_obj = $lq__post_comment_obj;
// $idaa_slct.post_comment_obj = $lq__post_comment_obj;
disable_submit_btn = false;
$idaa_sess.bb.show__inline_edit__post_comment_id = false;
@@ -168,6 +174,7 @@ async function handle_submit_form(event: any) {
});
return prom_api__post_comment_obj;
}
}
@@ -326,7 +333,8 @@ function send_poster_notification_email() {
<input type="text" id="title" name="title" required max="200" value={$lq__post_comment_obj?.title} placeholder="Title of Post" autocomplete="off" class="input w-96" />
</label> -->
<label for="content" class="ae_label post__content">Content (comment body):
<div>
<label for="content" class="ae_label post__content w-full">Content (comment body):
<Tiptap_editor
default_minimal={true}
@@ -337,6 +345,7 @@ function send_poster_notification_email() {
/>
</label>
</div>
<h3 class="h3">Poster's Information</h3>
@@ -427,6 +436,8 @@ function send_poster_notification_email() {
Secondary link using the Novi email address
</span>
</label>
{:else}
<input type="hidden" name="email" value={($idaa_slct.post_comment_obj.email ? $idaa_slct.post_comment_obj.email : $idaa_loc.novi_email)} />
{/if}
</section> <!-- END: section post__general_information -->

View File

@@ -172,7 +172,7 @@ async function handle_submit_form(event: any) {
})
.finally(() => {
// We need to do this since the post has changed and the idaa_slct object does automatically update (yet...???).
$idaa_slct.post_obj = $lq__post_obj;
// $idaa_slct.post_obj = $lq__post_obj;
disable_submit_btn = false;
$idaa_sess.bb.show__inline_edit__post_obj = false;
@@ -342,14 +342,17 @@ function send_staff_notification_email() {
<section class="ae_section post__general_information border border-gray-200 rounded p-2 space-y-2"> <!-- BEGIN: section post__general_information -->
<label for="title">
<div>
<label for="title" class="w-full">
<span class="text-sm text-gray-600 dark:text-gray-400">
Title of BB post:
</span>
<input type="text" id="title" name="title" required max="200" value={$idaa_slct.post_obj?.title ?? ''} placeholder="Title of Post" autocomplete="off" class="input w-full" />
</label>
</div>
<label for="content" class="ae_label post__content">
<div>
<label for="content" class="ae_label post__content w-full">
<span class="text-sm text-gray-600 dark:text-gray-400">
Content (post body):
</span>
@@ -386,6 +389,7 @@ function send_staff_notification_email() {
{/if}
</label>
</div>
<div
class="flex flex-col gap-1 items-center justify-center"
@@ -667,7 +671,7 @@ function send_staff_notification_email() {
{/if}
</span>
<input
type="text"
type="email"
name="email"
value={($idaa_slct.post_obj.email ? $idaa_slct.post_obj.email : $idaa_loc.novi_email ?? '')}
readonly={!$ae_loc.trusted_access}
@@ -677,6 +681,8 @@ function send_staff_notification_email() {
Secondary link using the Novi email address
</span>
</label>
{:else}
<input type="hidden" name="email" value={($idaa_slct.post_obj.email ? $idaa_slct.post_obj.email : $idaa_loc.novi_email ?? '')} />
{/if}
<!-- A yes/no radio button group to determine if they want to be notified of comments on this post. -->

View File

@@ -104,7 +104,7 @@ if (log_lvl) console.log('** Component Loaded: ** Post Options');
{#if ($ae_loc.trusted_access && $ae_loc.edit_mode) || $idaa_loc.novi_uuid}
<button
type="button"
disabled={!$ae_loc.trusted_access}
disabled={!$ae_loc.authenticated_access}
on:click={() => {
if (!confirm('Create new post?')) {
return false;