mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
[CST-18964] fix double search
This commit is contained in:
@@ -36,7 +36,6 @@ import { ViewMode } from '../view-mode.model';
|
|||||||
import { SearchService } from './search.service';
|
import { SearchService } from './search.service';
|
||||||
import { SearchConfigurationService } from './search-configuration.service';
|
import { SearchConfigurationService } from './search-configuration.service';
|
||||||
import anything = jasmine.anything;
|
import anything = jasmine.anything;
|
||||||
import { MatomoTestingModule } from 'ngx-matomo-client/testing';
|
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -57,7 +56,6 @@ describe('SearchService', () => {
|
|||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
MatomoTestingModule.forRoot(),
|
|
||||||
RouterTestingModule.withRoutes([
|
RouterTestingModule.withRoutes([
|
||||||
{ path: 'search', component: DummyComponent, pathMatch: 'full' },
|
{ path: 'search', component: DummyComponent, pathMatch: 'full' },
|
||||||
]),
|
]),
|
||||||
@@ -125,7 +123,6 @@ describe('SearchService', () => {
|
|||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
MatomoTestingModule.forRoot(),
|
|
||||||
RouterTestingModule.withRoutes([
|
RouterTestingModule.withRoutes([
|
||||||
{ path: 'search', component: DummyComponent, pathMatch: 'full' },
|
{ path: 'search', component: DummyComponent, pathMatch: 'full' },
|
||||||
]),
|
]),
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
/* eslint-disable max-classes-per-file */
|
/* eslint-disable max-classes-per-file */
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Angulartics2 } from 'angulartics2';
|
import { Angulartics2 } from 'angulartics2';
|
||||||
import { MatomoTracker } from 'ngx-matomo-client';
|
|
||||||
import {
|
import {
|
||||||
BehaviorSubject,
|
BehaviorSubject,
|
||||||
combineLatest as observableCombineLatest,
|
combineLatest as observableCombineLatest,
|
||||||
@@ -113,7 +112,6 @@ export class SearchService {
|
|||||||
private paginationService: PaginationService,
|
private paginationService: PaginationService,
|
||||||
private searchConfigurationService: SearchConfigurationService,
|
private searchConfigurationService: SearchConfigurationService,
|
||||||
private angulartics2: Angulartics2,
|
private angulartics2: Angulartics2,
|
||||||
private matomoTracker: MatomoTracker,
|
|
||||||
) {
|
) {
|
||||||
this.searchDataService = new SearchDataService();
|
this.searchDataService = new SearchDataService();
|
||||||
}
|
}
|
||||||
@@ -388,7 +386,6 @@ export class SearchService {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
this.matomoTracker.trackSiteSearch(config.query, config.scope, searchQueryResponse.pageInfo.totalElements, searchTrackObject);
|
|
||||||
this.angulartics2.eventTrack.next(searchTrackObject);
|
this.angulartics2.eventTrack.next(searchTrackObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -46,7 +46,7 @@ export class MatomoService {
|
|||||||
const preferences$ = this.orejimeService.getSavedPreferences();
|
const preferences$ = this.orejimeService.getSavedPreferences();
|
||||||
|
|
||||||
preferences$.subscribe(preferences => {
|
preferences$.subscribe(preferences => {
|
||||||
this.changeMatomoConsent(preferences.matomo);
|
this.changeMatomoConsent(preferences?.matomo);
|
||||||
|
|
||||||
if (environment.matomo?.siteId && environment.matomo?.trackerUrl) {
|
if (environment.matomo?.siteId && environment.matomo?.trackerUrl) {
|
||||||
this.matomoInitializer.initializeTracker({
|
this.matomoInitializer.initializeTracker({
|
||||||
|
Reference in New Issue
Block a user