@salesforcedevs/dx-components 0.18.2 → 0.18.6
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.
|
@@ -282,26 +282,20 @@ export default class SidebarSearch extends LightningElement {
|
|
|
282
282
|
uniqueId
|
|
283
283
|
}: Result): SidebarSearchResult => {
|
|
284
284
|
// discussion about this normalization here: https://salesforce-internal.slack.com/archives/C020S6784JX/p1639506238376600
|
|
285
|
-
const splitUri = clickUri.split("/");
|
|
286
|
-
let endPathInUri = "";
|
|
287
285
|
|
|
288
|
-
|
|
289
|
-
|
|
286
|
+
const isOverview = clickUri.endsWith("/overview");
|
|
287
|
+
|
|
288
|
+
const query = isOverview ? "" : `?q=${this.value}`;
|
|
289
|
+
let pathname;
|
|
290
|
+
if (sfhtml_url__c) {
|
|
291
|
+
pathname = `/docs/${sfhtml_url__c}`;
|
|
292
|
+
} else {
|
|
293
|
+
const url = new URL(clickUri);
|
|
294
|
+
const extension = clickUri.includes("/guide/") ? ".html" : "";
|
|
295
|
+
pathname = `${url.pathname}${extension}`;
|
|
290
296
|
}
|
|
291
297
|
|
|
292
|
-
const
|
|
293
|
-
endPathInUri === "overview" ||
|
|
294
|
-
this.coveoAdvancedQueryConfig.path_segment_3 === endPathInUri;
|
|
295
|
-
|
|
296
|
-
const extension =
|
|
297
|
-
this.coveoAdvancedQueryConfig.path_segment_4 === "references" ||
|
|
298
|
-
isOverview
|
|
299
|
-
? ""
|
|
300
|
-
: ".html";
|
|
301
|
-
const pathname = sfhtml_url__c
|
|
302
|
-
? `/docs/${sfhtml_url__c}`
|
|
303
|
-
: `${new URL(clickUri).pathname}${extension}`;
|
|
304
|
-
const href = `${pathname}?q=${this.value}`;
|
|
298
|
+
const href = `${pathname}${query}`;
|
|
305
299
|
|
|
306
300
|
return {
|
|
307
301
|
title,
|