@salesforcedevs/dx-components 1.15.2-alpha → 1.15.4-ldh-alpha
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/lwc.config.json
CHANGED
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// urlWatcherComponent.ts
|
|
2
2
|
import { LightningElement } from "lwc";
|
|
3
|
-
import UrlWatcher from "dxUtils/urlWatcher";
|
|
3
|
+
import { UrlWatcher } from "dxUtils/urlWatcher";
|
|
4
4
|
|
|
5
5
|
export default class UrlWatcherComponent extends LightningElement {
|
|
6
|
-
watcher = UrlWatcher;
|
|
6
|
+
watcher = UrlWatcher.getInstance();
|
|
7
7
|
connectedCallback() {
|
|
8
8
|
// Just ensure the singleton initializes
|
|
9
9
|
}
|
|
@@ -24,6 +24,21 @@
|
|
|
24
24
|
</div>
|
|
25
25
|
<div class="sidebar-header" show-shadow={showBoxShadow}>
|
|
26
26
|
<div class="header padding-horizontal" lwc:if={isDesktop}>
|
|
27
|
+
<div lwc:if={devCenter} class="dev-center-link">
|
|
28
|
+
<a href={devCenter.link} class="dev-center-content">
|
|
29
|
+
<dx-icon symbol="back"></dx-icon>
|
|
30
|
+
<dx-icon
|
|
31
|
+
class="brand-icon"
|
|
32
|
+
lwc:if={devCenter.icon}
|
|
33
|
+
sprite="salesforcebrand"
|
|
34
|
+
symbol={brand}
|
|
35
|
+
size="large"
|
|
36
|
+
></dx-icon>
|
|
37
|
+
<h2 class="dx-text-display-6 header-title">
|
|
38
|
+
{devCenter.title}
|
|
39
|
+
</h2>
|
|
40
|
+
</a>
|
|
41
|
+
</div>
|
|
27
42
|
<h2 class="dx-text-display-6 header-title">{header}</h2>
|
|
28
43
|
</div>
|
|
29
44
|
<div class="search padding-horizontal">
|
|
@@ -5,6 +5,7 @@ import { getSidebarSearchParams } from "dxUtils/coveo";
|
|
|
5
5
|
import { toJson } from "dxUtils/normalizers";
|
|
6
6
|
import SidebarSearch from "dx/sidebarSearch";
|
|
7
7
|
import { SidebarBase } from "dxBaseElements/sidebarBase";
|
|
8
|
+
import { Brand } from "typings/custom";
|
|
8
9
|
|
|
9
10
|
const MOBILE_SIZE_MATCH = "768px";
|
|
10
11
|
|
|
@@ -14,6 +15,16 @@ export default class Sidebar extends SidebarBase {
|
|
|
14
15
|
@api coveoSearchHub!: string;
|
|
15
16
|
@api coveoAdvancedQueryConfig!: string;
|
|
16
17
|
@api header: string = "";
|
|
18
|
+
@api brand: Brand | null = null;
|
|
19
|
+
|
|
20
|
+
@api
|
|
21
|
+
get devCenter() {
|
|
22
|
+
return this._devCenter;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
set devCenter(value) {
|
|
26
|
+
this._devCenter = toJson(value);
|
|
27
|
+
}
|
|
17
28
|
|
|
18
29
|
@api
|
|
19
30
|
get trees() {
|
|
@@ -53,6 +64,7 @@ export default class Sidebar extends SidebarBase {
|
|
|
53
64
|
private scrollToSelectedSearchResult: boolean = false;
|
|
54
65
|
private selectedSearchResultIndex: number = -1;
|
|
55
66
|
private requestedFetchMoreResults: boolean = false;
|
|
67
|
+
private _devCenter: any;
|
|
56
68
|
|
|
57
69
|
private get areResultsEmpty(): boolean {
|
|
58
70
|
return (
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
// utils/urlWatcher.ts
|
|
2
2
|
// there's a _lot_ of typescript fuckery happening here, because this whole class violates the laws of nature
|
|
3
3
|
// please do not be alarmed.
|
|
4
|
-
class UrlWatcher {
|
|
4
|
+
export class UrlWatcher {
|
|
5
5
|
// eslint-disable-next-line no-use-before-define
|
|
6
6
|
private static instance: UrlWatcher;
|
|
7
7
|
private lastUrl: string = window.location.href;
|
|
8
|
-
private shouldReloadOnRedirect: boolean = false;
|
|
9
8
|
|
|
10
9
|
private constructor() {
|
|
11
10
|
this.patchHistoryMethods();
|
|
@@ -67,10 +66,10 @@ class UrlWatcher {
|
|
|
67
66
|
);
|
|
68
67
|
|
|
69
68
|
if (
|
|
70
|
-
|
|
71
|
-
(response.status >= 300 && response.status < 400)
|
|
72
|
-
this.shouldReloadOnRedirect
|
|
69
|
+
response.type === "opaqueredirect" ||
|
|
70
|
+
(response.status >= 300 && response.status < 400)
|
|
73
71
|
) {
|
|
72
|
+
// eslint-disable-next-line no-self-assign
|
|
74
73
|
window.location.href = window.location.href;
|
|
75
74
|
}
|
|
76
75
|
} catch (error) {
|
|
@@ -78,5 +77,3 @@ class UrlWatcher {
|
|
|
78
77
|
}
|
|
79
78
|
}
|
|
80
79
|
}
|
|
81
|
-
|
|
82
|
-
export default UrlWatcher.getInstance();
|