@salesforcedevs/docs-components 1.3.150 → 1.3.155
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/docs-components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.155",
|
|
4
4
|
"description": "Docs Lightning web components for DSC",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "index.js",
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
"@types/lodash.orderby": "^4.6.7",
|
|
25
25
|
"@types/lodash.uniqby": "^4.7.7"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "49e14e97f56c7c2978f7dc7e8609ec921344e939"
|
|
28
28
|
}
|
|
@@ -4,6 +4,7 @@ import { sentenceCase } from "sentence-case";
|
|
|
4
4
|
import qs from "query-string";
|
|
5
5
|
import { AmfModelParser } from "./utils";
|
|
6
6
|
import { normalizeBoolean } from "dxUtils/normalizers";
|
|
7
|
+
import { CoveoAnalyticsClient } from "coveo.analytics";
|
|
7
8
|
import type {
|
|
8
9
|
AmfConfig,
|
|
9
10
|
AmfMetadataTopic,
|
|
@@ -34,6 +35,7 @@ export default class AmfReference extends LightningElement {
|
|
|
34
35
|
@api sidebarHeader!: string;
|
|
35
36
|
@api coveoOrganizationId!: string;
|
|
36
37
|
@api coveoPublicAccessToken!: string;
|
|
38
|
+
@api coveoAnalyticsToken!: string;
|
|
37
39
|
@api coveoAdvancedQueryConfig!: string;
|
|
38
40
|
@api coveoSearchHub!: string;
|
|
39
41
|
@api useOldSidebar?: boolean = false;
|
|
@@ -215,6 +217,19 @@ export default class AmfReference extends LightningElement {
|
|
|
215
217
|
}
|
|
216
218
|
}
|
|
217
219
|
|
|
220
|
+
private logCoveoPageView() {
|
|
221
|
+
if (this.coveoOrganizationId && this.coveoAnalyticsToken) {
|
|
222
|
+
const ua = new CoveoAnalyticsClient({
|
|
223
|
+
token: this.coveoAnalyticsToken,
|
|
224
|
+
endpoint: `https://${this.coveoOrganizationId}.analytics.org.coveo.com`
|
|
225
|
+
});
|
|
226
|
+
ua.sendViewEvent({
|
|
227
|
+
contentIdKey: "@clickableuri",
|
|
228
|
+
contentIdValue: window.location.href
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
218
233
|
/**
|
|
219
234
|
* Check if the URL hash to see whether this is one we want to redirect
|
|
220
235
|
* See GUS W-10718771 for references where we want hash-based redirects
|
|
@@ -907,6 +922,8 @@ export default class AmfReference extends LightningElement {
|
|
|
907
922
|
this.handleSelectedItem();
|
|
908
923
|
|
|
909
924
|
this.updateDocPhase();
|
|
925
|
+
|
|
926
|
+
this.logCoveoPageView();
|
|
910
927
|
}
|
|
911
928
|
|
|
912
929
|
/**
|
|
@@ -1168,6 +1185,8 @@ export default class AmfReference extends LightningElement {
|
|
|
1168
1185
|
if (referenceItem) {
|
|
1169
1186
|
window.location.href = referenceItem.href;
|
|
1170
1187
|
}
|
|
1188
|
+
|
|
1189
|
+
this.logCoveoPageView();
|
|
1171
1190
|
}
|
|
1172
1191
|
|
|
1173
1192
|
/**
|
|
@@ -1260,6 +1279,8 @@ export default class AmfReference extends LightningElement {
|
|
|
1260
1279
|
}
|
|
1261
1280
|
this.updateDocPhase();
|
|
1262
1281
|
this.selectedSidebarValue = window.location.pathname;
|
|
1282
|
+
|
|
1283
|
+
this.logCoveoPageView();
|
|
1263
1284
|
}
|
|
1264
1285
|
}
|
|
1265
1286
|
|
|
@@ -17,6 +17,7 @@ import { LightningElementWithState } from "docBaseElements/lightningElementWithS
|
|
|
17
17
|
import { oldVersionDocInfo } from "docUtils/utils";
|
|
18
18
|
import { Breadcrumb, DocPhaseInfo, Language } from "typings/custom";
|
|
19
19
|
import { track as trackGTM } from "dxUtils/analytics";
|
|
20
|
+
import { CoveoAnalyticsClient } from "coveo.analytics";
|
|
20
21
|
|
|
21
22
|
// TODO: Imitating from actual implementation as doc-content use it like this. We should refactor it later.
|
|
22
23
|
const handleContentError = (error): void => console.log(error);
|
|
@@ -34,6 +35,7 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
34
35
|
@api apiDomain = "https://developer.salesforce.com";
|
|
35
36
|
@api coveoOrganizationId!: string;
|
|
36
37
|
@api coveoPublicAccessToken!: string;
|
|
38
|
+
@api coveoAnalyticsToken!: string;
|
|
37
39
|
@api coveoSearchHub!: string;
|
|
38
40
|
|
|
39
41
|
@api
|
|
@@ -434,6 +436,19 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
434
436
|
);
|
|
435
437
|
}
|
|
436
438
|
|
|
439
|
+
async logCoveoPageView() {
|
|
440
|
+
if (this.coveoOrganizationId && this.coveoAnalyticsToken) {
|
|
441
|
+
const ua = new CoveoAnalyticsClient({
|
|
442
|
+
token: this.coveoAnalyticsToken,
|
|
443
|
+
endpoint: `https://${this.coveoOrganizationId}.analytics.org.coveo.com`
|
|
444
|
+
}); // MILES TODO: replace 'fullsalesforce' with coveo organizationid
|
|
445
|
+
ua.sendViewEvent({
|
|
446
|
+
contentIdKey: "@clickableuri",
|
|
447
|
+
contentIdValue: window.location.href
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
|
|
437
452
|
async fetchDocument(): Promise<void> {
|
|
438
453
|
this.setState({
|
|
439
454
|
isFetchingDocument: true
|
|
@@ -498,6 +513,7 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
498
513
|
}
|
|
499
514
|
|
|
500
515
|
async fetchContent(): Promise<void> {
|
|
516
|
+
this.logCoveoPageView();
|
|
501
517
|
this.setState({
|
|
502
518
|
isFetchingContent: true
|
|
503
519
|
});
|