feat(shared): add UI components, hooks, form fields, and action utils

- Add UI components: confirm-delete-dialog, empty-table-row, list-pagination, pagination, status-badge

- Add form-fields directory for reusable form field components

- Add hooks: use-action-mutation, use-action-query for server action integration

- Add action-utils lib for action state helpers

- Update a11y components, charts, global-search, onboarding-gate, question components

- Update UI components: chip-nav, filter-bar, page-header, stat-card, stat-item, switch, table

- Update hooks: use-action-with-toast, use-aria-live, use-debounce, use-local-storage, use-media-query, use-permission

- Update lib: a11y, ai, audit-logger, auth-guard, bcrypt-utils, change-logger, download, excel, file-storage, http-utils, login-logger, password-policy, password-security-service, permissions, rate-limit, role-utils, search-params, session, storage-provider

- Update types: action-state, permissions

- Update i18n messages (en, zh-CN) for dashboard, diagnostic, grades, lesson-preparation, settings
This commit is contained in:
SpecialX
2026-06-23 17:38:14 +08:00
parent 9ceb2b7b67
commit c4d3433cc9
25 changed files with 1986 additions and 28 deletions

View File

@@ -63,6 +63,7 @@ export const ROLE_PERMISSIONS: Record<Role, Permission[]> = {
Permissions.FILE_READ,
Permissions.FILE_DELETE,
Permissions.DASHBOARD_ADMIN_READ,
Permissions.ERROR_BOOK_ANALYTICS_READ,
],
teacher: [
Permissions.EXAM_CREATE,
@@ -107,6 +108,7 @@ export const ROLE_PERMISSIONS: Record<Role, Permission[]> = {
Permissions.LESSON_PLAN_DELETE,
Permissions.LESSON_PLAN_PUBLISH,
Permissions.DASHBOARD_TEACHER_READ,
Permissions.ERROR_BOOK_ANALYTICS_READ,
],
student: [
Permissions.EXAM_READ,
@@ -128,6 +130,8 @@ export const ROLE_PERMISSIONS: Record<Role, Permission[]> = {
Permissions.ELECTIVE_READ,
Permissions.DIAGNOSTIC_READ,
Permissions.DASHBOARD_STUDENT_READ,
Permissions.ERROR_BOOK_READ,
Permissions.ERROR_BOOK_MANAGE,
],
parent: [
Permissions.EXAM_READ,
@@ -141,6 +145,7 @@ export const ROLE_PERMISSIONS: Record<Role, Permission[]> = {
Permissions.MESSAGE_READ,
Permissions.MESSAGE_DELETE,
Permissions.DASHBOARD_PARENT_READ,
Permissions.ERROR_BOOK_READ,
],
grade_head: [
Permissions.EXAM_CREATE,
@@ -178,6 +183,7 @@ export const ROLE_PERMISSIONS: Record<Role, Permission[]> = {
Permissions.EXAM_PROCTOR_READ,
Permissions.DIAGNOSTIC_MANAGE,
Permissions.DIAGNOSTIC_READ,
Permissions.ERROR_BOOK_ANALYTICS_READ,
],
teaching_head: [
Permissions.EXAM_CREATE,
@@ -210,6 +216,7 @@ export const ROLE_PERMISSIONS: Record<Role, Permission[]> = {
Permissions.ELECTIVE_READ,
Permissions.EXAM_PROCTOR_READ,
Permissions.DIAGNOSTIC_READ,
Permissions.ERROR_BOOK_ANALYTICS_READ,
],
}