-
Notifications
You must be signed in to change notification settings - Fork 39
feat(headless): support spotlight content for commerce COMHUB2-1228 #6646
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
Merged
Merged
Changes from 23 commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
c40870a
wip
Tooni 57428c9
basic typesafe version
Tooni 0b1036b
refactor to dedupe a bit
Tooni c616a44
refactor types a bit
Tooni d8a47d5
see if this compiles
Tooni c9ae7e0
fix types
Tooni dc5d00a
is this working?
Tooni 2404f1d
reduce diff
Tooni a75aa10
refactor a default value
Tooni c4d8341
dedupe an option
Tooni 72011ea
update comment
Tooni 8d9aced
fix a type
Tooni f8280c3
fix a type
Tooni 215145a
checkpoint version with no build errors
Tooni 7c4fdb3
fix slice tests
Tooni 4be83f8
fix product listing slice
Tooni 5149845
fix headless-product-listing.test
Tooni f163219
product listing slice new tests
Tooni ccc14c5
Merge remote-tracking branch 'origin/main' into COMHUB2-1228
Tooni fb43ff0
fix product listing selector tests
Tooni a8d5bab
minor refactor
Tooni 86afe24
respond to ci
Tooni 9738dc2
remove unused field
Tooni 2913fd9
respond to a comment
Tooni 531092a
fix export
Tooni d62cdaf
Merge branch 'main' into COMHUB2-1228
Tooni 4053b0c
put position on spotlight
Tooni 750212b
put responseId on result too
Tooni a36065d
fix test
Tooni 290c634
Merge remote-tracking branch 'origin/main' into COMHUB2-1228
Tooni 3c28bd6
rearrange tests a bit
Tooni aa8d27e
fix type error
Tooni 03a2f6b
Merge remote-tracking branch 'origin/main' into COMHUB2-1228
Tooni 4fc3b42
make minor improvement to typing
Tooni 5c25e56
Merge branch 'main' into COMHUB2-1228
Tooni c1963bf
Merge branch 'main' into COMHUB2-1228
Tooni 8d9d483
Merge remote-tracking branch 'origin/main' into COMHUB2-1228
Tooni 8fa97f6
respond to @alexprudhomme's feedback
Tooni 0faa490
Merge branch 'COMHUB2-1228' of github.com:coveo/ui-kit into COMHUB2-1228
Tooni 4bac225
rearrange some imports
Tooni 238bc9c
Merge branch 'main' into COMHUB2-1228
Tooni 864b202
Merge branch 'main' into COMHUB2-1228
Tooni acd03d3
Merge remote-tracking branch 'origin/main' into COMHUB2-1228
Tooni 186ea12
refactor: merge preprocessing functions
Tooni c57d67c
refactor: deduplicate some code for processing products/results
Tooni 72b9f07
avoid type cast
Tooni fc1ea6c
reorder
Tooni 731d261
Merge branch 'COMHUB2-1228' of github.com:coveo/ui-kit into COMHUB2-1228
Tooni bb9b549
test: refactor tests to check enableResults param with mocks
Tooni d2d8020
test: rearrange tests a bit
Tooni 66c46e0
restore code that ai randomly deleted
Tooni 1666a81
Merge branch 'main' into COMHUB2-1228
Tooni 7fd8d46
Merge branch 'main' into COMHUB2-1228
Tooni cbd1e79
add id field
Tooni 21f7836
Merge branch 'COMHUB2-1228' of github.com:coveo/ui-kit into COMHUB2-1228
Tooni 768c130
fix type
Tooni File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| import type {BaseProduct, Product} from './product.js'; | ||
|
|
||
| export enum ResultType { | ||
| CHILD_PRODUCT = 'childProduct', | ||
| PRODUCT = 'product', | ||
| SPOTLIGHT = 'spotlight', | ||
| } | ||
|
|
||
| export interface SpotlightContent { | ||
| /** | ||
| * The URI to navigate to when the spotlight content is clicked. | ||
| */ | ||
| clickUri: string; | ||
| /** | ||
| * The image URL for desktop display. | ||
| */ | ||
| desktopImage: string; | ||
| /** | ||
| * The image URL for mobile display. | ||
| */ | ||
| mobileImage?: string; | ||
| /** | ||
| * The name of the spotlight content. | ||
| */ | ||
| name?: string; | ||
| /** | ||
| * The description of the spotlight content. | ||
| */ | ||
| description?: string; | ||
| /** | ||
| * The result type identifier, always SPOTLIGHT for spotlight content. | ||
| */ | ||
| resultType: ResultType.SPOTLIGHT; | ||
| } | ||
|
|
||
| export type BaseResult = BaseProduct | SpotlightContent; | ||
| export type Result = Product | SpotlightContent; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import type {EnableResultsParam} from '../commerce-api-params.js'; | ||
| import type {FilterableCommerceAPIRequest} from '../common/request.js'; | ||
|
|
||
| export type CommerceListingRequest = FilterableCommerceAPIRequest & | ||
| EnableResultsParam; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import type {CommerceSuccessResponse} from '../common/response.js'; | ||
| import type {BaseResult} from '../common/result.js'; | ||
|
|
||
| export interface ListingCommerceSuccessResponse | ||
| extends CommerceSuccessResponse { | ||
| results: BaseResult[]; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.