diff --git a/README.md b/README.md index 5fe9dd96..70576b8c 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ DATABASE_URL=connection-url ``` The connection url is in the following format: + ``` postgresql://username:mypassword@localhost:5432/mydb @@ -48,7 +49,7 @@ mysql://username:mypassword@localhost:3306/mydb yarn build ``` -The build step will also create tables in your database if you ae installing for the first time. It will also create a login account with username **admin** and password **umami**. +The build step will also create tables in your database if you ae installing for the first time. It will also create a login user with username **admin** and password **umami**. ### Start the application @@ -69,11 +70,13 @@ docker compose up ``` Alternatively, to pull just the Umami Docker image with PostgreSQL support: + ```bash docker pull docker.umami.is/umami-software/umami:postgresql-latest ``` Or with MySQL support: + ```bash docker pull docker.umami.is/umami-software/umami:mysql-latest ``` diff --git a/components/forms/ChangePasswordForm.js b/components/forms/ChangePasswordForm.js index dcad6f17..8942ecf6 100644 --- a/components/forms/ChangePasswordForm.js +++ b/components/forms/ChangePasswordForm.js @@ -43,7 +43,7 @@ export default function ChangePasswordForm({ values, onSave, onClose }) { const { user } = useUser(); const handleSubmit = async values => { - const { ok, error } = await post(`/accounts/${user.accountUuid}/password`, values); + const { ok, error } = await post(`/users/${user.id}/password`, values); if (ok) { onSave(); diff --git a/components/forms/TrackingCodeForm.js b/components/forms/TrackingCodeForm.js index 52df3bde..5a098b8d 100644 --- a/components/forms/TrackingCodeForm.js +++ b/components/forms/TrackingCodeForm.js @@ -26,7 +26,7 @@ export default function TrackingCodeForm({ values, onClose }) { rows={3} cols={60} spellCheck={false} - defaultValue={``} readOnly diff --git a/components/forms/AccountEditForm.js b/components/forms/UserEditForm.js similarity index 93% rename from components/forms/AccountEditForm.js rename to components/forms/UserEditForm.js index 70125656..0d7e392f 100644 --- a/components/forms/AccountEditForm.js +++ b/components/forms/UserEditForm.js @@ -28,13 +28,13 @@ const validate = ({ id, username, password }) => { return errors; }; -export default function AccountEditForm({ values, onSave, onClose }) { +export default function UserEditForm({ values, onSave, onClose }) { const { post } = useApi(); const [message, setMessage] = useState(); const handleSubmit = async values => { const { id } = values; - const { ok, data } = await post(id ? `/accounts/${id}` : '/accounts', values); + const { ok, data } = await post(id ? `/users/${id}` : '/users', values); if (ok) { onSave(); diff --git a/components/forms/WebsiteEditForm.js b/components/forms/WebsiteEditForm.js index f13d0aa0..491a8bfe 100644 --- a/components/forms/WebsiteEditForm.js +++ b/components/forms/WebsiteEditForm.js @@ -37,7 +37,7 @@ const validate = ({ name, domain }) => { return errors; }; -const OwnerDropDown = ({ user, accounts }) => { +const OwnerDropDown = ({ user, users }) => { const { setFieldValue, values } = useFormikContext(); useEffect(() => { @@ -46,7 +46,7 @@ const OwnerDropDown = ({ user, accounts }) => { } else if (user?.id && values.owner === '') { setFieldValue('owner', user.id.toString()); } - }, [accounts, setFieldValue, user, values]); + }, [users, setFieldValue, user, values]); if (user?.isAdmin) { return ( @@ -56,7 +56,7 @@ const OwnerDropDown = ({ user, accounts }) => {
- {accounts?.map(acc => ( + {users?.map(acc => ( @@ -73,14 +73,14 @@ const OwnerDropDown = ({ user, accounts }) => { export default function WebsiteEditForm({ values, onSave, onClose }) { const { post } = useApi(); - const { data: accounts } = useFetch(`/accounts`); + const { data: users } = useFetch(`/users`); const { user } = useUser(); const [message, setMessage] = useState(); const handleSubmit = async values => { - const { websiteUuid: websiteId } = values; + const { id } = values; - const { ok, data } = await post(websiteId ? `/websites/${websiteId}` : '/websites', values); + const { ok, data } = await post(id ? `/websites/${id}` : '/websites', values); if (ok) { onSave(); @@ -125,7 +125,7 @@ export default function WebsiteEditForm({ values, onSave, onClose }) {
- +