Skip to content

Commit

Permalink
[DSC-1520] Merge branch 'dspace-cris-2023_02_x' into task/dspace-cris…
Browse files Browse the repository at this point in the history
…-2023_02_x/DSC-1520
  • Loading branch information
alisaismailati committed Jun 12, 2024
2 parents d7b4e8a + 1b19d0f commit 085428c
Show file tree
Hide file tree
Showing 45 changed files with 896 additions and 122 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dspace-angular",
"version": "2023.02.04-SNAPSHOT",
"version": "2023.02.05-SNAPSHOT",
"scripts": {
"ng": "ng",
"config:watch": "nodemon",
Expand Down Expand Up @@ -84,6 +84,7 @@
"@angular/platform-server": "^15.2.8",
"@angular/router": "^15.2.8",
"@babel/runtime": "7.21.0",
"@datadog/browser-rum": "^5.7.0",
"@kolkov/ngx-gallery": "^2.0.1",
"@material-ui/core": "^4.11.0",
"@material-ui/icons": "^4.11.3",
Expand Down
18 changes: 18 additions & 0 deletions src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ import { BreadcrumbsService } from './breadcrumbs/breadcrumbs.service';
import { of } from 'rxjs';
import { APP_CONFIG } from '../config/app-config.interface';
import { environment } from '../environments/environment';
import { KlaroService } from './shared/cookies/klaro.service';
import { DatadogRumService } from './shared/datadog-rum/datadog-rum.service';

let comp: AppComponent;
let fixture: ComponentFixture<AppComponent>;
Expand All @@ -55,13 +57,27 @@ describe('App component', () => {

let breadcrumbsServiceSpy;
let routeServiceMock;
let klaroServiceSpy: jasmine.SpyObj<KlaroService>;
let datadogRumServiceSpy: jasmine.SpyObj<DatadogRumService>;

const getDefaultTestBedConf = () => {
breadcrumbsServiceSpy = jasmine.createSpyObj(['listenForRouteChanges']);
routeServiceMock = jasmine.createSpyObj('RouterService', {
getCurrentUrl: of('/home')
});

klaroServiceSpy = jasmine.createSpyObj('KlaroService', {
getSavedPreferences: jasmine.createSpy('getSavedPreferences'),
watchConsentUpdates: jasmine.createSpy('watchConsentUpdates')
},{
consentsUpdates$: of({})
});

datadogRumServiceSpy = jasmine.createSpyObj('DatadogRumService', {
initDatadogRum: jasmine.createSpy('initDatadogRum'),
getDatadogRumState: jasmine.createSpy('getDatadogRumState')
});

return {
imports: [
CommonModule,
Expand Down Expand Up @@ -89,6 +105,8 @@ describe('App component', () => {
{ provide: BreadcrumbsService, useValue: breadcrumbsServiceSpy },
{ provide: RouteService, useValue: routeServiceMock },
{ provide: APP_CONFIG, useValue: environment },
{ provide: KlaroService, useValue: klaroServiceSpy },
{ provide: DatadogRumService, useValue: datadogRumServiceSpy },
provideMockStore({ initialState }),
AppComponent,
// RouteService
Expand Down
4 changes: 4 additions & 0 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { distinctNext } from './core/shared/distinct-next';
import { RouteService } from './core/services/route.service';
import { getEditItemPageRoute, getWorkflowItemModuleRoute, getWorkspaceItemModuleRoute } from './app-routing-paths';
import { SocialService } from './social/social.service';
import { DatadogRumService } from './shared/datadog-rum/datadog-rum.service';

@Component({
selector: 'ds-app',
Expand Down Expand Up @@ -74,6 +75,7 @@ export class AppComponent implements OnInit, AfterViewInit {
private modalService: NgbModal,
private modalConfig: NgbModalConfig,
private socialService: SocialService,
private datadogRumService: DatadogRumService
) {
this.notificationOptions = environment.notifications;

Expand Down Expand Up @@ -108,6 +110,8 @@ export class AppComponent implements OnInit, AfterViewInit {
);

this.dispatchWindowSize(this._window.nativeWindow.innerWidth, this._window.nativeWindow.innerHeight);

this.datadogRumService.initDatadogRum();
}

private storeCSSVariables() {
Expand Down
Loading

0 comments on commit 085428c

Please sign in to comment.