@salesforcedevs/dw-components 1.3.207 → 1.3.212-canary.0
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 +2 -3
- package/src/modules/dw/codeSamplesGrid/codeSamplesGrid.html +3 -0
- package/src/modules/dw/codeSamplesGrid/codeSamplesGrid.ts +14 -3
- package/src/modules/dw/contentArchive/contentArchive.html +8 -6
- package/src/modules/dw/contentArchive/contentArchive.ts +15 -4
- package/src/modules/dw/docsGrid/docsGrid.html +3 -0
- package/src/modules/dw/docsGrid/docsGrid.ts +14 -2
- package/src/modules/dw/j2sCardSequence/j2sCardSequence.html +0 -1
- package/src/modules/dw/j2sCardSequence/j2sCardSequence.ts +15 -54
- package/src/modules/dw/podcastsPromo/podcastsPromo.css +3 -0
- package/src/modules/dw/podcastsPromo/podcastsPromo.html +6 -7
- package/LICENSE +0 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/dw-components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.212-canary.0",
|
|
4
4
|
"description": "Lightning web components for https://developer.salesforce.com",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -23,6 +23,5 @@
|
|
|
23
23
|
"@types/lodash.uniqby": "^4.7.7",
|
|
24
24
|
"@types/setimmediate": "^1.0.2",
|
|
25
25
|
"setimmediate": "^1.0.5"
|
|
26
|
-
}
|
|
27
|
-
"gitHead": "589869ddb0205df3817d80471db18ba35b016f49"
|
|
26
|
+
}
|
|
28
27
|
}
|
|
@@ -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()
|
|
264
|
+
get emptyStateSubtitle() {
|
|
265
265
|
return (
|
|
266
|
-
"
|
|
267
|
-
(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
|
-
<
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
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}` : "
|
|
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 =
|
|
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
|
-
"
|
|
263
|
-
(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
|
|
83
|
-
"https://
|
|
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
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
-
|
|
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
|
}
|
|
@@ -14,19 +14,18 @@
|
|
|
14
14
|
<div class="info-container">
|
|
15
15
|
<a href="/podcast" class="info-link">
|
|
16
16
|
<img
|
|
17
|
-
src="https://a.sfdcstatic.com/developer-website/images/
|
|
17
|
+
src="https://a.sfdcstatic.com/developer-website/images/podcast-bear-background.png"
|
|
18
18
|
loading="lazy"
|
|
19
19
|
alt="Developer Podcast"
|
|
20
20
|
style="width: 100%"
|
|
21
21
|
/>
|
|
22
22
|
</a>
|
|
23
23
|
<span class="dx-text-body-2">
|
|
24
|
-
Tune in to
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
learning, building, and integrating with Salesforce.
|
|
24
|
+
Tune in to our Developer Podcast hosted by René
|
|
25
|
+
Winkelmeyer, Senior Director of Salesforce Developer
|
|
26
|
+
Relations, and featuring our developer advocates. Hear
|
|
27
|
+
insightful stories, quick tips, and relevant updates for
|
|
28
|
+
the Salesforce Developer community.
|
|
30
29
|
</span>
|
|
31
30
|
</div>
|
|
32
31
|
<dx-grid columns="one">
|
package/LICENSE
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
Copyright (c) 2020, Salesforce.com, Inc.
|
|
2
|
-
All rights reserved.
|
|
3
|
-
|
|
4
|
-
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
5
|
-
|
|
6
|
-
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
7
|
-
|
|
8
|
-
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
9
|
-
|
|
10
|
-
* Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
11
|
-
|
|
12
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|