From 5fc55ad518d447d1d207bcea5820c364c3fd4636 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Fri, 24 Jul 2020 15:12:46 +0200 Subject: [PATCH 1/3] Hide search bar for built in phoenix config Since file search is not supported in ocis yet, we made a PR to phoenix to hide the searchbar when the respective config option is set to true. As we're using a builtin config, we need to provide that by default. --- pkg/config/config.go | 14 +++++++------- pkg/service/v0/service.go | 6 ++++++ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index 211cb16aa5..1aa518d980 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -38,13 +38,13 @@ type Asset struct { // PhoenixConfig defines the available phoenix configuration for a dynamically rendered config.json. type PhoenixConfig struct { - Server string `json:"server,omitempty"` - Theme string `json:"theme,omitempty"` - Version string `json:"version,omitempty"` // TODO what is version used for? - OpenIDConnect OIDC `json:"openIdConnect,omitempty"` - // TODO add nilasempty when https://go-review.googlesource.com/c/go/+/205897/ is released - Apps []string `json:"apps"` - ExternalApps []ExternalApp `json:"external_apps,omitempty"` + Server string `json:"server,omitempty"` + Theme string `json:"theme,omitempty"` + Version string `json:"version,omitempty"` // TODO what is version used for? + OpenIDConnect OIDC `json:"openIdConnect,omitempty"` + Apps []string `json:"apps"` // TODO add nilasempty when https://go-review.googlesource.com/c/go/+/205897/ is released + ExternalApps []ExternalApp `json:"external_apps,omitempty"` + Options map[string]interface{} `json:"options,omitempty"` } // OIDC defines the available oidc configuration diff --git a/pkg/service/v0/service.go b/pkg/service/v0/service.go index 3139e5fcbd..91a47afdbf 100644 --- a/pkg/service/v0/service.go +++ b/pkg/service/v0/service.go @@ -62,6 +62,12 @@ func (p Phoenix) getPayload() (payload []byte, err error) { if p.config.Phoenix.Path == "" { // render dynamically using config + // provide default ocis-web options + if p.config.Phoenix.Config.Options == nil { + p.config.Phoenix.Config.Options = make(map[string]interface{}, 0) + p.config.Phoenix.Config.Options["hideSearchBar"] = true + } + // make apps render as empty array if it is empty // TODO remove once https://github.com/golang/go/issues/27589 is fixed if len(p.config.Phoenix.Config.Apps) == 0 { From d62c05b4c0dbdee951c670662d3c706987566f22 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Fri, 24 Jul 2020 15:17:48 +0200 Subject: [PATCH 2/3] Add changelog item --- changelog/unreleased/hide-searchbar.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 changelog/unreleased/hide-searchbar.md diff --git a/changelog/unreleased/hide-searchbar.md b/changelog/unreleased/hide-searchbar.md new file mode 100644 index 0000000000..b3d173494e --- /dev/null +++ b/changelog/unreleased/hide-searchbar.md @@ -0,0 +1,6 @@ +Change: hide searchbar by default + +Since file search is not working at the moment we decided to hide the search bar by default. + +https://github.com/owncloud/product/issues/116 +https://github.com/owncloud/ocis-phoenix/pull/74 From 372cf88a4fe5d9c6ff25ed76fe7d75c3105c5fb5 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Fri, 24 Jul 2020 16:04:11 +0200 Subject: [PATCH 3/3] Make linter happy --- pkg/service/v0/service.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/service/v0/service.go b/pkg/service/v0/service.go index 91a47afdbf..5c2e3e5b5e 100644 --- a/pkg/service/v0/service.go +++ b/pkg/service/v0/service.go @@ -64,7 +64,7 @@ func (p Phoenix) getPayload() (payload []byte, err error) { // provide default ocis-web options if p.config.Phoenix.Config.Options == nil { - p.config.Phoenix.Config.Options = make(map[string]interface{}, 0) + p.config.Phoenix.Config.Options = make(map[string]interface{}) p.config.Phoenix.Config.Options["hideSearchBar"] = true }