Skip to content

Commit

Permalink
Merge pull request #2255 from nextcloud/bugfix/noid/unified-search-fi…
Browse files Browse the repository at this point in the history
…ltering

Use unified search events to apply on board filtering
  • Loading branch information
juliushaertl authored Oct 2, 2020
2 parents be7357d + 012e5b8 commit 4c2346c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
26 changes: 13 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@nextcloud/auth": "^1.3.0",
"@nextcloud/axios": "^1.4.0",
"@nextcloud/dialogs": "^2.0.1",
"@nextcloud/event-bus": "^1.2.0",
"@nextcloud/files": "^1.1.0",
"@nextcloud/initial-state": "^1.1.2",
"@nextcloud/l10n": "^1.4.1",
Expand Down
10 changes: 10 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { sync } from 'vuex-router-sync'
import { translate, translatePlural } from '@nextcloud/l10n'
import { generateFilePath } from '@nextcloud/router'
import { showError } from '@nextcloud/dialogs'
import { subscribe } from '@nextcloud/event-bus'
import { Tooltip } from '@nextcloud/vue'
import ClickOutside from 'vue-click-outside'
import './models'
Expand Down Expand Up @@ -74,8 +75,17 @@ new Vue({
}
},
created() {
subscribe('nextcloud:unified-search.search', ({ query }) => {
this.$store.commit('setSearchQuery', query)
})
subscribe('nextcloud:unified-search.reset', () => {
this.$store.commit('setSearchQuery', '')
})

// FIXME remove this once Nextcloud 20 is minimum required version
// eslint-disable-next-line
new OCA.Search(this.filter, this.cleanSearch)

this.interval = setInterval(() => {
this.time = Date.now()
}, 1000)
Expand Down

0 comments on commit 4c2346c

Please sign in to comment.