@salesforcedevs/docs-components 1.3.139-coveo-fix-test3 → 1.3.147

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/LICENSE ADDED
@@ -0,0 +1,12 @@
1
+ Copyright (c) 2020, Salesforce.com, Inc.
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5
+
6
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7
+
8
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9
+
10
+ * Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11
+
12
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/docs-components",
3
- "version": "1.3.139-coveo-fix-test3",
3
+ "version": "1.3.147",
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": "4629fdd9ca18a13480044ad43515b91945d16aad"
27
+ "gitHead": "c046874452685c28208a52392b494ad791c3f305"
28
28
  }
@@ -16,8 +16,7 @@ import type {
16
16
  ReferenceSetConfig,
17
17
  AmfMetaTopicType,
18
18
  RouteMeta,
19
- ParsedMarkdownTopic,
20
- CoveoAdvancedQueryXMLConfig
19
+ ParsedMarkdownTopic
21
20
  } from "./types";
22
21
 
23
22
  import {
@@ -35,6 +34,7 @@ export default class AmfReference extends LightningElement {
35
34
  @api sidebarHeader!: string;
36
35
  @api coveoOrganizationId!: string;
37
36
  @api coveoPublicAccessToken!: string;
37
+ @api coveoAdvancedQueryConfig!: string;
38
38
  @api coveoSearchHub!: string;
39
39
  @api useOldSidebar?: boolean = false;
40
40
  @api tocTitle?: string;
@@ -122,28 +122,6 @@ export default class AmfReference extends LightningElement {
122
122
  }
123
123
  }
124
124
 
125
- @api
126
- set coveoAdvancedQueryConfig(config : CoveoAdvancedQueryXMLConfig) {
127
- try {
128
- const coveoConfig =
129
- typeof config === "string" ? JSON.parse(config) : config;
130
- this._coveoAdvancedQueryConfig = coveoConfig;
131
- } catch (e) {
132
- this._coveoAdvancedQueryConfig = {
133
- locale: "en-us",
134
- version: "latest",
135
- topicid: this._currentReferenceId
136
- };
137
- }
138
- }
139
-
140
- private get coveoAdvancedQueryConfig(): CoveoAdvancedQueryXMLConfig {
141
- if(this.showVersionBanner) {
142
- this._coveoAdvancedQueryConfig.version = this.getSelectedVersion().id;
143
- }
144
- return this._coveoAdvancedQueryConfig;
145
- }
146
-
147
125
  @api
148
126
  get docPhaseInfo() {
149
127
  return this.selectedReferenceDocPhase;
@@ -170,7 +148,6 @@ export default class AmfReference extends LightningElement {
170
148
  protected _amfConfigMap: Map<string, AmfConfig> = new Map();
171
149
  protected _referenceSetConfig!: ReferenceSetConfig;
172
150
  protected _currentReferenceId = "";
173
- protected _coveoAdvancedQueryConfig!: CoveoAdvancedQueryXMLConfig;
174
151
 
175
152
  protected parentReferenceUrls = [];
176
153
  protected amfMap: Record<string, AmfModelRecord> = {};
@@ -8,12 +8,6 @@ export interface AmfTopicType {
8
8
  type: string;
9
9
  }
10
10
 
11
- export type CoveoAdvancedQueryXMLConfig = {
12
- locale?: string;
13
- version?: string;
14
- topicid?: string;
15
- };
16
-
17
11
  export interface AmfMetadataTopic extends AmfTopicType {
18
12
  meta: string;
19
13
  identifier: string;
@@ -53,7 +53,7 @@ export default class BreadcrumbItem extends LightningElement {
53
53
  private onLinkClick(event: Event): void {
54
54
  track(event.target!, "custEv_breadcrumbClick", {
55
55
  click_text: this.label,
56
- click_url: this.href,
56
+ click_url: `${window.location.origin}${this.href}`,
57
57
  element_type: "link",
58
58
  nav_type: "breadcrumb",
59
59
  nav_level: this.level ? this.level + 1 : 1,
@@ -62,7 +62,7 @@ export default class BreadcrumbItem extends LightningElement {
62
62
 
63
63
  track(event.target!, "custEv_linkClick", {
64
64
  click_text: this.label,
65
- click_url: this.href,
65
+ click_url: `${window.location.origin}${this.href}`,
66
66
  element_title: this.label,
67
67
  element_type: "link",
68
68
  content_category: "cta"
@@ -133,6 +133,7 @@ export default class Header extends HeaderBase {
133
133
  private onLangChange(event: CustomEvent<string>): void {
134
134
  const { detail } = event;
135
135
  this._language = detail;
136
+
136
137
  this.dispatchEvent(new CustomEvent("langchange", { detail }));
137
138
  }
138
139
 
@@ -16,6 +16,7 @@ import { SearchSyncer } from "docUtils/SearchSyncer";
16
16
  import { LightningElementWithState } from "docBaseElements/lightningElementWithState";
17
17
  import { oldVersionDocInfo } from "docUtils/utils";
18
18
  import { Breadcrumb, DocPhaseInfo, Language } from "typings/custom";
19
+ import { track as trackGTM } from "dxUtils/analytics";
19
20
 
20
21
  // TODO: Imitating from actual implementation as doc-content use it like this. We should refactor it later.
21
22
  const handleContentError = (error): void => console.log(error);
@@ -364,6 +365,17 @@ export default class DocXmlContent extends LightningElementWithState<{
364
365
  ({ id }) => id === event.detail
365
366
  );
366
367
  this.pageReference.docId = this.language.url;
368
+
369
+ trackGTM(event.target!, "custEv_ctaLinkClick", {
370
+ click_text: event.detail,
371
+ element_title: "language selector",
372
+ click_url: `${window.location.origin}${this.pageReferenceToString(
373
+ this.pageReference
374
+ )}`,
375
+ element_type: "link",
376
+ content_category: "cta"
377
+ });
378
+
367
379
  this.updateUrl();
368
380
  this.fetchDocument();
369
381
  };