mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
[DURACOM-191] Remove admin-notify-dashboard.module
This commit is contained in:
@@ -1,51 +0,0 @@
|
||||
import {
|
||||
CommonModule,
|
||||
DatePipe,
|
||||
} from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
|
||||
import { SearchPageModule } from '../../search-page/search-page.module';
|
||||
import { SearchModule } from '../../shared/search/search.module';
|
||||
import { AdminNotifyDashboardComponent } from './admin-notify-dashboard.component';
|
||||
import { AdminNotifyDashboardRoutingModule } from './admin-notify-dashboard-routing.module';
|
||||
import { AdminNotifyDetailModalComponent } from './admin-notify-detail-modal/admin-notify-detail-modal.component';
|
||||
import { AdminNotifyIncomingComponent } from './admin-notify-logs/admin-notify-incoming/admin-notify-incoming.component';
|
||||
import { AdminNotifyLogsResultComponent } from './admin-notify-logs/admin-notify-logs-result/admin-notify-logs-result.component';
|
||||
import { AdminNotifyOutgoingComponent } from './admin-notify-logs/admin-notify-outgoing/admin-notify-outgoing.component';
|
||||
import { AdminNotifyMetricsComponent } from './admin-notify-metrics/admin-notify-metrics.component';
|
||||
import { AdminNotifySearchResultComponent } from './admin-notify-search-result/admin-notify-search-result.component';
|
||||
import { AdminNotifyMessagesService } from './services/admin-notify-messages.service';
|
||||
|
||||
const ENTRY_COMPONENTS = [
|
||||
AdminNotifySearchResultComponent,
|
||||
];
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
RouterModule,
|
||||
AdminNotifyDashboardRoutingModule,
|
||||
SearchModule,
|
||||
SearchPageModule,
|
||||
...ENTRY_COMPONENTS,
|
||||
AdminNotifyDashboardComponent,
|
||||
AdminNotifyMetricsComponent,
|
||||
AdminNotifyIncomingComponent,
|
||||
AdminNotifyOutgoingComponent,
|
||||
AdminNotifyDetailModalComponent,
|
||||
AdminNotifySearchResultComponent,
|
||||
AdminNotifyLogsResultComponent,
|
||||
],
|
||||
providers: [
|
||||
AdminNotifyMessagesService,
|
||||
DatePipe,
|
||||
],
|
||||
})
|
||||
export class AdminNotifyDashboardModule {
|
||||
static withEntryComponents() {
|
||||
return {
|
||||
ngModule: AdminNotifyDashboardModule,
|
||||
providers: ENTRY_COMPONENTS.map((component) => ({ provide: component })),
|
||||
};
|
||||
}
|
||||
}
|
@@ -19,11 +19,8 @@ import {
|
||||
} from 'rxjs';
|
||||
|
||||
import { PaginatedList } from '../../../core/data/paginated-list.model';
|
||||
import { Context } from '../../../core/shared/context.model';
|
||||
import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service';
|
||||
import { ViewMode } from '../../../core/shared/view-mode.model';
|
||||
import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-configuration.service';
|
||||
import { tabulatableObjectsComponent } from '../../../shared/object-collection/shared/tabulatable-objects/tabulatable-objects.decorator';
|
||||
import { TabulatableResultListElementsComponent } from '../../../shared/object-list/search-result-list-element/tabulatable-search-result/tabulatable-result-list-elements.component';
|
||||
import { TruncatableComponent } from '../../../shared/truncatable/truncatable.component';
|
||||
import { TruncatablePartComponent } from '../../../shared/truncatable/truncatable-part/truncatable-part.component';
|
||||
@@ -32,7 +29,6 @@ import { AdminNotifyMessage } from '../models/admin-notify-message.model';
|
||||
import { AdminNotifySearchResult } from '../models/admin-notify-message-search-result.model';
|
||||
import { AdminNotifyMessagesService } from '../services/admin-notify-messages.service';
|
||||
|
||||
@tabulatableObjectsComponent(PaginatedList<AdminNotifySearchResult>, ViewMode.Table, Context.CoarNotify)
|
||||
@Component({
|
||||
selector: 'ds-admin-notify-search-result',
|
||||
templateUrl: './admin-notify-search-result.component.html',
|
||||
@@ -57,8 +53,6 @@ import { AdminNotifyMessagesService } from '../services/admin-notify-messages.se
|
||||
/**
|
||||
* Component for visualization in table format of the search results related to the AdminNotifyDashboardComponent
|
||||
*/
|
||||
|
||||
|
||||
export class AdminNotifySearchResultComponent extends TabulatableResultListElementsComponent<PaginatedList<AdminNotifySearchResult>, AdminNotifySearchResult> implements OnInit, OnDestroy{
|
||||
public messagesSubject$: BehaviorSubject<AdminNotifyMessage[]> = new BehaviorSubject([]);
|
||||
public reprocessStatus = 'QUEUE_STATUS_QUEUED_FOR_RETRY';
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { PaginatedList } from '../../../../core/data/paginated-list.model';
|
||||
import { AdminNotifySearchResult } from '../../../../admin/admin-notify-dashboard/models/admin-notify-message-search-result.model';
|
||||
import { Context } from '../../../../core/shared/context.model';
|
||||
import { GenericConstructor } from '../../../../core/shared/generic-constructor';
|
||||
import { ViewMode } from '../../../../core/shared/view-mode.model';
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
hasNoValue,
|
||||
hasValue,
|
||||
} from '../../../empty.util';
|
||||
import { TabulatableResultListElementsComponent } from '../../../object-list/search-result-list-element/tabulatable-search-result/tabulatable-result-list-elements.component';
|
||||
import { ListableObject } from '../listable-object.model';
|
||||
import {
|
||||
DEFAULT_CONTEXT,
|
||||
@@ -15,32 +16,16 @@ import {
|
||||
MatchRelevancy,
|
||||
} from '../listable-object/listable-object.decorator';
|
||||
|
||||
const map = new Map();
|
||||
type TabulatableComponentType = typeof TabulatableResultListElementsComponent;
|
||||
|
||||
/**
|
||||
* Decorator used for rendering tabulatable objects
|
||||
* @param objectsType The object type or entity type the component represents
|
||||
* @param viewMode The view mode the component represents
|
||||
* @param context The optional context the component represents
|
||||
* @param theme The optional theme for the component
|
||||
*/
|
||||
export function tabulatableObjectsComponent(objectsType: string | GenericConstructor<PaginatedList<ListableObject>>, viewMode: ViewMode, context: Context = DEFAULT_CONTEXT, theme = DEFAULT_THEME) {
|
||||
return function decorator(component: any) {
|
||||
if (hasNoValue(objectsType)) {
|
||||
return;
|
||||
}
|
||||
if (hasNoValue(map.get(objectsType))) {
|
||||
map.set(objectsType, new Map());
|
||||
}
|
||||
if (hasNoValue(map.get(objectsType).get(viewMode))) {
|
||||
map.get(objectsType).set(viewMode, new Map());
|
||||
}
|
||||
if (hasNoValue(map.get(objectsType).get(viewMode).get(context))) {
|
||||
map.get(objectsType).get(viewMode).set(context, new Map());
|
||||
}
|
||||
map.get(objectsType).get(viewMode).get(context).set(theme, component);
|
||||
};
|
||||
}
|
||||
export const TABUTABLE_DECORATOR_MAP =
|
||||
new Map<string | GenericConstructor<ListableObject>, Map<ViewMode, Map<Context, Map<string, TabulatableComponentType>>>>([
|
||||
[AdminNotifySearchResult, new Map([
|
||||
[ViewMode.Table, new Map([
|
||||
[Context.CoarNotify, new Map([[DEFAULT_THEME, TabulatableResultListElementsComponent as any]])]
|
||||
])],
|
||||
])],
|
||||
]);
|
||||
|
||||
/**
|
||||
* Getter to retrieve the matching tabulatable objects component
|
||||
@@ -56,7 +41,7 @@ export function tabulatableObjectsComponent(objectsType: string | GenericConstru
|
||||
export function getTabulatableObjectsComponent(types: (string | GenericConstructor<ListableObject>)[], viewMode: ViewMode, context: Context = DEFAULT_CONTEXT, theme: string = DEFAULT_THEME) {
|
||||
let currentBestMatch: MatchRelevancy = null;
|
||||
for (const type of types) {
|
||||
const typeMap = map.get(PaginatedList<typeof type>);
|
||||
const typeMap = TABUTABLE_DECORATOR_MAP.get(type);
|
||||
|
||||
if (hasValue(typeMap)) {
|
||||
const match = getMatch(typeMap, [viewMode, context, theme], [DEFAULT_VIEW_MODE, DEFAULT_CONTEXT, DEFAULT_THEME]);
|
||||
|
Reference in New Issue
Block a user