From 623c97c24867a5805294be02f52494b232d41c24 Mon Sep 17 00:00:00 2001 From: Olga Bulat Date: Tue, 10 Oct 2023 15:18:47 +0300 Subject: [PATCH] Add result kind to the `SELECT_SEARCH_RESULT` event --- .../VAudioDetails/VRelatedAudio.vue | 2 +- .../src/components/VImageCell/VImageCell.vue | 6 ++++ .../VImageDetails/VRelatedImages.vue | 4 +-- .../VSearchResultsGrid/VAudioCollection.vue | 9 +++--- .../VSearchResultsGrid/VAudioList.vue | 11 +++---- .../VSearchResultsGrid/VAudioResult.vue | 19 +++++++----- .../VSearchResultsGrid/VImageGrid.vue | 30 ++++++++++--------- frontend/src/pages/search/audio.vue | 2 +- frontend/src/pages/search/image.vue | 4 +-- frontend/src/types/analytics.ts | 3 ++ frontend/src/types/external-source.ts | 4 --- frontend/src/types/result.ts | 1 + .../e2e/all-results-analytics.spec.ts | 2 ++ .../specs/components/v-image-grid.spec.js | 11 ++++--- 14 files changed, 61 insertions(+), 47 deletions(-) delete mode 100644 frontend/src/types/external-source.ts create mode 100644 frontend/src/types/result.ts diff --git a/frontend/src/components/VAudioDetails/VRelatedAudio.vue b/frontend/src/components/VAudioDetails/VRelatedAudio.vue index a5cacb356c7..2c22ce6afa0 100644 --- a/frontend/src/components/VAudioDetails/VRelatedAudio.vue +++ b/frontend/src/components/VAudioDetails/VRelatedAudio.vue @@ -6,7 +6,7 @@ diff --git a/frontend/src/components/VImageCell/VImageCell.vue b/frontend/src/components/VImageCell/VImageCell.vue index b041940ab9f..f36302d4306 100644 --- a/frontend/src/components/VImageCell/VImageCell.vue +++ b/frontend/src/components/VImageCell/VImageCell.vue @@ -64,6 +64,7 @@ import { computed, defineComponent, PropType } from "vue" import type { AspectRatio, ImageDetail } from "~/types/media" +import type { ResultKind } from "~/types/result" import { useImageCellSize } from "~/composables/use-image-cell-size" import { useI18n } from "~/composables/use-i18n" import { useAnalytics } from "~/composables/use-analytics" @@ -107,6 +108,10 @@ export default defineComponent({ type: String as PropType, default: "square", }, + kind: { + type: String as PropType, + default: "search", + }, relatedTo: { type: [String, null] as PropType, default: null, @@ -175,6 +180,7 @@ export default defineComponent({ const sendSelectSearchResultEvent = () => { sendCustomEvent("SELECT_SEARCH_RESULT", { id: props.image.id, + kind: props.kind, mediaType: IMAGE, provider: props.image.provider, query: props.searchTerm || "", diff --git a/frontend/src/components/VImageDetails/VRelatedImages.vue b/frontend/src/components/VImageDetails/VRelatedImages.vue index d61913b3446..954b620e0bb 100644 --- a/frontend/src/components/VImageDetails/VRelatedImages.vue +++ b/frontend/src/components/VImageDetails/VRelatedImages.vue @@ -4,8 +4,8 @@ {{ $t("imageDetails.relatedImages") }} diff --git a/frontend/src/components/VSearchResultsGrid/VAudioCollection.vue b/frontend/src/components/VSearchResultsGrid/VAudioCollection.vue index 55c365eb594..db3f04ab70a 100644 --- a/frontend/src/components/VSearchResultsGrid/VAudioCollection.vue +++ b/frontend/src/components/VSearchResultsGrid/VAudioCollection.vue @@ -18,10 +18,10 @@ -