add bookmarks section and fix group cover lightbox
- add bookmarks table, API, admin page and public launcher - persist bookmarks in backup/restore and orphan sweep - fix group cover lightbox via shared image modal - add optional idle unload and trim-after-each to photo-ai - document bookmarks in AGENTS.md
This commit is contained in:
+16
-3
@@ -9,13 +9,13 @@ const BACKUP_TABLES = [
|
||||
'group_photos', 'entry_photos', 'modules', 'student_photos', 'share_links', 'photo_jobs',
|
||||
'lesson_reports', 'lesson_report_versions', 'audit_log', 'notifications',
|
||||
'notification_reads', 'banned_ips', 'chat_threads', 'chat_messages', 'chat_attachments',
|
||||
'short_messages', 'feedbacks',
|
||||
'short_messages', 'feedbacks', 'bookmarks',
|
||||
];
|
||||
const BACKUP_SEQUENCE_TABLES = [
|
||||
'groups', 'students', 'entries', 'project_files', 'branches', 'users', 'user_notes', 'group_photos',
|
||||
'entry_photos', 'modules', 'student_photos', 'share_links', 'photo_jobs', 'lesson_reports',
|
||||
'lesson_report_versions', 'audit_log', 'notifications', 'chat_threads', 'chat_messages',
|
||||
'chat_attachments', 'short_messages', 'feedbacks',
|
||||
'chat_attachments', 'short_messages', 'feedbacks', 'bookmarks',
|
||||
];
|
||||
|
||||
function isSupportedBackupVersion(data) {
|
||||
@@ -571,7 +571,20 @@ function normalizeRestoreData(data) {
|
||||
created_at: optTs(x.created_at),
|
||||
updated_at: optTs(x.updated_at),
|
||||
}));
|
||||
return { groups, students, entries, project_files, settings, branches, users, user_branches, user_settings, user_notes, entry_photos, student_photos, group_photos, share_links, modules, photo_jobs, lesson_reports, lesson_report_versions, audit_log, notifications, notification_reads, banned_ips, chat_threads, chat_messages, chat_attachments, short_messages, feedbacks };
|
||||
const bookmarks = (data.bookmarks || []).map(x => ({
|
||||
id: reqInt(x.id),
|
||||
title: optText(x.title, 200) || '',
|
||||
url: optText(x.url, 500) || '',
|
||||
description: optText(x.description, 500) || '',
|
||||
photo_path: optUploadPath(x.photo_path, 300),
|
||||
image_mode: x.image_mode === 'cover' ? 'cover' : 'logo',
|
||||
open_new_tab: x.open_new_tab !== false,
|
||||
is_active: x.is_active !== false,
|
||||
sort_order: optInt(x.sort_order, -10000000, 10000000) ?? 0,
|
||||
created_at: optTs(x.created_at),
|
||||
updated_at: optTs(x.updated_at),
|
||||
}));
|
||||
return { groups, students, entries, project_files, settings, branches, users, user_branches, user_settings, user_notes, entry_photos, student_photos, group_photos, share_links, modules, photo_jobs, lesson_reports, lesson_report_versions, audit_log, notifications, notification_reads, banned_ips, chat_threads, chat_messages, chat_attachments, short_messages, feedbacks, bookmarks };
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
||||
Reference in New Issue
Block a user