@salesforcedevs/docs-components 1.3.219-coveoversion-alpha5 → 1.3.220

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.219-coveoversion-alpha5",
3
+ "version": "1.3.220",
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": "b103445eefcc5f98bbe038bfe8624a60f0b026ae"
28
28
  }
@@ -1,6 +1,5 @@
1
1
  <template>
2
2
  <doc-content-layout
3
- if:true={loaded}
4
3
  use-old-sidebar={useOldSidebar}
5
4
  class="content-type content-type-reference"
6
5
  coveo-organization-id={coveoOrganizationId}
@@ -3,7 +3,7 @@ import { noCase } from "no-case";
3
3
  import { sentenceCase } from "sentence-case";
4
4
  import qs from "query-string";
5
5
  import { AmfModelParser } from "doc/amfModelParser";
6
- import { normalizeBoolean, toJson } from "dxUtils/normalizers";
6
+ import { normalizeBoolean } from "dxUtils/normalizers";
7
7
  import type {
8
8
  AmfConfig,
9
9
  AmfMetadataTopic,
@@ -43,6 +43,7 @@ export default class AmfReference extends LightningElement {
43
43
  @api coveoOrganizationId!: string;
44
44
  @api coveoPublicAccessToken!: string;
45
45
  @api coveoAnalyticsToken!: string;
46
+ @api coveoAdvancedQueryConfig!: string;
46
47
  @api coveoSearchHub!: string;
47
48
  @api useOldSidebar: boolean = false;
48
49
  @api tocTitle?: string;
@@ -50,7 +51,6 @@ export default class AmfReference extends LightningElement {
50
51
  @track navigation = [] as NavigationItem[];
51
52
  @track versions: Array<ReferenceVersion> = [];
52
53
  @track showVersionBanner = false;
53
- @track loaded = false;
54
54
 
55
55
  // Update this to update what component gets rendered in the content block
56
56
  @track
@@ -114,14 +114,12 @@ export default class AmfReference extends LightningElement {
114
114
  this.versions = this.getVersions();
115
115
  }
116
116
  this.selectedVersion = selectedVersion;
117
- if (this.isSpecBasedReference(this._currentReferenceId)) {
118
- this.loaded = true;
119
- if (this.oldVersionInfo) {
120
- this.showVersionBanner = true;
121
- }
117
+ if (
118
+ this.isSpecBasedReference(this._currentReferenceId) &&
119
+ this.oldVersionInfo
120
+ ) {
121
+ this.showVersionBanner = true;
122
122
  }
123
- } else {
124
- this.loaded = true;
125
123
  }
126
124
 
127
125
  // This is to check if the url is hash based and redirect if needed
@@ -154,25 +152,6 @@ export default class AmfReference extends LightningElement {
154
152
  this._expandChildren = normalizeBoolean(value);
155
153
  }
156
154
 
157
- @api
158
- get coveoAdvancedQueryConfig(): { [key: string]: any } {
159
- const coveoConfig = this._coveoAdvancedQueryConfig;
160
- if (this.versions.length > 1 && this.selectedVersion) {
161
- const currentGAVersionRef = this.versions[0];
162
- if (this.selectedVersion.id !== currentGAVersionRef.id) {
163
- // Currently Coveo only supports query without "v"
164
- const version = this.selectedVersion.id.replace("v", "");
165
- coveoConfig.version = version;
166
- this._coveoAdvancedQueryConfig = coveoConfig;
167
- }
168
- }
169
- return this._coveoAdvancedQueryConfig;
170
- }
171
-
172
- set coveoAdvancedQueryConfig(config) {
173
- this._coveoAdvancedQueryConfig = toJson(config);
174
- }
175
-
176
155
  // model
177
156
  protected _amfConfigList: AmfConfig[] = [];
178
157
  protected _amfConfigMap: Map<string, AmfConfig> = new Map();
@@ -193,7 +172,6 @@ export default class AmfReference extends LightningElement {
193
172
  private isParentLevelDocPhaseEnabled = false;
194
173
  private selectedReferenceDocPhase?: string | null = null;
195
174
  private _expandChildren?: boolean = false;
196
- private _coveoAdvancedQueryConfig!: { [key: string]: any };
197
175
 
198
176
  /**
199
177
  * Key for storing the currently selected reference url. This will be used to save the
@@ -1306,7 +1284,6 @@ export default class AmfReference extends LightningElement {
1306
1284
  this.showVersionBanner = true;
1307
1285
  }
1308
1286
 
1309
- this.loaded = true;
1310
1287
  this.updateDocPhase();
1311
1288
  this.selectedSidebarValue = window.location.pathname;
1312
1289
  }
@@ -98,7 +98,9 @@ export default class Header extends HeaderBase {
98
98
  (window.location.pathname.includes("/docs/") &&
99
99
  window.location.pathname !== "/docs/apis") ||
100
100
  window.location.pathname ===
101
- "/tableau/embedding-playground/overview"
101
+ "/tableau/embedding-playground/overview" ||
102
+ window.location.host === "localhost:6006" ||
103
+ window.location.host === "dsc-components.herokuapp.com"
102
104
  ) {
103
105
  this.shouldRender = true;
104
106
  }