mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-18 08:02:12 +00:00
merge: remove the bug-report integration for v1.23
# Conflicts: # messages/de.json # messages/en.json # messages/es.json # messages/fr.json # messages/it.json # messages/pl.json # src/app/admin/[section]/renderer.tsx
This commit is contained in:
commit
b271a39fe4
68 files changed
+115
-3344
No files matched your search
@@ -62,20 +62,6 @@ export const adminSettingsSchema = z
|
||||
)
|
||||
.optional(),
|
||||
glitchtipEnvironment: z.string().optional(),
|
||||
bugReportRepo: z
|
||||
.string()
|
||||
.refine(
|
||||
(v) => {
|
||||
const trimmed = v.trim();
|
||||
if (!trimmed) return true;
|
||||
return /^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(trimmed);
|
||||
},
|
||||
{ message: "GitHub repository must be in owner/repo format" },
|
||||
)
|
||||
.optional(),
|
||||
bugReportToken: z.string().optional(),
|
||||
clearBugReportToken: z.boolean().optional(),
|
||||
bugReportEnabled: z.boolean().optional(),
|
||||
reminderLateMinutes: z.number().int().min(15).max(480).optional(),
|
||||
reminderMissedMinutes: z.number().int().min(30).max(720).optional(),
|
||||
moodLogGlobal: z.boolean().optional(),
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
import { z } from "zod/v4";
|
||||
|
||||
export const feedbackCategoryEnum = z.enum([
|
||||
"BUG",
|
||||
"FEATURE_REQUEST",
|
||||
"QUESTION",
|
||||
"OTHER",
|
||||
]);
|
||||
|
||||
export const feedbackStatusEnum = z.enum([
|
||||
"OPEN",
|
||||
"ACKNOWLEDGED",
|
||||
"RESOLVED",
|
||||
"ARCHIVED",
|
||||
]);
|
||||
|
||||
// Strictly PNG / JPEG / WEBP / GIF data URLs. SVG intentionally excluded —
|
||||
// it can carry inline JS that would execute when the admin inbox renders the
|
||||
// preview.
|
||||
const SCREENSHOT_DATA_URL =
|
||||
/^data:image\/(png|jpeg|webp|gif);base64,[A-Za-z0-9+/=]+$/;
|
||||
|
||||
export const createFeedbackSchema = z.object({
|
||||
category: feedbackCategoryEnum.default("BUG"),
|
||||
subject: z.string().min(3).max(200),
|
||||
description: z.string().min(10).max(5000),
|
||||
screenshot: z
|
||||
.string()
|
||||
.max(7_000_000, "Screenshot too large (max 5 MB)")
|
||||
.regex(
|
||||
SCREENSHOT_DATA_URL,
|
||||
"Screenshot must be a base64-encoded PNG/JPEG/WEBP/GIF data URL",
|
||||
)
|
||||
.optional(),
|
||||
metadata: z.record(z.string(), z.unknown()).optional(),
|
||||
});
|
||||
|
||||
export const updateFeedbackSchema = z.object({
|
||||
status: feedbackStatusEnum.optional(),
|
||||
adminNote: z.string().max(5000).nullable().optional(),
|
||||
});
|
||||
|
||||
export type CreateFeedbackPayload = z.infer<typeof createFeedbackSchema>;
|
||||
export type UpdateFeedbackPayload = z.infer<typeof updateFeedbackSchema>;
|
||||
Reference in new issue
Block a user