diff --git a/core/src/views/UnifiedSearchModal.vue b/core/src/views/UnifiedSearchModal.vue
index 8d2d282049583..b724b31d28d4e 100644
--- a/core/src/views/UnifiedSearchModal.vue
+++ b/core/src/views/UnifiedSearchModal.vue
@@ -11,79 +11,89 @@
@update:is-open="showDateRangeModal = $event" />
-
{{ t('core', 'Unified search') }}
-
-
-
-
-
-
-
+
@@ -92,8 +102,8 @@
-
-
+
+
{{ providerResult.provider }}
@@ -116,14 +126,6 @@
-
-
- {{ t('core', 'Filter in current view') }}
-
-
-
-
-
@@ -150,6 +152,7 @@ import SearchResult from '../components/UnifiedSearch/SearchResult.vue'
import debounce from 'debounce'
import { emit } from '@nextcloud/event-bus'
+import { useBrowserLocation } from '@vueuse/core'
import { getProviders, search as unifiedSearch, getContacts } from '../services/UnifiedSearchService.js'
export default {
@@ -180,6 +183,15 @@ export default {
required: true,
},
},
+ setup() {
+ /**
+ * Reactive version of window.location
+ */
+ const currentLocation = useBrowserLocation()
+ return {
+ currentLocation,
+ }
+ },
data() {
return {
providers: [],
@@ -206,22 +218,22 @@ export default {
},
computed: {
- userContacts: {
- get() {
- return this.contacts
- },
+ userContacts() {
+ return this.contacts
},
- noContentInfo: {
- get() {
- const isEmptySearch = this.searchQuery.length === 0
- const hasNoResults = this.searchQuery.length > 0 && this.results.length === 0
-
- return {
- show: isEmptySearch || hasNoResults,
- text: this.searching && hasNoResults ? t('core', 'Searching …') : (isEmptySearch ? t('core', 'Start typing to search') : t('core', 'No matching results')),
- icon: MagnifyIcon,
- }
- },
+ noContentInfo() {
+ const isEmptySearch = this.searchQuery.length === 0
+ const hasNoResults = this.searchQuery.length > 0 && this.results.length === 0
+ return {
+ show: isEmptySearch || hasNoResults,
+ text: this.searching && hasNoResults ? t('core', 'Searching …') : (isEmptySearch ? t('core', 'Start typing to search') : t('core', 'No matching results')),
+ icon: MagnifyIcon,
+ }
+ },
+ supportFiltering() {
+ /* Hard coded apps for the moment this would be improved in coming updates. */
+ const providerPaths = ['/settings/users', '/apps/files', '/apps/deck']
+ return providerPaths.some((path) => this.currentLocation.pathname?.includes?.(path))
},
},
watch: {
@@ -523,21 +535,27 @@ export default {
this.internalIsVisible = false
this.searchQuery = ''
},
- supportFiltering() {
- /* Hard coded apps for the moment this would be improved in coming updates. */
- const providerPaths = ['/settings/users', '/apps/files', '/apps/deck']
- const currentPath = window.location.pathname.replace('/index.php', '')
- const containsProvider = providerPaths.some(path => currentPath.includes(path))
- return containsProvider
- },
},
}