Implement Activity Log management and Person activity integration

- Updated qry__activity_log to support filtering by person_id
- Created /core/activity_logs standalone page for monitoring system actions
- Enhanced Person detail page with 'Recent Activity' column showing real data
- Added 'Activity Logs' card to the Core Management dashboard
This commit is contained in:
Scott Idem
2026-01-07 12:20:52 -05:00
parent 5bd7c4756c
commit 07479f17a8
5 changed files with 307 additions and 12 deletions

View File

@@ -181,52 +181,112 @@ export async function update_ae_obj__activity_log({
return ae_promises.update__activity_log_obj;
}
// Updated 2026-01-06
// Updated 2026-01-07
export async function qry__activity_log({
api_cfg,
account_id,
qry_str,
qry_person_id = null,
enabled = 'enabled',
hidden = 'not_hidden',
view = 'default',
limit = 50,
offset = 0,
order_by_li = { created_on: 'DESC' },
log_lvl = 0
}: {
api_cfg: any;
account_id: string;
qry_str?: string;
qry_person_id?: string | null;
enabled?: 'enabled' | 'all' | 'not_enabled';
hidden?: 'hidden' | 'all' | 'not_hidden';
view?: string;
limit?: number;
offset?: number;
order_by_li?: Record<string, 'ASC' | 'DESC'>;
log_lvl?: number;
}) {
const search_query: any = { and: [] };
if (account_id) {
search_query.and.push({ field: 'account_id_random', op: 'eq', value: account_id });
}
if (qry_str) {
search_query.q = qry_str;
}
if (qry_person_id) {
search_query.and.push({ field: 'person_id_random', op: 'eq', value: qry_person_id });
}
ae_promises.load__activity_log_obj_li = await api.search_ae_obj_v3({
api_cfg,
obj_type: 'activity_log',
search_query,
enabled,
hidden,
view,
limit,
offset,
order_by_li,
log_lvl
});
return ae_promises.load__activity_log_obj_li;
}
}