mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 14:47:14 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
d7f32e6987
15 changed files with 53 additions and 41 deletions
|
|
@ -49,6 +49,7 @@ export function ReportDeleteButton({
|
|||
error={error}
|
||||
onConfirm={handleConfirm.bind(null, close)}
|
||||
onClose={close}
|
||||
buttonLabel={formatMessage(labels.delete)}
|
||||
/>
|
||||
)}
|
||||
</Modal>
|
||||
|
|
|
|||
|
|
@ -1,14 +1,13 @@
|
|||
import {
|
||||
Form,
|
||||
FormRow,
|
||||
FormInput,
|
||||
FormButtons,
|
||||
TextField,
|
||||
Button,
|
||||
SubmitButton,
|
||||
} from 'react-basics';
|
||||
import { touch } from 'store/modified';
|
||||
import { useApi, useMessages } from 'components/hooks';
|
||||
import {
|
||||
Button,
|
||||
Form,
|
||||
FormButtons,
|
||||
FormInput,
|
||||
FormRow,
|
||||
SubmitButton,
|
||||
TextField,
|
||||
} from 'react-basics';
|
||||
|
||||
export function TeamAddForm({ onSave, onClose }: { onSave: () => void; onClose: () => void }) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
|
|
@ -20,7 +19,6 @@ export function TeamAddForm({ onSave, onClose }: { onSave: () => void; onClose:
|
|||
const handleSubmit = async (data: any) => {
|
||||
mutate(data, {
|
||||
onSuccess: async () => {
|
||||
touch('teams');
|
||||
onSave?.();
|
||||
onClose?.();
|
||||
},
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ export function TeamLeaveForm({
|
|||
const handleConfirm = async () => {
|
||||
mutate(null, {
|
||||
onSuccess: async () => {
|
||||
touch('team:members');
|
||||
touch('teams:members');
|
||||
onSave();
|
||||
onClose();
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,10 +1,19 @@
|
|||
import { Button, Icon, Modal, ModalTrigger, Text } from 'react-basics';
|
||||
import { Button, Icon, Modal, ModalTrigger, Text, useToasts } from 'react-basics';
|
||||
import Icons from 'components/icons';
|
||||
import { useMessages } from 'components/hooks';
|
||||
import TeamAddForm from './TeamAddForm';
|
||||
import { messages } from 'components/messages';
|
||||
import { touch } from 'store/modified';
|
||||
|
||||
export function TeamsAddButton({ onAdd }: { onAdd?: () => void }) {
|
||||
export function TeamsAddButton({ onSave }: { onSave?: () => void }) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const { showToast } = useToasts();
|
||||
|
||||
const handleSave = async () => {
|
||||
showToast({ message: formatMessage(messages.saved), variant: 'success' });
|
||||
touch('teams');
|
||||
onSave?.();
|
||||
};
|
||||
|
||||
return (
|
||||
<ModalTrigger>
|
||||
|
|
@ -15,7 +24,7 @@ export function TeamsAddButton({ onAdd }: { onAdd?: () => void }) {
|
|||
<Text>{formatMessage(labels.createTeam)}</Text>
|
||||
</Button>
|
||||
<Modal title={formatMessage(labels.createTeam)}>
|
||||
{(close: () => void) => <TeamAddForm onSave={onAdd} onClose={close} />}
|
||||
{(close: () => void) => <TeamAddForm onSave={handleSave} onClose={close} />}
|
||||
</Modal>
|
||||
</ModalTrigger>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ export function TeamMemberRemoveButton({
|
|||
const handleRemoveTeamMember = () => {
|
||||
mutate(null, {
|
||||
onSuccess: () => {
|
||||
touch('team:members');
|
||||
touch('teams:members');
|
||||
onSave?.();
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ export function TeamDeleteForm({
|
|||
const { labels, formatMessage } = useMessages();
|
||||
const { del, useMutation } = useApi();
|
||||
const { mutate, error, isPending } = useMutation({
|
||||
mutationFn: (data: any) => del(`/teams/${teamId}`, data),
|
||||
mutationFn: () => del(`/teams/${teamId}`),
|
||||
});
|
||||
|
||||
const handleConfirm = async () => {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ export function WebsiteDeleteForm({
|
|||
const { formatMessage, labels } = useMessages();
|
||||
const { del, useMutation } = useApi();
|
||||
const { mutate, isPending, error } = useMutation({
|
||||
mutationFn: (data: any) => del(`/websites/${websiteId}`, data),
|
||||
mutationFn: () => del(`/websites/${websiteId}`),
|
||||
});
|
||||
|
||||
const handleConfirm = async () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue