Add feedback system functionality

- Implement feedback management system in admin interface
- Add feedback processing and AI-based features
- Update user interface with new feedback components
- Modify server-side API endpoints for feedback handling
- Enhance worker.js for background feedback processing
- Update deployment configuration for feedback components

Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
dev
2026-10-06 13:10:14 +03:00
co-authored by openhands
parent a3169648f3
commit 98f24faaaf
13 changed files with 1717 additions and 31 deletions
+24 -3
View File
@@ -8,13 +8,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',
'short_messages', 'feedbacks',
];
const BACKUP_SEQUENCE_TABLES = [
'groups', 'students', 'entries', 'project_files', 'branches', 'users', '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',
'chat_attachments', 'short_messages', 'feedbacks',
];
function isSupportedBackupVersion(data) {
@@ -516,7 +516,28 @@ 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, 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 };
const feedbacks = (data.feedbacks || []).map(r => ({
id: reqInt(r.id),
feedback_date: optDate(r.feedback_date),
group_id: reqInt(r.group_id),
resident: reqStr(r.resident),
topic: optStr(r.topic),
past_review: optStr(r.past_review),
short_message_ids: Array.isArray(r.short_message_ids) ? r.short_message_ids.map(v => reqInt(v)) : [],
text: optStr(r.text),
ai_status: optStr(r.ai_status) || 'none',
ai_checked_at: optTs(r.ai_checked_at),
ai_error: optStr(r.ai_error),
ai_profile: optStr(r.ai_profile),
sent_at: optTs(r.sent_at),
author_id: optInt(r.author_id),
branch_id: optInt(r.branch_id),
deleted_at: optTs(r.deleted_at),
purge_at: optTs(r.purge_at),
created_at: optTs(r.created_at),
updated_at: optTs(r.updated_at),
}));
return { groups, students, entries, project_files, settings, branches, users, user_branches, 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 };
}
module.exports = {