mirror of
https://github.com/Myzel394/kleckrelay-website.git
synced 2025-06-18 23:45:26 +02:00
feat: Add allowAliasDeletion field to admin settings
This commit is contained in:
parent
9a7b868301
commit
28e645abcb
@ -383,6 +383,10 @@
|
||||
"allowStatistics": {
|
||||
"label": "Allow statistics",
|
||||
"description": "If enabled, your instance will collect anonymous statistics and share them. They will only be stored locally on this instance but made public."
|
||||
},
|
||||
"allowAliasDeletion": {
|
||||
"label": "Allow alias deletion",
|
||||
"description": "If enabled, users will be able to delete their aliases."
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -11,4 +11,5 @@ export const DEFAULT_ADMIN_SETTINGS: AdminSettings = {
|
||||
imageProxyStorageLifeTimeInHours: 24,
|
||||
enableImageProxy: true,
|
||||
allowStatistics: true,
|
||||
allowAliasDeletion: false,
|
||||
}
|
||||
|
@ -488,6 +488,35 @@ export default function SettingsForm({settings, queryKey}: SettingsFormProps) {
|
||||
</FormHelperText>
|
||||
</FormGroup>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<FormGroup key="allow_alias_deletion">
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Checkbox
|
||||
checked={formik.values.allowAliasDeletion!}
|
||||
onChange={formik.handleChange}
|
||||
name="allowAliasDeletion"
|
||||
/>
|
||||
}
|
||||
disabled={formik.isSubmitting}
|
||||
label={t(
|
||||
"routes.AdminRoute.forms.settings.allowAliasDeletion.label",
|
||||
)}
|
||||
/>
|
||||
<FormHelperText
|
||||
error={
|
||||
formik.touched.allowAliasDeletion &&
|
||||
Boolean(formik.errors.allowAliasDeletion)
|
||||
}
|
||||
>
|
||||
{(formik.touched.allowAliasDeletion &&
|
||||
formik.errors.allowAliasDeletion) ||
|
||||
t(
|
||||
"routes.AdminRoute.forms.settings.allowAliasDeletion.description",
|
||||
)}
|
||||
</FormHelperText>
|
||||
</FormGroup>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
|
@ -210,4 +210,5 @@ export interface AdminSettings {
|
||||
userEmailEnableDisposableEmails: boolean
|
||||
userEmailEnableOtherRelays: boolean | null
|
||||
allowStatistics: boolean | null
|
||||
allowAliasDeletion: boolean | null
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user