Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide search bar #3817

Merged
merged 4 commits into from
Jul 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelog/unreleased/hide-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Change: Provide option for hiding the search bar

We introduced a new `options.hideSearchBar` config variable which can be used to disable the search bar entirely.

https://github.com/owncloud/product/issues/116
https://github.com/owncloud/phoenix/pull/3817
3 changes: 3 additions & 0 deletions config.json.sample-ocis
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
"response_type": "code",
"scope": "openid profile email"
},
"options": {
"hideSearchBar": true
},
"apps": [
"files",
"draw-io",
Expand Down
1 change: 1 addition & 0 deletions docs/backend-ocis.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ geekdocFilePath: backend-ocis.md
## Setting up Phoenix

- Please note that config.json is generated by ocis-phoenix so there is no need to create one.
- If you want to provide a config.json file, you can do so by starting ocis with `PHOENIX_WEB_CONFIG=/path/to/config.json`

## Setting up ocis-phoenix service

Expand Down
8 changes: 6 additions & 2 deletions src/components/Top-Bar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<oc-icon name="menu" class="uk-flex" aria-hidden="true" />
</oc-button>
</div>
<search-bar />
<search-bar v-if="!isSearchDisabled" />
</oc-grid>
<oc-grid
v-if="!isPublicPage"
Expand Down Expand Up @@ -73,7 +73,7 @@ export default {
}
},
computed: {
...mapGetters(['apps']),
...mapGetters(['apps', 'configuration']),

isPublicPage() {
return !this.userId
Expand All @@ -84,6 +84,10 @@ export default {
return this.$gettext(this.apps[this.currentExtension].name)
}
return this.currentExtension
},

isSearchDisabled() {
return this.configuration.options.hideSearchBar === true
}
},
methods: {
Expand Down
11 changes: 10 additions & 1 deletion src/store/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ const state = {
filesList: {
hideDefaultStatusIndicators: false
}
},
options: {
hideSearchBar: false
}
}

Expand All @@ -51,7 +54,13 @@ const mutations = {
state.uploadChunkSize = config.uploadChunkSize === undefined ? Infinity : config.uploadChunkSize
state.state = config.state === undefined ? 'working' : config.state
state.applications = config.applications === undefined ? [] : config.applications
if (config.corrupted) state.corrupted = config.corrupted
if (config.options !== undefined) {
// Merge default options and provided options. Config options take precedence over defaults.
state.options = { ...state.options, ...config.options }
}
if (config.corrupted) {
state.corrupted = config.corrupted
}
},
LOAD_THEME(state, theme) {
state.theme = theme
Expand Down