Skip to content

Commit 5a4cc8c

Browse files
committed
Global search : Fix basic functional issues
- Fixes remove person filter/chip when applied - Close person searchable filter via workaround - Person filter has no effect fixed, now uses user property instead of id - Left align filters - Reduce avatar size in user chip and make photo non-clickable Resolves : #41381 Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
1 parent 5c04112 commit 5a4cc8c

File tree

3 files changed

+24
-17
lines changed

3 files changed

+24
-17
lines changed

core/src/components/GlobalSearch/SearchFilterChip.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export default {
5252
width: 20px;
5353
padding: 2px;
5454
border-radius: 20px;
55+
filter: var(--background-invert-if-bright);
5556
}
5657
}
5758
@@ -63,8 +64,7 @@ export default {
6364
cursor: pointer;
6465
6566
:hover {
66-
border-radius: 4px;
67-
padding: 1px;
67+
filter: invert(20%);
6868
}
6969
}
7070
}

core/src/components/GlobalSearch/SearchableList.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
@show="opened = true"
2626
@hide="opened = false">
2727
<template #trigger>
28-
<slot name="trigger" />
28+
<slot ref="popoverTrigger" name="trigger" />
2929
</template>
3030
<div class="searchable-list__wrapper">
3131
<NcTextField :value.sync="searchTerm"

core/src/views/GlobalSearchModal.vue

+21-14
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,16 @@
7575
<template #icon>
7676
<NcAvatar v-if="filter.type === 'person'"
7777
:user="filter.user"
78+
:size="24"
79+
:disable-menu="true"
7880
:show-user-status="false"
7981
:hide-favorite="false" />
8082
<CalendarRangeIcon v-else-if="filter.type === 'date'" />
8183
<img v-else :src="filter.icon" alt="">
8284
</template>
8385
</FilterChip>
8486
</div>
85-
<div v-if="searchQuery.length === 0">
87+
<div v-if="searchQuery.length === 0" class="global-search-modal__no-search">
8688
<NcEmptyContent :name="t('core', 'Start typing in search')">
8789
<template #icon>
8890
<MagnifyIcon />
@@ -257,7 +259,7 @@ export default {
257259
258260
if (filters.personFilterIsApplied) {
259261
if (provider.filters.person) {
260-
params.person = this.personFilter.id
262+
params.person = this.personFilter.user
261263
} else {
262264
// Person filter is applied but provider does not support it, no need to search provider
263265
return
@@ -378,7 +380,7 @@ export default {
378380
this.providerActionMenuIsOpen = false
379381
const existingFilter = this.filteredProviders.find(existing => existing.id === providerFilter.id)
380382
if (!existingFilter) {
381-
this.filteredProviders.push({ id: providerFilter.id, name: providerFilter.name, icon: providerFilter.icon, type: 'provider' })
383+
this.filteredProviders.push({ id: providerFilter.id, name: providerFilter.name, icon: providerFilter.icon, type: 'provider', filters: providerFilter.filters })
382384
}
383385
this.filters = this.syncProviderFilters(this.filters, this.filteredProviders)
384386
console.debug('Search filters (newly added)', this.filters)
@@ -397,9 +399,13 @@ export default {
397399
398400
} else {
399401
for (let i = 0; i < this.filters.length; i++) {
400-
if (this.filters[i].id === 'date') {
402+
// Remove date and person filter
403+
if (this.filters[i].id === 'date' || this.filters[i].id === filter.id) {
401404
this.dateFilterIsApplied = false
402405
this.filters.splice(i, 1)
406+
if (filter.type === 'person') {
407+
this.personFilterIsApplied = false
408+
}
403409
break
404410
}
405411
}
@@ -520,27 +526,28 @@ $margin: 10px;
520526
521527
&__filters {
522528
display: flex;
523-
padding-top: 5px;
524-
justify-content: space-between;
525-
526-
>*:not(:last-child) {
527-
// flex: 1;
528-
margin-right: 0.5m;
529-
}
529+
padding-top: 4px;
530+
justify-content: left;
530531
531532
>* {
532-
button {
533-
min-width: 160px;
534-
}
533+
margin-right: 4px;
534+
535535
}
536536
537537
}
538538
539539
&__filters-applied {
540+
padding-top: 4px;
540541
display: flex;
541542
flex-wrap: wrap;
542543
}
543544
545+
&__no-search {
546+
display: flex;
547+
align-items: center;
548+
height: 100%;
549+
}
550+
544551
&__results {
545552
padding: 10px;
546553

0 commit comments

Comments
 (0)