Skip to content

Commit 59b5f27

Browse files
committed
Use unified search events to apply on board filtering
Signed-off-by: Julius Härtl <jus@bitgrid.net>
1 parent f08e792 commit 59b5f27

3 files changed

Lines changed: 24 additions & 13 deletions

File tree

package-lock.json

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"@nextcloud/auth": "^1.3.0",
3535
"@nextcloud/axios": "^1.3.3",
3636
"@nextcloud/dialogs": "^2.0.1",
37+
"@nextcloud/event-bus": "^1.2.0",
3738
"@nextcloud/files": "^1.1.0",
3839
"@nextcloud/initial-state": "^1.1.2",
3940
"@nextcloud/l10n": "^1.3.0",

src/main.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { sync } from 'vuex-router-sync'
2727
import { translate, translatePlural } from '@nextcloud/l10n'
2828
import { generateFilePath } from '@nextcloud/router'
2929
import { showError } from '@nextcloud/dialogs'
30+
import { subscribe } from '@nextcloud/event-bus'
3031
import { Tooltip } from '@nextcloud/vue'
3132
import ClickOutside from 'vue-click-outside'
3233
import './models'
@@ -74,8 +75,17 @@ new Vue({
7475
}
7576
},
7677
created() {
78+
subscribe('nextcloud:unified-search:search', ({ query }) => {
79+
this.$store.commit('setSearchQuery', query)
80+
})
81+
subscribe('nextcloud:unified-search:close', () => {
82+
this.$store.commit('setSearchQuery', '')
83+
})
84+
85+
// FIXME remove this once Nextcloud 20 is minimum required version
7786
// eslint-disable-next-line
7887
new OCA.Search(this.filter, this.cleanSearch)
88+
7989
this.interval = setInterval(() => {
8090
this.time = Date.now()
8191
}, 1000)

0 commit comments

Comments
 (0)