diff --git a/web/apps/doprocess/app/(rest)/(marketing)/page.tsx b/web/apps/doprocess/app/(rest)/(marketing)/page.tsx index 31bbcb33ef..4326e84c54 100644 --- a/web/apps/doprocess/app/(rest)/(marketing)/page.tsx +++ b/web/apps/doprocess/app/(rest)/(marketing)/page.tsx @@ -1,4 +1,4 @@ -import { ListChecks, Play, Share } from '@signalco/ui-icons'; +import { ListTodo, Play, Share } from '@signalco/ui-icons'; import { NavigatingButton } from '@signalco/ui/NavigatingButton'; import { KnownPages } from '../../../src/knownPages'; import { ImagePlaceholder } from '../../../components/images/ImagePlaceholder'; @@ -15,7 +15,7 @@ function FeaturesSection() {
Create and manage your documents in one place. diff --git a/web/apps/doprocess/app/api/documents/route.ts b/web/apps/doprocess/app/api/documents/route.ts index b4864c9fed..47009a2378 100644 --- a/web/apps/doprocess/app/api/documents/route.ts +++ b/web/apps/doprocess/app/api/documents/route.ts @@ -1,4 +1,4 @@ -import { documentCreate, documentGet, documentsGet } from '../../../src/lib/repo/documentsRepository'; +import { documentCreate, documentGet, documentsGet, documentSetData } from '../../../src/lib/repo/documentsRepository'; import { ensureUserId } from '../../../src/lib/auth/apiAuth'; export async function GET() { @@ -10,11 +10,17 @@ export async function GET() { export async function POST(request: Request) { const data = await request.json(); - const name = data != null && typeof data === 'object' && 'name' in data && typeof data.name === 'string' ? data.name : ''; + const name = data != null && typeof data === 'object' && 'name' in data && typeof data.name === 'string' ? data.name : null; + if (name == null) { + throw new Error('Missing name'); + } const { userId } = ensureUserId(); - const id = await documentCreate(userId, name); - const document = await documentGet(userId, Number(id)); + const basedOn = data != null && typeof data === 'object' && 'basedOn' in data && typeof data.basedOn === 'string' ? data.basedOn : undefined; + + const id = await documentCreate(userId, name, basedOn); + + const document = await documentGet(userId, id); return Response.json({ id: document?.publicId }); } diff --git a/web/apps/doprocess/app/api/processes/[id]/task-definitions/route.ts b/web/apps/doprocess/app/api/processes/[id]/task-definitions/route.ts index 90462cb6db..0c853234e5 100644 --- a/web/apps/doprocess/app/api/processes/[id]/task-definitions/route.ts +++ b/web/apps/doprocess/app/api/processes/[id]/task-definitions/route.ts @@ -34,6 +34,6 @@ export async function POST(request: Request, { params }: { params: { id: string return new Response(null, { status: 404 }); const id = await createTaskDefinition(userId, processId, text); - const taskDefinition = await getTaskDefinition(userId, processId, Number(id)); + const taskDefinition = await getTaskDefinition(userId, processId, id); return Response.json({ id: taskDefinition?.publicId }); } diff --git a/web/apps/doprocess/app/api/processes/route.ts b/web/apps/doprocess/app/api/processes/route.ts index 62617b40d2..c4775bdacd 100644 --- a/web/apps/doprocess/app/api/processes/route.ts +++ b/web/apps/doprocess/app/api/processes/route.ts @@ -14,7 +14,10 @@ export async function POST(request: Request) { const name = typeof req === 'object' && req != null && 'name' in req && typeof req.name === 'string' ? req.name.toString() : null; if (name == null) throw new Error('Missing name'); - const id = await createProcess(userId, name); + + const basedOn = typeof req === 'object' && req != null && 'basedOn' in req && typeof req.basedOn === 'string' ? req.basedOn.toString() : undefined; + const id = await createProcess(userId, name, basedOn); + const process = await getProcess(userId, Number(id)); return Response.json({ id: process?.publicId }); } diff --git a/web/apps/doprocess/components/layouts/Sidebar.tsx b/web/apps/doprocess/components/layouts/Sidebar.tsx index eb0e30f31d..3e44f0a9f9 100644 --- a/web/apps/doprocess/components/layouts/Sidebar.tsx +++ b/web/apps/doprocess/components/layouts/Sidebar.tsx @@ -6,7 +6,7 @@ import { ListItem } from '@signalco/ui-primitives/ListItem'; import { List } from '@signalco/ui-primitives/List'; import { IconButton } from '@signalco/ui-primitives/IconButton'; import { cx } from '@signalco/ui-primitives/cx'; -import { FileText, ListChecks, Play, Right } from '@signalco/ui-icons'; +import { FileText, ListTodo, Play, Right } from '@signalco/ui-icons'; import { KnownPages } from '../../src/knownPages'; export function Sidebar({ open, onOpenChange }: { open: boolean, onOpenChange?: (open: boolean) => void }) { @@ -14,7 +14,7 @@ export function Sidebar({ open, onOpenChange }: { open: boolean, onOpenChange?: const links = useMemo(() => [ { href: KnownPages.Runs, label: 'Runs', Icon: Play }, - { href: KnownPages.Processes, label: 'Processes', Icon: ListChecks }, + { href: KnownPages.Processes, label: 'Processes', Icon: ListTodo }, { href: KnownPages.Documents, label: 'Documents', Icon: FileText }, ], []); diff --git a/web/apps/doprocess/components/layouts/SplitView.tsx b/web/apps/doprocess/components/layouts/SplitView.tsx index 656ffeca56..ffd6966129 100644 --- a/web/apps/doprocess/components/layouts/SplitView.tsx +++ b/web/apps/doprocess/components/layouts/SplitView.tsx @@ -41,7 +41,7 @@ export function SplitView({ children, size, minSize, maxSize, collapsable, colla onTouchStart={handlers.handleTouchStart} orientation="vertical" /> -