From 0817dc64a48db6a7dd02a0b8fa9745fd8c5d4e3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20CG?= Date: Wed, 27 Nov 2024 13:46:05 +0100 Subject: [PATCH] feat: integrate related prompts (#516) --- src/adapter/adapter.ts | 9 +- src/components/desktop/desktop.vue | 25 +- src/components/main.vue | 51 +++- .../custom-related-prompts.vue | 71 +++++ .../related-prompts-tag-list.vue | 224 ++++++++++++++ .../search/results/custom-query-preview.vue | 74 +++++ src/components/search/results/results.vue | 69 +++-- src/i18n/messages.types.ts | 3 + src/i18n/messages/de.messages.json | 281 +++++++++--------- src/i18n/messages/en.messages.json | 3 + src/i18n/messages/es.messages.json | 5 +- src/i18n/messages/fr.messages.json | 3 + src/i18n/messages/it.messages.json | 3 + src/i18n/messages/pt.messages.json | 3 + tests/e2e/cucumber/scroll.spec.ts | 2 +- 15 files changed, 654 insertions(+), 172 deletions(-) create mode 100644 src/components/related-prompts/custom-related-prompts.vue create mode 100644 src/components/related-prompts/related-prompts-tag-list.vue create mode 100644 src/components/search/results/custom-query-preview.vue diff --git a/src/adapter/adapter.ts b/src/adapter/adapter.ts index d83818b9..de39d3a5 100644 --- a/src/adapter/adapter.ts +++ b/src/adapter/adapter.ts @@ -6,7 +6,8 @@ import { recommendationsRequestSchema, resultSchema, semanticQueriesRequestSchema, - experienceControlsResponseSchema + experienceControlsResponseSchema, + relatedPromptsEndpointAdapter } from '@empathyco/x-adapter-platform'; import { ExperienceControlsResponse, @@ -73,3 +74,9 @@ experienceControlsResponseSchema.$override< } } }); + +adapter.relatedPrompts = relatedPromptsEndpointAdapter.extends({ + endpoint: + 'https://api.empathy.co/relatedprompts/mymotivemarketplace?store=Labstore+London&lang=en', + requestMapper: ({ query }) => ({ query }) +}); diff --git a/src/components/desktop/desktop.vue b/src/components/desktop/desktop.vue index d7152b5a..c0e58994 100644 --- a/src/components/desktop/desktop.vue +++ b/src/components/desktop/desktop.vue @@ -9,7 +9,11 @@ - + @@ -52,9 +56,14 @@ diff --git a/src/components/main.vue b/src/components/main.vue index 7d550512..4f0dc4d7 100644 --- a/src/components/main.vue +++ b/src/components/main.vue @@ -4,10 +4,16 @@ - + + + + - + @@ -17,33 +23,62 @@ diff --git a/src/components/related-prompts/custom-related-prompts.vue b/src/components/related-prompts/custom-related-prompts.vue new file mode 100644 index 00000000..8d80668f --- /dev/null +++ b/src/components/related-prompts/custom-related-prompts.vue @@ -0,0 +1,71 @@ + + diff --git a/src/components/related-prompts/related-prompts-tag-list.vue b/src/components/related-prompts/related-prompts-tag-list.vue new file mode 100644 index 00000000..393fcf42 --- /dev/null +++ b/src/components/related-prompts/related-prompts-tag-list.vue @@ -0,0 +1,224 @@ + + + + diff --git a/src/components/search/results/custom-query-preview.vue b/src/components/search/results/custom-query-preview.vue new file mode 100644 index 00000000..04c5e7e2 --- /dev/null +++ b/src/components/search/results/custom-query-preview.vue @@ -0,0 +1,74 @@ + + + diff --git a/src/components/search/results/results.vue b/src/components/search/results/results.vue index 7be3b1d6..c110839b 100644 --- a/src/components/search/results/results.vue +++ b/src/components/search/results/results.vue @@ -6,12 +6,7 @@ > - + -