@salesforcedevs/dx-components 1.3.282 → 1.3.283
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/dx-components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.283",
|
|
4
4
|
"description": "DX Lightning web components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"volta": {
|
|
47
47
|
"node": "16.19.1"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "2772851564fbe52b3cd31699e8d5f7983d3bc3d0"
|
|
50
50
|
}
|
|
@@ -15,9 +15,15 @@ interface Recommendation {
|
|
|
15
15
|
clickEvent: () => void;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
const language_to_locale_map = {
|
|
19
|
+
english: "en",
|
|
20
|
+
japanese: "ja"
|
|
21
|
+
};
|
|
22
|
+
|
|
18
23
|
export default class CoveoRecommendations extends LightningElement {
|
|
19
24
|
@api coveoAuthToken!: string;
|
|
20
25
|
@api coveoOrganizationId!: string;
|
|
26
|
+
@api postAcf: string = "{}";
|
|
21
27
|
|
|
22
28
|
_recommendations = [] as Recommendation[];
|
|
23
29
|
|
|
@@ -28,6 +34,13 @@ export default class CoveoRecommendations extends LightningElement {
|
|
|
28
34
|
showRecommendations = true;
|
|
29
35
|
recommendationsLoading = true;
|
|
30
36
|
|
|
37
|
+
getLocale() {
|
|
38
|
+
const acf = JSON.parse(this.postAcf);
|
|
39
|
+
return language_to_locale_map[
|
|
40
|
+
(acf?.language as keyof typeof language_to_locale_map) || "english"
|
|
41
|
+
];
|
|
42
|
+
}
|
|
43
|
+
|
|
31
44
|
connectedCallback() {
|
|
32
45
|
const actionsHistory = localStorage.getItem(
|
|
33
46
|
"__coveo.analytics.history"
|
|
@@ -42,6 +55,7 @@ export default class CoveoRecommendations extends LightningElement {
|
|
|
42
55
|
method: "POST",
|
|
43
56
|
body: JSON.stringify({
|
|
44
57
|
pipeline: "Recommendations_Developer_Blogs",
|
|
58
|
+
locale: this.getLocale(),
|
|
45
59
|
searchHub: SEARCH_HUB,
|
|
46
60
|
numberOfResults: 3,
|
|
47
61
|
actionsHistory: JSON.parse(actionsHistory!),
|
|
@@ -94,7 +108,7 @@ export default class CoveoRecommendations extends LightningElement {
|
|
|
94
108
|
logSearchAnalytics = (uid: string, time: number) => {
|
|
95
109
|
const payload = {
|
|
96
110
|
anonymous: true,
|
|
97
|
-
language:
|
|
111
|
+
language: this.getLocale(),
|
|
98
112
|
originLevel1: SEARCH_HUB,
|
|
99
113
|
originLevel2: SEARCH_HUB,
|
|
100
114
|
actionCause: "recommendationInterfaceLoad",
|
|
@@ -121,7 +135,7 @@ export default class CoveoRecommendations extends LightningElement {
|
|
|
121
135
|
documentPosition: index,
|
|
122
136
|
documentTitle: this._recommendations[index].originalCoveoData.title,
|
|
123
137
|
documentUrl: this._recommendations[index].originalCoveoData.uri,
|
|
124
|
-
language:
|
|
138
|
+
language: this.getLocale(),
|
|
125
139
|
originLevel1: SEARCH_HUB,
|
|
126
140
|
originLevel2: SEARCH_HUB,
|
|
127
141
|
actionCause: "recommendationOpen",
|