diff --git a/scripts/langindex.json b/scripts/langindex.json index 2ad44374b..5233adbf0 100644 --- a/scripts/langindex.json +++ b/scripts/langindex.json @@ -685,7 +685,6 @@ "addon.mod_forum.removefromfavourites": "forum", "addon.mod_forum.reply": "forum", "addon.mod_forum.replyplaceholder": "forum", - "addon.mod_forum.searchresults": "course", "addon.mod_forum.subject": "forum", "addon.mod_forum.tagarea_forum_posts": "forum", "addon.mod_forum.thisforumhasduedate": "forum", diff --git a/src/addons/mod/forum/lang.json b/src/addons/mod/forum/lang.json index 42c33b92a..46277f2df 100644 --- a/src/addons/mod/forum/lang.json +++ b/src/addons/mod/forum/lang.json @@ -59,7 +59,6 @@ "removefromfavourites": "Unstar this discussion", "reply": "Reply", "replyplaceholder": "Write your reply...", - "searchresults": "Search results: {{$a}}", "subject": "Subject", "tagarea_forum_posts": "Forum posts", "thisforumhasduedate": "The due date for posting to this forum is {{$a}}.", diff --git a/src/addons/mod/forum/pages/search/search.html b/src/addons/mod/forum/pages/search/search.html index 24274aa3c..c33244429 100644 --- a/src/addons/mod/forum/pages/search/search.html +++ b/src/addons/mod/forum/pages/search/search.html @@ -23,10 +23,6 @@ -
- {{ 'addon.mod_forum.searchresults' | translate: { $a: resultsSource.getTotalResults() } }} -
- diff --git a/src/addons/mod/forum/tests/behat/search.feature b/src/addons/mod/forum/tests/behat/search.feature index f9cde8dc2..b6471d5d3 100644 --- a/src/addons/mod/forum/tests/behat/search.feature +++ b/src/addons/mod/forum/tests/behat/search.feature @@ -46,6 +46,5 @@ Feature: Test Forum Search When I set the field "Search" to "message" in the app And I press "Search" "button" in the app - Then I should find "Search results: 2" in the app - And I should find "Test forum 1" in the app + Then I should find "Test forum 1" in the app And I should find "Test forum 2" in the app diff --git a/src/core/components/mod-icon/mod-icon.scss b/src/core/components/mod-icon/mod-icon.scss index 8a6085ae4..d8a742862 100644 --- a/src/core/components/mod-icon/mod-icon.scss +++ b/src/core/components/mod-icon/mod-icon.scss @@ -27,6 +27,12 @@ } } + &.other { + img { + filter: var(--filter); + } + } + } img { diff --git a/src/core/features/search/components/global-search-result/global-search-result.html b/src/core/features/search/components/global-search-result/global-search-result.html index 46c186d82..dfb49fe48 100644 --- a/src/core/features/search/components/global-search-result/global-search-result.html +++ b/src/core/features/search/components/global-search-result/global-search-result.html @@ -11,7 +11,7 @@ -
+
diff --git a/src/core/features/search/components/global-search-result/global-search-result.scss b/src/core/features/search/components/global-search-result/global-search-result.scss index 566a5a56d..824d1823c 100644 --- a/src/core/features/search/components/global-search-result/global-search-result.scss +++ b/src/core/features/search/components/global-search-result/global-search-result.scss @@ -21,6 +21,7 @@ margin-bottom: 0px; --padding: 0px; background: transparent; + flex-shrink: 0; } ion-icon, .result-icon { @@ -28,6 +29,7 @@ height: var(--core-global-search-result-icon-size); margin-inline-end: var(--spacing-2); + flex-shrink: 0; } } @@ -61,20 +63,33 @@ } - .result-context { + .result-context-wrapper { display: flex; - justify-items: center; - align-items: center; - color: var(--core-global-search-result-context-color); - margin-top: var(--spacing-2); - font-size: 12px; + flex-wrap: wrap; + flex-direction: row; - ion-icon { - margin-inline-end: var(--spacing-1); - } + .result-context { + display: flex; + justify-items: center; + align-items: center; + color: var(--core-global-search-result-context-color); + margin-top: var(--spacing-2); + margin-inline-end: var(--spacing-4); + font-size: 12px; + + ion-icon { + margin-inline-end: var(--spacing-1); + flex-shrink: 0; + } + + core-format-text { + color: var(--core-global-search-result-context-color); + } + + span { + white-space: normal; + } - + .result-context { - margin-inline-start: var(--spacing-4); } } diff --git a/src/core/features/search/services/global-search.ts b/src/core/features/search/services/global-search.ts index b7728e195..33f553ff7 100644 --- a/src/core/features/search/services/global-search.ts +++ b/src/core/features/search/services/global-search.ts @@ -101,7 +101,7 @@ export class CoreSearchGlobalSearchService { ? await CoreSites.getSite(siteId) : CoreSites.getRequiredCurrentSite(); - return !site?.isFeatureDisabled('CoreNoDelegate_GlobalSearch') + return !site?.isFeatureDisabled('NoDelegate_GlobalSearch') && site?.wsAvailable('core_search_get_results') // @since 4.3 && site?.canUseAdvancedFeature('enableglobalsearch'); } diff --git a/src/core/features/search/stories/components/components.module.ts b/src/core/features/search/stories/components/components.module.ts index bfece68ca..1e59da784 100644 --- a/src/core/features/search/stories/components/components.module.ts +++ b/src/core/features/search/stories/components/components.module.ts @@ -20,13 +20,11 @@ import { CommonModule } from '@angular/common'; import { CoreSearchGlobalSearchResultsPageComponent, } from '@features/search/stories/components/global-search-results-page/global-search-results-page'; -import { CoreSearchGlobalSearchResultComponent } from '@features/search/components/global-search-result/global-search-result'; import { CoreSharedModule } from '@/core/shared.module'; @NgModule({ declarations: [ CoreSearchGlobalSearchResultsPageComponent, - CoreSearchGlobalSearchResultComponent, ], imports: [ CoreSharedModule, diff --git a/src/core/features/search/stories/components/global-search-results-page/global-search-results-page.ts b/src/core/features/search/stories/components/global-search-results-page/global-search-results-page.ts index 8e4dd3dd3..6154c5d22 100644 --- a/src/core/features/search/stories/components/global-search-results-page/global-search-results-page.ts +++ b/src/core/features/search/stories/components/global-search-results-page/global-search-results-page.ts @@ -107,6 +107,26 @@ export class CoreSearchGlobalSearchResultsPageComponent { iconurl: 'https://master.mm.moodledemo.net/theme/image.php?theme=boost&component=core&image=i%2Fsection', }, }, + { + id: 8, + url: '', + title: 'This item has long text everywhere, so make sure that it looks good anyways. ' + + 'Even if the screen you\'re using is also big, this should still be a problem because this text is *really* long.', + content: 'You would normally see lorem ipsum here, but we decided to just write some gibberish here to make it more ' + + 'real. We all know that lorem ipsum is fabricated text, and even though it serves its purpose, it isn\'t as ' + + 'engaging as some real, hand-crafted text (not sure why this should be engaging, anyways).', + context: { + courseName: 'And it\'s not just the title, either. Other things like the Course title also take more than ' + + 'you would expect in a normal site (or even not so normal).', + userName: 'To top it off, it has a user name as well! What is this madness? Well, at some point you just have to ' + + 'get creative. Honestly, I\'m surprised if you\'re even reading this. Kudos to you for being thorough.', + }, + module: { + name: 'book', + iconurl: 'assets/img/mod/book.svg', + area: '', + }, + }, ]; /**