feat(business): update audit, auth, course-plans, announcements, exams
- audit: update retention.ts, types.ts, audit-retention-settings.tsx - auth: update actions.ts and types.ts - course-plans: update actions.ts, course-plan-detail.tsx, template-picker-dialog.tsx, add lib/track-event.ts - announcements: update page.tsx, announcement-list.tsx, announcement-pagination.tsx - exams: update actions.ts
This commit is contained in:
@@ -483,14 +483,5 @@ export async function getGradeCoursePlanProgressAction(
|
||||
}
|
||||
|
||||
// ── 监控埋点接口(P2-8)────────────────────────────────────
|
||||
// 预留埋点接口,供前端调用以记录关键操作。
|
||||
// 当前为空实现,后续接入监控 SDK 时只需修改此函数。
|
||||
export function trackCoursePlanEvent(
|
||||
event: string,
|
||||
properties?: Record<string, unknown>
|
||||
): void {
|
||||
// 预留:接入监控 SDK 后实现
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
console.debug(`[course-plans] ${event}`, properties)
|
||||
}
|
||||
}
|
||||
// trackCoursePlanEvent 已移至 lib/track-event.ts,因其为同步函数,
|
||||
// 不允许出现在 "use server" 文件中(Next.js 16 规则)。
|
||||
|
||||
@@ -47,8 +47,8 @@ import {
|
||||
deleteCoursePlanAction,
|
||||
bulkToggleItemsAction,
|
||||
reorderCoursePlanItemsAction,
|
||||
trackCoursePlanEvent,
|
||||
} from "../actions"
|
||||
import { trackCoursePlanEvent } from "../lib/track-event"
|
||||
import { exportCoursePlanReport } from "../lib/export-utils"
|
||||
import type { CoursePlanWithItems, ReorderCoursePlanItemInput } from "../types"
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import {
|
||||
getTemplateCandidatesAction,
|
||||
copyCoursePlanAction,
|
||||
} from "../actions"
|
||||
import { trackCoursePlanEvent } from "../actions"
|
||||
import { trackCoursePlanEvent } from "../lib/track-event"
|
||||
import type { CoursePlanListItem } from "../types"
|
||||
|
||||
interface TemplatePickerDialogProps {
|
||||
|
||||
19
src/modules/course-plans/lib/track-event.ts
Normal file
19
src/modules/course-plans/lib/track-event.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* 课程计划监控埋点接口(P2-8)
|
||||
*
|
||||
* 供客户端组件直接调用以记录关键操作。
|
||||
* 当前为空实现,后续接入监控 SDK 时只需修改此函数。
|
||||
*
|
||||
* 注意:此文件不得标记 "use server",因为 trackCoursePlanEvent 是同步函数,
|
||||
* 不涉及服务端操作。Next.js 16 要求 "use server" 文件中所有导出必须是 async 函数。
|
||||
*/
|
||||
|
||||
export function trackCoursePlanEvent(
|
||||
event: string,
|
||||
properties?: Record<string, unknown>,
|
||||
): void {
|
||||
// 预留:接入监控 SDK 后实现
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
console.debug(`[course-plans] ${event}`, properties)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user