[CST-5249] fix suggestion refresh after ignore

This commit is contained in:
FrancescoMolinaro
2024-02-13 12:37:29 +01:00
parent 5b7ca7cfa5
commit 8dc7eeb242
4 changed files with 7 additions and 5 deletions

View File

@@ -155,7 +155,7 @@ describe('SuggestionDataService test', () => {
searchParams: [new RequestParam('target', testUserId), new RequestParam('source', testSource)] searchParams: [new RequestParam('target', testUserId), new RequestParam('source', testSource)]
}; };
service.getSuggestionsByTargetAndSource(testUserId, testSource); service.getSuggestionsByTargetAndSource(testUserId, testSource);
expect(suggestionsDataService.searchBy).toHaveBeenCalledWith('findByTargetAndSource', options, true, true); expect(suggestionsDataService.searchBy).toHaveBeenCalledWith('findByTargetAndSource', options, false, true);
}); });
it('should call suggestionsDataService.delete', () => { it('should call suggestionsDataService.delete', () => {

View File

@@ -217,7 +217,7 @@ export class SuggestionsDataService {
new RequestParam('source', source) new RequestParam('source', source)
]; ];
return this.suggestionsDataService.searchBy(this.searchFindByTargetAndSourceMethod, options, true, true, ...linksToFollow); return this.suggestionsDataService.searchBy(this.searchFindByTargetAndSourceMethod, options, false, true, ...linksToFollow);
} }
/** /**

View File

@@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Data, Router } from '@angular/router'; import { ActivatedRoute, Data, Router } from '@angular/router';
import { BehaviorSubject, combineLatest, Observable } from 'rxjs'; import { BehaviorSubject, combineLatest, Observable } from 'rxjs';
import { distinctUntilChanged, map, switchMap, take } from 'rxjs/operators'; import { delay, distinctUntilChanged, map, switchMap, take } from 'rxjs/operators';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { SortDirection, SortOptions, } from '../core/cache/models/sort-options.model'; import { SortDirection, SortOptions, } from '../core/cache/models/sort-options.model';
@@ -155,7 +155,9 @@ export class SuggestionsPageComponent implements OnInit {
* @suggestionId * @suggestionId
*/ */
ignoreSuggestion(suggestionId) { ignoreSuggestion(suggestionId) {
this.suggestionService.ignoreSuggestion(suggestionId).subscribe(() => { this.suggestionService.ignoreSuggestion(suggestionId).pipe(
delay(100)
).subscribe(() => {
this.suggestionTargetsStateService.dispatchRefreshUserSuggestionsAction(); this.suggestionTargetsStateService.dispatchRefreshUserSuggestionsAction();
this.updatePage(); this.updatePage();
}); });

View File

@@ -3120,7 +3120,7 @@
"mydspace.import": "Import", "mydspace.import": "Import",
"notification.suggestion": "We found <b>{{count}} publications</b><br> in the {{source}} that seems to be related to your profile.<br> Please <a href='{{ url }}'>review the suggestions</a>", "notification.suggestion": "We found <b>{{count}} publications</b> in the {{source}} that seems to be related to your profile.<br> Please <a href='{{ url }}'>review the suggestions</a>",
"nav.browse.header": "All of DSpace", "nav.browse.header": "All of DSpace",