feat(dashboard,ui): overhaul dashboard KPIs, audit trail tab, responsive controls, and settings

- Remove recent activities and user history from dashboard; relocate to dedicated History tab
- Fix Document Breakdown overflow and rebalance Bento KPI grid layout
- Fix Android overflow on student profile Edit Details button
- Simplify grid view cards in documents and archives screens with minimal folder styling
- Fix transparency board filter contrast and export button styling in reports
- Default auto-update enrollment to off, add grace period input, and fix settings danger zone
This commit is contained in:
ssbg04 committed 2026-09-19 02:26:49 +08:00
1 parent 2dc8ee4242
commit 69b4879ac2
28 files changed
+2981 -1206

No files matched your search

+13 -1
View File
@@ -1,5 +1,6 @@
const db = require('../config/db');
const autoGraduationService = require('../services/autoGraduationService');
const autoArchiveService = require('../services/autoArchiveService');
// ============================================================
// ACADEMIC YEAR AUTOMATION
@@ -85,10 +86,11 @@ exports.createAcademicYear = (req, res) => {
const finalStatus = status || 'inactive';
const result = db.prepare('INSERT INTO academic_years (year_range, status, start_date, end_date) VALUES (?, ?, ?, ?)')
.run(normalizedRange, finalStatus, sDate, eDate);
// If the new year is active, deactivate all others and check graduation
// If the new year is active, deactivate all others and check graduation & archiving
if (finalStatus === 'active') {
deactivateOtherYears(result.lastInsertRowid);
autoGraduationService.checkAndRunAutoGraduation(req.user?.id);
autoArchiveService.checkAndRunAutoArchive(req.user?.id);
}
res.status(201).json({ id: result.lastInsertRowid, message: 'Academic year created successfully' });
} catch (error) {
@@ -142,6 +144,7 @@ exports.updateAcademicYear = (req, res) => {
if (finalStatus === 'active') {
deactivateOtherYears(parseInt(id));
autoGraduationService.checkAndRunAutoGraduation(req.user?.id);
autoArchiveService.checkAndRunAutoArchive(req.user?.id);
}
res.json({ message: 'Academic year updated successfully' });
} catch (error) {
@@ -161,6 +164,15 @@ exports.checkAutoGraduation = (req, res) => {
}
};
exports.checkAutoArchive = (req, res) => {
try {
const result = autoArchiveService.checkAndRunAutoArchive(req.user?.id);
res.json(result);
} catch (error) {
res.status(500).json({ message: 'Failed to check auto archive', error: error.message });
}
};
exports.deleteAcademicYear = (req, res) => {
const { id } = req.params;
try {