Openstatus www.openstatus.dev
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

๐Ÿš‘ (#230)

authored by

Thibault Le Ouay and committed by
GitHub
7a80fbdd 67f37b23

+9 -12
+6 -5
apps/web/src/components/forms/status-page-form.tsx
··· 65 65 const [isPending, startTransition] = useTransition(); 66 66 const watchSlug = form.watch("slug"); 67 67 const debouncedSlug = useDebounce(watchSlug, 1000); // using debounce to not exhaust the server 68 - const watchTitle = form.watch("title"); 69 68 const { toast } = useToast(); 70 - 71 69 const checkUniqueSlug = useCallback(async () => { 72 70 const isUnique = await api.page.getSlugUniqueness.query({ 73 71 slug: debouncedSlug, ··· 94 92 // eslint-disable-next-line react-hooks/exhaustive-deps 95 93 }, [checkUniqueSlug]); 96 94 97 - useEffect(() => { 98 - form.setValue("slug", slugify(watchTitle)); 99 - }, [watchTitle, form]); 95 + // FIXME: ๐Ÿ› This is causing a bug 96 + // useEffect(() => { 97 + // if (!watchSlug) { 98 + // form.setValue("slug", slugify(watchTitle)); 99 + // } 100 + // }, [watchTitle, form, watchSlug]); 100 101 101 102 const onSubmit = async ({ 102 103 ...props
+3 -7
packages/db/src/schema/page.ts
··· 3 3 import { createInsertSchema, createSelectSchema } from "drizzle-zod"; 4 4 import { z } from "zod"; 5 5 6 - import { 7 - incident, 8 - selectIncidentSchema, 9 - selectIncidentUpdateSchema, 10 - } from "./incident"; 11 - import { monitorsToPages, selectMonitorSchema } from "./monitor"; 6 + import { monitorsToPages } from "./monitor"; 12 7 import { workspace } from "./workspace"; 13 8 14 9 export const page = sqliteTable("page", { ··· 55 50 .regex( 56 51 new RegExp("^(?!https?://|www.)([a-zA-Z0-9]+(.[a-zA-Z0-9]+)+.*)$"), 57 52 "Should not start with http://, https:// or www.", 58 - ); 53 + ) 54 + .or(z.enum([""])); 59 55 60 56 // Schema for inserting a Page - can be used to validate API requests 61 57 export const insertPageSchema = createInsertSchema(page, {