@salesforcedevs/dx-components 0.18.11 → 0.19.2

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": "0.18.11",
3
+ "version": "0.19.2",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -29,5 +29,5 @@
29
29
  "@types/debounce": "^1.2.0",
30
30
  "@types/lodash.get": "^4.4.6"
31
31
  },
32
- "gitHead": "ecf0f25f4c6927eb21118122f3b15884c198a287"
32
+ "gitHead": "8bfc13904276093b75868ad2c4d9003d74873fbb"
33
33
  }
@@ -13,13 +13,7 @@ import {
13
13
  mockNavAnalytics
14
14
  } from "./mockNavs";
15
15
  import mockNavDevelopers from "./mockNavDevelopers";
16
-
17
- export const coveoConfig = {
18
- coveoOrganizationId: "coveosalesforcetestakshatha",
19
- coveoPublicAccessToken: "xx114e9d50-bc6b-40f1-b25b-fa5a06c7e168",
20
- coveoSearchPipeline: "salesforcedevdoc",
21
- coveoSearchHub: "salesforcedevdoc2"
22
- };
16
+ import { coveoHeaderConfig } from "../../../utils/coveo/coveo";
23
17
 
24
18
  const versions = JSON.stringify([
25
19
  {
@@ -44,18 +38,18 @@ export const mockPropsDevelopers = {
44
38
  navItems: JSON.stringify(mockNavDevelopers),
45
39
  subtitle: "Developers",
46
40
  signupLink: "/sign-up",
47
- ...coveoConfig
41
+ ...coveoHeaderConfig
48
42
  };
49
43
 
50
44
  export const mockPropsNoNavigation = {
51
45
  subtitle: "Developers",
52
- ...coveoConfig
46
+ ...coveoHeaderConfig
53
47
  };
54
48
 
55
49
  export const mockPropsDevWebsite = {
56
50
  version: "1",
57
51
  versions,
58
- ...coveoConfig,
52
+ ...coveoHeaderConfig,
59
53
  signupLink: "/sign-up",
60
54
  bannerMarkup:
61
55
  '<span><a href="https://forms.gle/TdSyKFPHXoBx7seM9" target="blank">Share your feedback</a>about our new site.</span>'
@@ -23,7 +23,6 @@
23
23
  placeholder="Search"
24
24
  size="override"
25
25
  type="search"
26
- value={searchBox.value}
27
26
  ></dx-input>
28
27
  </dx-dropdown>
29
28
  <dx-button
@@ -77,25 +77,29 @@ export default class HeaderSearch extends LightningElement {
77
77
  }
78
78
 
79
79
  private instantiateSearchbox() {
80
- const options: StandaloneSearchBoxOptions = {
81
- numberOfSuggestions: 3,
82
- redirectionUrl: "https://developer.salesforce.com"
83
- };
84
-
85
- const engine = buildSearchEngine({
86
- organizationId: this.coveoOrganizationId,
87
- publicAccessToken: this.coveoPublicAccessToken,
88
- searchPipeline: this.coveoSearchPipeline,
89
- searchHub: this.coveoSearchHub
90
- });
91
-
92
- this.searchBox = buildStandaloneSearchBox(engine, { options });
93
-
94
- this.searchBox?.subscribe(() => {
95
- if (this.searchBox) {
96
- this.searchState = this.searchBox.state;
97
- }
98
- });
80
+ try {
81
+ const options: StandaloneSearchBoxOptions = {
82
+ numberOfSuggestions: 3,
83
+ redirectionUrl: "https://developer.salesforce.com"
84
+ };
85
+
86
+ const engine = buildSearchEngine({
87
+ organizationId: this.coveoOrganizationId,
88
+ publicAccessToken: this.coveoPublicAccessToken,
89
+ searchPipeline: this.coveoSearchPipeline,
90
+ searchHub: this.coveoSearchHub
91
+ });
92
+
93
+ this.searchBox = buildStandaloneSearchBox(engine, { options });
94
+
95
+ this.searchBox?.subscribe(() => {
96
+ if (this.searchBox) {
97
+ this.searchState = this.searchBox.state;
98
+ }
99
+ });
100
+ } catch (e) {
101
+ console.error(`Coveo searchbox failed to initialize (${e})`);
102
+ }
99
103
  }
100
104
 
101
105
  private createSearchHref = (value: string | null = "") => {
@@ -38,17 +38,18 @@ export const getSidebarSearchParams = () =>
38
38
  new URLSearchParams(window.location.search).get("q");
39
39
 
40
40
  const coveoOrganizationId = "coveosalesforcetestakshatha";
41
+ const coveoPublicAccessToken = "xxfeb39525-e402-4e41-a870-7132441f7875";
41
42
 
42
43
  export const coveoHeaderConfig = {
43
44
  coveoOrganizationId,
44
- coveoPublicAccessToken: "xx8d9c92ef-1018-4d92-a3c7-647dff01c21c",
45
+ coveoPublicAccessToken,
45
46
  coveoSearchPipeline: "salesforcedevdoc",
46
47
  coveoSearchHub: "salesforcedevdoc"
47
48
  };
48
49
 
49
50
  export const coveoXMLDocsConfig = {
50
51
  coveoOrganizationId,
51
- coveoPublicAccessToken: "xxfeb39525-e402-4e41-a870-7132441f7875",
52
+ coveoPublicAccessToken,
52
53
  coveoSearchHub: "Developer_Docs_SS",
53
54
  coveoAdvancedQueryConfig: JSON.stringify({
54
55
  objecttype: "HTDeveloperDocumentsC",
@@ -60,7 +61,7 @@ export const coveoXMLDocsConfig = {
60
61
 
61
62
  export const coveoSFDocsConfig = {
62
63
  coveoOrganizationId,
63
- coveoPublicAccessToken: "xxfeb39525-e402-4e41-a870-7132441f7875",
64
+ coveoPublicAccessToken,
64
65
  coveoSearchHub: "Developer_MdDocs_SS",
65
66
  coveoAdvancedQueryConfig: JSON.stringify({
66
67
  source: "Sitemap - Developer Docs",