From 973849e0e0d8376e9002fc2f013bf1afd9dba76c Mon Sep 17 00:00:00 2001 From: Jannik Stehle Date: Mon, 11 Dec 2023 13:37:55 +0100 Subject: [PATCH 1/2] fix: updating logo with new theme structure Fixes updating and resetting the logo when using the new `theme.json` structure in Web. --- .../fix-updating-logo-new-theme-structure.md | 5 +++ services/web/pkg/service/v0/branding.go | 31 ++++++------------- 2 files changed, 14 insertions(+), 22 deletions(-) create mode 100644 changelog/unreleased/fix-updating-logo-new-theme-structure.md diff --git a/changelog/unreleased/fix-updating-logo-new-theme-structure.md b/changelog/unreleased/fix-updating-logo-new-theme-structure.md new file mode 100644 index 000000000..884d8918b --- /dev/null +++ b/changelog/unreleased/fix-updating-logo-new-theme-structure.md @@ -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 diff --git a/services/web/pkg/service/v0/branding.go b/services/web/pkg/service/v0/branding.go index 4eae62732..7afaf46e0 100644 --- a/services/web/pkg/service/v0/branding.go +++ b/services/web/pkg/service/v0/branding.go @@ -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 From b6ce5e44b436acf18ffe171d670c69def45ca8f3 Mon Sep 17 00:00:00 2001 From: Jannik Stehle Date: Tue, 12 Dec 2023 12:59:37 +0100 Subject: [PATCH 2/2] chore: bump web to v8.0.0-beta.1 --- .drone.env | 2 +- changelog/unreleased/update-web-8.0.0.md | 13 +++++++++++++ services/web/Makefile | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 changelog/unreleased/update-web-8.0.0.md diff --git a/.drone.env b/.drone.env index 4480809b7..1a38e64d1 100644 --- a/.drone.env +++ b/.drone.env @@ -1,3 +1,3 @@ # The test runner source for UI tests -WEB_COMMITID=f0a937705e51cef0393af3b070730d6f347a41e5 +WEB_COMMITID=f3b6c0699537483a1497c69c2493b271f45def9d WEB_BRANCH=master diff --git a/changelog/unreleased/update-web-8.0.0.md b/changelog/unreleased/update-web-8.0.0.md new file mode 100644 index 000000000..3bd8ba879 --- /dev/null +++ b/changelog/unreleased/update-web-8.0.0.md @@ -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 diff --git a/services/web/Makefile b/services/web/Makefile index 792f17060..90e8e26ab 100644 --- a/services/web/Makefile +++ b/services/web/Makefile @@ -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