Add website binding to boards with filter and date controls.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Mike Cao 2026-02-05 22:04:59 -08:00
parent d3d86f43fa
commit f66a508892
5 changed files with 48 additions and 5 deletions

View file

@ -1,5 +1,7 @@
import { Button, Form, FormField, FormSubmitButton, Row, TextField } from '@umami/react-zen';
import { Button, Form, FormField, FormSubmitButton, Row, Text, TextField } from '@umami/react-zen';
import { useState } from 'react';
import { useMessages, useUpdateQuery } from '@/components/hooks';
import { WebsiteSelect } from '@/components/input/WebsiteSelect';
export function BoardAddForm({
teamId,
@ -12,10 +14,11 @@ export function BoardAddForm({
}) {
const { formatMessage, labels } = useMessages();
const { mutateAsync, error, isPending } = useUpdateQuery('/boards', { teamId });
const [websiteId, setWebsiteId] = useState<string>();
const handleSubmit = async (data: any) => {
await mutateAsync(
{ type: 'board', ...data },
{ type: 'board', ...data, parameters: { websiteId } },
{
onSuccess: async () => {
onSave?.();
@ -43,6 +46,10 @@ export function BoardAddForm({
>
<TextField asTextArea autoComplete="off" />
</FormField>
<Row alignItems="center" gap="3" paddingTop="3">
<Text>{formatMessage(labels.website)}</Text>
<WebsiteSelect websiteId={websiteId} teamId={teamId} onChange={setWebsiteId} />
</Row>
<Row justifyContent="flex-end" paddingTop="3" gap="3">
{onClose && (
<Button isDisabled={isPending} onPress={onClose}>