mirror of
https://github.com/umami-software/umami.git
synced 2026-02-12 08:37:13 +01:00
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:
parent
d3d86f43fa
commit
f66a508892
5 changed files with 48 additions and 5 deletions
|
|
@ -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}>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue