diff --git a/packages/x-components/src/__stubs__/semantic-queries-stubs.factory.ts b/packages/x-components/src/__stubs__/semantic-queries-stubs.factory.ts index 0ca0767968..facc2ad981 100644 --- a/packages/x-components/src/__stubs__/semantic-queries-stubs.factory.ts +++ b/packages/x-components/src/__stubs__/semantic-queries-stubs.factory.ts @@ -1,6 +1,6 @@ import { deepMerge } from '@empathyco/x-deep-merge'; import { SemanticQueriesResponse, SemanticQuery } from '@empathyco/x-types'; -import { DeepPartial } from '@empathyco/x-utils/src/types/utils.types'; +import { DeepPartial } from '@empathyco/x-utils'; /** * Creates a {@link SemanticQuery} stub with the provided options. diff --git a/packages/x-components/src/views/home/Home.vue b/packages/x-components/src/views/home/Home.vue index f47669051f..f2fc5416f1 100644 --- a/packages/x-components/src/views/home/Home.vue +++ b/packages/x-components/src/views/home/Home.vue @@ -626,10 +626,12 @@ protected queriesPreviewInfo: QueryPreviewInfo[] = [ { query: 'cortina', - extraParams: { store: 'Gijón' } + extraParams: { store: 'Gijón' }, + filters: ['categoryIds:66dd06d9f'] }, { - query: 'marni summer dress' + query: 'summer dress', + filters: ['categoryIds:5b612edb5', 'brand:marni'] }, { query: 'woven hat' diff --git a/packages/x-components/src/x-modules/queries-preview/components/__tests__/query-preview.spec.ts b/packages/x-components/src/x-modules/queries-preview/components/__tests__/query-preview.spec.ts index 8fabdef16b..18fadcb0e4 100644 --- a/packages/x-components/src/x-modules/queries-preview/components/__tests__/query-preview.spec.ts +++ b/packages/x-components/src/x-modules/queries-preview/components/__tests__/query-preview.spec.ts @@ -103,7 +103,11 @@ describe('query preview', () => { it('sends the `QueryPreviewRequestUpdated` event', async () => { const { queryPreviewRequestUpdatedSpy, wrapper, updateExtraParams } = renderQueryPreview({ - queryPreviewInfo: { query: 'shoes', extraParams: { directory: 'Magrathea' } } + queryPreviewInfo: { + query: 'shoes', + extraParams: { directory: 'Magrathea' }, + filters: ['fit:regular'] + } }); jest.advanceTimersByTime(0); // Wait for first emission. @@ -112,6 +116,15 @@ describe('query preview', () => { extraParams: { directory: 'Magrathea' }, + filters: { + fit: [ + { + id: 'fit:regular', + modelName: 'RawFilter', + selected: true + } + ] + }, origin: undefined, query: 'shoes', rows: 24 @@ -126,6 +139,15 @@ describe('query preview', () => { extraParams: { directory: 'Magrathea' }, + filters: { + fit: [ + { + id: 'fit:regular', + modelName: 'RawFilter', + selected: true + } + ] + }, origin: 'popular_search:none', query: 'shoes', rows: 24 @@ -139,6 +161,15 @@ describe('query preview', () => { directory: 'Magrathea', store: 'Uganda' }, + filters: { + fit: [ + { + id: 'fit:regular', + modelName: 'RawFilter', + selected: true + } + ] + }, origin: 'popular_search:none', query: 'shoes', rows: 24 diff --git a/packages/x-components/src/x-modules/queries-preview/components/query-preview-button.vue b/packages/x-components/src/x-modules/queries-preview/components/query-preview-button.vue index cbd110be42..9f52af291d 100644 --- a/packages/x-components/src/x-modules/queries-preview/components/query-preview-button.vue +++ b/packages/x-components/src/x-modules/queries-preview/components/query-preview-button.vue @@ -62,7 +62,8 @@ extraParams: { ...this.params, ...this.queryPreviewInfo.extraParams - } + }, + filters: this.queryPreviewInfo.filters }; } diff --git a/packages/x-components/src/x-modules/queries-preview/components/query-preview.vue b/packages/x-components/src/x-modules/queries-preview/components/query-preview.vue index 6c224d369d..10d7f7dc43 100644 --- a/packages/x-components/src/x-modules/queries-preview/components/query-preview.vue +++ b/packages/x-components/src/x-modules/queries-preview/components/query-preview.vue @@ -35,8 +35,8 @@