@salesforcedevs/dx-components 1.28.7-alpha.0 → 1.28.7-alpha.1

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": "1.28.7-alpha.0",
3
+ "version": "1.28.7-alpha.1",
4
4
  "description": "DX Lightning web components",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -44,5 +44,5 @@
44
44
  "luxon": "3.4.4",
45
45
  "msw": "^2.12.4"
46
46
  },
47
- "gitHead": "fd19dde09113f8458a649b7f5e27fac4db3d2bb5"
47
+ "gitHead": "3782e0f52d705901c7307ba5751d1c3297f7ca25"
48
48
  }
@@ -10,18 +10,21 @@ import {
10
10
  const SEARCH_DEBOUNCE_DELAY = 1200;
11
11
  const DATA_CLOUD_SEARCH_PATH = "/data-cloud-search/search";
12
12
 
13
+ /** Origin used for Data Cloud search (always production so results point to developer.salesforce.com). */
14
+ const DATA_CLOUD_SEARCH_ORIGIN = "https://developer.salesforce.com";
15
+
13
16
  const UserRecentSearches = new RecentSearches();
14
17
 
15
18
  const getSearchQueryParam = (): string =>
16
19
  new URLSearchParams(window.location.search).get("q") ?? "";
17
20
 
18
21
  /**
19
- * Returns the current page base URL without the last path segment.
20
- * e.g. https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_dev_guide.htm
22
+ * Returns the base URL path for the current page, always using developer.salesforce.com.
23
+ * e.g. on QA or prod, path /docs/atlas.en-us.apexcode.meta/apexcode/apex_dev_guide.htm
21
24
  * -> https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode
22
25
  */
23
26
  const getBaseUrlPath = (): string => {
24
- const url = window.location.origin + window.location.pathname;
27
+ const url = DATA_CLOUD_SEARCH_ORIGIN + window.location.pathname;
25
28
  const lastSlash = url.lastIndexOf("/");
26
29
  return lastSlash > 0 ? url.substring(0, lastSlash) : url;
27
30
  };