Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bundleRecommendations component #965

Merged
merged 40 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
5547094
feat(preact-components-bundlerecommendations): new component for upco…
chrisFrazier77 Dec 19, 2023
b4f27b2
test(preact-components-testing): updating tests to pass with swiper u…
chrisFrazier77 Dec 20, 2023
53431af
chore(preact-demo-recs): reverting demo back to expected recommendati…
chrisFrazier77 Dec 20, 2023
5fc146d
test(recommendation.cy): reliability hardening to cypress recommendat…
chrisFrazier77 Dec 20, 2023
be36989
refactor(preact-components-bundledrecommendation): some tweaks and bu…
chrisFrazier77 Jan 3, 2024
71fa958
refactor(preact-components-carousel): some typing clean up
chrisFrazier77 Jan 3, 2024
ac7f9be
refactor(preact-components-bundlerecommendation): typing changes
chrisFrazier77 Jan 3, 2024
ede9163
refactor(recommendationcontroller): change bundle track event types
chrisFrazier77 Jan 3, 2024
917c20c
test(preact-components-cypress-testing): adding cypress component tes…
chrisFrazier77 Jan 9, 2024
1d49d2d
test(preact-components-bundlerecs): temporary remove bundle rec beaco…
chrisFrazier77 Jan 9, 2024
3e00e5f
Merge pull request #976 from searchspring/swiperUpgrade-Testing
chrisFrazier77 Jan 9, 2024
15208ed
feat(product-variants): adding initial product variants code to the r…
chrisFrazier77 Jan 23, 2024
af653cc
refactor(searchresultstore): variants are broken
chrisFrazier77 Jan 23, 2024
42d3c8e
refactor(store-mobx/searchresultstore): changes to get a demo working
korgon Jan 25, 2024
80caa17
refactor(preact-components-bundledrecommendation): clean up and some …
chrisFrazier77 Feb 1, 2024
5bde153
Merge pull request #988 from searchspring/bundled-variants
chrisFrazier77 Feb 1, 2024
eeec473
build(cypress-component-testing): build fixed, component cypress test…
chrisFrazier77 Feb 2, 2024
8a1f12f
chore(merge-develop): merge in develop
chrisFrazier77 Feb 2, 2024
dccb266
refactor(fix-demo): fix preact-demo for tests to pass
chrisFrazier77 Feb 2, 2024
bcb5baa
test(bundlerecommendations): test hardenening
chrisFrazier77 Feb 5, 2024
dc12622
refactor(bundlerecommendations): cartstore, bundleRecommendation clea…
chrisFrazier77 Feb 21, 2024
06aeca1
chore(merge-develop): merge in develop
chrisFrazier77 Feb 21, 2024
88bae80
test(preact-components-bundlerecommendation): adding some additional …
chrisFrazier77 Feb 23, 2024
881ad04
fix(bundledrecommendation): bugfixes around seedincarousel
chrisFrazier77 Feb 27, 2024
6a7a761
feat(preact-components/carousel): updating to swiper v11
korgon Feb 27, 2024
7bd6371
refactor(preact-components-carousel): adding a few things for backwar…
chrisFrazier77 Feb 27, 2024
f16f8c3
Merge pull request #1005 from searchspring/bundleRecComponent-v11
chrisFrazier77 Feb 27, 2024
80139d0
test(preact-components-bundlerec): adding e2e tests for bundlerecs
chrisFrazier77 Feb 28, 2024
ed6629d
group review changes
korgon Mar 4, 2024
355b5c0
fix(preact-components-carousel): monkey patching navigation.onprev an…
chrisFrazier77 Mar 4, 2024
abdc4eb
fix(preact-components-carousel): custom swiper navigation support, bc…
chrisFrazier77 Mar 4, 2024
2c04a47
test: fixing jest tests after dependency changes
korgon Mar 4, 2024
cfc8e61
build: fixes to mobx packages to prevent mismatched versions
korgon Mar 4, 2024
2091afb
build: removing nx dependency
korgon Mar 5, 2024
278de24
build: bringing `nx` devDependency back for build fix
korgon Mar 5, 2024
21833b3
refactor(preact-components/recommendation): rename component -> Recom…
korgon Mar 5, 2024
98e475f
refactor(preact-components-recommendationbundle): change default valu…
chrisFrazier77 Mar 5, 2024
25a61b0
test(preact-components-recommendationbundle): fixing tests, and few s…
chrisFrazier77 Mar 5, 2024
b45deba
refactor(preact-components-recommendationbundle): adding back vertica…
chrisFrazier77 Mar 5, 2024
fb544e5
docs: addressing some documentation around recommendations
korgon Mar 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
144,793 changes: 72,387 additions & 72,406 deletions package-lock.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,19 @@ import type { RecommendationStore } from '@searchspring/snap-store-mobx';
import type { Next } from '@searchspring/snap-event-manager';
import type { RecommendationControllerConfig, BeforeSearchObj, AfterStoreObj, ControllerServices, ContextVariables } from '../types';

export interface selectedItem {
chrisFrazier77 marked this conversation as resolved.
Show resolved Hide resolved
id: string;
quantity: number;
}

type RecommendationTrackMethods = {
product: {
click: (e: MouseEvent, result: any) => BeaconEvent | undefined;
render: (result: any) => BeaconEvent | undefined;
impression: (result: any) => BeaconEvent | undefined;
};
click: (e: MouseEvent) => BeaconEvent | undefined;
addBundleToCart: (e: MouseEvent, results: selectedItem[], price: number) => BeaconEvent | undefined;
impression: () => BeaconEvent | undefined;
render: (results?: Product[]) => BeaconEvent | undefined;
};
Expand Down Expand Up @@ -206,6 +212,34 @@ export class RecommendationController extends AbstractController {
return event;
},
},
addBundleToCart: (e: MouseEvent, results: selectedItem[], price: number): BeaconEvent | undefined => {
chrisFrazier77 marked this conversation as resolved.
Show resolved Hide resolved
if (!this.store.profile.tag) return;
const event: BeaconEvent = this.tracker.track.event({
type: BeaconType.PROFILE_CLICK,
category: BeaconCategory.RECOMMENDATIONS,
context: this.config.globals.siteId ? { website: { trackingCode: this.config.globals.siteId } } : undefined,
event: {
context: {
action: 'navigate',
placement: this.store.profile.placement,
tag: this.store.profile.tag,
type: 'product-recommendation',
results: results,
price: price,
},
profile: {
tag: this.store.profile.tag,
placement: this.store.profile.placement,
threshold: this.store.profile.display.threshold,
templateId: this.store.profile.display.template.uuid,
seed: getSeed(),
},
},
});
this.events.click = event;
this.eventManager.fire('track.click', { controller: this, event: e, trackEvent: event });
return event;
},
click: (e: MouseEvent): BeaconEvent | undefined => {
if (!this.store.profile.tag) return;
const event: BeaconEvent = this.tracker.track.event({
Expand Down Expand Up @@ -284,7 +318,7 @@ export class RecommendationController extends AbstractController {
this.eventManager.fire('track.render', { controller: this, trackEvent: event });
return event;
},
};
} as RecommendationTrackMethods;
})();

get params(): RecommendCombinedRequestModel {
Expand Down
2 changes: 1 addition & 1 deletion packages/snap-preact-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"dequal": "2.0.3",
"mobx-react-lite": "3.4.0",
"react-ranger": "2.1.0",
"swiper": "6.8.4"
"swiper": "9.0.5"
korgon marked this conversation as resolved.
Show resolved Hide resolved
},
"peerDependencies": {
"preact": "10.9.0"
Expand Down
Loading
Loading