diff --git a/landingPages/landing-utils/parsingFunctions.class.ts b/landingPages/landing-utils/parsingFunctions.class.ts index a7c6b200..a0764fc2 100644 --- a/landingPages/landing-utils/parsingFunctions.class.ts +++ b/landingPages/landing-utils/parsingFunctions.class.ts @@ -1,5 +1,5 @@ import {HostedByCollectedFrom, Journal, Project, RelationResult} from "../../utils/result-preview/result-preview"; -import {Reference} from "../../utils/entities/resultLandingInfo"; +import {Context, Reference} from "../../utils/entities/resultLandingInfo"; import {Injectable} from '@angular/core'; import {properties} from "../../../../environments/environment"; import {StringUtils} from "../../utils/string-utils.class"; @@ -653,16 +653,8 @@ export class ParsingFunctions { return [subjects, otherSubjects, classifiedSubjects, fos, sdg]; } - parseContexts(_contexts: any): { - "labelContext": string, "idContext": string, - "labelCategory": string, "idCategory": string, - "labelConcept": string, "idConcept": string - }[] { - let contexts = new Array<{ - "labelContext": string, "idContext": string, - "labelCategory": string, "idCategory": string, - "labelConcept": string, "idConcept": string - }>(); + parseContexts(_contexts: any): Context[] { + let contexts = new Array(); let position = 0; let labels = ""; diff --git a/utils/entities/resultLandingInfo.ts b/utils/entities/resultLandingInfo.ts index 7a461f9d..f1a15378 100644 --- a/utils/entities/resultLandingInfo.ts +++ b/utils/entities/resultLandingInfo.ts @@ -18,6 +18,17 @@ export interface Reference { ids: Id[]; } +export interface Context { + labelContext: string; + idContext: string; + labelCategory: string; + idCategory: string; + labelConcept: string; + idConcept: string; + link?: string; + logo?: string; +} + export class ResultLandingInfo { relcanId; objIdentifier: string; @@ -112,9 +123,7 @@ export class ResultLandingInfo { relatedResults: RelationResult[]; relatedClassFilters: Set = new Set(); - contexts: { "labelContext": string, "idContext": string, - "labelCategory": string, "idCategory": string, - "labelConcept": string, "idConcept": string}[]; + contexts: Context[]; deletedByInferenceIds: string[];