enhancement: introduce theme processing (#9133)
* enhancement: introduce theme processing * enhancement: introduce theme processing * enhancement: add theme processing tests and changelog * Update services/web/pkg/config/config.go Co-authored-by: Michael Barz <michael.barz@zeitgestalten.eu> * fix: ci findings * Apply suggestions from code review Co-authored-by: Martin <github@diemattels.at> * enhancement: use the theme assets from web instead of having them inside the oCis repo (license clash Apache vs. AGPLv3) * fix: golangci tagalign order * fix: rename UnifiedRoleUploader to UnifiedRoleEditorLite * fix: some typos Co-authored-by: Michael Barz <michael.barz@zeitgestalten.eu> * enhancement: export supported theme logo upload filetypes * chore: bump reva * fix: allow init func --------- Co-authored-by: Michael Barz <michael.barz@zeitgestalten.eu> Co-authored-by: Martin <github@diemattels.at>
This commit is contained in:
co-authored by
Michael Barz
Martin
parent
80480cb7fa
commit
eb7c36443f
@@ -0,0 +1,35 @@
|
||||
package capabilities
|
||||
|
||||
import (
|
||||
"sync/atomic"
|
||||
|
||||
"github.com/cs3org/reva/v2/pkg/owncloud/ocs"
|
||||
)
|
||||
|
||||
// allow the consuming part to change defaults, e.g., tests
|
||||
var defaultCapabilities atomic.Pointer[ocs.Capabilities]
|
||||
|
||||
func init() { //nolint:gochecknoinits
|
||||
ResetDefault()
|
||||
}
|
||||
|
||||
// ResetDefault resets the default [Capabilities] to the default values.
|
||||
func ResetDefault() {
|
||||
defaultCapabilities.Store(
|
||||
&ocs.Capabilities{
|
||||
Theme: &ocs.CapabilitiesTheme{
|
||||
Logo: &ocs.CapabilitiesThemeLogo{
|
||||
PermittedFileTypes: map[string]string{
|
||||
".jpg": "image/jpeg",
|
||||
".jpeg": "image/jpeg",
|
||||
".png": "image/png",
|
||||
".gif": "image/gif",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
// Default returns the default [Capabilities].
|
||||
func Default() *ocs.Capabilities { return defaultCapabilities.Load() }
|
||||
Reference in New Issue
Block a user