diff --git a/components/forms/EventDataForm.js b/components/forms/EventDataForm.js
index 01013416..2795ff6b 100644
--- a/components/forms/EventDataForm.js
+++ b/components/forms/EventDataForm.js
@@ -168,20 +168,19 @@ export default function EventDataForm({ websiteId, onClose, className }) {
handleAddTag({ ...value, value: type }, columns, setColumns, columnRef, true)
}
>
- }
- rules={{ required: 'Required' }}
- >
-
-
}
+ label={}
>
-
- {({ value, label }) => - {label}
}
-
+
+
+
+
+ }>
+
+
+ {({ value, label }) => - {label}
}
+
+
+
+ value === CONFIRM_VALUE }}>
+
+
+
Save
diff --git a/components/forms/UserEditForm.js b/components/forms/UserEditForm.js
index 28233250..ab16eca8 100644
--- a/components/forms/UserEditForm.js
+++ b/components/forms/UserEditForm.js
@@ -2,6 +2,7 @@ import {
Dropdown,
Item,
Form,
+ FormRow,
FormButtons,
FormInput,
TextField,
@@ -48,14 +49,18 @@ export default function UserEditForm({ data, onSave }) {
error={error}
values={data}
>
-
-
-
-
-
- {({ value, label }) => - {label}
}
-
-
+
+
+
+
+
+
+
+
+ {({ value, label }) => - {label}
}
+
+
+
Save
diff --git a/components/forms/UserPasswordForm.js b/components/forms/UserPasswordForm.js
index ff474608..0e75fcd1 100644
--- a/components/forms/UserPasswordForm.js
+++ b/components/forms/UserPasswordForm.js
@@ -1,5 +1,5 @@
import { useRef } from 'react';
-import { Form, FormInput, FormButtons, PasswordField, Button } from 'react-basics';
+import { Form, FormRow, FormInput, FormButtons, PasswordField, Button } from 'react-basics';
import useApi from 'hooks/useApi';
import styles from './UserPasswordForm.module.css';
import useUser from 'hooks/useUser';
@@ -38,31 +38,35 @@ export default function UserPasswordForm({ onSave, onClose, userId }) {
return (
{isCurrentUser && (
-
+
+
+
+
+
+ )}
+
+
- )}
-
-
-
-
-
-
+
+
+
+
+
+
Save
diff --git a/components/forms/WebsiteAddForm.js b/components/forms/WebsiteAddForm.js
index 45392ed7..43abec78 100644
--- a/components/forms/WebsiteAddForm.js
+++ b/components/forms/WebsiteAddForm.js
@@ -1,5 +1,13 @@
import { useRef } from 'react';
-import { Form, FormInput, FormButtons, TextField, Button, SubmitButton } from 'react-basics';
+import {
+ Form,
+ FormRow,
+ FormInput,
+ FormButtons,
+ TextField,
+ Button,
+ SubmitButton,
+} from 'react-basics';
import useApi from 'hooks/useApi';
import styles from './Form.module.css';
import { useMutation } from '@tanstack/react-query';
@@ -20,19 +28,22 @@ export default function WebsiteAddForm({ onSave, onClose }) {
return (
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
Save
diff --git a/components/forms/WebsiteDeleteForm.js b/components/forms/WebsiteDeleteForm.js
index 9b6ad698..195c5a76 100644
--- a/components/forms/WebsiteDeleteForm.js
+++ b/components/forms/WebsiteDeleteForm.js
@@ -1,6 +1,14 @@
import { useMutation } from '@tanstack/react-query';
import useApi from 'hooks/useApi';
-import { Button, Form, FormButtons, FormInput, SubmitButton, TextField } from 'react-basics';
+import {
+ Button,
+ Form,
+ FormRow,
+ FormButtons,
+ FormInput,
+ SubmitButton,
+ TextField,
+} from 'react-basics';
import styles from './Form.module.css';
const CONFIRM_VALUE = 'DELETE';
@@ -22,13 +30,11 @@ export default function WebsiteDeleteForm({ websiteId, onSave, onClose }) {
To delete this website, type {CONFIRM_VALUE} in the box below to confirm.
- value === CONFIRM_VALUE }}
- >
-
-
+
+ value === CONFIRM_VALUE }}>
+
+
+
Save
diff --git a/components/forms/WebsiteEditForm.js b/components/forms/WebsiteEditForm.js
index dd3d3989..91bfd2f9 100644
--- a/components/forms/WebsiteEditForm.js
+++ b/components/forms/WebsiteEditForm.js
@@ -23,22 +23,25 @@ export default function WebsiteEditForm({ websiteId, data, onSave }) {
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
Save
diff --git a/components/forms/WebsiteResetForm.js b/components/forms/WebsiteResetForm.js
index a40c5cbb..36307f32 100644
--- a/components/forms/WebsiteResetForm.js
+++ b/components/forms/WebsiteResetForm.js
@@ -1,6 +1,14 @@
import { useMutation } from '@tanstack/react-query';
import useApi from 'hooks/useApi';
-import { Button, Form, FormButtons, FormInput, SubmitButton, TextField } from 'react-basics';
+import {
+ Button,
+ Form,
+ FormRow,
+ FormButtons,
+ FormInput,
+ SubmitButton,
+ TextField,
+} from 'react-basics';
import styles from './Form.module.css';
const CONFIRM_VALUE = 'RESET';
@@ -24,13 +32,11 @@ export default function WebsiteResetForm({ websiteId, onSave, onClose }) {
To reset this website, type {CONFIRM_VALUE} in the box below to confirm.
- value === CONFIRM_VALUE }}
- >
-
-
+
+ value === CONFIRM_VALUE }}>
+
+
+
Save
diff --git a/components/pages/WebsiteSettings.js b/components/pages/WebsiteSettings.js
index 25f00da0..b9738d41 100644
--- a/components/pages/WebsiteSettings.js
+++ b/components/pages/WebsiteSettings.js
@@ -13,7 +13,7 @@ import ExternalLink from 'assets/external-link.svg';
export default function Websites({ websiteId }) {
const [values, setValues] = useState(null);
- const [tab, setTab] = useState('general');
+ const [tab, setTab] = useState('details');
const { get } = useApi();
const { toast, showToast } = useToast();
const { data, isLoading } = useQuery(
@@ -59,12 +59,12 @@ export default function Websites({ websiteId }) {
- - General
+ - General
- Tracking code
- Share URL
- Danger zone
- {tab === 'general' && (
+ {tab === 'details' && (
)}
{tab === 'tracking' && }
diff --git a/pages/api/teams/[id]/index.ts b/pages/api/teams/[id]/index.ts
index 4612f4ed..1c7dbb66 100644
--- a/pages/api/teams/[id]/index.ts
+++ b/pages/api/teams/[id]/index.ts
@@ -12,6 +12,7 @@ export interface TeamRequestQuery {
export interface TeamRequestBody {
name: string;
+ accessCode: string;
}
export default async (
@@ -33,13 +34,14 @@ export default async (
}
if (req.method === 'POST') {
- const { name } = req.body;
-
if (!(await canUpdateTeam(req.auth, teamId))) {
return unauthorized(res, 'You must be the owner of this team.');
}
- const updated = await updateTeam({ name }, { id: teamId });
+ const { name, accessCode } = req.body;
+ const data = { name, accessCode };
+
+ const updated = await updateTeam(data, { id: teamId });
return ok(res, updated);
}