From 7d7d29ab5f7f89b3d1b189028ff8d2843df1e39e Mon Sep 17 00:00:00 2001 From: riggraz Date: Mon, 27 Jan 2025 12:57:44 +0100 Subject: [PATCH] Add allow_attachment_upload flag to tenant_settings --- .../SiteSettings/General/GeneralSiteSettingsP.tsx | 15 ++++++++++++++- app/javascript/containers/GeneralSiteSettings.tsx | 2 ++ app/javascript/interfaces/ITenantSetting.ts | 1 + app/policies/tenant_setting_policy.rb | 1 + app/views/site_settings/general.html.erb | 1 + config/locales/backend/backend.en.yml | 1 + config/locales/en.yml | 1 + ..._allow_attachment_upload_to_tenant_settings.rb | 5 +++++ db/schema.rb | 3 ++- 9 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20250127115010_add_allow_attachment_upload_to_tenant_settings.rb diff --git a/app/javascript/components/SiteSettings/General/GeneralSiteSettingsP.tsx b/app/javascript/components/SiteSettings/General/GeneralSiteSettingsP.tsx index 169d92b9..4dc33704 100644 --- a/app/javascript/components/SiteSettings/General/GeneralSiteSettingsP.tsx +++ b/app/javascript/components/SiteSettings/General/GeneralSiteSettingsP.tsx @@ -39,6 +39,7 @@ export interface ISiteSettingsGeneralForm { isPrivate: boolean; allowAnonymousFeedback: boolean; feedbackApprovalPolicy: string; + allowAttachmentUpload: boolean; logoLinksTo: string; logoCustomUrl?: string; showRoadmapInHeader: boolean; @@ -75,6 +76,7 @@ interface Props { isPrivate: boolean, allowAnonymousFeedback: boolean, feedbackApprovalPolicy: string, + allowAttachmentUpload: boolean, logoLinksTo: string, logoCustomUrl: string, showRoadmapInHeader: boolean, @@ -105,7 +107,6 @@ const GeneralSiteSettingsP = ({ formState: { isDirty, isSubmitSuccessful, errors }, watch, control, - getValues, } = useForm({ defaultValues: { siteName: originForm.siteName, @@ -122,6 +123,7 @@ const GeneralSiteSettingsP = ({ isPrivate: originForm.isPrivate, allowAnonymousFeedback: originForm.allowAnonymousFeedback, feedbackApprovalPolicy: originForm.feedbackApprovalPolicy, + allowAttachmentUpload: originForm.allowAttachmentUpload, logoLinksTo: originForm.logoLinksTo, logoCustomUrl: originForm.logoCustomUrl, showRoadmapInHeader: originForm.showRoadmapInHeader, @@ -149,6 +151,7 @@ const GeneralSiteSettingsP = ({ data.isPrivate, data.allowAnonymousFeedback, data.feedbackApprovalPolicy, + data.allowAttachmentUpload, data.logoLinksTo, data.logoCustomUrl, data.showRoadmapInHeader, @@ -524,6 +527,16 @@ const GeneralSiteSettingsP = ({ { I18n.t('site_settings.general.feedback_approval_policy_help') } + +
+
+ + + + { I18n.t('site_settings.general.allow_attachment_upload_help') } + +
+