Skip to content

Commit

Permalink
Merge branch 'added-recently-added-section-to-community-page_contribu…
Browse files Browse the repository at this point in the history
…te-7.6' into added-recently-added-section-to-community-page_contribute-main
  • Loading branch information
alexandrevryghem committed Feb 18, 2024
2 parents 5590ef4 + 7968f68 commit 629c06c
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions src/app/shared/search/search.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -485,18 +485,20 @@ export class SearchComponent implements OnDestroy, OnInit {
* This method should only be called once and is essentially what SearchTrackingComponent used to do (now removed)
* @private
*/
private subscribeToRoutingEvents() {
this.subs.push(
this.router.events.pipe(
filter((event) => event instanceof NavigationStart),
map((event: NavigationStart) => this.getDsoUUIDFromUrl(event.url)),
hasValueOperator(),
).subscribe((uuid) => {
if (this.resultsRD$.value.hasSucceeded) {
this.service.trackSearch(this.searchOptions$.value, this.resultsRD$.value.payload as SearchObjects<DSpaceObject>, uuid);
}
}),
);
private subscribeToRoutingEvents(): void {
if (this.trackStatistics) {
this.subs.push(

Check warning on line 490 in src/app/shared/search/search.component.ts

View check run for this annotation

Codecov / codecov/patch

src/app/shared/search/search.component.ts#L490

Added line #L490 was not covered by tests
this.router.events.pipe(
filter((event) => event instanceof NavigationStart),
map((event: NavigationStart) => this.getDsoUUIDFromUrl(event.url)),

Check warning on line 493 in src/app/shared/search/search.component.ts

View check run for this annotation

Codecov / codecov/patch

src/app/shared/search/search.component.ts#L492-L493

Added lines #L492 - L493 were not covered by tests
hasValueOperator(),
).subscribe((uuid) => {
if (this.resultsRD$.value.hasSucceeded) {
this.service.trackSearch(this.searchOptions$.value, this.resultsRD$.value.payload as SearchObjects<DSpaceObject>, uuid);

Check warning on line 497 in src/app/shared/search/search.component.ts

View check run for this annotation

Codecov / codecov/patch

src/app/shared/search/search.component.ts#L497

Added line #L497 was not covered by tests
}
}),
);
}
}

/**
Expand Down

0 comments on commit 629c06c

Please sign in to comment.