More work on updating Archives and Posts to use tmp_sort_x and other changes.
This commit is contained in:
@@ -818,6 +818,12 @@ export const properties_to_save = [
|
||||
'created_on',
|
||||
'updated_on',
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
'tmp_sort_1',
|
||||
'tmp_sort_2',
|
||||
// 'tmp_sort_a',
|
||||
// 'tmp_sort_b',
|
||||
|
||||
// From SQL view
|
||||
// 'archive_content_count',
|
||||
|
||||
@@ -883,6 +889,10 @@ export async function process_ae_obj__archive_props({
|
||||
created_on: obj.created_on,
|
||||
updated_on: obj.updated_on,
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
tmp_sort_1: `${obj.group}_${obj.priority}_${obj.sort}_${obj.updated_on ?? obj.created_on}`,
|
||||
tmp_sort_2: `${obj.group}_${obj.priority}_${obj.sort}_${obj.updated_on}_${obj.created_on}`,
|
||||
|
||||
// From SQL view
|
||||
// archive_content_count: obj.archive_content_count,
|
||||
|
||||
|
||||
@@ -499,6 +499,8 @@ export const properties_to_save = [
|
||||
// Generated fields for sorting locally only
|
||||
'tmp_sort_1',
|
||||
'tmp_sort_2',
|
||||
// 'tmp_sort_a',
|
||||
// 'tmp_sort_b',
|
||||
|
||||
// From SQL view
|
||||
'archive_code',
|
||||
@@ -579,6 +581,8 @@ export async function process_ae_obj__archive_content_props({
|
||||
// Generated fields for sorting locally only
|
||||
tmp_sort_1: `${obj.original_datetime}_${obj.group}_${obj.priority}_${obj.sort}`,
|
||||
tmp_sort_2: `${obj.group}_${obj.original_datetime}_${obj.priority}_${obj.sort}`,
|
||||
// tmp_sort_a: `${obj.group}_${obj.priority}_${obj.sort}_${obj.updated_on ?? obj.created_on}`,
|
||||
// tmp_sort_b: `${obj.group}_${obj.priority}_${obj.sort}_${obj.updated_on}_${obj.created_on}`,
|
||||
|
||||
// From SQL view
|
||||
archive_code: obj.archive_code,
|
||||
|
||||
@@ -53,6 +53,10 @@ export interface Archive {
|
||||
created_on: Date;
|
||||
updated_on?: null|Date;
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
tmp_sort_1?: null|string;
|
||||
tmp_sort_2?: null|string;
|
||||
|
||||
// Additional fields for convenience (database views)
|
||||
// archive_content_count?: number;
|
||||
// archive_content_kv?: null|key_val;
|
||||
@@ -138,6 +142,7 @@ export class MySubClassedDexie extends Dexie {
|
||||
account_id,
|
||||
name,
|
||||
original_datetime, original_timezone, original_location,
|
||||
tmp_sort_1, tmp_sort_2,
|
||||
enable, hide, priority, sort, group, notes, created_on, updated_on`,
|
||||
content: `
|
||||
id, archive_content_id,
|
||||
|
||||
@@ -1090,9 +1090,10 @@ export const properties_to_save = [
|
||||
'attend_phone_passcode',
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
// 'tmp_sort_1',
|
||||
// 'tmp_sort_2',
|
||||
// 'tmp_sort_3',
|
||||
'tmp_sort_1',
|
||||
'tmp_sort_2',
|
||||
// 'tmp_sort_a',
|
||||
// 'tmp_sort_b',
|
||||
|
||||
// From SQL view
|
||||
'file_count',
|
||||
@@ -1184,6 +1185,10 @@ export async function process_ae_obj__event_props({
|
||||
created_on: obj.created_on,
|
||||
updated_on: obj.updated_on,
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
tmp_sort_1: `${obj.group}_${obj.priority}_${obj.sort}_${obj.updated_on ?? obj.created_on}`,
|
||||
tmp_sort_2: `${obj.group}_${obj.priority}_${obj.sort}_${obj.updated_on}_${obj.created_on}`,
|
||||
|
||||
// IDAA Recovery Meetings:
|
||||
// Currently only really used for IDAA
|
||||
contact_li_json: obj.contact_li_json,
|
||||
|
||||
@@ -732,6 +732,12 @@ export const properties_to_save = [
|
||||
'created_on',
|
||||
'updated_on',
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
'tmp_sort_1',
|
||||
'tmp_sort_2',
|
||||
// 'tmp_sort_a',
|
||||
// 'tmp_sort_b',
|
||||
|
||||
// From SQL view
|
||||
'event_name',
|
||||
'event_location_code',
|
||||
@@ -819,6 +825,10 @@ export async function process_ae_obj__event_device_props({
|
||||
created_on: obj.created_on,
|
||||
updated_on: obj.updated_on,
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
tmp_sort_1: `${obj.group}_${obj.priority}_${obj.sort}_${obj.updated_on ?? obj.created_on}`,
|
||||
tmp_sort_2: `${obj.group}_${obj.priority}_${obj.sort}_${obj.updated_on}_${obj.created_on}`,
|
||||
|
||||
// From SQL view
|
||||
event_name: obj.event_name,
|
||||
event_location_code: obj.event_location_code,
|
||||
|
||||
@@ -753,6 +753,12 @@ export const properties_to_save = [
|
||||
'created_on',
|
||||
'updated_on',
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
'tmp_sort_1',
|
||||
'tmp_sort_2',
|
||||
// 'tmp_sort_a',
|
||||
// 'tmp_sort_b',
|
||||
|
||||
'filename_no_ext',
|
||||
'filename_w_ext',
|
||||
'hosted_file_content_type',
|
||||
@@ -843,6 +849,10 @@ export async function process_ae_obj__event_file_props({
|
||||
created_on: obj.created_on,
|
||||
updated_on: obj.updated_on,
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
tmp_sort_1: `${obj.group}_${obj.priority}_${obj.sort}_${obj.updated_on ?? obj.created_on}`,
|
||||
tmp_sort_2: `${obj.group}_${obj.priority}_${obj.sort}_${obj.updated_on}_${obj.created_on}`,
|
||||
|
||||
filename_no_ext: obj.filename_no_ext,
|
||||
filename_w_ext: obj.filename_w_ext,
|
||||
hosted_file_content_type: obj.hosted_file_content_type,
|
||||
|
||||
@@ -798,6 +798,12 @@ export const properties_to_save = [
|
||||
'created_on',
|
||||
'updated_on',
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
'tmp_sort_1',
|
||||
'tmp_sort_2',
|
||||
// 'tmp_sort_a',
|
||||
// 'tmp_sort_b',
|
||||
|
||||
// From SQL view
|
||||
'file_count',
|
||||
'file_count_all',
|
||||
@@ -864,6 +870,10 @@ export async function process_ae_obj__event_location_props({
|
||||
created_on: obj.created_on,
|
||||
updated_on: obj.updated_on,
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
tmp_sort_1: `${obj.group}_${obj.priority}_${obj.sort}_${obj.updated_on ?? obj.created_on}`,
|
||||
tmp_sort_2: `${obj.group}_${obj.priority}_${obj.sort}_${obj.updated_on}_${obj.created_on}`,
|
||||
|
||||
// From SQL view
|
||||
file_count: obj.file_count,
|
||||
file_count_all: obj.file_count_all,
|
||||
|
||||
@@ -693,6 +693,12 @@ export const properties_to_save = [
|
||||
'created_on',
|
||||
'updated_on',
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
'tmp_sort_1',
|
||||
'tmp_sort_2',
|
||||
// 'tmp_sort_a',
|
||||
// 'tmp_sort_b',
|
||||
|
||||
// From SQL view
|
||||
'event_session_code',
|
||||
'event_session_name',
|
||||
@@ -769,6 +775,10 @@ export async function process_ae_obj__event_presentation_props({
|
||||
created_on: obj.created_on,
|
||||
updated_on: obj.updated_on,
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
tmp_sort_1: `${obj.group}_${obj.priority}_${obj.sort}_${obj.updated_on ?? obj.created_on}`,
|
||||
tmp_sort_2: `${obj.group}_${obj.priority}_${obj.sort}_${obj.updated_on}_${obj.created_on}`,
|
||||
|
||||
// From SQL view
|
||||
event_session_code: obj.event_session_code,
|
||||
event_session_name: obj.event_session_name,
|
||||
|
||||
@@ -866,6 +866,12 @@ export const properties_to_save = [
|
||||
'created_on',
|
||||
'updated_on',
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
'tmp_sort_1',
|
||||
'tmp_sort_2',
|
||||
// 'tmp_sort_a',
|
||||
// 'tmp_sort_b',
|
||||
|
||||
// From SQL view
|
||||
'file_count',
|
||||
|
||||
@@ -971,6 +977,10 @@ export async function process_ae_obj__event_presenter_props({
|
||||
created_on: obj.created_on,
|
||||
updated_on: obj.updated_on,
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
tmp_sort_1: `${obj.group}_${obj.priority}_${obj.sort}_${obj.updated_on ?? obj.created_on}`,
|
||||
tmp_sort_2: `${obj.group}_${obj.priority}_${obj.sort}_${obj.updated_on}_${obj.created_on}`,
|
||||
|
||||
// From SQL view
|
||||
file_count: obj.file_count,
|
||||
|
||||
|
||||
@@ -1136,6 +1136,12 @@ export const properties_to_save = [
|
||||
'created_on',
|
||||
'updated_on',
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
'tmp_sort_1',
|
||||
'tmp_sort_2',
|
||||
// 'tmp_sort_a',
|
||||
// 'tmp_sort_b',
|
||||
|
||||
// From SQL view
|
||||
'file_count',
|
||||
'file_count_all',
|
||||
@@ -1236,6 +1242,10 @@ export async function process_ae_obj__event_session_props({
|
||||
created_on: obj.created_on,
|
||||
updated_on: obj.updated_on,
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
tmp_sort_1: `${obj.group}_${obj.priority}_${obj.sort}_${obj.updated_on ?? obj.created_on}`,
|
||||
tmp_sort_2: `${obj.group}_${obj.priority}_${obj.sort}_${obj.updated_on}_${obj.created_on}`,
|
||||
|
||||
// From SQL view
|
||||
file_count: obj.file_count,
|
||||
file_count_all: obj.file_count_all,
|
||||
|
||||
@@ -55,6 +55,10 @@ export interface Event {
|
||||
created_on: Date;
|
||||
updated_on?: null|Date;
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
tmp_sort_1?: null|string;
|
||||
tmp_sort_2?: null|string;
|
||||
|
||||
// IDAA Recovery Meetings:
|
||||
// Currently only really used for IDAA
|
||||
contact_li_json?: null|string[]; // full_name, email, phone_mobile, phone_home, phone_office, other_text
|
||||
@@ -215,6 +219,10 @@ export interface Device {
|
||||
created_on: Date;
|
||||
updated_on?: null|Date;
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
tmp_sort_1?: null|string;
|
||||
tmp_sort_2?: null|string;
|
||||
|
||||
// Additional fields for convenience (database views)
|
||||
event_name?: string;
|
||||
event_location_code?: string;
|
||||
@@ -254,6 +262,10 @@ export interface Exhibit {
|
||||
notes: null|string;
|
||||
created_on: Date;
|
||||
updated_on: null|Date;
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
// tmp_sort_1?: null|string;
|
||||
// tmp_sort_2?: null|string;
|
||||
}
|
||||
|
||||
|
||||
@@ -308,6 +320,10 @@ export interface Exhibit_tracking {
|
||||
notes: null|string;
|
||||
created_on: Date;
|
||||
updated_on: null|Date;
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
// tmp_sort_1?: null|string;
|
||||
// tmp_sort_2?: null|string;
|
||||
}
|
||||
|
||||
|
||||
@@ -354,6 +370,10 @@ export interface File {
|
||||
created_on: Date;
|
||||
updated_on?: null|Date;
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
tmp_sort_1?: null|string;
|
||||
tmp_sort_2?: null|string;
|
||||
|
||||
// Additional fields for convenience (database views)
|
||||
filename_no_ext: string;
|
||||
filename_w_ext: string;
|
||||
@@ -416,6 +436,10 @@ export interface Location {
|
||||
created_on: Date;
|
||||
updated_on?: null|Date;
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
tmp_sort_1?: null|string;
|
||||
tmp_sort_2?: null|string;
|
||||
|
||||
// Additional fields for convenience (database views)
|
||||
file_count?: null|number;
|
||||
file_count_all?: null|number;
|
||||
@@ -475,6 +499,10 @@ export interface Presentation {
|
||||
created_on: Date;
|
||||
updated_on?: null|Date;
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
tmp_sort_1?: null|string;
|
||||
tmp_sort_2?: null|string;
|
||||
|
||||
// Additional fields for convenience (database views)
|
||||
// file_count: null|number;
|
||||
|
||||
@@ -546,6 +574,10 @@ export interface Presenter {
|
||||
created_on?: Date;
|
||||
updated_on?: null|Date;
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
tmp_sort_1?: null|string;
|
||||
tmp_sort_2?: null|string;
|
||||
|
||||
// Additional fields for convenience (database views)
|
||||
file_count?: null|number;
|
||||
// file_count_all?: null|number;
|
||||
@@ -634,6 +666,10 @@ export interface Session {
|
||||
created_on: Date;
|
||||
updated_on: null|Date;
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
tmp_sort_1?: null|string;
|
||||
tmp_sort_2?: null|string;
|
||||
|
||||
// Additional fields for convenience (database views)
|
||||
file_count?: null|number; // Only files directly under a session
|
||||
file_count_all?: null|number; // All files under a session
|
||||
@@ -688,6 +724,7 @@ export class MySubClassedDexie extends Dexie {
|
||||
start_datetime, end_datetime,
|
||||
timezone,
|
||||
cfg_json,
|
||||
tmp_sort_1, tmp_sort_2,
|
||||
enable, hide, priority, sort, group, notes, created_on, updated_on`,
|
||||
|
||||
// badges: '++id, full_name, email' // Primary key and indexed props
|
||||
@@ -706,6 +743,7 @@ export class MySubClassedDexie extends Dexie {
|
||||
code, name,
|
||||
for_type, for_id, for_id_random,
|
||||
alert,
|
||||
tmp_sort_1, tmp_sort_2,
|
||||
enable, hide, priority, sort, group, notes, created_on, updated_on`,
|
||||
|
||||
exhibits: `
|
||||
@@ -732,6 +770,7 @@ export class MySubClassedDexie extends Dexie {
|
||||
event_id_random, event_session_id_random, event_presentation_id_random, event_presenter_id_random, event_location_id_random,
|
||||
filename, extension,
|
||||
lu_file_purpose_id, lu_event_file_purpose_name, file_purpose,
|
||||
tmp_sort_1, tmp_sort_2,
|
||||
enable, hide, priority, sort, group, created_on, updated_on`,
|
||||
|
||||
locations: `
|
||||
@@ -743,6 +782,7 @@ export class MySubClassedDexie extends Dexie {
|
||||
hide_event_launcher,
|
||||
alert, alert_msg,
|
||||
data_json,
|
||||
tmp_sort_1, tmp_sort_2,
|
||||
enable, hide, priority, sort, group, created_on, updated_on`,
|
||||
|
||||
presentations: `
|
||||
@@ -754,6 +794,7 @@ export class MySubClassedDexie extends Dexie {
|
||||
event_id_random, event_session_id_random, event_abstract_id_random,
|
||||
abstract_code, name, description, start_datetime, end_datetime,
|
||||
hide_event_launcher,
|
||||
tmp_sort_1, tmp_sort_2,
|
||||
enable, hide, priority, sort, group, created_on, updated_on`,
|
||||
|
||||
presenters: `
|
||||
@@ -767,6 +808,7 @@ export class MySubClassedDexie extends Dexie {
|
||||
full_name, affiliations, email,
|
||||
agree,
|
||||
hide_event_launcher,
|
||||
tmp_sort_1, tmp_sort_2,
|
||||
enable, hide, priority, sort, group, created_on, updated_on`,
|
||||
|
||||
sessions: `
|
||||
@@ -781,6 +823,7 @@ export class MySubClassedDexie extends Dexie {
|
||||
name, start_datetime, end_datetime,
|
||||
hide_event_launcher,
|
||||
ux_mode,
|
||||
tmp_sort_1, tmp_sort_2,
|
||||
enable, hide, priority, sort, group, created_on, updated_on`,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import type { key_val } from '$lib/ae_stores';
|
||||
import { api } from '$lib/api';
|
||||
|
||||
import { db_save_ae_obj_li__ae_obj } from "$lib/ae_core/core__idb_dexie";
|
||||
|
||||
import { db_posts } from "$lib/ae_posts/db_posts";
|
||||
|
||||
import { load_ae_obj_li__post_comment } from "$lib/ae_posts/ae_posts__post_comment";
|
||||
@@ -732,3 +734,140 @@ export function db_save_ae_obj_li__post(
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Updated 2025-06-04
|
||||
export const properties_to_save = [
|
||||
'id',
|
||||
'post_id',
|
||||
// 'post_id_random',
|
||||
|
||||
'account_id',
|
||||
// 'account_id_random',
|
||||
|
||||
'external_person_id',
|
||||
|
||||
'topic_id',
|
||||
'topic',
|
||||
'topic_name',
|
||||
|
||||
'name',
|
||||
'title',
|
||||
'content',
|
||||
|
||||
'anonymous',
|
||||
'full_name',
|
||||
'email',
|
||||
'notify',
|
||||
|
||||
'enable_comments',
|
||||
|
||||
'archive',
|
||||
'archive_on',
|
||||
|
||||
'linked_li_json',
|
||||
'cfg_json',
|
||||
|
||||
'enable',
|
||||
'hide',
|
||||
'priority',
|
||||
'sort',
|
||||
'group',
|
||||
'notes',
|
||||
'created_on',
|
||||
'updated_on',
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
'tmp_sort_1',
|
||||
'tmp_sort_2',
|
||||
// 'tmp_sort_a',
|
||||
// 'tmp_sort_b',
|
||||
|
||||
// From SQL view
|
||||
'post_comment_count',
|
||||
|
||||
// A key value list of the comments
|
||||
// 'post_comment_kv',
|
||||
// 'post_comment_li',
|
||||
];
|
||||
|
||||
|
||||
// Updated 2025-06-04
|
||||
export async function process_ae_obj__post_props({
|
||||
obj_li,
|
||||
log_lvl = 0,
|
||||
}: {
|
||||
obj_li: any[];
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
if (log_lvl) {
|
||||
console.log(`*** process_ae_obj__post_props() ***`, obj_li);
|
||||
}
|
||||
|
||||
if (!obj_li || obj_li.length === 0) {
|
||||
if (log_lvl) console.log('No objects to process.');
|
||||
return [];
|
||||
}
|
||||
|
||||
const processed_obj_li = [];
|
||||
|
||||
for (const obj of obj_li) {
|
||||
if (log_lvl) console.log(`Processing ae_obj post:`, obj);
|
||||
|
||||
let processed_obj = {
|
||||
id: obj.post_id_random,
|
||||
post_id: obj.post_id_random,
|
||||
// post_id_random: obj.post_id_random,
|
||||
|
||||
account_id: obj.account_id_random,
|
||||
// account_id_random: obj.account_id_random,
|
||||
|
||||
external_person_id: obj.external_person_id,
|
||||
|
||||
topic_id: obj.topic_id,
|
||||
topic: obj.topic,
|
||||
topic_name: obj.topic_name,
|
||||
|
||||
name: obj.title,
|
||||
title: obj.title,
|
||||
content: obj.content,
|
||||
|
||||
anonymous: obj.anonymous,
|
||||
full_name: obj.full_name,
|
||||
email: obj.email,
|
||||
notify: obj.notify,
|
||||
|
||||
enable_comments: obj.enable_comments,
|
||||
|
||||
archive: obj.archive,
|
||||
archive_on: obj.archive_on,
|
||||
|
||||
linked_li_json: obj.linked_li_json,
|
||||
cfg_json: obj.cfg_json,
|
||||
|
||||
enable: obj.enable,
|
||||
hide: obj.hide,
|
||||
priority: obj.priority,
|
||||
sort: obj.sort,
|
||||
group: obj.group,
|
||||
notes: obj.notes,
|
||||
created_on: obj.created_on,
|
||||
updated_on: obj.updated_on,
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
tmp_sort_1: `${obj.group}_${obj.priority}_${obj.sort}_${obj.updated_on ?? obj.created_on}`,
|
||||
tmp_sort_2: `${obj.group}_${obj.priority}_${obj.sort}_${obj.updated_on}_${obj.created_on}`,
|
||||
|
||||
// From SQL view
|
||||
post_comment_count: obj.post_comment_count,
|
||||
|
||||
// A key value list of the contents
|
||||
// post_comment_kv: obj.post_comment_kv,
|
||||
// post_comment_li: obj.post_comment_li,
|
||||
};
|
||||
|
||||
processed_obj_li.push(processed_obj);
|
||||
}
|
||||
|
||||
return processed_obj_li;
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
import type { key_val } from '$lib/ae_stores';
|
||||
import { api } from '$lib/api';
|
||||
|
||||
import { db_save_ae_obj_li__ae_obj } from "$lib/ae_core/core__idb_dexie";
|
||||
|
||||
import { db_posts } from "$lib/ae_posts/db_posts";
|
||||
|
||||
let ae_promises: key_val = {};
|
||||
@@ -392,3 +394,110 @@ export function db_save_ae_obj_li__post_comment(
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Updated 2025-06-04
|
||||
export const properties_to_save = [
|
||||
'id',
|
||||
'post_comment_id',
|
||||
// 'post_comment_id_random',
|
||||
|
||||
'post_id',
|
||||
// 'post_id_random',
|
||||
|
||||
'external_person_id',
|
||||
|
||||
'name',
|
||||
'title',
|
||||
'content',
|
||||
|
||||
'anonymous',
|
||||
'full_name',
|
||||
'email',
|
||||
'notify',
|
||||
|
||||
'linked_li_json',
|
||||
'cfg_json',
|
||||
|
||||
'enable',
|
||||
'hide',
|
||||
'priority',
|
||||
'sort',
|
||||
'group',
|
||||
'notes',
|
||||
'created_on',
|
||||
'updated_on',
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
'tmp_sort_1',
|
||||
'tmp_sort_2',
|
||||
// 'tmp_sort_a',
|
||||
// 'tmp_sort_b',
|
||||
|
||||
// From SQL view
|
||||
];
|
||||
|
||||
|
||||
// Updated 2025-06-04
|
||||
export async function process_ae_obj__post_comment_props({
|
||||
obj_li,
|
||||
log_lvl = 0,
|
||||
}: {
|
||||
obj_li: any[];
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
if (log_lvl) {
|
||||
console.log(`*** process_ae_obj__post_comment_props() ***`, obj_li);
|
||||
}
|
||||
|
||||
if (!obj_li || obj_li.length === 0) {
|
||||
if (log_lvl) console.log('No objects to process.');
|
||||
return [];
|
||||
}
|
||||
|
||||
const processed_obj_li = [];
|
||||
|
||||
for (const obj of obj_li) {
|
||||
if (log_lvl) console.log(`Processing ae_obj post_comment:`, obj);
|
||||
|
||||
let processed_obj = {
|
||||
id: obj.post_comment_id_random,
|
||||
post_comment_id: obj.post_comment_id_random,
|
||||
post_comment_id_random: obj.post_comment_id_random,
|
||||
|
||||
post_id: obj.post_id_random,
|
||||
post_id_random: obj.post_id_random,
|
||||
|
||||
external_person_id: obj.external_person_id,
|
||||
|
||||
name: obj.name,
|
||||
title: obj.title,
|
||||
content: obj.content,
|
||||
|
||||
anonymous: obj.anonymous,
|
||||
full_name: obj.full_name,
|
||||
email: obj.email,
|
||||
notify: obj.notify,
|
||||
|
||||
linked_li_json: obj.linked_li_json,
|
||||
cfg_json: obj.cfg_json,
|
||||
|
||||
enable: obj.enable,
|
||||
hide: obj.hide,
|
||||
priority: obj.priority,
|
||||
sort: obj.sort,
|
||||
group: obj.group,
|
||||
notes: obj.notes,
|
||||
created_on: obj.created_on,
|
||||
updated_on: obj.updated_on,
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
tmp_sort_1: `${obj.group}_${obj.priority}_${obj.sort}_${obj.updated_on ?? obj.created_on}`,
|
||||
tmp_sort_2: `${obj.group}_${obj.priority}_${obj.sort}_${obj.updated_on}_${obj.created_on}`,
|
||||
};
|
||||
|
||||
processed_obj_li.push(processed_obj);
|
||||
}
|
||||
|
||||
return processed_obj_li;
|
||||
}
|
||||
@@ -93,6 +93,10 @@ export interface Post_Comment {
|
||||
created_on: Date;
|
||||
updated_on?: null|Date;
|
||||
|
||||
// Generated fields for sorting locally only
|
||||
tmp_sort_1?: null|string;
|
||||
tmp_sort_2?: null|string;
|
||||
|
||||
// Additional fields for convenience (database views)
|
||||
}
|
||||
|
||||
@@ -113,6 +117,7 @@ export class MySubClassedDexie extends Dexie {
|
||||
title,
|
||||
full_name, email,
|
||||
archive, archive_on,
|
||||
tmp_sort_1, tmp_sort_2,
|
||||
enable, hide, priority, sort, group, notes, created_on, updated_on, [updated_on+created_on], [created_on+updated_on]`,
|
||||
|
||||
comment: `
|
||||
|
||||
Reference in New Issue
Block a user