diff --git a/src/app/admin/admin-notify-dashboard/admin-notify-dashboard-routing.module.ts b/src/app/admin/admin-notify-dashboard/admin-notify-dashboard-routing.module.ts index 447a1fe39a..778815e1fb 100644 --- a/src/app/admin/admin-notify-dashboard/admin-notify-dashboard-routing.module.ts +++ b/src/app/admin/admin-notify-dashboard/admin-notify-dashboard-routing.module.ts @@ -2,8 +2,8 @@ import { NgModule } from '@angular/core'; import { RouterModule } from '@angular/router'; import { I18nBreadcrumbResolver } from '../../core/breadcrumbs/i18n-breadcrumb.resolver'; import { I18nBreadcrumbsService } from '../../core/breadcrumbs/i18n-breadcrumbs.service'; -import { AuthenticatedGuard } from "../../core/auth/authenticated.guard"; -import { AdminNotifyDashboardComponent } from "./admin-notify-dashboard.component"; +import { AuthenticatedGuard } from '../../core/auth/authenticated.guard'; +import { AdminNotifyDashboardComponent } from './admin-notify-dashboard.component'; @NgModule({ imports: [ diff --git a/src/app/admin/admin-notify-dashboard/admin-notify-dashboard.component.spec.ts b/src/app/admin/admin-notify-dashboard/admin-notify-dashboard.component.spec.ts index 4df980e1df..c5afaa3b59 100644 --- a/src/app/admin/admin-notify-dashboard/admin-notify-dashboard.component.spec.ts +++ b/src/app/admin/admin-notify-dashboard/admin-notify-dashboard.component.spec.ts @@ -1,6 +1,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { AdminNotifyDashboardComponent } from './admin-notify-dashboard.component'; +import { TranslateModule } from '@ngx-translate/core'; +import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap'; describe('AdminNotifyDashboardComponent', () => { let component: AdminNotifyDashboardComponent; @@ -8,6 +10,7 @@ describe('AdminNotifyDashboardComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ + imports: [TranslateModule.forRoot(), NgbNavModule], declarations: [ AdminNotifyDashboardComponent ] }) .compileComponents(); diff --git a/src/app/admin/admin-notify-dashboard/admin-notify-dashboard.component.ts b/src/app/admin/admin-notify-dashboard/admin-notify-dashboard.component.ts index 7959d9917f..56f5091969 100644 --- a/src/app/admin/admin-notify-dashboard/admin-notify-dashboard.component.ts +++ b/src/app/admin/admin-notify-dashboard/admin-notify-dashboard.component.ts @@ -1,10 +1,47 @@ -import { Component } from '@angular/core'; +import { Component, Inject, OnInit } from '@angular/core'; +import { SearchConfigurationService } from "../../core/shared/search/search-configuration.service"; +import { SearchService } from "../../core/shared/search/search.service"; +import { PaginatedSearchOptions } from "../../shared/search/models/paginated-search-options.model"; +import { SEARCH_CONFIG_SERVICE } from "../../my-dspace-page/my-dspace-page.component"; +import { PaginationComponentOptions } from "../../shared/pagination/pagination-component-options.model"; +import { SearchFilterConfig } from "../../shared/search/models/search-filter-config.model"; @Component({ selector: 'ds-admin-notify-dashboard', templateUrl: './admin-notify-dashboard.component.html', - styleUrls: ['./admin-notify-dashboard.component.scss'] + styleUrls: ['./admin-notify-dashboard.component.scss'], + providers: [ + { + provide: SEARCH_CONFIG_SERVICE, + useClass: SearchConfigurationService + } + ] }) -export class AdminNotifyDashboardComponent { +export class AdminNotifyDashboardComponent implements OnInit{ + mockFilterConfig : SearchFilterConfig = Object.assign(new SearchFilterConfig(), { + type: { + value: "discovery-filter" + }, + pageSize: 10, + name: "author", + filterType: "text", + _links: { + self: { + href: "https://dspace-coar.4science.cloud/server/api/discover/facets/author" + } + } + }); + mockPaginatedSearchOptions = new PaginatedSearchOptions({ + pagination: Object.assign(new PaginationComponentOptions(), { id: 'page-id', currentPage: 1, pageSize: 20 }), + configuration: '', + }); + + constructor(private searchService: SearchService, + @Inject(SEARCH_CONFIG_SERVICE) public searchConfigService: SearchConfigurationService, + ) {} + + ngOnInit() { + this.searchService.getFacetValuesFor(this.mockFilterConfig, 1, this.mockPaginatedSearchOptions).subscribe(c => console.log(c)) + } } diff --git a/src/app/admin/admin-notify-dashboard/admin-notify-dashboard.module.ts b/src/app/admin/admin-notify-dashboard/admin-notify-dashboard.module.ts index 0074d13ce0..ec6d63d8e1 100644 --- a/src/app/admin/admin-notify-dashboard/admin-notify-dashboard.module.ts +++ b/src/app/admin/admin-notify-dashboard/admin-notify-dashboard.module.ts @@ -1,18 +1,19 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { RouterModule } from '@angular/router'; -import { SharedModule } from '../../shared/shared.module'; -import { AdminNotifyDashboardComponent } from "./admin-notify-dashboard.component"; -import { AdminNotifyDashboardRoutingModule } from "./admin-notify-dashboard-routing.module"; +import { AdminNotifyDashboardComponent } from './admin-notify-dashboard.component'; +import { AdminNotifyDashboardRoutingModule } from './admin-notify-dashboard-routing.module'; import { AdminNotifyMetricsComponent } from './admin-notify-metrics/admin-notify-metrics.component'; import { AdminNotifyLogsComponent } from './admin-notify-logs/admin-notify-logs.component'; +import { SharedModule } from '../../shared/shared.module'; + @NgModule({ imports: [ CommonModule, - SharedModule, RouterModule, - AdminNotifyDashboardRoutingModule, + SharedModule, + AdminNotifyDashboardRoutingModule ], declarations: [ AdminNotifyDashboardComponent, diff --git a/src/app/admin/admin-notify-dashboard/admin-notify-logs/admin-notify-logs.component.spec.ts b/src/app/admin/admin-notify-dashboard/admin-notify-logs/admin-notify-logs.component.spec.ts index 12a0feae64..b1f89a4f76 100644 --- a/src/app/admin/admin-notify-dashboard/admin-notify-logs/admin-notify-logs.component.spec.ts +++ b/src/app/admin/admin-notify-dashboard/admin-notify-logs/admin-notify-logs.component.spec.ts @@ -1,6 +1,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { AdminNotifyLogsComponent } from './admin-notify-logs.component'; +import { TranslateModule } from '@ngx-translate/core'; describe('AdminNotifyLogsComponent', () => { let component: AdminNotifyLogsComponent; @@ -8,6 +9,7 @@ describe('AdminNotifyLogsComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ + imports: [TranslateModule.forRoot()], declarations: [ AdminNotifyLogsComponent ] }) .compileComponents(); diff --git a/src/app/admin/admin-notify-dashboard/admin-notify-metrics/admin-notify-metrics.component.html b/src/app/admin/admin-notify-dashboard/admin-notify-metrics/admin-notify-metrics.component.html index f4e0e45279..c3ba6364dc 100644 --- a/src/app/admin/admin-notify-dashboard/admin-notify-metrics/admin-notify-metrics.component.html +++ b/src/app/admin/admin-notify-dashboard/admin-notify-metrics/admin-notify-metrics.component.html @@ -1,11 +1,9 @@ -