@coveo/quantic 3.43.1 → 3.43.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/force-app/main/default/lwc/quanticCategoryFacet/e2e/data.ts +70 -6
- package/force-app/main/default/lwc/quanticCategoryFacet/e2e/fixture.ts +17 -13
- package/force-app/main/default/lwc/quanticCategoryFacet/e2e/quanticCategoryFacet.e2e.ts +34 -14
- package/force-app/main/default/lwc/quanticDateFacet/e2e/data.ts +24 -4
- package/force-app/main/default/lwc/quanticDateFacet/e2e/fixture.ts +17 -13
- package/force-app/main/default/lwc/quanticDateFacet/e2e/quanticDateFacet.e2e.ts +26 -4
- package/force-app/main/default/lwc/quanticFacet/e2e/data.ts +50 -9
- package/force-app/main/default/lwc/quanticFacet/e2e/fixture.ts +18 -13
- package/force-app/main/default/lwc/quanticFacet/e2e/quanticFacet.e2e.ts +43 -9
- package/force-app/main/default/lwc/quanticGeneratedAnswer/templates/generatedAnswer.html +3 -3
- package/force-app/main/default/lwc/quanticGeneratedAnswerThread/quanticGeneratedAnswerThread.css +16 -4
- package/force-app/main/default/lwc/quanticGeneratedAnswerThread/quanticGeneratedAnswerThread.html +12 -16
- package/force-app/main/default/lwc/quanticNumericFacet/e2e/data.ts +24 -4
- package/force-app/main/default/lwc/quanticNumericFacet/e2e/fixture.ts +17 -13
- package/force-app/main/default/lwc/quanticNumericFacet/e2e/quanticNumericFacet.e2e.ts +28 -6
- package/force-app/main/default/lwc/quanticPager/e2e/fixture.ts +3 -3
- package/force-app/main/default/lwc/quanticPager/e2e/quanticPager.e2e.ts +1 -1
- package/force-app/main/default/lwc/quanticSort/e2e/fixture.ts +3 -2
- package/force-app/main/default/lwc/quanticThreadItem/__tests__/quanticThreadItem.test.js +138 -0
- package/force-app/main/default/lwc/quanticThreadItem/quanticThreadItem.css +50 -11
- package/force-app/main/default/lwc/quanticThreadItem/quanticThreadItem.html +17 -13
- package/force-app/main/default/lwc/quanticThreadItem/quanticThreadItem.js +38 -1
- package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/data.ts +66 -0
- package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/fixture.ts +20 -4
- package/force-app/main/default/lwc/quanticTimeframeFacet/e2e/quanticTimeframeFacet.e2e.ts +24 -0
- package/force-app/main/default/staticresources/coveobueno/browser/bueno.js +1 -3
- package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +3 -3
- package/force-app/main/default/staticresources/coveoheadless/definitions/app/insight-engine/insight-engine.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/case-assist.index.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/commerce.index.d.ts +6 -6
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/breadcrumb-manager/headless-breadcrumb-manager.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/sort/headless-core-commerce-sort.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/core/url-manager/headless-core-url-manager.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/product-listing/headless-product-listing.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/recommendations/headless-recommendations.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/commerce/search/headless-search.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/context/headless-core-context.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/did-you-mean/headless-core-did-you-mean.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facet-manager/headless-core-facet-manager.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/category-facet/headless-core-category-facet.d.ts +0 -4
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/facet/headless-core-facet.d.ts +0 -5
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/range-facet/date-facet/headless-core-date-facet.d.ts +1 -5
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/range-facet/date-facet/headless-core-date-filter.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/range-facet/numeric-facet/headless-core-numeric-facet.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/range-facet/numeric-facet/headless-core-numeric-filter.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/folded-result-list/headless-core-folded-result-list.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/pager/headless-core-pager.d.ts +0 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/query-error/headless-core-query-error.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/recent-queries-list/headless-core-recent-queries-list.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/result-list/headless-core-result-list.d.ts +0 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/results-per-page/headless-core-results-per-page.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/sort/headless-core-sort.d.ts +0 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/status/headless-core-status.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/tab/headless-core-tab.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/triggers/headless-core-notify-trigger.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/triggers/headless-core-query-trigger.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/triggers/headless-core-redirection-trigger.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/dictionary-field-context/headless-dictionary-field-context.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/document-suggestion-list/case-assist-headless-interactive-result.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facets/automatic-facet-generator/headless-automatic-facet-generator.d.ts +0 -4
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facets/category-facet/headless-category-facet.d.ts +2 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facets/facet/headless-facet.d.ts +2 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/field-suggestions/category-facet/headless-category-field-suggestions.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/field-suggestions/facet/headless-field-suggestions.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/generated-answer/headless-interactive-citation.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/history-manager/headless-history-manager.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/facet-conditions-manager/headless-facet-conditions-manager.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/generated-answer/headless-insight-interactive-citation.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/result-list/headless-insight-interactive-result.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/insight/results-per-page/headless-insight-results-per-page.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/instant-results/instant-results.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/pager/headless-pager.d.ts +2 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/query-summary/headless-query-summary.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/quickview/headless-quickview.d.ts +1 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/recent-results-list/headless-recent-results-list.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/recommendation/headless-recommendation.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/recommendation/result-list/headless-recommendation-interactive-result.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/relevance-inspector/headless-relevance-inspector.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/result-list/headless-interactive-result.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/result-list/headless-result-list.d.ts +2 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/results-per-page/headless-results-per-page.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/smart-snippet-questions-list/headless-smart-snippet-questions-list.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/sort/headless-sort.d.ts +2 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/standalone-search-box/headless-standalone-search-box.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/static-filter/headless-static-filter.d.ts +1 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/triggers/headless-execute-trigger.d.ts +0 -4
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/url-manager/headless-url-manager.d.ts +0 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/configuration/configuration-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/context/cart/cart-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/context/context-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/commerce/facets/category-facet/category-facet-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/folding/insight-folding-actions.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/insight-search/insight-query-set-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/insight-search/insight-search-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/query-set/query-set-actions-loader.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/index.d.ts +7 -7
- package/force-app/main/default/staticresources/coveoheadless/definitions/insight.index.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/recommendation.index.d.ts +2 -2
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/instant-products/headless-instant-products.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr/commerce/controllers/standalone-search-box/headless-standalone-search-box.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-commerce-next.index.d.ts +4 -4
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-commerce.index.d.ts +4 -4
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/instant-products/headless-instant-products.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/controllers/standalone-search-box/headless-standalone-search-box.ssr.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next/commerce/types/engine.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr-next.index.d.ts +6 -6
- package/force-app/main/default/staticresources/coveoheadless/definitions/ssr.index.d.ts +6 -6
- package/force-app/main/default/staticresources/coveoheadless/headless.js +17 -17
- package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +16 -16
- package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +4 -4
- package/package.json +3 -3
|
@@ -2,27 +2,30 @@
|
|
|
2
2
|
list-style: none;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
.thread-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
.thread-item__grid {
|
|
6
|
+
display: grid;
|
|
7
|
+
grid-template-columns: 10px 1fr;
|
|
8
|
+
grid-template-rows: auto 1fr;
|
|
9
|
+
column-gap: var(--lwc-spacingXSmall, 8px);
|
|
8
10
|
}
|
|
9
11
|
|
|
10
|
-
.thread-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
border-radius: 50%;
|
|
14
|
-
background-color: var(--lwc-colorBorder, #dddbda);
|
|
12
|
+
.thread-item__timeline {
|
|
13
|
+
grid-row: 1 / -1;
|
|
14
|
+
align-self: stretch;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
.thread-item__dot
|
|
18
|
-
|
|
17
|
+
.thread-item__dot-column {
|
|
18
|
+
width: 10px;
|
|
19
|
+
height: 1lh;
|
|
20
|
+
margin-block: var(--lwc-spacingXxSmall, 4px);
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
.thread-item__line {
|
|
22
24
|
position: relative;
|
|
25
|
+
flex: 1;
|
|
23
26
|
width: 1px;
|
|
24
|
-
height: 100%;
|
|
25
27
|
background-color: var(--lwc-colorBorder, #dddbda);
|
|
28
|
+
transition: background-color 0.2s ease;
|
|
26
29
|
}
|
|
27
30
|
|
|
28
31
|
.thread-item__line::before,
|
|
@@ -33,6 +36,7 @@
|
|
|
33
36
|
width: 1px;
|
|
34
37
|
height: 8px;
|
|
35
38
|
background-color: var(--lwc-colorBorder, #dddbda);
|
|
39
|
+
transition: background-color 0.2s ease;
|
|
36
40
|
}
|
|
37
41
|
|
|
38
42
|
.thread-item__line::before {
|
|
@@ -43,6 +47,41 @@
|
|
|
43
47
|
bottom: -8px;
|
|
44
48
|
}
|
|
45
49
|
|
|
50
|
+
.thread-item__line-column--interactive {
|
|
51
|
+
cursor: pointer;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.thread-item__line-column--interactive:hover .thread-item__line,
|
|
55
|
+
.thread-item__line-column--interactive:hover .thread-item__line::before,
|
|
56
|
+
.thread-item__line-column--interactive:hover .thread-item__line::after {
|
|
57
|
+
background-color: var(--lwc-colorTextDefault, #080707);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.thread-item__content {
|
|
61
|
+
grid-column: 2;
|
|
62
|
+
grid-row: 2;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.thread-item__dot {
|
|
66
|
+
height: 8px;
|
|
67
|
+
width: 8px;
|
|
68
|
+
border-radius: 50%;
|
|
69
|
+
background-color: var(--lwc-colorBorder, #dddbda);
|
|
70
|
+
transition: background-color 0.2s ease;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.thread-item__dot--interactive {
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.thread-item__dot--interactive:hover {
|
|
78
|
+
background-color: var(--lwc-colorTextDefault, #080707);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.thread-item__dot--expanded {
|
|
82
|
+
background-color: var(--lwc-colorTextDefault, #080707);
|
|
83
|
+
}
|
|
84
|
+
|
|
46
85
|
.thread-item__clamped-text {
|
|
47
86
|
display: -webkit-box;
|
|
48
87
|
-webkit-line-clamp: 3;
|
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<li class="thread-item">
|
|
3
|
-
<div class="
|
|
3
|
+
<div class="thread-item__grid">
|
|
4
4
|
<div
|
|
5
|
-
class=
|
|
5
|
+
class={lineColumnClass}
|
|
6
|
+
data-testid="thread-item-line-column"
|
|
7
|
+
onclick={handleLineClick}
|
|
6
8
|
>
|
|
7
|
-
<
|
|
9
|
+
<div
|
|
10
|
+
class="slds-grid slds-grid_align-center slds-grid_vertical-align-center thread-item__dot-column"
|
|
11
|
+
>
|
|
12
|
+
<span
|
|
13
|
+
class={dotClass}
|
|
14
|
+
data-testid="thread-item-dot"
|
|
15
|
+
onclick={handleDotClick}
|
|
16
|
+
></span>
|
|
17
|
+
</div>
|
|
18
|
+
<template lwc:if={shouldDisplayLine}>
|
|
19
|
+
<span class="thread-item__line" data-testid="thread-item-line"></span>
|
|
20
|
+
</template>
|
|
8
21
|
</div>
|
|
9
22
|
<div class="slds-has-flexi-truncate">
|
|
10
23
|
<template lwc:if={disableCollapse}>
|
|
@@ -25,18 +38,9 @@
|
|
|
25
38
|
</button>
|
|
26
39
|
</template>
|
|
27
40
|
</div>
|
|
28
|
-
</div>
|
|
29
|
-
<div class="slds-grid">
|
|
30
|
-
<div
|
|
31
|
-
class="slds-grid slds-grid_align-center slds-shrink-none thread-item__line-column slds-m-right_x-small"
|
|
32
|
-
>
|
|
33
|
-
<template lwc:if={shouldDisplayLine}>
|
|
34
|
-
<span class="thread-item__line" data-testid="thread-item-line"></span>
|
|
35
|
-
</template>
|
|
36
|
-
</div>
|
|
37
41
|
<div
|
|
38
42
|
id="thread-item-content"
|
|
39
|
-
class="slds-
|
|
43
|
+
class="slds-p-left_x-small slds-p-vertical_xx-small thread-item__content"
|
|
40
44
|
data-testid="thread-item-content"
|
|
41
45
|
>
|
|
42
46
|
<div hidden={contentHidden}>
|
|
@@ -58,6 +58,21 @@ export default class QuanticThreadItem extends LightningElement {
|
|
|
58
58
|
this._isExpanded = !this._isExpanded;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
handleDotClick(event) {
|
|
62
|
+
event.stopPropagation();
|
|
63
|
+
if (this.disableCollapse) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
this._isExpanded = !this._isExpanded;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
handleLineClick() {
|
|
70
|
+
if (this.disableCollapse || this.hideLine) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
this._isExpanded = !this._isExpanded;
|
|
74
|
+
}
|
|
75
|
+
|
|
61
76
|
get shouldDisplayLine() {
|
|
62
77
|
return !this.hideLine;
|
|
63
78
|
}
|
|
@@ -75,6 +90,28 @@ export default class QuanticThreadItem extends LightningElement {
|
|
|
75
90
|
}
|
|
76
91
|
|
|
77
92
|
get dotClass() {
|
|
78
|
-
|
|
93
|
+
const classes = ['thread-item__dot'];
|
|
94
|
+
if (this._isExpanded) {
|
|
95
|
+
classes.push('thread-item__dot--expanded');
|
|
96
|
+
}
|
|
97
|
+
if (!this.disableCollapse) {
|
|
98
|
+
classes.push('thread-item__dot--interactive');
|
|
99
|
+
}
|
|
100
|
+
return classes.join(' ');
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
get lineColumnClass() {
|
|
104
|
+
const classes = [
|
|
105
|
+
'slds-grid',
|
|
106
|
+
'slds-grid_align-center',
|
|
107
|
+
'slds-grid_vertical',
|
|
108
|
+
'slds-grid_vertical-align-center',
|
|
109
|
+
'slds-shrink-none',
|
|
110
|
+
'thread-item__timeline',
|
|
111
|
+
];
|
|
112
|
+
if (!this.disableCollapse && !this.hideLine) {
|
|
113
|
+
classes.push('thread-item__line-column--interactive');
|
|
114
|
+
}
|
|
115
|
+
return classes.join(' ');
|
|
79
116
|
}
|
|
80
117
|
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
const facetId = 'Date';
|
|
2
|
+
const field = 'Date';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Facet response before any value is selected.
|
|
6
|
+
* The values mirror the relative timeframes declared on the exampleQuanticTimeframeFacet.html file
|
|
7
|
+
*/
|
|
8
|
+
export const initialFacetData = {
|
|
9
|
+
facetId,
|
|
10
|
+
field,
|
|
11
|
+
moreValuesAvailable: false,
|
|
12
|
+
values: [
|
|
13
|
+
{
|
|
14
|
+
start: 'now',
|
|
15
|
+
end: 'next-1-year',
|
|
16
|
+
endInclusive: false,
|
|
17
|
+
state: 'idle',
|
|
18
|
+
numberOfResults: 10,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
start: 'past-2-week',
|
|
22
|
+
end: 'now',
|
|
23
|
+
endInclusive: false,
|
|
24
|
+
state: 'idle',
|
|
25
|
+
numberOfResults: 20,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
start: 'past-1-month',
|
|
29
|
+
end: 'now',
|
|
30
|
+
endInclusive: false,
|
|
31
|
+
state: 'idle',
|
|
32
|
+
numberOfResults: 30,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
start: 'past-1-year',
|
|
36
|
+
end: 'now',
|
|
37
|
+
endInclusive: false,
|
|
38
|
+
state: 'idle',
|
|
39
|
+
numberOfResults: 40,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
start: 'past-10-year',
|
|
43
|
+
end: 'now',
|
|
44
|
+
endInclusive: false,
|
|
45
|
+
state: 'idle',
|
|
46
|
+
numberOfResults: 50,
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
indexScore: 0.4,
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const [firstRange, ...remainingRanges] = initialFacetData.values;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Facet response after the first value is selected.
|
|
56
|
+
*/
|
|
57
|
+
export const selectedFacetData = {
|
|
58
|
+
...initialFacetData,
|
|
59
|
+
values: [
|
|
60
|
+
{
|
|
61
|
+
...firstRange,
|
|
62
|
+
state: 'selected',
|
|
63
|
+
},
|
|
64
|
+
...remainingRanges,
|
|
65
|
+
],
|
|
66
|
+
};
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
insightSearchRequestRegex,
|
|
7
7
|
} from '../../../../../../playwright/utils/requests';
|
|
8
8
|
import {BaseFacetObject} from '../../../../../../playwright/page-object/baseFacetObject';
|
|
9
|
+
import {initialFacetData} from './data';
|
|
9
10
|
import {facetBase} from '../../../../../../playwright/fixtures/baseFacetFixture';
|
|
10
11
|
|
|
11
12
|
const pageUrl = 's/quantic-timeframe-facet';
|
|
@@ -22,11 +23,20 @@ type QuanticFacetE2EFixtures = {
|
|
|
22
23
|
|
|
23
24
|
export const testSearch = facetBase.extend<QuanticFacetE2EFixtures>({
|
|
24
25
|
options: {withDatePicker: true},
|
|
26
|
+
facetResponses: {responses: [[initialFacetData]]},
|
|
25
27
|
baseFacet: async ({page}, use) => {
|
|
26
28
|
await use(new BaseFacetObject(page, searchRequestRegex));
|
|
27
29
|
},
|
|
28
|
-
facet: async (
|
|
30
|
+
facet: async (
|
|
31
|
+
{page, options, configuration, baseFacet, urlHash, facetResponses},
|
|
32
|
+
use
|
|
33
|
+
) => {
|
|
34
|
+
// search use case: interface auto-triggers a search on load, hence the mockSearchWithBaseResponse call below
|
|
35
|
+
await baseFacet.mockSearchWithBaseResponse();
|
|
29
36
|
await page.goto(`${pageUrl}#${urlHash ? urlHash : ''}`);
|
|
37
|
+
await baseFacet.mockSearchWithFacetResponseSequence(
|
|
38
|
+
facetResponses?.responses
|
|
39
|
+
);
|
|
30
40
|
configuration.configure(options);
|
|
31
41
|
await baseFacet.waitForSearchResponse();
|
|
32
42
|
|
|
@@ -36,6 +46,7 @@ export const testSearch = facetBase.extend<QuanticFacetE2EFixtures>({
|
|
|
36
46
|
|
|
37
47
|
export const testInsight = facetBase.extend<QuanticFacetE2EFixtures>({
|
|
38
48
|
options: {withDatePicker: true},
|
|
49
|
+
facetResponses: {responses: [[initialFacetData]]},
|
|
39
50
|
baseFacet: async ({page}, use) => {
|
|
40
51
|
await use(new BaseFacetObject(page, insightSearchRequestRegex));
|
|
41
52
|
},
|
|
@@ -43,14 +54,19 @@ export const testInsight = facetBase.extend<QuanticFacetE2EFixtures>({
|
|
|
43
54
|
await use(new InsightSetupObject(page));
|
|
44
55
|
},
|
|
45
56
|
facet: async (
|
|
46
|
-
{page, options, baseFacet, configuration, insightSetup},
|
|
57
|
+
{page, options, baseFacet, configuration, insightSetup, facetResponses},
|
|
47
58
|
use
|
|
48
59
|
) => {
|
|
49
60
|
await page.goto(pageUrl);
|
|
61
|
+
await baseFacet.mockSearchWithFacetResponseSequence(
|
|
62
|
+
facetResponses?.responses
|
|
63
|
+
);
|
|
50
64
|
configuration.configure({...options, useCase: useCaseEnum.insight});
|
|
51
65
|
await insightSetup?.waitForInsightInterfaceInitialization();
|
|
52
|
-
await
|
|
53
|
-
|
|
66
|
+
await Promise.all([
|
|
67
|
+
baseFacet.waitForSearchResponse(),
|
|
68
|
+
baseFacet.performSearch(),
|
|
69
|
+
]);
|
|
54
70
|
await use(new TimeframeFacetObject(page));
|
|
55
71
|
},
|
|
56
72
|
});
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
useCaseEnum,
|
|
4
4
|
useCaseTestCases,
|
|
5
5
|
} from '../../../../../../playwright/utils/useCase';
|
|
6
|
+
import {initialFacetData, selectedFacetData} from './data';
|
|
6
7
|
|
|
7
8
|
const fixtures = {
|
|
8
9
|
search: testSearch,
|
|
@@ -15,6 +16,16 @@ useCaseTestCases.forEach((useCase) => {
|
|
|
15
16
|
let test = fixtures[useCase.value];
|
|
16
17
|
test.describe(`quantic timeframe facet ${useCase.label}`, () => {
|
|
17
18
|
test.describe('when selecting and deselecting a facet value', () => {
|
|
19
|
+
test.use({
|
|
20
|
+
facetResponses: {
|
|
21
|
+
responses: [
|
|
22
|
+
[initialFacetData],
|
|
23
|
+
[selectedFacetData],
|
|
24
|
+
[initialFacetData],
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
|
|
18
29
|
test('should trigger a new search and log the corresponding UA analytics events', async ({
|
|
19
30
|
baseFacet,
|
|
20
31
|
facet,
|
|
@@ -59,6 +70,16 @@ useCaseTestCases.forEach((useCase) => {
|
|
|
59
70
|
});
|
|
60
71
|
|
|
61
72
|
test.describe('when selecting a facet value and clicking the clear filter button', () => {
|
|
73
|
+
test.use({
|
|
74
|
+
facetResponses: {
|
|
75
|
+
responses: [
|
|
76
|
+
[initialFacetData],
|
|
77
|
+
[selectedFacetData],
|
|
78
|
+
[initialFacetData],
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
|
|
62
83
|
test('should trigger a new search and log the corresponding UA analytics events', async ({
|
|
63
84
|
baseFacet,
|
|
64
85
|
facet,
|
|
@@ -143,6 +164,9 @@ useCaseTestCases.forEach((useCase) => {
|
|
|
143
164
|
const yesterdayDate = date.toISOString().slice(0, 10);
|
|
144
165
|
test.use({
|
|
145
166
|
urlHash: `df-${exampleField}=${yesterdayDate.replaceAll('-', '/')}@00:00:00..${todayDate.replaceAll('-', '/')}@23:59:59`,
|
|
167
|
+
facetResponses: {
|
|
168
|
+
responses: [],
|
|
169
|
+
},
|
|
146
170
|
});
|
|
147
171
|
|
|
148
172
|
test('should select the correct facet value', async ({facet}) => {
|
|
@@ -383,9 +383,7 @@ var EnumValue = class {
|
|
|
383
383
|
if (isUndefined(value)) {
|
|
384
384
|
return null;
|
|
385
385
|
}
|
|
386
|
-
const valueInEnum = Object.values(this.config.enum).find(
|
|
387
|
-
(enumValue) => enumValue === value
|
|
388
|
-
);
|
|
386
|
+
const valueInEnum = Object.values(this.config.enum).find((enumValue) => enumValue === value);
|
|
389
387
|
if (!valueInEnum) {
|
|
390
388
|
return "value is not in enum.";
|
|
391
389
|
}
|