mirror of
https://github.com/umami-software/umami.git
synced 2025-12-08 05:12:36 +01:00
Enable public website sharing.
This commit is contained in:
parent
48a524e09c
commit
560f1316c1
36 changed files with 294 additions and 61 deletions
|
|
@ -8,10 +8,12 @@ import FormLayout, {
|
|||
FormMessage,
|
||||
FormRow,
|
||||
} from 'components/layout/FormLayout';
|
||||
import Checkbox from '../common/Checkbox';
|
||||
|
||||
const initialValues = {
|
||||
name: '',
|
||||
domain: '',
|
||||
public: false,
|
||||
};
|
||||
|
||||
const validate = ({ name, domain }) => {
|
||||
|
|
@ -43,7 +45,7 @@ export default function WebsiteEditForm({ values, onSave, onClose }) {
|
|||
return (
|
||||
<FormLayout>
|
||||
<Formik
|
||||
initialValues={{ ...initialValues, ...values }}
|
||||
initialValues={{ ...initialValues, ...values, make_public: !!values?.share_id }}
|
||||
validate={validate}
|
||||
onSubmit={handleSubmit}
|
||||
>
|
||||
|
|
@ -59,6 +61,12 @@ export default function WebsiteEditForm({ values, onSave, onClose }) {
|
|||
<Field name="domain" type="text" />
|
||||
<FormError name="domain" />
|
||||
</FormRow>
|
||||
<FormRow>
|
||||
<label></label>
|
||||
<Field name="make_public">
|
||||
{({ field }) => <Checkbox {...field} label="Make public" />}
|
||||
</Field>
|
||||
</FormRow>
|
||||
<FormButtons>
|
||||
<Button type="submit" variant="action">
|
||||
Save
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue