diff --git a/packages/x-adapter-platform/src/schemas/responses/search-response.schema.ts b/packages/x-adapter-platform/src/schemas/responses/search-response.schema.ts index 5dd2867302..81083dd90d 100644 --- a/packages/x-adapter-platform/src/schemas/responses/search-response.schema.ts +++ b/packages/x-adapter-platform/src/schemas/responses/search-response.schema.ts @@ -41,5 +41,6 @@ export const searchResponseSchema = createMutableSchema getTaggingInfoFromUrl(catalog?.tagging?.query) + queryTagging: ({ catalog }) => getTaggingInfoFromUrl(catalog?.tagging?.query), + displayTagging: ({ catalog }) => getTaggingInfoFromUrl(catalog?.tagging?.display) }); diff --git a/packages/x-adapter-platform/src/types/responses/search-response.model.ts b/packages/x-adapter-platform/src/types/responses/search-response.model.ts index fb3563c45b..a93b9c9bb3 100644 --- a/packages/x-adapter-platform/src/types/responses/search-response.model.ts +++ b/packages/x-adapter-platform/src/types/responses/search-response.model.ts @@ -22,6 +22,7 @@ export interface PlatformSearchResponse { partials: PlatformPartialResult[]; tagging: { query: string; + display: string; }; }; direct: { diff --git a/packages/x-components/src/x-modules/search/store/module.ts b/packages/x-components/src/x-modules/search/store/module.ts index 20dcf349e6..8430c7920b 100644 --- a/packages/x-components/src/x-modules/search/store/module.ts +++ b/packages/x-components/src/x-modules/search/store/module.ts @@ -106,6 +106,9 @@ export const searchXStoreModule: SearchXStoreModule = { setQueryTagging(state, queryTagging) { state.queryTagging = queryTagging; }, + setDisplayTagging(state, displayTagging) { + state.displayTagging = displayTagging; + }, updateResult(state, result) { const stateResult = state.results.find(stateResult => result.id === stateResult.id); if (stateResult) { @@ -153,6 +156,10 @@ export function resettableState() { queryTagging: { url: '', params: {} + }, + displayTagging: { + url: '', + params: {} } }; } diff --git a/packages/x-components/src/x-modules/search/store/types.ts b/packages/x-components/src/x-modules/search/store/types.ts index d8ad39084a..848532f4da 100644 --- a/packages/x-components/src/x-modules/search/store/types.ts +++ b/packages/x-components/src/x-modules/search/store/types.ts @@ -52,6 +52,8 @@ export interface SearchState extends StatusState, QueryState { promoteds: Promoted[]; /** The query tagging used to track the search events. */ queryTagging: TaggingRequest; + /** The display tagging used to track the search events. */ + displayTagging: TaggingRequest; /** The redirections associated to the `query`. */ redirections: Redirection[]; /** The list of the related tags, related to the `query` property of the state. */ @@ -172,6 +174,12 @@ export interface SearchMutations * @param queryTagging - The new query tagging object to save to the state. */ setQueryTagging(queryTagging: TaggingRequest): void; + /** + * Sets the display tagging of the module. + * + * @param displayTagging - The new display tagging object to save to the state. + */ + setDisplayTagging(DisplayTagging: TaggingRequest): void; /** * Sets the redirection of the module. * diff --git a/packages/x-types/src/response/search-response.model.ts b/packages/x-types/src/response/search-response.model.ts index 7c22354b76..7b6a32ff36 100644 --- a/packages/x-types/src/response/search-response.model.ts +++ b/packages/x-types/src/response/search-response.model.ts @@ -17,6 +17,7 @@ export interface SearchResponse { partialResults?: PartialResult[]; promoteds?: Promoted[]; queryTagging?: TaggingRequest; + displayTagging?: TaggingRequest; redirections?: Redirection[]; results: Result[]; spellcheck?: string;