mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-11 20:13:07 +00:00
add base config
This commit is contained in:
@@ -6,6 +6,8 @@ import { AdminNotifyDashboardRoutingModule } from './admin-notify-dashboard-rout
|
||||
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';
|
||||
import { SearchModule } from "../../shared/search/search.module";
|
||||
import { SearchPageModule } from "../../search-page/search-page.module";
|
||||
|
||||
|
||||
@NgModule({
|
||||
@@ -13,7 +15,9 @@ import { SharedModule } from '../../shared/shared.module';
|
||||
CommonModule,
|
||||
RouterModule,
|
||||
SharedModule,
|
||||
AdminNotifyDashboardRoutingModule
|
||||
AdminNotifyDashboardRoutingModule,
|
||||
SearchModule,
|
||||
SearchPageModule,
|
||||
],
|
||||
declarations: [
|
||||
AdminNotifyDashboardComponent,
|
||||
|
@@ -0,0 +1,93 @@
|
||||
import { SearchConfigurationService } from "../../../core/shared/search/search-configuration.service";
|
||||
import { PaginationComponentOptions } from "../../../shared/pagination/pagination-component-options.model";
|
||||
import { SortDirection, SortOptions } from "../../../core/cache/models/sort-options.model";
|
||||
import { RouteService } from "../../../core/services/route.service";
|
||||
import { ActivatedRoute } from "@angular/router";
|
||||
import { LinkService } from "../../../core/cache/builders/link.service";
|
||||
import { HALEndpointService } from "../../../core/shared/hal-endpoint.service";
|
||||
import { RequestService } from "../../../core/data/request.service";
|
||||
import { RemoteDataBuildService } from "../../../core/cache/builders/remote-data-build.service";
|
||||
import { PaginationService } from '../../../core/pagination/pagination.service';
|
||||
import { Injectable } from "@angular/core";
|
||||
import { PaginatedSearchOptions } from "../../../shared/search/models/paginated-search-options.model";
|
||||
import { Observable } from "rxjs";
|
||||
import { map } from "rxjs/operators";
|
||||
import { hasValue } from "../../../shared/empty.util";
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Service that performs all actions that have to do with the current notify configuration
|
||||
*/
|
||||
@Injectable()
|
||||
export class AdminNotifyLogsConfigurationService extends SearchConfigurationService {
|
||||
|
||||
|
||||
/**
|
||||
* Endpoint link path for retrieving general search results
|
||||
*/
|
||||
private searchLinkPath = 'discover/search/objects';
|
||||
/**
|
||||
* Default pagination settings
|
||||
*/
|
||||
protected defaultPagination = Object.assign(new PaginationComponentOptions(), {
|
||||
id: 'notify-logs-page',
|
||||
pageSize: 10,
|
||||
currentPage: 1
|
||||
});
|
||||
/**
|
||||
* Default sort settings
|
||||
*/
|
||||
protected defaultSort = new SortOptions('dc.date.issued', SortDirection.DESC);
|
||||
|
||||
/**
|
||||
* Default scope setting
|
||||
*/
|
||||
protected defaultScope = '';
|
||||
|
||||
/**
|
||||
* Default query setting
|
||||
*/
|
||||
protected defaultQuery = '';
|
||||
|
||||
|
||||
/**
|
||||
* Initialize class
|
||||
*
|
||||
* @param {roleService} roleService
|
||||
* @param {RouteService} routeService
|
||||
* @param {PaginationService} paginationService
|
||||
* @param {ActivatedRoute} route
|
||||
* @param linkService
|
||||
* @param halService
|
||||
* @param requestService
|
||||
* @param rdb
|
||||
*/
|
||||
constructor(
|
||||
protected routeService: RouteService,
|
||||
protected paginationService: PaginationService,
|
||||
protected route: ActivatedRoute,
|
||||
protected linkService: LinkService,
|
||||
protected halService: HALEndpointService,
|
||||
protected requestService: RequestService,
|
||||
protected rdb: RemoteDataBuildService) {
|
||||
|
||||
super(routeService, paginationService, route, linkService, halService, requestService, rdb);
|
||||
|
||||
// override parent class initialization
|
||||
this._defaults = null;
|
||||
this.initDefaults();
|
||||
}
|
||||
|
||||
getEndpoint(searchOptions?: PaginatedSearchOptions): Observable<string> {
|
||||
return this.halService.getEndpoint(this.searchLinkPath).pipe(
|
||||
map((url: string) => {
|
||||
if (hasValue(searchOptions)) {
|
||||
return (searchOptions as PaginatedSearchOptions).toRestUrl(url);
|
||||
} else {
|
||||
return url;
|
||||
}
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
<ds-themed-search configuration="NOTIFY.incoming'"></ds-themed-search>
|
||||
|
||||
<ds-themed-search configuration="NOTIFY.outgoing'"></ds-themed-search>
|
||||
|
@@ -1,10 +1,23 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { Component, Inject } from '@angular/core';
|
||||
import { SEARCH_CONFIG_SERVICE } from "../../../my-dspace-page/my-dspace-page.component";
|
||||
import { AdminNotifyLogsConfigurationService } from "./admin-notify-logs-configuration.service";
|
||||
import { SearchConfigurationService } from "../../../core/shared/search/search-configuration.service";
|
||||
import { Context } from "../../../core/shared/context.model";
|
||||
|
||||
@Component({
|
||||
selector: 'ds-admin-notify-logs',
|
||||
templateUrl: './admin-notify-logs.component.html',
|
||||
styleUrls: ['./admin-notify-logs.component.scss']
|
||||
styleUrls: ['./admin-notify-logs.component.scss'],
|
||||
providers: [
|
||||
{
|
||||
provide: SEARCH_CONFIG_SERVICE,
|
||||
useClass: AdminNotifyLogsConfigurationService
|
||||
}
|
||||
]
|
||||
})
|
||||
export class AdminNotifyLogsComponent {
|
||||
constructor(@Inject(SEARCH_CONFIG_SERVICE) private searchConfigService: SearchConfigurationService) {
|
||||
}
|
||||
|
||||
protected readonly context = Context.Search;
|
||||
}
|
||||
|
Reference in New Issue
Block a user