Skip to content

Commit

Permalink
feat(tagging): add displayClick to recommendations and customer previ…
Browse files Browse the repository at this point in the history
…ews (#294)

EMP-1110
  • Loading branch information
ajperezbau authored Jun 19, 2023
1 parent fbcf37c commit 55fb68d
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 29 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"dependencies": {
"@empathyco/x-adapter": "^8.0.0-alpha.22",
"@empathyco/x-adapter-platform": "^1.0.0-alpha.77",
"@empathyco/x-adapter-platform": "^1.0.0-alpha.79",
"@empathyco/x-archetype-utils": "^0.1.0-alpha.15",
"@empathyco/x-components": "^3.0.0-alpha.388",
"@empathyco/x-deep-merge": "^1.3.0-alpha.29",
Expand Down
20 changes: 12 additions & 8 deletions src/components/pre-search/custom-query-preview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@
<ArrowRightIcon class="x-icon-lg" />
</BaseEventButton>
</template>
<div class="x-flex x-gap-16 x-pt-16 max-desktop:x-px-16">
<Result
v-for="result in results"
:key="result.id"
:result="result"
class="x-w-[calc(38vw-16px)] desktop:x-w-[216px]"
/>
</div>
<DisplayClickProvider resultFeature="brand_recommendations">
<div class="x-flex x-gap-16 x-pt-16 max-desktop:x-px-16">
<Result
v-for="result in results"
:key="result.id"
:result="result"
class="x-w-[calc(38vw-16px)] desktop:x-w-[216px]"
/>
</div>
</DisplayClickProvider>
</CustomSlidingPanel>
</div>
</QueryPreviewList>
Expand All @@ -47,10 +49,12 @@
} from '@empathyco/x-components';
import { default as Result } from '../results/result.vue';
import CustomSlidingPanel from '../custom-sliding-panel.vue';
import DisplayClickProvider from '../search/display-click-provider.vue';
@Component({
components: {
CustomSlidingPanel,
DisplayClickProvider,
QueryPreview,
Result,
BaseEventButton,
Expand Down
18 changes: 11 additions & 7 deletions src/components/predictive-layer/sliding-recommendations.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@

<Recommendations class="x-flex x-flex-row x-gap-12 x-pl-16 desktop:x-pl-0">
<template #default="{ recommendation }">
<Result
:result="recommendation"
data-test="recommendation-item"
:showDescription="false"
:showAddToCart="false"
class="x-w-[200px]"
/>
<DisplayClickProvider resultFeature="recommendations">
<Result
:result="recommendation"
data-test="recommendation-item"
:showDescription="false"
:showAddToCart="false"
class="x-w-[200px]"
/>
</DisplayClickProvider>
</template>
</Recommendations>

Expand All @@ -39,11 +41,13 @@
import { Recommendations } from '@empathyco/x-components/recommendations';
import { defineComponent } from 'vue';
import Result from '../results/result.vue';
import DisplayClickProvider from '../search/display-click-provider.vue';
export default defineComponent({
components: {
ChevronLeftIcon,
ChevronRightIcon,
DisplayClickProvider,
Recommendations,
Result,
SlidingPanel
Expand Down
22 changes: 13 additions & 9 deletions src/components/results/custom-recommendations.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@
</h1>
<Recommendations v-if="!$x.totalResults">
<template #layout="{ recommendations }">
<BaseGrid
#default="{ item: result }"
:animation="staggeredFadeAndSlide"
:columns="columns"
:items="recommendations"
class="x-gap-y-32 x-gap-x-16"
>
<Result :result="result" data-test="recommendation-item" />
</BaseGrid>
<DisplayClickProvider resultFeature="recommendations">
<BaseGrid
#default="{ item: result }"
:animation="staggeredFadeAndSlide"
:columns="columns"
:items="recommendations"
class="x-gap-y-32 x-gap-x-16"
>
<Result :result="result" data-test="recommendation-item" />
</BaseGrid>
</DisplayClickProvider>
</template>
</Recommendations>
</div>
Expand All @@ -27,11 +29,13 @@
import { Recommendations } from '@empathyco/x-components/recommendations';
import { computed, defineComponent } from 'vue';
import { useDevice } from '../../composables/use-device.composable';
import DisplayClickProvider from '../search/display-click-provider.vue';
import Result from './result.vue';
export default defineComponent({
components: {
BaseGrid,
DisplayClickProvider,
Recommendations,
Result
},
Expand Down

0 comments on commit 55fb68d

Please sign in to comment.