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

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.219-coveoversion-alpha5",
3
+ "version": "1.3.219-coveoversion-alpha6",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <doc-content-layout
3
- if:true={loaded}
3
+ if:true={isVersionFetched}
4
4
  use-old-sidebar={useOldSidebar}
5
5
  class="content-type content-type-reference"
6
6
  coveo-organization-id={coveoOrganizationId}
@@ -50,7 +50,7 @@ export default class AmfReference extends LightningElement {
50
50
  @track navigation = [] as NavigationItem[];
51
51
  @track versions: Array<ReferenceVersion> = [];
52
52
  @track showVersionBanner = false;
53
- @track loaded = false;
53
+ @track _coveoAdvancedQueryConfig!: { [key: string]: any };
54
54
 
55
55
  // Update this to update what component gets rendered in the content block
56
56
  @track
@@ -115,13 +115,13 @@ export default class AmfReference extends LightningElement {
115
115
  }
116
116
  this.selectedVersion = selectedVersion;
117
117
  if (this.isSpecBasedReference(this._currentReferenceId)) {
118
- this.loaded = true;
118
+ this.isVersionFetched = true;
119
119
  if (this.oldVersionInfo) {
120
120
  this.showVersionBanner = true;
121
121
  }
122
122
  }
123
123
  } else {
124
- this.loaded = true;
124
+ this.isVersionFetched = true;
125
125
  }
126
126
 
127
127
  // This is to check if the url is hash based and redirect if needed
@@ -154,6 +154,12 @@ export default class AmfReference extends LightningElement {
154
154
  this._expandChildren = normalizeBoolean(value);
155
155
  }
156
156
 
157
+ /*
158
+ * The get coveoAdvancedQueryConfig() method returns this._coveoAdvancedQueryConfig,
159
+ * but before returning it, it checks if there are multiple versions (this.versions.length > 1)
160
+ * and if a version is selected (this.selectedVersion). If both conditions are met,
161
+ * it updates the version property of this._coveoAdvancedQueryConfig with the selected version.
162
+ */
157
163
  @api
158
164
  get coveoAdvancedQueryConfig(): { [key: string]: any } {
159
165
  const coveoConfig = this._coveoAdvancedQueryConfig;
@@ -193,7 +199,7 @@ export default class AmfReference extends LightningElement {
193
199
  private isParentLevelDocPhaseEnabled = false;
194
200
  private selectedReferenceDocPhase?: string | null = null;
195
201
  private _expandChildren?: boolean = false;
196
- private _coveoAdvancedQueryConfig!: { [key: string]: any };
202
+ private isVersionFetched = false;
197
203
 
198
204
  /**
199
205
  * Key for storing the currently selected reference url. This will be used to save the
@@ -1306,7 +1312,7 @@ export default class AmfReference extends LightningElement {
1306
1312
  this.showVersionBanner = true;
1307
1313
  }
1308
1314
 
1309
- this.loaded = true;
1315
+ this.isVersionFetched = true;
1310
1316
  this.updateDocPhase();
1311
1317
  this.selectedSidebarValue = window.location.pathname;
1312
1318
  }