feat(admin): server-safe StatusCard and Import hub polish
Split OnlineUsersWidget from StatusCard, decouple ad delete button, sync badge import to ExternalTexts+WebsiteBadges, add Import section hub with cancelable SSE jobs and upload SQL option. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
1 parent
db957d7fb1
commit
9c4949186c
21 files changed
+576
-249
No files matched your search
@@ -179,6 +179,21 @@ describe("staff smoke contract", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("keeps StatusCard server-safe without client boundary", () => {
|
||||
expect(
|
||||
readFileSync("src/components/admin/dashboard.tsx", "utf8"),
|
||||
).not.toMatch(/^["']use client["']/m);
|
||||
expect(existsSync("src/components/admin/online-users-widget.tsx")).toBe(
|
||||
true,
|
||||
);
|
||||
expect(
|
||||
readFileSync("src/components/admin/online-users-widget.tsx", "utf8"),
|
||||
).toContain("use client");
|
||||
expect(existsSync("src/app/admin/ads/edit-ad-delete-button.tsx")).toBe(
|
||||
true,
|
||||
);
|
||||
});
|
||||
|
||||
it("ships ops health alerts, optional DB backup, and health rate limit", () => {
|
||||
const worker = readFileSync("scripts/jobs-worker.ts", "utf8");
|
||||
expect(worker).toContain("checkOpsHealth");
|
||||
@@ -215,4 +230,19 @@ describe("staff smoke contract", () => {
|
||||
"/admin/items",
|
||||
);
|
||||
});
|
||||
|
||||
it("ships import hub with synced badge import path", () => {
|
||||
const nav = readFileSync("src/lib/admin-nav.ts", "utf8");
|
||||
expect(nav).toContain('id: "import"');
|
||||
expect(nav).toContain("importSubtitle");
|
||||
expect(nav).toContain("/admin/import");
|
||||
expect(existsSync("src/lib/services/import-badge.ts")).toBe(true);
|
||||
const badgeService = readFileSync(
|
||||
"src/lib/services/import-badge.ts",
|
||||
"utf8",
|
||||
);
|
||||
expect(badgeService).toContain("ExternalTexts.json");
|
||||
expect(badgeService).toContain("WebsiteBadges");
|
||||
expect(badgeService).toContain("importBadgeSynced");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user