@salesforcedevs/dw-components 1.2.17-canary.0 → 1.2.17-canary.2

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/dw-components",
3
- "version": "1.2.17-canary.0",
3
+ "version": "1.2.17-canary.2",
4
4
  "description": "Lightning web components for https://developer.salesforce.com",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -12,10 +12,12 @@
12
12
  <img
13
13
  src="/assets/svg/login-widget-bg.png"
14
14
  class="header-img"
15
+ alt="Light blue background image showing line-drawn hills and trees"
15
16
  />
16
17
  <img
17
18
  src={userInfo.avatarImgSrc}
18
19
  class="avatar avatar-medium"
20
+ alt="Medium user avatar image"
19
21
  />
20
22
  <span class="heading">{userInfo.fullName}</span>
21
23
  <span class="sub-heading">{userInfo.username}</span>
@@ -32,7 +34,13 @@
32
34
  <span class="login-section-title">Trailblazer.me</span>
33
35
  <ul>
34
36
  <li class="login-list-item">
35
- <a href={settingsUrl} class="login-link" target="_blank" onclick={trackLoggedInMenuClick}>
37
+ <a
38
+ href={settingsUrl}
39
+ class="login-link"
40
+ target="_blank"
41
+ rel="noopener"
42
+ onclick={trackLoggedInMenuClick}
43
+ >
36
44
  <span class="login-link-label">
37
45
  Settings
38
46
  </span>
@@ -44,7 +52,13 @@
44
52
  </a>
45
53
  </li>
46
54
  <li class="login-list-item">
47
- <a href={profileUrl} class="login-link" target="_blank" onclick={trackLoggedInMenuClick}>
55
+ <a
56
+ href={profileUrl}
57
+ class="login-link"
58
+ target="_blank"
59
+ rel="noopener"
60
+ onclick={trackLoggedInMenuClick}
61
+ >
48
62
  <span class="login-link-label">
49
63
  Profile
50
64
  </span>
@@ -56,7 +70,13 @@
56
70
  </a>
57
71
  </li>
58
72
  <li class="login-list-item">
59
- <a href="https://trailhead.salesforce.com/trailblazer-community/groups/0F93A000000DJbJSAW" class="login-link" target="_blank" onclick={trackLoggedInMenuClick}>
73
+ <a
74
+ href="https://trailhead.salesforce.com/trailblazer-community/groups/0F93A000000DJbJSAW"
75
+ class="login-link"
76
+ target="_blank"
77
+ rel="noopener"
78
+ onclick={trackLoggedInMenuClick}
79
+ >
60
80
  <span class="login-link-label">
61
81
  Developer Community
62
82
  </span>
@@ -67,8 +87,8 @@
67
87
  ></dx-icon>
68
88
  </a>
69
89
  <div class="login-link-blurb">
70
- Collaborate, network, build connections
71
- and learn Salesforce development.
90
+ Collaborate, network, build connections and
91
+ learn Salesforce development.
72
92
  </div>
73
93
  </li>
74
94
  </ul>
@@ -82,7 +102,13 @@
82
102
  <span class="login-section-title">Products</span>
83
103
  <ul>
84
104
  <li class="login-list-item">
85
- <a href="https://www.salesforce.com" class="login-link" target="_blank" onclick={trackLoginMenuClick}>
105
+ <a
106
+ href="https://login.salesforce.com/"
107
+ class="login-link"
108
+ target="_blank"
109
+ rel="noopener"
110
+ onclick={trackLoginMenuClick}
111
+ >
86
112
  <span class="login-link-label">
87
113
  Salesforce
88
114
  </span>
@@ -99,7 +125,13 @@
99
125
  </a>
100
126
  </li>
101
127
  <li class="login-list-item">
102
- <a href={marketingCloudUrl} class="login-link" target="_blank" onclick={trackLoginMenuClick}>
128
+ <a
129
+ href="https://mc.exacttarget.com/"
130
+ class="login-link"
131
+ target="_blank"
132
+ rel="noopener"
133
+ onclick={trackLoginMenuClick}
134
+ >
103
135
  <span class="login-link-label">
104
136
  Marketing Cloud
105
137
  </span>
@@ -118,7 +150,11 @@
118
150
  </span>
119
151
  <ul>
120
152
  <li class="login-list-item">
121
- <a href={loginUrl} class="login-link" onclick={handleComponentLoginClick}>
153
+ <a
154
+ href={loginUrl}
155
+ class="login-link"
156
+ onclick={handleComponentLoginClick}
157
+ >
122
158
  <span class="login-link-label">
123
159
  Trailblazer.me
124
160
  </span>
@@ -130,7 +166,13 @@
130
166
  </div>
131
167
  </li>
132
168
  <li class="login-list-item">
133
- <a href="https://developer.salesforce.com/forums" class="login-link" target="_blank" onclick={trackLoginMenuClick}>
169
+ <a
170
+ href="https://developer.salesforce.com/forums"
171
+ class="login-link"
172
+ target="_blank"
173
+ rel="noopener"
174
+ onclick={trackLoginMenuClick}
175
+ >
134
176
  <span class="login-link-label">
135
177
  Developer Forums
136
178
  </span>
@@ -1,8 +1,6 @@
1
1
  import { LightningElement } from "lwc";
2
2
  import { track } from "dxUtils/analytics";
3
- import type TbidAvatarButton from "dx/tbidAvatarButton";
4
-
5
- const DSC_BASE_URL = process.env.BASE_URL || "https://developer.salesforce.com";
3
+ import TbidAvatarButton from "dx/tbidAvatarButton";
6
4
 
7
5
  interface UserInfo {
8
6
  avatarImgSrc?: string;
@@ -30,16 +28,13 @@ const trackableUserInfo = new Set([
30
28
  // which this component uses.
31
29
  export default class TbidLoginMenu extends LightningElement {
32
30
  // URLs:
33
- // TODO: change these urls when the environment is correct
34
- private tbidBaseUrl = "https://dev1-trailblazer-identity.cs192.force.com";
35
- private tbidApiBaseUrl =
36
- "https://development.developer.salesforce.com/tbid";
31
+ private tbidBaseUrl = process.env.TBID_BASE_URL || "";
32
+ private tbidApiBaseUrl = `${
33
+ process.env.TBID_API_BASE_URL || "https://developer.salesforce.com"
34
+ }/tbid`;
37
35
  private settingsUrl = `${this.tbidBaseUrl}/settings`;
38
36
  private profileUrl = `${this.tbidBaseUrl}/id`;
39
37
  private logoutUrl = `${this.tbidApiBaseUrl}/logout`;
40
- private get marketingCloudUrl() {
41
- return `${DSC_BASE_URL}/developer-centers/marketing-cloud`;
42
- }
43
38
  private get loginUrl() {
44
39
  return `${this.tbidApiBaseUrl}/dologin?startURL=${encodeURIComponent(
45
40
  window.location.href
@@ -52,12 +47,20 @@ export default class TbidLoginMenu extends LightningElement {
52
47
  private handleComponentLogoutClick = (event: Event) => {
53
48
  event.preventDefault();
54
49
  this.trackLogoutClick();
55
- (this.template.querySelector('dx-tbid-avatar-button') as unknown as TbidAvatarButton).logout();
50
+ (
51
+ this.template.querySelector(
52
+ "dx-tbid-avatar-button"
53
+ ) as unknown as TbidAvatarButton
54
+ ).logout();
56
55
  };
57
56
 
58
57
  private handleComponentLoginClick = (event: Event) => {
59
58
  this.trackLoginClick();
60
- (this.template.querySelector('dx-tbid-avatar-button') as unknown as TbidAvatarButton).login(event);
59
+ (
60
+ this.template.querySelector(
61
+ "dx-tbid-avatar-button"
62
+ ) as unknown as TbidAvatarButton
63
+ ).login(event);
61
64
  };
62
65
 
63
66
  private handleTbidLoginSuccess = (event: CustomEvent) => {
@@ -135,10 +138,8 @@ export default class TbidLoginMenu extends LightningElement {
135
138
  if (target) {
136
139
  trackingPayload.clickText = target.textContent?.trim() || "";
137
140
  trackingPayload.clickUrl = target.href;
138
- const [
139
- firstWord,
140
- ...remainingText
141
- ] = trackingPayload.clickText.split(" ");
141
+ const [firstWord, ...remainingText] =
142
+ trackingPayload.clickText.split(" ");
142
143
  trackingPayload.nav_item = `${navItemPrefix}${firstWord.toLowerCase()}${remainingText.join()}`;
143
144
  }
144
145