From 4292c01d8fbaf38a86afcad299da4ed784cafa42 Mon Sep 17 00:00:00 2001 From: FrancescoMolinaro Date: Fri, 5 Jan 2024 13:22:17 +0100 Subject: [PATCH] clean up --- .../admin-notify-search-result.component.ts | 9 ++-- .../listable-object.decorator.ts | 2 +- ...bjects-collection-tabulatable.component.ts | 4 -- .../tabulatable-objects.decorator.ts | 51 ++----------------- ...ulatable-result-list-elements.component.ts | 9 +--- 5 files changed, 9 insertions(+), 66 deletions(-) diff --git a/src/app/admin/admin-notify-dashboard/admin-notify-search-result/admin-notify-search-result.component.ts b/src/app/admin/admin-notify-dashboard/admin-notify-search-result/admin-notify-search-result.component.ts index f0c9e3f7d8..0f4fbb28d3 100644 --- a/src/app/admin/admin-notify-dashboard/admin-notify-search-result/admin-notify-search-result.component.ts +++ b/src/app/admin/admin-notify-dashboard/admin-notify-search-result/admin-notify-search-result.component.ts @@ -31,11 +31,8 @@ export class AdminNotifySearchResultComponent extends TabulatableResultListElem QUEUE_STATUS_UNMAPPED_ACTION: 'Unmapped action', }; - constructor(private modalService: NgbModal, - protected truncatableService: TruncatableService, - public dsoNameService: DSONameService, - @Inject(APP_CONFIG) protected appConfig?: AppConfig) { - super(truncatableService, dsoNameService, appConfig); + constructor(private modalService: NgbModal) { + super(); } /** @@ -50,7 +47,7 @@ export class AdminNotifySearchResultComponent extends TabulatableResultListElem }); } - /** + /** * Open modal for details visualization * @param message the message to be displayed */ diff --git a/src/app/shared/object-collection/shared/listable-object/listable-object.decorator.ts b/src/app/shared/object-collection/shared/listable-object/listable-object.decorator.ts index f56e983dff..4f1a04a985 100644 --- a/src/app/shared/object-collection/shared/listable-object/listable-object.decorator.ts +++ b/src/app/shared/object-collection/shared/listable-object/listable-object.decorator.ts @@ -133,7 +133,7 @@ export function getListableObjectComponent(types: (string | GenericConstructor, keys: any[], defaults: any[]): MatchRelevancy { +export function getMatch(typeMap: Map, keys: any[], defaults: any[]): MatchRelevancy { let currentMap = typeMap; let level = -1; let relevancy = 0; diff --git a/src/app/shared/object-collection/shared/objects-collection-tabulatable/objects-collection-tabulatable.component.ts b/src/app/shared/object-collection/shared/objects-collection-tabulatable/objects-collection-tabulatable.component.ts index c6b6b1bb5b..3118ec255e 100644 --- a/src/app/shared/object-collection/shared/objects-collection-tabulatable/objects-collection-tabulatable.component.ts +++ b/src/app/shared/object-collection/shared/objects-collection-tabulatable/objects-collection-tabulatable.component.ts @@ -73,10 +73,6 @@ export class AbstractTabulatableElementComponent, keys: any[], defaults: any[]): MatchRelevancy { - let currentMap = typeMap; - let level = -1; - let relevancy = 0; - for (let i = 0; i < keys.length; i++) { - // If we're currently checking the theme, resolve it first to take extended themes into account - let currentMatch = defaults[i] === DEFAULT_THEME ? resolveTheme(currentMap, keys[i]) : currentMap.get(keys[i]); - if (hasNoValue(currentMatch)) { - currentMatch = currentMap.get(defaults[i]); - if (level === -1) { - level = i; - } - } else { - relevancy++; - } - if (hasValue(currentMatch)) { - if (currentMatch instanceof Map) { - currentMap = currentMatch as Map; - } else { - return new MatchRelevancy(currentMatch, level > -1 ? level : i + 1, relevancy); - } - } else { - return null; - } - } - return null; -} diff --git a/src/app/shared/object-list/search-result-list-element/tabulatable-search-result/tabulatable-result-list-elements.component.ts b/src/app/shared/object-list/search-result-list-element/tabulatable-search-result/tabulatable-result-list-elements.component.ts index 956f750b9e..b1be6443b8 100644 --- a/src/app/shared/object-list/search-result-list-element/tabulatable-search-result/tabulatable-result-list-elements.component.ts +++ b/src/app/shared/object-list/search-result-list-element/tabulatable-search-result/tabulatable-result-list-elements.component.ts @@ -12,11 +12,4 @@ import { SearchResult } from '../../../search/models/search-result.model'; selector: 'ds-search-result-list-element', template: `` }) -export class TabulatableResultListElementsComponent, K extends SearchResult> extends AbstractTabulatableElementComponent { - public constructor(protected truncatableService: TruncatableService, - public dsoNameService: DSONameService, - @Inject(APP_CONFIG) protected appConfig?: AppConfig) { - super(dsoNameService); - } - -} +export class TabulatableResultListElementsComponent, K extends SearchResult> extends AbstractTabulatableElementComponent {}