From 6066f47de802ffc6214cf85a2c0e08fbe3527e98 Mon Sep 17 00:00:00 2001 From: Jacob Pihl Date: Thu, 9 Jan 2025 15:26:25 +0100 Subject: [PATCH 1/4] Generate graphql files with `yarn codegen:dbc:gateway` --- .../dbc-gateway/generated/graphql.schema.json | 445 +++++++++++++++++- src/core/dbc-gateway/generated/graphql.tsx | 93 ++++ 2 files changed, 534 insertions(+), 4 deletions(-) diff --git a/src/core/dbc-gateway/generated/graphql.schema.json b/src/core/dbc-gateway/generated/graphql.schema.json index 29db834d52..b19b265ba1 100644 --- a/src/core/dbc-gateway/generated/graphql.schema.json +++ b/src/core/dbc-gateway/generated/graphql.schema.json @@ -1,10 +1,12 @@ { "__schema": { "queryType": { - "name": "Query" + "name": "Query", + "kind": "OBJECT" }, "mutationType": { - "name": "Mutation" + "name": "Mutation", + "kind": "OBJECT" }, "subscriptionType": null, "types": [ @@ -787,6 +789,18 @@ }, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "traceId", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null } ], "inputFields": null, @@ -821,6 +835,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "CHAMBERMUSICTYPE", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CHOIRTYPE", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "CONTRIBUTOR", "description": null, @@ -899,6 +925,12 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "INSTRUMENT", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "ISSUE", "description": null, @@ -2539,6 +2571,22 @@ }, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "traceId", + "description": "A unique identifier for tracking user interactions with this didYouMean value. \nIt is generated in the response and should be included in subsequent\nAPI calls when this manifestation is selected.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null } ], "inputFields": null, @@ -3093,6 +3141,22 @@ }, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "traceId", + "description": "A unique identifier for tracking user interactions with this facet value. \nIt is generated in the response and should be included in subsequent\nAPI calls when this manifestation is selected.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null } ], "inputFields": null, @@ -5069,6 +5133,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "localId", + "description": "Identification of the local id of this manifestation", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "manifestationParts", "description": "Tracks on music album, sheet music content, or articles/short stories etc. in this manifestation", @@ -5301,6 +5377,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "sheetMusicCategories", + "description": "Material that can be identified as sheet music", + "args": [], + "type": { + "kind": "OBJECT", + "name": "SheetMusicCategory", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "shelfmark", "description": "Information about on which shelf in the library this manifestation can be found", @@ -7345,6 +7433,22 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "traceId", + "description": "A unique identifier for tracking user interactions with this suggestion. \nIt is generated in the response and should be included in subsequent\nAPI calls when this manifestation is selected.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "type", "description": "The type of suggestion title/creator/tag", @@ -7455,6 +7559,58 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "OBJECT", + "name": "MusicalExercise", + "description": null, + "isOneOf": null, + "fields": [ + { + "name": "display", + "description": "The types of instrument 'schools' intended to practise with", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "forExercise", + "description": "Information whether material is intended for practising and in combination with an instrument", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "Mutation", @@ -8834,6 +8990,22 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "recommendations", + "description": "Access to various types of recommendations.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Recommendations", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "refWorks", "description": null, @@ -8929,8 +9101,8 @@ } } }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": true, + "deprecationReason": "Use 'Recommendations.subjects' instead expires: 01/03-2025" }, { "name": "ris", @@ -9533,6 +9705,75 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "OBJECT", + "name": "Recommendations", + "description": "Get different kinds of recommendations", + "isOneOf": null, + "fields": [ + { + "name": "subjects", + "description": "Retrieve subject-based recommendations based on a list of query strings and an optional limit.\n- q: An array of strings used to generate subject recommendations.\n- limit: The maximum number of recommendations to return.", + "args": [ + { + "name": "limit", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "q", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SubjectRecommendation", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "RelatedPublication", @@ -11542,6 +11783,22 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "traceId", + "description": "Traceid for tracking", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "workTypes", "description": "WorkTypes for the series", @@ -11646,6 +11903,126 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "OBJECT", + "name": "SheetMusicCategory", + "description": null, + "isOneOf": null, + "fields": [ + { + "name": "chamberMusicTypes", + "description": "The types of chamber music material covers", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "choirTypes", + "description": "The types of choir material covers", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "instruments", + "description": "The types of instruments material covers", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "musicalExercises", + "description": "Material intended to practice with", + "args": [], + "type": { + "kind": "OBJECT", + "name": "MusicalExercise", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "orchestraTypes", + "description": "The types of orchestra material covers", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "Shelfmark", @@ -11978,6 +12355,50 @@ } ] }, + { + "kind": "OBJECT", + "name": "SubjectRecommendation", + "description": "Details about a single subject recommendation.", + "isOneOf": null, + "fields": [ + { + "name": "subject", + "description": "The recommended subject.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "traceId", + "description": "A unique identifier for tracking user interactions with this subject recommendation. \nIt is generated in the response and should be included in subsequent\nAPI calls when this suggestion is selected.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "SubjectText", @@ -13660,6 +14081,22 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "traceId", + "description": "A unique identifier for tracking user interactions with this universe.\nIt is generated in the response and should be included in subsequent\nAPI calls when this work is selected.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "universeId", "description": "An id that identifies a universe.", diff --git a/src/core/dbc-gateway/generated/graphql.tsx b/src/core/dbc-gateway/generated/graphql.tsx index df78059f83..765d91dc05 100644 --- a/src/core/dbc-gateway/generated/graphql.tsx +++ b/src/core/dbc-gateway/generated/graphql.tsx @@ -154,6 +154,7 @@ export type ComplexSearchFacetValue = { __typename?: "ComplexSearchFacetValue"; key: Scalars["String"]["output"]; score: Scalars["Int"]["output"]; + traceId?: Maybe; }; /** The supported facet fields */ @@ -161,6 +162,8 @@ export enum ComplexSearchFacetsEnum { Accesstype = "ACCESSTYPE", Ages = "AGES", Cataloguecode = "CATALOGUECODE", + Chambermusictype = "CHAMBERMUSICTYPE", + Choirtype = "CHOIRTYPE", Contributor = "CONTRIBUTOR", Contributorfunction = "CONTRIBUTORFUNCTION", Creator = "CREATOR", @@ -174,6 +177,7 @@ export enum ComplexSearchFacetsEnum { Generalmaterialtype = "GENERALMATERIALTYPE", Genreandform = "GENREANDFORM", Hostpublication = "HOSTPUBLICATION", + Instrument = "INSTRUMENT", Issue = "ISSUE", Language = "LANGUAGE", Let = "LET", @@ -404,6 +408,12 @@ export type DidYouMean = { query: Scalars["String"]["output"]; /** A probability score between 0-1 indicating how relevant the query is */ score: Scalars["Float"]["output"]; + /** + * A unique identifier for tracking user interactions with this didYouMean value. + * It is generated in the response and should be included in subsequent + * API calls when this manifestation is selected. + */ + traceId: Scalars["String"]["output"]; }; export type DigitalArticleService = { @@ -504,6 +514,12 @@ export type FacetValue = { score?: Maybe; /** A value of a facet field */ term: Scalars["String"]["output"]; + /** + * A unique identifier for tracking user interactions with this facet value. + * It is generated in the response and should be included in subsequent + * API calls when this manifestation is selected. + */ + traceId: Scalars["String"]["output"]; }; export type FictionNonfiction = { @@ -807,6 +823,8 @@ export type Manifestation = { languages?: Maybe; /** Details about the latest printing of this manifestation */ latestPrinting?: Maybe; + /** Identification of the local id of this manifestation */ + localId?: Maybe; /** Tracks on music album, sheet music content, or articles/short stories etc. in this manifestation */ manifestationParts?: Maybe; /** Field for presenting bibliographic records in MARC format */ @@ -833,6 +851,8 @@ export type Manifestation = { review?: Maybe; /** Series for this manifestation */ series: Array; + /** Material that can be identified as sheet music */ + sheetMusicCategories?: Maybe; /** Information about on which shelf in the library this manifestation can be found */ shelfmark?: Maybe; /** The source of the manifestation, e.g. own library catalogue (Bibliotekskatalog) or online source e.g. Filmstriben, Ebook Central, eReolen Global etc. */ @@ -1109,6 +1129,12 @@ export type MoodSuggestItem = { __typename?: "MoodSuggestItem"; /** Suggestion */ term: Scalars["String"]["output"]; + /** + * A unique identifier for tracking user interactions with this suggestion. + * It is generated in the response and should be included in subsequent + * API calls when this manifestation is selected. + */ + traceId: Scalars["String"]["output"]; /** The type of suggestion title/creator/tag */ type: MoodSuggestEnum; /** A work associated with the suggestion */ @@ -1129,6 +1155,14 @@ export type MoodTagRecommendResponse = { work: Work; }; +export type MusicalExercise = { + __typename?: "MusicalExercise"; + /** The types of instrument 'schools' intended to practise with */ + display: Array; + /** Information whether material is intended for practising and in combination with an instrument */ + forExercise: Scalars["Boolean"]["output"]; +}; + export type Mutation = { __typename?: "Mutation"; elba: ElbaServices; @@ -1288,7 +1322,10 @@ export type Query = { ors: OrsQuery; /** Get recommendations */ recommend: RecommendationResponse; + /** Access to various types of recommendations. */ + recommendations: Recommendations; refWorks: Scalars["String"]["output"]; + /** @deprecated Use 'Recommendations.subjects' instead expires: 01/03-2025 */ relatedSubjects?: Maybe>; ris: Scalars["String"]["output"]; search: SearchResponse; @@ -1413,6 +1450,23 @@ export type RecommendationResponse = { result: Array; }; +/** Get different kinds of recommendations */ +export type Recommendations = { + __typename?: "Recommendations"; + /** + * Retrieve subject-based recommendations based on a list of query strings and an optional limit. + * - q: An array of strings used to generate subject recommendations. + * - limit: The maximum number of recommendations to return. + */ + subjects?: Maybe>; +}; + +/** Get different kinds of recommendations */ +export type RecommendationsSubjectsArgs = { + limit?: InputMaybe; + q: Array; +}; + export type RelatedPublication = { __typename?: "RelatedPublication"; /** Faust of the related publication */ @@ -1647,6 +1701,8 @@ export type Series = { seriesId?: Maybe; /** The title of the series */ title: Scalars["String"]["output"]; + /** Traceid for tracking */ + traceId: Scalars["String"]["output"]; /** WorkTypes for the series */ workTypes: Array; }; @@ -1664,6 +1720,20 @@ export type Setting = SubjectInterface & { type: SubjectTypeEnum; }; +export type SheetMusicCategory = { + __typename?: "SheetMusicCategory"; + /** The types of chamber music material covers */ + chamberMusicTypes: Array; + /** The types of choir material covers */ + choirTypes: Array; + /** The types of instruments material covers */ + instruments: Array; + /** Material intended to practice with */ + musicalExercises?: Maybe; + /** The types of orchestra material covers */ + orchestraTypes: Array; +}; + export type Shelfmark = { __typename?: "Shelfmark"; /** A postfix to the shelfmark, eg. 99.4 Christensen, Inger. f. 1935 */ @@ -1707,6 +1777,19 @@ export type SubjectInterface = { type: SubjectTypeEnum; }; +/** Details about a single subject recommendation. */ +export type SubjectRecommendation = { + __typename?: "SubjectRecommendation"; + /** The recommended subject. */ + subject: Scalars["String"]["output"]; + /** + * A unique identifier for tracking user interactions with this subject recommendation. + * It is generated in the response and should be included in subsequent + * API calls when this suggestion is selected. + */ + traceId: Scalars["String"]["output"]; +}; + export type SubjectText = SubjectInterface & { __typename?: "SubjectText"; display: Scalars["String"]["output"]; @@ -1949,6 +2032,12 @@ export type Universe = { series: Array; /** Literary/movie universe this work is part of e.g. Wizarding World, Marvel Cinematic Universe */ title: Scalars["String"]["output"]; + /** + * A unique identifier for tracking user interactions with this universe. + * It is generated in the response and should be included in subsequent + * API calls when this work is selected. + */ + traceId: Scalars["String"]["output"]; /** An id that identifies a universe. */ universeId?: Maybe; /** work types that are in this universe */ @@ -5022,6 +5111,7 @@ export type SearchFacetQuery = { key: string; term: string; score?: number | null; + traceId: string; }>; }>; }; @@ -5047,6 +5137,7 @@ export type IntelligentFacetsQuery = { key: string; term: string; score?: number | null; + traceId: string; }>; }>; }; @@ -7289,6 +7380,7 @@ export const SearchFacetDocument = ` key term score + traceId } } } @@ -7319,6 +7411,7 @@ export const IntelligentFacetsDocument = ` key term score + traceId } } } From f5823cc9b4ec1a58b20c70e31be7a54ca12219ad Mon Sep 17 00:00:00 2001 From: Jacob Pihl Date: Thu, 9 Jan 2025 15:28:13 +0100 Subject: [PATCH 2/4] Introduce new traceid field in facet queries --- src/components/facet-browser/facet-search.graphql | 1 + src/components/facet-line/intelligent-facets-search.graphql | 1 + 2 files changed, 2 insertions(+) diff --git a/src/components/facet-browser/facet-search.graphql b/src/components/facet-browser/facet-search.graphql index 275fa11bf0..e2856a464b 100644 --- a/src/components/facet-browser/facet-search.graphql +++ b/src/components/facet-browser/facet-search.graphql @@ -12,6 +12,7 @@ query searchFacet( key term score + traceId } } } diff --git a/src/components/facet-line/intelligent-facets-search.graphql b/src/components/facet-line/intelligent-facets-search.graphql index a026ede8b3..0acac4a51b 100644 --- a/src/components/facet-line/intelligent-facets-search.graphql +++ b/src/components/facet-line/intelligent-facets-search.graphql @@ -12,6 +12,7 @@ query intelligentFacets( key term score + traceId } } } From e16d442583491d7361ea6bcfa1866e957de3bcbb Mon Sep 17 00:00:00 2001 From: Jacob Pihl Date: Thu, 9 Jan 2025 15:37:47 +0100 Subject: [PATCH 3/4] Add traceId to facet object --- src/apps/search-result/useFilterHandler.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/apps/search-result/useFilterHandler.tsx b/src/apps/search-result/useFilterHandler.tsx index 725e376304..55424798af 100644 --- a/src/apps/search-result/useFilterHandler.tsx +++ b/src/apps/search-result/useFilterHandler.tsx @@ -47,9 +47,10 @@ const useFilterHandler = () => { const urlFilter = getUrlQueryParam(mapFacetToFilter(facet)); if (urlFilter) { // We only use term from the url, therefore key is not important here. + // We dont have a traceId, so we just use a placeholder. addToFilter({ facet: mapFacetToFilter(facet), - term: { key: "key", term: urlFilter } + term: { key: "key", term: urlFilter, traceId: "traceId" } }); } }; From b0adf9469e515f7da4806b2ffb6bbd92dcdc8404 Mon Sep 17 00:00:00 2001 From: Jacob Pihl Date: Thu, 9 Jan 2025 15:39:08 +0100 Subject: [PATCH 4/4] Add `traceId` to vitest facet objects We dont need a valid traceId while testing, which is why an empty or mocked string will work just fine --- .../__snapshots__/helper.ts.snap | 17 +++++++++ src/components/facet-browser/helper.ts | 36 ++++++++++++------- 2 files changed, 41 insertions(+), 12 deletions(-) diff --git a/src/components/facet-browser/__snapshots__/helper.ts.snap b/src/components/facet-browser/__snapshots__/helper.ts.snap index 9e55d2433b..0aa0717388 100644 --- a/src/components/facet-browser/__snapshots__/helper.ts.snap +++ b/src/components/facet-browser/__snapshots__/helper.ts.snap @@ -6,36 +6,43 @@ exports[`createFacetsMap 1`] = ` "key": "dan", "score": 427, "term": "Dansk", + "traceId": "2", }, "mainLanguages:eng": { "key": "eng", "score": 82, "term": "Engelsk", + "traceId": "3", }, "materialTypesGeneral:artikler": { "key": "artikler", "score": 346, "term": "artikler", + "traceId": "4", }, "materialTypesGeneral:bøger": { "key": "bøger", "score": 74, "term": "bøger", + "traceId": "5", }, "materialTypesGeneral:computerspil": { "key": "computerspil", "score": 26, "term": "computerspil", + "traceId": "7", }, "materialTypesGeneral:e-bøger": { "key": "e-bøger", "score": 38, "term": "e-bøger", + "traceId": "6", }, "materialTypesGeneral:film": { "key": "film", "score": 9, "term": "film", + "traceId": "8", }, } `; @@ -77,6 +84,7 @@ exports[`getPlaceHolderFacets > should get placeholder facets 1`] = ` { "key": "", "term": "", + "traceId": "", }, ], }, @@ -87,6 +95,7 @@ exports[`getPlaceHolderFacets > should get placeholder facets 1`] = ` { "key": "", "term": "", + "traceId": "", }, ], }, @@ -97,6 +106,7 @@ exports[`getPlaceHolderFacets > should get placeholder facets 1`] = ` { "key": "", "term": "", + "traceId": "", }, ], }, @@ -107,6 +117,7 @@ exports[`getPlaceHolderFacets > should get placeholder facets 1`] = ` { "key": "", "term": "", + "traceId": "", }, ], }, @@ -117,6 +128,7 @@ exports[`getPlaceHolderFacets > should get placeholder facets 1`] = ` { "key": "", "term": "", + "traceId": "", }, ], }, @@ -127,6 +139,7 @@ exports[`getPlaceHolderFacets > should get placeholder facets 1`] = ` { "key": "", "term": "", + "traceId": "", }, ], }, @@ -137,6 +150,7 @@ exports[`getPlaceHolderFacets > should get placeholder facets 1`] = ` { "key": "", "term": "", + "traceId": "", }, ], }, @@ -147,6 +161,7 @@ exports[`getPlaceHolderFacets > should get placeholder facets 1`] = ` { "key": "", "term": "", + "traceId": "", }, ], }, @@ -157,6 +172,7 @@ exports[`getPlaceHolderFacets > should get placeholder facets 1`] = ` { "key": "", "term": "", + "traceId": "", }, ], }, @@ -167,6 +183,7 @@ exports[`getPlaceHolderFacets > should get placeholder facets 1`] = ` { "key": "", "term": "", + "traceId": "", }, ], }, diff --git a/src/components/facet-browser/helper.ts b/src/components/facet-browser/helper.ts index f6d392b609..d9d1a94af8 100644 --- a/src/components/facet-browser/helper.ts +++ b/src/components/facet-browser/helper.ts @@ -30,7 +30,8 @@ export const getPlaceHolderFacets = (facets: string[]) => values: [ { key: "", - term: "" + term: "", + traceId: "" } ] })); @@ -182,19 +183,22 @@ if (import.meta.vitest) { Dansk: { key: "dan", term: "Dansk", - score: 295 + score: 295, + traceId: "1" }, Engelsk: { key: "eng", term: "Engelsk", - score: 9 + score: 9, + traceId: "2" } }, accessTypes: { Fysisk: { key: "PHYSICAL", term: "Fysisk", - score: 356 + score: 356, + traceId: "3" } } }; @@ -207,7 +211,8 @@ if (import.meta.vitest) { { key: "computerspil", term: "computerspil", - score: 26 + score: 26, + traceId: "1" } ] }, @@ -218,12 +223,14 @@ if (import.meta.vitest) { { key: "dan", term: "Dansk", - score: 427 + score: 427, + traceId: "2" }, { key: "eng", term: "Engelsk", - score: 82 + score: 82, + traceId: "3" } ] }, @@ -234,27 +241,32 @@ if (import.meta.vitest) { { key: "artikler", term: "artikler", - score: 346 + score: 346, + traceId: "4" }, { key: "bøger", term: "bøger", - score: 74 + score: 74, + traceId: "5" }, { key: "e-bøger", term: "e-bøger", - score: 38 + score: 38, + traceId: "6" }, { key: "computerspil", term: "computerspil", - score: 26 + score: 26, + traceId: "7" }, { key: "film", term: "film", - score: 9 + score: 9, + traceId: "8" } ] }