aboutsummaryrefslogtreecommitdiffstats
path: root/core/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/components')
-rw-r--r--core/src/components/AppMenuIcon.vue15
-rw-r--r--core/src/components/UnifiedSearch/UnifiedSearchModal.vue17
2 files changed, 13 insertions, 19 deletions
diff --git a/core/src/components/AppMenuIcon.vue b/core/src/components/AppMenuIcon.vue
index 228e00eb746..1b0d48daf8c 100644
--- a/core/src/components/AppMenuIcon.vue
+++ b/core/src/components/AppMenuIcon.vue
@@ -14,24 +14,25 @@
</template>
<script setup lang="ts">
-import type { INavigationEntry } from '../types/navigation'
+import type { INavigationEntry } from '../types/navigation.ts'
+
import { n } from '@nextcloud/l10n'
import { computed } from 'vue'
-
import IconDot from 'vue-material-design-icons/CircleOutline.vue'
const props = defineProps<{
app: INavigationEntry
}>()
-const ariaHidden = computed(() => String(props.app.unread > 0))
+// only hide if there are no unread notifications
+const ariaHidden = computed(() => !props.app.unread ? 'true' : undefined)
const ariaLabel = computed(() => {
- if (ariaHidden.value === 'true') {
- return ''
+ if (!props.app.unread) {
+ return undefined
}
- return props.app.name
- + (props.app.unread > 0 ? ` (${n('core', '{count} notification', '{count} notifications', props.app.unread, { count: props.app.unread })})` : '')
+
+ return `${props.app.name} (${n('core', '{count} notification', '{count} notifications', props.app.unread, { count: props.app.unread })})`
})
</script>
diff --git a/core/src/components/UnifiedSearch/UnifiedSearchModal.vue b/core/src/components/UnifiedSearch/UnifiedSearchModal.vue
index 002606f058b..b21c65301c4 100644
--- a/core/src/components/UnifiedSearch/UnifiedSearchModal.vue
+++ b/core/src/components/UnifiedSearch/UnifiedSearchModal.vue
@@ -129,7 +129,7 @@
v-bind="result" />
</ul>
<div class="result-footer">
- <NcButton type="tertiary-no-background" @click="loadMoreResultsForProvider(providerResult)">
+ <NcButton v-if="providerResult.results.length === providerResult.limit" type="tertiary-no-background" @click="loadMoreResultsForProvider(providerResult)">
{{ t('core', 'Load more results') }}
<template #icon>
<IconDotsHorizontal :size="20" />
@@ -367,7 +367,7 @@ export default defineComponent({
this.$refs.searchInput?.focus()
})
},
- find(query: string) {
+ find(query: string, providersToSearchOverride = null) {
if (query.length === 0) {
this.results = []
this.searching = false
@@ -382,7 +382,7 @@ export default defineComponent({
this.searching = true
const newResults = []
- const providersToSearch = this.filteredProviders.length > 0 ? this.filteredProviders : this.providers
+ const providersToSearch = providersToSearchOverride || (this.filteredProviders.length > 0 ? this.filteredProviders : this.providers)
const searchProvider = (provider) => {
const params = {
type: provider.searchFrom ?? provider.id,
@@ -424,6 +424,7 @@ export default defineComponent({
newResults.push({
...provider,
results: response.data.ocs.data.entries,
+ limit: params.limit ?? 5,
})
unifiedSearchLogger.debug('Unified search results:', { results: this.results, newResults })
@@ -513,15 +514,7 @@ export default defineComponent({
},
async loadMoreResultsForProvider(provider) {
this.providerResultLimit += 5
- // Remove all other providers from filteredProviders except the current "loadmore" provider
- this.filteredProviders = this.filteredProviders.filter(filteredProvider => filteredProvider.id === provider.id)
- // Plugin filters may have extra parameters, so we need to keep them
- // See method handlePluginFilter for more details
- if (this.filteredProviders.length > 0 && this.filteredProviders[0].isPluginFilter) {
- provider = this.filteredProviders[0]
- }
- this.addProviderFilter(provider, true)
- this.find(this.searchQuery)
+ this.find(this.searchQuery, [provider])
},
addProviderFilter(providerFilter, loadMoreResultsForProvider = false) {
unifiedSearchLogger.debug('Applying provider filter', { providerFilter, loadMoreResultsForProvider })