From 538cf7275fe29bb89bae0209ac6d74cb25b9aca1 Mon Sep 17 00:00:00 2001 From: jkoberg Date: Mon, 30 Dec 2024 11:27:28 +0100 Subject: [PATCH] feat(capabilities): notification toggle Signed-off-by: jkoberg --- services/frontend/pkg/config/config.go | 2 ++ services/frontend/pkg/revaconfig/config.go | 3 ++- services/settings/pkg/config/config.go | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/services/frontend/pkg/config/config.go b/services/frontend/pkg/config/config.go index 7eda98ef3..b4e3c721f 100644 --- a/services/frontend/pkg/config/config.go +++ b/services/frontend/pkg/config/config.go @@ -58,6 +58,8 @@ type Config struct { PasswordPolicy PasswordPolicy `yaml:"password_policy"` + ConfigurableNotifications bool `yaml:"configurable_notifications" env:"FRONTEND_CONFIGURABLE_NOTIFICATIONS" desc:"Allow configuring notifications via web client." introductionVersion:"7.1"` + Context context.Context `yaml:"-"` } diff --git a/services/frontend/pkg/revaconfig/config.go b/services/frontend/pkg/revaconfig/config.go index e58a93c25..3cd7ad87a 100644 --- a/services/frontend/pkg/revaconfig/config.go +++ b/services/frontend/pkg/revaconfig/config.go @@ -333,7 +333,8 @@ func FrontendConfigFromStruct(cfg *config.Config, logger log.Logger) (map[string }, "password_policy": passwordPolicyCfg, "notifications": map[string]interface{}{ - "endpoints": []string{"list", "get", "delete"}, + "endpoints": []string{"list", "get", "delete"}, + "configurable": cfg.ConfigurableNotifications, }, }, "version": map[string]interface{}{ diff --git a/services/settings/pkg/config/config.go b/services/settings/pkg/config/config.go index 1efddbba0..a85f8eb16 100644 --- a/services/settings/pkg/config/config.go +++ b/services/settings/pkg/config/config.go @@ -38,7 +38,7 @@ type Config struct { ServiceAccountIDs []string `yaml:"service_account_ids" env:"SETTINGS_SERVICE_ACCOUNT_IDS;OCIS_SERVICE_ACCOUNT_ID" desc:"The list of all service account IDs. These will be assigned the hidden 'service-account' role. Note: When using 'OCIS_SERVICE_ACCOUNT_ID' this will contain only one value while 'SETTINGS_SERVICE_ACCOUNT_IDS' can have multiple. See the 'auth-service' service description for more details about service accounts." introductionVersion:"5.0"` DefaultLanguage string `yaml:"default_language" env:"OCIS_DEFAULT_LANGUAGE" desc:"The default language used by services and the WebUI. If not defined, English will be used as default. See the documentation for more details." introductionVersion:"5.0"` - TranslationPath string `yaml:"translation_path" env:"OCIS_TRANSLATION_PATH;SETTINGS_TRANSLATION_PATH" desc:"(optional) Set this to a path with custom translations to overwrite the builtin translations. Note that file and folder naming rules apply, see the documentation for more details." introductionVersion:"7.0"` + TranslationPath string `yaml:"translation_path" env:"OCIS_TRANSLATION_PATH;SETTINGS_TRANSLATION_PATH" desc:"(optional) Set this to a path with custom translations to overwrite the builtin translations. Note that file and folder naming rules apply, see the documentation for more details." introductionVersion:"7.1"` Context context.Context `yaml:"-"` }