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 " >
86- <NcEmptyContent :name =" t('core', 'Start typing in search') " >
87+ <div v-if =" noContentInfo.show " class = " global-search-modal__no-content " >
88+ <NcEmptyContent :name =" noContentInfo.text " >
8789 <template #icon >
88- <MagnifyIcon />
90+ <component :is = " noContentInfo.icon " />
8991 </template >
9092 </NcEmptyContent >
9193 </div >
122124 </ul >
123125 <div class =" result-footer" >
124126 <NcButton type =" tertiary-no-background" @click =" loadMoreResultsForProvider(providerResult.id)" >
125- Load more results
127+ {{ t('core', ' Load more results') }}
126128 <template #icon >
127129 <DotsHorizontalIcon :size =" 20" />
128130 </template >
129131 </NcButton >
130- <NcButton alignment =" end-reverse" type =" tertiary-no-background" >
131- Search in {{ providerResult.provider }}
132+ <NcButton v-if = " providerResult.inAppSearch " alignment =" end-reverse" type =" tertiary-no-background" >
133+ {{ t('core', ' Search in') }} {{ providerResult.provider }}
132134 <template #icon >
133135 <ArrowRight :size =" 20" />
134136 </template >
@@ -147,6 +149,7 @@ import CalendarRangeIcon from 'vue-material-design-icons/CalendarRange.vue'
147149import CustomDateRangeModal from ' ../components/GlobalSearch/CustomDateRangeModal.vue'
148150import DotsHorizontalIcon from ' vue-material-design-icons/DotsHorizontal.vue'
149151import FilterChip from ' ../components/GlobalSearch/SearchFilterChip.vue'
152+ import FlaskEmpty from ' vue-material-design-icons/FlaskEmpty.vue'
150153import ListBox from ' vue-material-design-icons/ListBox.vue'
151154import NcActions from ' @nextcloud/vue/dist/Components/NcActions.js'
152155import NcActionButton from ' @nextcloud/vue/dist/Components/NcActionButton.js'
@@ -171,6 +174,7 @@ export default {
171174 CustomDateRangeModal,
172175 DotsHorizontalIcon,
173176 FilterChip,
177+ FlaskEmpty,
174178 ListBox,
175179 NcActions,
176180 NcActionButton,
@@ -216,9 +220,19 @@ export default {
216220 get () {
217221 return this .contacts
218222 },
219-
220223 },
224+ noContentInfo: {
225+ get () {
226+ const isEmptySearch = this .searchQuery .length === 0
227+ const hasNoResults = this .searchQuery .length > 0 && this .results .length === 0
221228
229+ return {
230+ show: isEmptySearch || hasNoResults,
231+ text: isEmptySearch ? t (' core' , ' Start typing in search' ) : t (' core' , ' No matching results' ),
232+ icon: isEmptySearch ? MagnifyIcon : FlaskEmpty,
233+ }
234+ },
235+ },
222236 },
223237 mounted () {
224238 getProviders ().then ((providers ) => {
@@ -257,7 +271,7 @@ export default {
257271
258272 if (filters .personFilterIsApplied ) {
259273 if (provider .filters .person ) {
260- params .person = this .personFilter .id
274+ params .person = this .personFilter .user
261275 } else {
262276 // Person filter is applied but provider does not support it, no need to search provider
263277 return
@@ -274,6 +288,7 @@ export default {
274288 newResults .push ({
275289 id: provider .id ,
276290 provider: provider .name ,
291+ inAppSearch: provider .inAppSearch ,
277292 results: response .data .ocs .data .entries ,
278293 })
279294
@@ -378,7 +393,7 @@ export default {
378393 this .providerActionMenuIsOpen = false
379394 const existingFilter = this .filteredProviders .find (existing => existing .id === providerFilter .id )
380395 if (! existingFilter) {
381- this .filteredProviders .push ({ id: providerFilter .id , name: providerFilter .name , icon: providerFilter .icon , type: ' provider' })
396+ this .filteredProviders .push ({ id: providerFilter .id , name: providerFilter .name , icon: providerFilter .icon , type: ' provider' , filters : providerFilter . filters })
382397 }
383398 this .filters = this .syncProviderFilters (this .filters , this .filteredProviders )
384399 console .debug (' Search filters (newly added)' , this .filters )
@@ -397,9 +412,13 @@ export default {
397412
398413 } else {
399414 for (let i = 0 ; i < this .filters .length ; i++ ) {
400- if (this .filters [i].id === ' date' ) {
415+ // Remove date and person filter
416+ if (this .filters [i].id === ' date' || this .filters [i].id === filter .id ) {
401417 this .dateFilterIsApplied = false
402418 this .filters .splice (i, 1 )
419+ if (filter .type === ' person' ) {
420+ this .personFilterIsApplied = false
421+ }
403422 break
404423 }
405424 }
@@ -520,27 +539,28 @@ $margin: 10px;
520539
521540 & __filters {
522541 display : flex ;
523- padding-top : 5px ;
524- justify-content : space-between ;
525-
526- >* :not (:last-child ) {
527- // flex: 1;
528- margin-right : 0.5 m;
529- }
542+ padding-top : 4px ;
543+ justify-content : left ;
530544
531545 >* {
532- button {
533- min-width : 160px ;
534- }
546+ margin-right : 4px ;
547+
535548 }
536549
537550 }
538551
539552 & __filters-applied {
553+ padding-top : 4px ;
540554 display : flex ;
541555 flex-wrap : wrap ;
542556 }
543557
558+ & __no-content {
559+ display : flex ;
560+ align-items : center ;
561+ height : 100% ;
562+ }
563+
544564 & __results {
545565 padding : 10px ;
546566
0 commit comments