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:
@@ -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", () => {
|
||||
|
||||
Reference in New Issue
Block a user