mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-05-03 17:29:22 -05:00
Merge pull request #7930 from owncloud/adjust-web-theme
[full-ci] fix: updating logo with new theme structure
This commit is contained in:
+1
-1
@@ -1,3 +1,3 @@
|
||||
# The test runner source for UI tests
|
||||
WEB_COMMITID=f0a937705e51cef0393af3b070730d6f347a41e5
|
||||
WEB_COMMITID=f3b6c0699537483a1497c69c2493b271f45def9d
|
||||
WEB_BRANCH=master
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
Bugfix: Updating logo with new theme structure
|
||||
|
||||
Updating and resetting the logo when using the new `theme.json` structure in Web has been fixed.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/7930
|
||||
@@ -0,0 +1,13 @@
|
||||
Enhancement: Update web to v8.0.0-beta.1
|
||||
|
||||
Tags: web
|
||||
|
||||
We updated ownCloud Web to v8.0.0-beta.1. Please refer to the changelog (linked) for details on the web release.
|
||||
|
||||
## Summary
|
||||
* Change [owncloud/web#9698](https://github.com/owncloud/web/pull/9698): Theme handling
|
||||
* Enhancement [owncloud/web#10111](https://github.com/owncloud/web/pull/10111): Registering right sidebar panels as extension
|
||||
* Enhancement [owncloud/web#10111](https://github.com/owncloud/web/pull/10111): File sidebar in viewer and editor apps
|
||||
|
||||
https://github.com/owncloud/ocis/pull/7930
|
||||
https://github.com/owncloud/web/releases/tag/v8.0.0-beta.1
|
||||
@@ -1,6 +1,6 @@
|
||||
SHELL := bash
|
||||
NAME := web
|
||||
WEB_ASSETS_VERSION = v8.0.0-alpha.13
|
||||
WEB_ASSETS_VERSION = v8.0.0-beta.1
|
||||
|
||||
include ../../.make/recursion.mk
|
||||
|
||||
|
||||
@@ -145,17 +145,12 @@ func (p Web) getLogoPath(r io.Reader) (string, error) {
|
||||
var m map[string]interface{}
|
||||
_ = json.NewDecoder(r).Decode(&m)
|
||||
|
||||
webCfg, ok := m["web"].(map[string]interface{})
|
||||
webCfg, ok := m["clients"].(map[string]interface{})["web"].(map[string]interface{})
|
||||
if !ok {
|
||||
return "", errInvalidThemeConfig
|
||||
}
|
||||
|
||||
defaultCfg, ok := webCfg["default"].(map[string]interface{})
|
||||
if !ok {
|
||||
return "", errInvalidThemeConfig
|
||||
}
|
||||
|
||||
logoCfg, ok := defaultCfg["logo"].(map[string]interface{})
|
||||
logoCfg, ok := webCfg["defaults"].(map[string]interface{})["logo"].(map[string]interface{})
|
||||
if !ok {
|
||||
return "", errInvalidThemeConfig
|
||||
}
|
||||
@@ -186,27 +181,19 @@ func (p Web) updateLogoThemeConfig(logoPath string) error {
|
||||
}
|
||||
commonCfg["logo"] = logoPath
|
||||
|
||||
webCfg, ok := m["web"].(map[string]interface{})
|
||||
webCfg, ok := m["clients"].(map[string]interface{})["web"].(map[string]interface{})
|
||||
if !ok {
|
||||
return errInvalidThemeConfig
|
||||
}
|
||||
|
||||
// iterate over all possible themes and replace logo
|
||||
for theme := range webCfg {
|
||||
themeCfg, ok := webCfg[theme].(map[string]interface{})
|
||||
if !ok {
|
||||
return errInvalidThemeConfig
|
||||
}
|
||||
|
||||
logoCfg, ok := themeCfg["logo"].(map[string]interface{})
|
||||
if !ok {
|
||||
return errInvalidThemeConfig
|
||||
}
|
||||
|
||||
logoCfg["login"] = logoPath
|
||||
logoCfg["topbar"] = logoPath
|
||||
logoCfg, ok := webCfg["defaults"].(map[string]interface{})["logo"].(map[string]interface{})
|
||||
if !ok {
|
||||
return errInvalidThemeConfig
|
||||
}
|
||||
|
||||
logoCfg["login"] = logoPath
|
||||
logoCfg["topbar"] = logoPath
|
||||
|
||||
dst, err := p.fs.Create(_themesConfigPath)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user