feat(analytics): add daily trend and activity heatmap endpoints, and implement corresponding frontend components

- Added new API endpoints for daily trend data and activity heatmap in analyticsRoutes.ts.
- Created new frontend components: ActivityChart, ControlBar, Heatmap, SummaryCards, TopicList, TrendChart, UserTable, and ViolatorTable for displaying analytics data.
- Implemented loading and empty states in the new components.
- Enhanced the existing moderation tests with remote fallback handling for Indonesian text normalization.
This commit is contained in:
MythEclipse
2026-05-31 00:41:34 +07:00
parent 4e9e370eb1
commit 71e240c1e7
21 changed files with 2130 additions and 1066 deletions
@@ -1,4 +1,4 @@
import { describe, expect, it } from "vitest";
import { afterAll, afterEach, describe, expect, it } from "vitest";
import {
buildModerationTextEvidence,
detectIndonesianBadwords,
@@ -6,6 +6,26 @@ import {
normalizeDiscordCustomEmoji,
normalizeIndonesianSlang,
} from "../../src/moderation/indonesianTextNormalizer";
import { config } from "../../src/config";
const originalNemotronKey = config.NVIDIA_NEMOTRON_API_KEY;
const originalPrimaryAiKey = config.AI_LLM_API_KEY;
function disableRemoteModeration(): void {
config.NVIDIA_NEMOTRON_API_KEY = undefined;
config.AI_LLM_API_KEY = undefined;
}
disableRemoteModeration();
afterEach(() => {
disableRemoteModeration();
});
afterAll(() => {
config.NVIDIA_NEMOTRON_API_KEY = originalNemotronKey;
config.AI_LLM_API_KEY = originalPrimaryAiKey;
});
describe("normalizeDiscordCustomEmoji", () => {
it("replaces static custom emoji", () => {