@salesforcedevs/dw-components 1.3.207 → 1.3.211

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.3.207",
3
+ "version": "1.3.211",
4
4
  "description": "Lightning web components for https://developer.salesforce.com",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -24,5 +24,5 @@
24
24
  "@types/setimmediate": "^1.0.2",
25
25
  "setimmediate": "^1.0.5"
26
26
  },
27
- "gitHead": "589869ddb0205df3817d80471db18ba35b016f49"
27
+ "gitHead": "868580e697a07798c02537d4bd3cab7530127812"
28
28
  }
@@ -131,8 +131,11 @@
131
131
  ></dx-pagination>
132
132
  </div>
133
133
  <dx-empty-state
134
+ variant="alt"
134
135
  title="Beep boop. That did not compute."
135
136
  subtitle={emptyStateSubtitle}
137
+ body={emptyStateBody}
138
+ suggestions={emptyStateSuggestions}
136
139
  if:true={showEmptyState}
137
140
  ></dx-empty-state>
138
141
  </dx-section>
@@ -261,13 +261,24 @@ export default class CodeSamplesGrid extends LightningElement {
261
261
  return this.totalPages < 2;
262
262
  }
263
263
 
264
- get emptyStateSubtitle(): string {
264
+ get emptyStateSubtitle() {
265
265
  return (
266
- "No results" +
267
- (this.searchTerm !== "" ? ` for "${this.searchTerm}"` : "")
266
+ "Sorry, no results were found for your search" +
267
+ (this.searchTerm !== "" ? ` "${this.searchTerm}"` : "")
268
268
  );
269
269
  }
270
270
 
271
+ get emptyStateBody() {
272
+ return "Search Tips:";
273
+ }
274
+
275
+ get emptyStateSuggestions() {
276
+ return JSON.stringify([
277
+ "Please consider misspellings",
278
+ "Try different search keywords"
279
+ ]);
280
+ }
281
+
271
282
  handleView = (e: MediaQueryListEvent | MediaQueryList): void => {
272
283
  if (e.media === this.isDesktop && e.matches) {
273
284
  this.deviceType = "desktop";
@@ -245,7 +245,7 @@
245
245
  </template>
246
246
  </div>
247
247
  <h3 class="results-heading" if:false={loading}>{resultsHeading}</h3>
248
- <hr />
248
+ <hr if:false={isEmptyState} />
249
249
  <template if:true={loading}>
250
250
  <template if:false={modalOpen}>
251
251
  <div class="spinner-container">
@@ -328,11 +328,13 @@
328
328
  </template>
329
329
  </template>
330
330
  <template if:true={isEmptyState}>
331
- <div class="empty-state-container">
332
- <p class="empty-state-text">
333
- Please try a different filter selection.
334
- </p>
335
- </div>
331
+ <dx-empty-state
332
+ variant="alt"
333
+ title="Beep boop. That did not compute."
334
+ subtitle={emptyStateSubtitle}
335
+ body={emptyStateBody}
336
+ suggestions={emptyStateSuggestions}
337
+ ></dx-empty-state>
336
338
  </template>
337
339
  </div>
338
340
  </div>
@@ -56,6 +56,18 @@ export default class ContentArchive extends LightningElement {
56
56
  return this.totalResults === 0 && !this.loading;
57
57
  }
58
58
 
59
+ get emptyStateSubtitle() {
60
+ return "Sorry, no results were found for your search";
61
+ }
62
+
63
+ get emptyStateBody() {
64
+ return "Search Tips:";
65
+ }
66
+
67
+ get emptyStateSuggestions() {
68
+ return JSON.stringify(["Try a different filter selection"]);
69
+ }
70
+
59
71
  get currentPageLength() {
60
72
  if (this.loading) {
61
73
  return "Loading Results...";
@@ -78,7 +90,7 @@ export default class ContentArchive extends LightningElement {
78
90
  if (this.currentPage !== 1) {
79
91
  pageInfo = `- Page ${this.currentPage}`;
80
92
  }
81
- return this.totalResults ? `Archive Results ${pageInfo}` : "No results";
93
+ return this.totalResults ? `Archive Results ${pageInfo}` : "";
82
94
  }
83
95
 
84
96
  get spinnerSize() {
@@ -258,9 +270,8 @@ export default class ContentArchive extends LightningElement {
258
270
  }
259
271
 
260
272
  private async updateCheckedStatus() {
261
- const filterMenuElements = this.template.querySelectorAll(
262
- "dx-filter-menu"
263
- );
273
+ const filterMenuElements =
274
+ this.template.querySelectorAll("dx-filter-menu");
264
275
 
265
276
  filterMenuElements.forEach((filterMenuElement: any) =>
266
277
  filterMenuElement.updateCheckedStatus(this.selectedFilterMenuData)
@@ -83,8 +83,11 @@
83
83
  </div>
84
84
  </div>
85
85
  <dx-empty-state
86
+ variant="alt"
86
87
  title="Beep boop. That did not compute."
87
88
  subtitle={emptyStateSubtitle}
89
+ body={emptyStateBody}
90
+ suggestions={emptyStateSuggestions}
88
91
  if:true={showEmptyState}
89
92
  ></dx-empty-state>
90
93
  </template>
@@ -11,6 +11,7 @@ const DSC_API_URL = {
11
11
  "en-us": "/docs/get_index/en-us/000.0/false/All%20Services/all",
12
12
  "ja-jp": "/docs/get_index/ja-jp/000.0/false/All%20Services/all"
13
13
  };
14
+
14
15
  const PRODUCT_FILTER_ALL_SERVICES = "all services";
15
16
  const LANGUAGE_FILTER_LABEL = "Language";
16
17
  const WAIT_TIME = 500;
@@ -259,11 +260,22 @@ export default class DocsGrid extends LightningElement {
259
260
 
260
261
  get emptyStateSubtitle() {
261
262
  return (
262
- "No results" +
263
- (this.searchTerm !== "" ? ` for "${this.searchTerm}"` : "")
263
+ "Sorry, no results were found for your search" +
264
+ (this.searchTerm !== "" ? ` "${this.searchTerm}"` : "")
264
265
  );
265
266
  }
266
267
 
268
+ get emptyStateBody() {
269
+ return "Search Tips:";
270
+ }
271
+
272
+ get emptyStateSuggestions() {
273
+ return JSON.stringify([
274
+ "Please consider misspellings",
275
+ "Try different search keywords"
276
+ ]);
277
+ }
278
+
267
279
  getOtherDocsForSelectedLocale() {
268
280
  const docsForLocale = this._otherDocs!.filter(
269
281
  (doc) => doc.locale === this.selectedLanguageFilter
@@ -4,7 +4,6 @@
4
4
  communicate-step-changes="true"
5
5
  force-initially-visible={forceInitiallyVisible}
6
6
  initial-step-index={initialStepIndex}
7
- lwc:ref="stepSequence"
8
7
  onstepsequencechange={handleStepSequenceChange}
9
8
  optimize-position-after-animation="true"
10
9
  session-storage-id={sessionStorageId}
@@ -79,8 +79,8 @@ export default class J2sCardSequence extends LightningElement {
79
79
  _recaptchaResetTimeoutId: number | null = null;
80
80
  _stepsData: StepDatum[] = [];
81
81
  @api drmDomain: string = "https://drm.my.salesforce-sites.com";
82
- @api drmHandlerBaseUrl: string =
83
- "https://dev-sapi-th-ms-infra-form-handler-proxy.us-w2.cloudhub.io";
82
+ @api formHandler: string =
83
+ "https://formhandlermule-1s9xrb.5sc6y6-4.usa-e2.cloudhub.io/form_handler";
84
84
  @api tbidApiBaseUrl: string | undefined;
85
85
  @api useHistory: boolean = false;
86
86
 
@@ -128,14 +128,6 @@ export default class J2sCardSequence extends LightningElement {
128
128
  return Boolean(this.tbidUserInfo);
129
129
  }
130
130
 
131
- private get drmEmailUrl() {
132
- return `${this.drmHandlerBaseUrl}/getEmail`;
133
- }
134
-
135
- private get formHandlerUrl() {
136
- return `${this.drmHandlerBaseUrl}/form_handler`;
137
- }
138
-
139
131
  private get formIncomingUserInfo() {
140
132
  if (!this.tbidUserInfo) {
141
133
  return {} as DrmFormData;
@@ -149,8 +141,8 @@ export default class J2sCardSequence extends LightningElement {
149
141
  Company__c: this.tbidUserInfo.custom_attributes?.CompanyName,
150
142
  MailingCountry: this.tbidUserInfo.custom_attributes?.Country,
151
143
  MailingState: this.tbidUserInfo.address?.region,
152
- RelationshipToSalesforce:
153
- this.tbidUserInfo.custom_attributes?.RelationshipToSalesforce
144
+ RelationshipToSalesforce: this.tbidUserInfo.custom_attributes
145
+ ?.RelationshipToSalesforce
154
146
  };
155
147
 
156
148
  // Return above object but only with keys that have a truthy value, and with any URI-encoded values decoded
@@ -227,16 +219,18 @@ export default class J2sCardSequence extends LightningElement {
227
219
 
228
220
  renderedCallback() {
229
221
  if (!this.isLoading) {
230
- (this.refs.stepSequence as StepSequence)?.remeasureSteps();
222
+ ((this.template.querySelector(
223
+ "dx-step-sequence"
224
+ ) as unknown) as StepSequence)?.remeasureSteps();
231
225
  }
232
226
 
233
227
  if (
234
228
  this.formSubmissionFailureState &&
235
229
  this.stepsData[this.currentSequenceStep].formData
236
230
  ) {
237
- const j2sCardStep = this.template.querySelectorAll(
231
+ const j2sCardStep = (this.template.querySelectorAll(
238
232
  "dw-j2s-card-sequence-step"
239
- ) as unknown as J2sCardSequenceStep[];
233
+ ) as unknown) as J2sCardSequenceStep[];
240
234
  j2sCardStep[this.currentSequenceStep]?.notifyFormSubmitFailure(
241
235
  this.formSubmissionFailureState
242
236
  );
@@ -291,14 +285,14 @@ export default class J2sCardSequence extends LightningElement {
291
285
  }
292
286
 
293
287
  async handleFormSubmit({ detail: formData }: CustomEvent<DrmFormData>) {
294
- if (!this.formHandlerUrl || !this.isLoggedIn) {
288
+ if (!this.formHandler || !this.isLoggedIn) {
295
289
  return;
296
290
  }
297
291
 
298
292
  this._isFormSubmitting = true;
299
293
 
300
294
  try {
301
- const res = await fetch(this.formHandlerUrl, {
295
+ const res = await fetch(this.formHandler, {
302
296
  method: "POST",
303
297
  headers: {
304
298
  "Content-Type": "application/json",
@@ -380,7 +374,9 @@ export default class J2sCardSequence extends LightningElement {
380
374
  if (andStoreIndex) {
381
375
  this.initialStepIndex = stepIndex; // update sessionStorage value
382
376
  }
383
- (this.refs.stepSequence as StepSequence)?.jumpToStep(stepIndex);
377
+ ((this.template.querySelector(
378
+ "dx-step-sequence"
379
+ ) as unknown) as StepSequence)?.jumpToStep(stepIndex);
384
380
  }
385
381
 
386
382
  private async getCountryList() {
@@ -413,16 +409,7 @@ export default class J2sCardSequence extends LightningElement {
413
409
  try {
414
410
  const res = await fetch(`${this.tbidApiBaseUrl}/userinfo`);
415
411
  if (res.ok) {
416
- const userInfo = await res.json();
417
- const emailOverride = await this.getDrmEmailOverride(
418
- userInfo?.user_id
419
- );
420
- this.tbidUserInfo = !emailOverride
421
- ? userInfo
422
- : {
423
- ...userInfo,
424
- email: emailOverride
425
- };
412
+ this.tbidUserInfo = await res.json();
426
413
  this.selectedCountry = this.formIncomingUserInfo.MailingCountry;
427
414
  }
428
415
  } catch (ex) {
@@ -437,30 +424,4 @@ export default class J2sCardSequence extends LightningElement {
437
424
 
438
425
  this._isTbidLoading = false;
439
426
  }
440
-
441
- private async getDrmEmailOverride(
442
- tbid: string
443
- ): Promise<string | undefined> {
444
- let resolvedEmail = "";
445
-
446
- if (!tbid) {
447
- return resolvedEmail;
448
- }
449
-
450
- try {
451
- const res = await fetch(`${this.drmEmailUrl}?tbid=${tbid}`);
452
- if (res.ok) {
453
- const resData = await res.json();
454
- if (resData.message === "success") {
455
- resolvedEmail = resData.Email;
456
- }
457
- }
458
- } catch (ex) {
459
- console.warn(
460
- `Could not fetch email address from DRM, defaulting to TBID info. (Exception: ${ex})`
461
- );
462
- }
463
-
464
- return resolvedEmail;
465
- }
466
427
  }