Merge commit '3ac76491c' into feat/propagate-workshop-admin-widgets
This commit is contained in:
21 files changed
+174
-132
No files matched your search
@@ -1026,7 +1026,7 @@
|
||||
"description": "Copy one prompt, then paste the AI's single JSON block. Homarr loads its JSX into the editor automatically.",
|
||||
"request": "What should this widget do?",
|
||||
"documentationUrl": "API documentation URL (optional)",
|
||||
"paste": "Paste AI response",
|
||||
"paste": "Paste",
|
||||
"response": "AI response",
|
||||
"loaded": "Widget loaded into the editor",
|
||||
"invalidResponse": "Clipboard does not contain a valid v2 widget",
|
||||
@@ -1060,8 +1060,6 @@
|
||||
"liveActions": "Run actions against the configured API",
|
||||
"liveActionsDescription": "Off is safe simulation. Turning this on affects the real service.",
|
||||
"noActions": "No actions are defined.",
|
||||
"sessionActive": "Preview session active",
|
||||
"simulationPending": "Actions are simulated until you run preview",
|
||||
"containedFailures": "Runtime failures are contained inside this widget. Request journals never include secret values.",
|
||||
"validation": {
|
||||
"title": "Validation",
|
||||
@@ -1096,10 +1094,6 @@
|
||||
"standard": "Standard",
|
||||
"wide": "Wide"
|
||||
},
|
||||
"theme": {
|
||||
"light": "Light",
|
||||
"dark": "Dark"
|
||||
},
|
||||
"fixture": {
|
||||
"live": "Live",
|
||||
"loading": "Loading",
|
||||
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
normalizeHttpUrl,
|
||||
resolveHomarrUrlConfig,
|
||||
validateWorkshopWidget,
|
||||
workshopReportCategorySchema,
|
||||
workshopSubmissionInputSchema,
|
||||
workshopSubmissionSummarySchema,
|
||||
} from "./schema";
|
||||
@@ -40,6 +41,10 @@ describe("Workshop URL configuration", () => {
|
||||
});
|
||||
|
||||
describe("Workshop widget validation", () => {
|
||||
test("accepts outdated as a report category", () => {
|
||||
expect(workshopReportCategorySchema.parse("outdated")).toBe("outdated");
|
||||
});
|
||||
|
||||
test("accepts a canonical credential-free widget", () => {
|
||||
expect(validateWorkshopWidget(JSON.stringify(CUSTOM_WIDGET_STARTER)).success).toBe(true);
|
||||
expect(
|
||||
|
||||
@@ -73,7 +73,14 @@ export function resolveHomarrUrlConfig(input: HomarrUrlConfigInput = {}): Homarr
|
||||
return { homarrWebsiteUrl, workshopApiUrl, workshopWebUrl };
|
||||
}
|
||||
|
||||
export const workshopReportCategorySchema = z.enum(["malicious", "spam", "copyright", "inappropriate", "other"]);
|
||||
export const workshopReportCategorySchema = z.enum([
|
||||
"outdated",
|
||||
"malicious",
|
||||
"spam",
|
||||
"copyright",
|
||||
"inappropriate",
|
||||
"other",
|
||||
]);
|
||||
export const workshopSubmissionTypeSchema = z.enum(["customWidget", "customCss"]);
|
||||
export type WorkshopSubmissionType = z.infer<typeof workshopSubmissionTypeSchema>;
|
||||
|
||||
|
||||
Reference in new issue
Block a user