-
Notifications
You must be signed in to change notification settings - Fork 21
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
feat: query preview components allow adding extra params to the request #1270
Changes from all commits
b116bff
b60bbd9
5af7914
a627cc3
456d207
a75a05b
1b28629
72548f6
ac45301
cee26fa
8e1a008
a51a00d
af6a719
663521e
48ce240
1a9c819
d7d2896
201c7c1
e95532c
d0e5983
7a560e7
f7304ae
4fbae0b
9f8711b
7226167
25602d4
1de54b3
bc1d3a1
773db9b
f54611e
07ddc70
2b2a614
cea3da7
57374af
3a087e0
d12fe0d
dfc7677
8afac86
0c89eaf
c099e1d
13c2bd3
a900051
ba6f6ed
87a0f24
593dfc8
2572bf7
b19770a
c4eaa5d
f6752b9
6d10177
88cbab6
2e0768b
0b203a5
9826536
aaa420b
2c33b9b
602846b
c116447
7a97094
8bb4a94
fa9bf2c
e49dd4b
cd8bb29
092e933
4051a3d
fdb4966
bf9d6cc
7277501
a96e323
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -248,12 +248,17 @@ | |
<LocationProvider location="no_results"> | ||
<QueryPreviewList | ||
:debounceTimeMs="250" | ||
:queries="queriesToPreview" | ||
#default="{ query, totalResults, results }" | ||
:queriesPreviewInfo="queriesPreviewInfo" | ||
#default="{ queryPreviewInfo, totalResults, results }" | ||
data-test="brand-recommendation" | ||
> | ||
<div class="x-flex x-flex-col x-gap-8 x-mb-16"> | ||
<h1 class="x-title2">{{ query }} ({{ totalResults }})</h1> | ||
<QueryPreviewButton | ||
class="x-w-fit x-button-xl x-button-ghost" | ||
:queryPreviewInfo="queryPreviewInfo" | ||
> | ||
{{ `${queryPreviewInfo.query} (${totalResults})` }} | ||
</QueryPreviewButton> | ||
<SlidingPanel :resetOnContentChange="false"> | ||
<div class="x-flex x-gap-8"> | ||
<Result | ||
|
@@ -348,8 +353,8 @@ | |
</h1> | ||
<LocationProvider :location="$x.noResults ? 'no_results' : 'low_results'"> | ||
<QueryPreviewList | ||
:queries="queries" | ||
#default="{ query, results }" | ||
:queries-preview-info="queries.map(q => ({ query: q }))" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd move this to a property There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. but |
||
#default="{ queryPreviewInfo: { query }, results }" | ||
queryFeature="semantics" | ||
> | ||
<div | ||
|
@@ -496,6 +501,8 @@ | |
import SemanticQueries from '../../x-modules/semantic-queries/components/semantic-queries.vue'; | ||
import SemanticQuery from '../../x-modules/semantic-queries/components/semantic-query.vue'; | ||
import { useQueriesPreview } from '../../x-modules/queries-preview/composables/use-queries-preview.composable'; | ||
import { QueryPreviewInfo } from '../../x-modules/queries-preview/store/types'; | ||
import QueryPreviewButton from '../../x-modules/queries-preview/components/query-preview-button.vue'; | ||
import Aside from './aside.vue'; | ||
import PredictiveLayer from './predictive-layer.vue'; | ||
import Result from './result.vue'; | ||
|
@@ -507,6 +514,7 @@ | |
infiniteScroll | ||
}, | ||
components: { | ||
QueryPreviewButton, | ||
DisplayResultProvider, | ||
FallbackDisclaimer, | ||
QueryPreviewList, | ||
|
@@ -615,7 +623,29 @@ | |
} | ||
}; | ||
|
||
protected queriesToPreview = ['sunglasses', 'handbag', 'earrings', 'jeans', 't-shirt']; | ||
protected queriesPreviewInfo: QueryPreviewInfo[] = [ | ||
{ | ||
query: 'cortina', | ||
extraParams: { store: 'Gijón' } | ||
}, | ||
{ | ||
query: 'marni summer dress' | ||
}, | ||
{ | ||
query: 'woven hat' | ||
}, | ||
{ | ||
query: 'jeans', | ||
extraParams: { store: 'Gijón' } | ||
}, | ||
{ | ||
query: 't-shirt' | ||
} | ||
]; | ||
|
||
protected get queries(): string[] { | ||
return this.queriesPreviewInfo.map(item => item.query); | ||
} | ||
CachedaCodes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
toggleE2EAdapter(): void { | ||
adapterConfig.e2e = !adapterConfig.e2e; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding access to the module's state here to be able to filter if the event of the emitter is fired based on the current values of the state.