@salesforcedevs/dw-components 0.79.3 → 1.0.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/lwc.config.json +10 -1
- package/package.json +16 -12
- package/src/modules/dw/blogsGrid/blogsGrid.css +14 -7
- package/src/modules/dw/blogsGrid/blogsGrid.html +15 -12
- package/src/modules/dw/blogsGrid/blogsGrid.ts +23 -9
- package/src/modules/dw/browseTrials/browseTrials.css +35 -0
- package/src/modules/dw/browseTrials/browseTrials.html +86 -0
- package/src/modules/dw/browseTrials/browseTrials.ts +116 -0
- package/src/modules/dw/cardBlogPostProvider/cardBlogPostProvider.css +2 -0
- package/src/modules/dw/cardBlogPostProvider/cardBlogPostProvider.html +3 -3
- package/src/modules/dw/cardPodcastEpisodeProvider/cardPodcastEpisodeProvider.css +2 -0
- package/src/modules/dw/cardPodcastEpisodeProvider/cardPodcastEpisodeProvider.html +2 -1
- package/src/modules/dw/codeSamplesGrid/codeSamplesGrid.css +85 -4
- package/src/modules/dw/codeSamplesGrid/codeSamplesGrid.html +72 -110
- package/src/modules/dw/codeSamplesGrid/codeSamplesGrid.ts +14 -375
- package/src/modules/dw/contentArchive/contentArchive.css +5 -4
- package/src/modules/dw/contentArchive/contentArchive.html +58 -24
- package/src/modules/dw/contentArchive/contentArchive.ts +46 -8
- package/src/modules/dw/contentArchive/contentArchive.types.ts +8 -4
- package/src/modules/dw/contentArchive/utils.ts +29 -13
- package/src/modules/dw/deSignupForm/deSignupForm.css +11 -10
- package/src/modules/dw/deSignupForm/deSignupForm.html +39 -25
- package/src/modules/dw/deSignupForm/deSignupForm.ts +205 -133
- package/src/modules/dw/deSignupForm/submitForm.ts +7 -3
- package/src/modules/dw/docsGrid/docsGrid.css +0 -1
- package/src/modules/dw/docsGrid/docsGrid.html +6 -2
- package/src/modules/dw/docsGrid/docsGrid.ts +103 -38
- package/src/modules/dw/eventsList/eventsList.css +4 -4
- package/src/modules/dw/eventsList/eventsList.html +5 -5
- package/src/modules/dw/eventsList/eventsList.ts +47 -48
- package/src/modules/dw/j2sCardSequence/j2sCardSequence.css +14 -0
- package/src/modules/dw/j2sCardSequence/j2sCardSequence.html +41 -0
- package/src/modules/dw/j2sCardSequence/j2sCardSequence.ts +487 -0
- package/src/modules/dw/j2sCardSequenceStep/j2sCardSequenceStep.css +76 -0
- package/src/modules/dw/j2sCardSequenceStep/j2sCardSequenceStep.html +64 -0
- package/src/modules/dw/j2sCardSequenceStep/j2sCardSequenceStep.ts +157 -0
- package/src/modules/dw/j2sForm/j2sForm.css +65 -0
- package/src/modules/dw/j2sForm/j2sForm.html +217 -0
- package/src/modules/dw/j2sForm/j2sForm.ts +371 -0
- package/src/modules/dw/j2sForm/mockProps.ts +3102 -0
- package/src/modules/dw/languageSelector/languageSelector.css +86 -0
- package/src/modules/dw/languageSelector/languageSelector.html +36 -0
- package/src/modules/dw/languageSelector/languageSelector.ts +119 -0
- package/src/modules/dw/newsletterForm/newsletterForm.css +2 -2
- package/src/modules/dw/newsletterForm/newsletterForm.html +35 -10
- package/src/modules/dw/newsletterForm/newsletterForm.ts +107 -78
- package/src/modules/dw/podcastSubscription/podcastSubscription.css +8 -8
- package/src/modules/dw/podcastSubscription/podcastSubscription.html +2 -2
- package/src/modules/dw/podcastSubscription/podcastSubscription.ts +3 -3
- package/src/modules/dw/podcastsGrid/podcastsGrid.css +7 -0
- package/src/modules/dw/podcastsGrid/podcastsGrid.html +6 -1
- package/src/modules/dw/podcastsGrid/podcastsGrid.ts +3 -3
- package/src/modules/dw/podcastsPromo/podcastsPromo.css +14 -0
- package/src/modules/dw/podcastsPromo/podcastsPromo.html +16 -8
- package/src/modules/dw/podcastsPromo/podcastsPromo.ts +11 -2
- package/src/modules/dw/rcgTable/altData.ts +72 -9
- package/src/modules/dw/rcgTable/getTableData.ts +1 -1
- package/src/modules/dw/rcgTable/rcgTable.ts +3 -3
- package/src/modules/dw/slackCta/slackCta.css +5 -6
- package/src/modules/dw/slackCta/slackCta.html +1 -1
- package/src/modules/dw/slackSuccess/slackSuccess.css +1 -1
- package/src/modules/dw/slackSuccess/slackSuccess.html +2 -2
- package/src/modules/dw/tbidLoginMenu/tbidLoginMenu.css +119 -0
- package/src/modules/dw/tbidLoginMenu/tbidLoginMenu.html +192 -0
- package/src/modules/dw/tbidLoginMenu/tbidLoginMenu.ts +148 -0
- package/src/modules/dw/videoGrid/types.ts +12 -0
- package/src/modules/dw/videoGrid/videoGrid.css +24 -0
- package/src/modules/dw/videoGrid/videoGrid.html +41 -0
- package/src/modules/dw/videoGrid/videoGrid.ts +41 -0
- package/src/modules/dw/youtubeVideoGrid/types.ts +8 -0
- package/src/modules/dw/youtubeVideoGrid/youtubeVideoGrid.css +18 -0
- package/src/modules/dw/youtubeVideoGrid/youtubeVideoGrid.html +40 -0
- package/src/modules/dw/youtubeVideoGrid/youtubeVideoGrid.ts +66 -0
- package/src/modules/dwHelpers/mobileDividers/mobileDividers.css +19 -0
- package/src/modules/dwUtils/forms/forms.ts +514 -0
- package/src/modules/{dwBaseElements → dwUtils}/postsGrid/postsGrid.ts +10 -13
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<dx-featured-content-header
|
|
3
3
|
class="documentation_header"
|
|
4
|
-
|
|
4
|
+
header="Content Archive"
|
|
5
5
|
body="Learn more about the topics that interest you most by exploring the full collection of Salesforce Developers blog and podcast content."
|
|
6
6
|
dark="true"
|
|
7
7
|
no-swoop={isMobile}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<dx-modal-drawer open={modalOpen} onclickclose={toggleModal}>
|
|
12
12
|
<img
|
|
13
13
|
if:true={filtersLoading}
|
|
14
|
-
src="/
|
|
14
|
+
src="https://a.sfdcstatic.com/developer-website/images/sidebar-loading.svg"
|
|
15
15
|
alt="loading"
|
|
16
16
|
class="modal-loading"
|
|
17
17
|
/>
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
</div>
|
|
28
28
|
<dx-filter-menu
|
|
29
29
|
name="content-type"
|
|
30
|
-
|
|
30
|
+
header={contentTypeTitle}
|
|
31
31
|
options={contentTypeList}
|
|
32
32
|
onchange={handleUpdateSiteFilter}
|
|
33
33
|
></dx-filter-menu>
|
|
34
34
|
<dx-filter-menu
|
|
35
35
|
name="dates"
|
|
36
|
-
|
|
36
|
+
header={dateTitle}
|
|
37
37
|
options={dateList}
|
|
38
38
|
variant="nested"
|
|
39
39
|
filters-dates-loading={filtersDatesLoading}
|
|
@@ -42,17 +42,23 @@
|
|
|
42
42
|
<template if:false={hideBlogFilters}>
|
|
43
43
|
<dx-filter-menu
|
|
44
44
|
name="authors"
|
|
45
|
-
|
|
45
|
+
header={authorTitle}
|
|
46
46
|
options={authorList}
|
|
47
47
|
onchange={handleFiltersEvent}
|
|
48
48
|
></dx-filter-menu>
|
|
49
49
|
</template>
|
|
50
50
|
<dx-filter-menu
|
|
51
51
|
name="categories"
|
|
52
|
-
|
|
52
|
+
header={categoryTitle}
|
|
53
53
|
options={categoryList}
|
|
54
54
|
onchange={handleFiltersEvent}
|
|
55
55
|
></dx-filter-menu>
|
|
56
|
+
<dx-filter-menu
|
|
57
|
+
name="language"
|
|
58
|
+
header={languageTitle}
|
|
59
|
+
options={languagesList}
|
|
60
|
+
onchange={handleFiltersEvent}
|
|
61
|
+
></dx-filter-menu>
|
|
56
62
|
</template>
|
|
57
63
|
</dx-modal-drawer>
|
|
58
64
|
</template>
|
|
@@ -60,7 +66,7 @@
|
|
|
60
66
|
<template if:false={isMobile}>
|
|
61
67
|
<img
|
|
62
68
|
if:true={filtersLoading}
|
|
63
|
-
src="/
|
|
69
|
+
src="https://a.sfdcstatic.com/developer-website/images/sidebar-loading.svg"
|
|
64
70
|
alt="loading"
|
|
65
71
|
/>
|
|
66
72
|
<template if:false={filtersLoading}>
|
|
@@ -75,13 +81,13 @@
|
|
|
75
81
|
</div>
|
|
76
82
|
<dx-filter-menu
|
|
77
83
|
name="contentType"
|
|
78
|
-
|
|
84
|
+
header={contentTypeTitle}
|
|
79
85
|
options={contentTypeList}
|
|
80
86
|
onchange={handleUpdateSiteFilter}
|
|
81
87
|
></dx-filter-menu>
|
|
82
88
|
<dx-filter-menu
|
|
83
89
|
name="dates"
|
|
84
|
-
|
|
90
|
+
header={dateTitle}
|
|
85
91
|
options={dateList}
|
|
86
92
|
filters-dates-loading={filtersDatesLoading}
|
|
87
93
|
variant="nested"
|
|
@@ -90,17 +96,23 @@
|
|
|
90
96
|
<template if:false={hideBlogFilters}>
|
|
91
97
|
<dx-filter-menu
|
|
92
98
|
name="authors"
|
|
93
|
-
|
|
99
|
+
header={authorTitle}
|
|
94
100
|
options={authorList}
|
|
95
101
|
onchange={handleFiltersEvent}
|
|
96
102
|
></dx-filter-menu>
|
|
97
103
|
</template>
|
|
98
104
|
<dx-filter-menu
|
|
99
105
|
name="categories"
|
|
100
|
-
|
|
106
|
+
header={categoryTitle}
|
|
101
107
|
options={categoryList}
|
|
102
108
|
onchange={handleFiltersEvent}
|
|
103
109
|
></dx-filter-menu>
|
|
110
|
+
<dx-filter-menu
|
|
111
|
+
name="language"
|
|
112
|
+
header={languageTitle}
|
|
113
|
+
options={languagesList}
|
|
114
|
+
onchange={handleFiltersEvent}
|
|
115
|
+
></dx-filter-menu>
|
|
104
116
|
</template>
|
|
105
117
|
</template>
|
|
106
118
|
<template if:true={isMobile}>
|
|
@@ -180,6 +192,27 @@
|
|
|
180
192
|
</template>
|
|
181
193
|
</div>
|
|
182
194
|
</template>
|
|
195
|
+
<template if:true={selectedFilterMenuData.language.length}>
|
|
196
|
+
<div class="chip-item-container">
|
|
197
|
+
<p class="chip-title">Language</p>
|
|
198
|
+
<template
|
|
199
|
+
for:each={selectedFilterMenuData.language}
|
|
200
|
+
for:item="lang"
|
|
201
|
+
>
|
|
202
|
+
<span class="chip-item" key={lang}>
|
|
203
|
+
{lang.name}
|
|
204
|
+
<dx-button
|
|
205
|
+
name="language"
|
|
206
|
+
onclick={removeFilterItem}
|
|
207
|
+
value={lang}
|
|
208
|
+
variant="inline"
|
|
209
|
+
>
|
|
210
|
+
✕
|
|
211
|
+
</dx-button>
|
|
212
|
+
</span>
|
|
213
|
+
</template>
|
|
214
|
+
</div>
|
|
215
|
+
</template>
|
|
183
216
|
<template if:true={selectedFilterMenuData.dates.length}>
|
|
184
217
|
<div class="chip-item-container">
|
|
185
218
|
<p class="chip-title">Date</p>
|
|
@@ -245,7 +278,7 @@
|
|
|
245
278
|
</template>
|
|
246
279
|
</div>
|
|
247
280
|
<h3 class="results-heading" if:false={loading}>{resultsHeading}</h3>
|
|
248
|
-
<hr />
|
|
281
|
+
<hr if:false={isEmptyState} />
|
|
249
282
|
<template if:true={loading}>
|
|
250
283
|
<template if:false={modalOpen}>
|
|
251
284
|
<div class="spinner-container">
|
|
@@ -279,7 +312,7 @@
|
|
|
279
312
|
<dx-card-minimal
|
|
280
313
|
key={post.id}
|
|
281
314
|
content-type={post.contentType}
|
|
282
|
-
|
|
315
|
+
header={post.title}
|
|
283
316
|
href={post.href}
|
|
284
317
|
></dx-card-minimal>
|
|
285
318
|
</template>
|
|
@@ -288,24 +321,23 @@
|
|
|
288
321
|
</template>
|
|
289
322
|
<template for:each={posts} for:item="post">
|
|
290
323
|
<template if:false={isMinimalCard}>
|
|
291
|
-
<template if:true={post.
|
|
324
|
+
<template if:true={post.authors}>
|
|
292
325
|
<dx-card-expanded
|
|
293
326
|
key={post.id}
|
|
294
|
-
|
|
327
|
+
header={post.title}
|
|
295
328
|
content-type={post.contentType}
|
|
296
329
|
href={post.href}
|
|
297
330
|
date={post.date}
|
|
298
331
|
body={post.excerpt}
|
|
299
|
-
|
|
300
|
-
author-label={post.author.name}
|
|
332
|
+
authors={post.authors}
|
|
301
333
|
topics={post.topics}
|
|
302
334
|
length={post.duration}
|
|
303
335
|
></dx-card-expanded>
|
|
304
336
|
</template>
|
|
305
|
-
<template if:false={post.
|
|
337
|
+
<template if:false={post.authors}>
|
|
306
338
|
<dx-card-expanded
|
|
307
339
|
key={post.id}
|
|
308
|
-
|
|
340
|
+
header={post.title}
|
|
309
341
|
content-type={post.contentType}
|
|
310
342
|
href={post.href}
|
|
311
343
|
date={post.date}
|
|
@@ -329,11 +361,13 @@
|
|
|
329
361
|
</template>
|
|
330
362
|
</template>
|
|
331
363
|
<template if:true={isEmptyState}>
|
|
332
|
-
<
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
364
|
+
<dx-empty-state
|
|
365
|
+
variant="alt"
|
|
366
|
+
header="Beep boop. That did not compute."
|
|
367
|
+
subtitle={emptyStateSubtitle}
|
|
368
|
+
body={emptyStateBody}
|
|
369
|
+
suggestions={emptyStateSuggestions}
|
|
370
|
+
></dx-empty-state>
|
|
337
371
|
</template>
|
|
338
372
|
</div>
|
|
339
373
|
</div>
|
|
@@ -15,6 +15,7 @@ const MOBILE_MATCH = "767px";
|
|
|
15
15
|
enum FilterNames {
|
|
16
16
|
QUERY_CONTENT_FILTER = "contentType",
|
|
17
17
|
QUERY_AUTHOR_FILTER = "authors",
|
|
18
|
+
QUERY_LANGUAGE_FILTER = "language",
|
|
18
19
|
QUERY_DATES_FILTER = "dates",
|
|
19
20
|
QUERY_CATEGORIES_FILTER = "categories"
|
|
20
21
|
}
|
|
@@ -38,6 +39,7 @@ export default class ContentArchive extends LightningElement {
|
|
|
38
39
|
private postsByDate: {} = {};
|
|
39
40
|
private dateList: any[] = [];
|
|
40
41
|
private authorList: any[] = [];
|
|
42
|
+
private languagesList: any[] = [];
|
|
41
43
|
private categoryList: any[] = [];
|
|
42
44
|
|
|
43
45
|
private isMobile: boolean = false;
|
|
@@ -47,7 +49,8 @@ export default class ContentArchive extends LightningElement {
|
|
|
47
49
|
contentType: [],
|
|
48
50
|
dates: [],
|
|
49
51
|
authors: [],
|
|
50
|
-
categories: []
|
|
52
|
+
categories: [],
|
|
53
|
+
language: []
|
|
51
54
|
};
|
|
52
55
|
|
|
53
56
|
private posts: any[] = [];
|
|
@@ -56,6 +59,18 @@ export default class ContentArchive extends LightningElement {
|
|
|
56
59
|
return this.totalResults === 0 && !this.loading;
|
|
57
60
|
}
|
|
58
61
|
|
|
62
|
+
get emptyStateSubtitle() {
|
|
63
|
+
return "Sorry, no results were found for your search";
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
get emptyStateBody() {
|
|
67
|
+
return "Search Tips:";
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
get emptyStateSuggestions() {
|
|
71
|
+
return JSON.stringify(["Try a different filter selection"]);
|
|
72
|
+
}
|
|
73
|
+
|
|
59
74
|
get currentPageLength() {
|
|
60
75
|
if (this.loading) {
|
|
61
76
|
return "Loading Results...";
|
|
@@ -78,7 +93,7 @@ export default class ContentArchive extends LightningElement {
|
|
|
78
93
|
if (this.currentPage !== 1) {
|
|
79
94
|
pageInfo = `- Page ${this.currentPage}`;
|
|
80
95
|
}
|
|
81
|
-
return this.totalResults ? `Archive Results ${pageInfo}` : "
|
|
96
|
+
return this.totalResults ? `Archive Results ${pageInfo}` : "";
|
|
82
97
|
}
|
|
83
98
|
|
|
84
99
|
get spinnerSize() {
|
|
@@ -135,6 +150,15 @@ export default class ContentArchive extends LightningElement {
|
|
|
135
150
|
: ""
|
|
136
151
|
}`;
|
|
137
152
|
}
|
|
153
|
+
|
|
154
|
+
get languageTitle() {
|
|
155
|
+
return `Language ${
|
|
156
|
+
this.selectedFilterMenuData.language.length > 0
|
|
157
|
+
? `(${this.selectedFilterMenuData.language.length})`
|
|
158
|
+
: ""
|
|
159
|
+
}`;
|
|
160
|
+
}
|
|
161
|
+
|
|
138
162
|
get categoryTitle() {
|
|
139
163
|
return `Topic ${
|
|
140
164
|
this.selectedFilterMenuData.categories.length > 0
|
|
@@ -232,7 +256,8 @@ export default class ContentArchive extends LightningElement {
|
|
|
232
256
|
contentType: [...copy.contentType],
|
|
233
257
|
categories: [...copy.categories],
|
|
234
258
|
dates: [...copy.dates],
|
|
235
|
-
authors: []
|
|
259
|
+
authors: [],
|
|
260
|
+
language: []
|
|
236
261
|
};
|
|
237
262
|
}
|
|
238
263
|
|
|
@@ -243,7 +268,8 @@ export default class ContentArchive extends LightningElement {
|
|
|
243
268
|
contentType: [{ id: 1, name: "Blogs" }],
|
|
244
269
|
categories: [...copy.categories],
|
|
245
270
|
dates: [...copy.dates],
|
|
246
|
-
authors: [...copy.authors]
|
|
271
|
+
authors: [...copy.authors],
|
|
272
|
+
language: [...copy.language]
|
|
247
273
|
};
|
|
248
274
|
}
|
|
249
275
|
|
|
@@ -319,6 +345,7 @@ export default class ContentArchive extends LightningElement {
|
|
|
319
345
|
contentType: [],
|
|
320
346
|
dates: [],
|
|
321
347
|
authors: [],
|
|
348
|
+
language: [],
|
|
322
349
|
categories: []
|
|
323
350
|
};
|
|
324
351
|
|
|
@@ -328,6 +355,7 @@ export default class ContentArchive extends LightningElement {
|
|
|
328
355
|
setUrlParamValue({
|
|
329
356
|
[FilterNames.QUERY_CONTENT_FILTER]: [],
|
|
330
357
|
[FilterNames.QUERY_AUTHOR_FILTER]: [],
|
|
358
|
+
[FilterNames.QUERY_LANGUAGE_FILTER]: [],
|
|
331
359
|
[FilterNames.QUERY_CATEGORIES_FILTER]: [],
|
|
332
360
|
[FilterNames.QUERY_DATES_FILTER]: []
|
|
333
361
|
});
|
|
@@ -362,8 +390,16 @@ export default class ContentArchive extends LightningElement {
|
|
|
362
390
|
this.authorList = authors;
|
|
363
391
|
this.categoryList = categories;
|
|
364
392
|
this.filtersLoading = false;
|
|
365
|
-
|
|
366
|
-
|
|
393
|
+
this.languagesList = [
|
|
394
|
+
{ id: "english", name: "English" },
|
|
395
|
+
{ id: "japanese", name: "日本語" }
|
|
396
|
+
];
|
|
397
|
+
|
|
398
|
+
// note... this is super hacky... but necessary in order to both
|
|
399
|
+
// 1. actually filter the content
|
|
400
|
+
// 2. update the filter checkboxes to show that we filtered the content
|
|
401
|
+
this.updateAllFiltersFromUrl();
|
|
402
|
+
requestAnimationFrame(() => this.updateCheckedStatus());
|
|
367
403
|
}
|
|
368
404
|
}
|
|
369
405
|
|
|
@@ -465,8 +501,9 @@ export default class ContentArchive extends LightningElement {
|
|
|
465
501
|
this.mobileMatchMedia.addEventListener("change", this.onMobileChange);
|
|
466
502
|
|
|
467
503
|
if (this.posts.length === 0) {
|
|
468
|
-
this.fetchArchiveFilterList()
|
|
469
|
-
|
|
504
|
+
this.fetchArchiveFilterList().then(() => {
|
|
505
|
+
this.fetchPostsByCardType();
|
|
506
|
+
});
|
|
470
507
|
}
|
|
471
508
|
}
|
|
472
509
|
|
|
@@ -489,6 +526,7 @@ export default class ContentArchive extends LightningElement {
|
|
|
489
526
|
private updateAllFiltersFromUrl() {
|
|
490
527
|
const filters: FilterMenuData = {
|
|
491
528
|
[FilterNames.QUERY_AUTHOR_FILTER]: this.authorList,
|
|
529
|
+
[FilterNames.QUERY_LANGUAGE_FILTER]: this.languagesList,
|
|
492
530
|
[FilterNames.QUERY_DATES_FILTER]: this.dateList,
|
|
493
531
|
[FilterNames.QUERY_CATEGORIES_FILTER]: this.categoryList,
|
|
494
532
|
[FilterNames.QUERY_CONTENT_FILTER]: this.contentTypeList
|
|
@@ -4,9 +4,7 @@ export type ArchivePostAuthor = {
|
|
|
4
4
|
name: string;
|
|
5
5
|
slug: string;
|
|
6
6
|
url: string;
|
|
7
|
-
|
|
8
|
-
[key: string]: string;
|
|
9
|
-
};
|
|
7
|
+
image_src: string;
|
|
10
8
|
};
|
|
11
9
|
|
|
12
10
|
export type ArchivePost = {
|
|
@@ -15,6 +13,9 @@ export type ArchivePost = {
|
|
|
15
13
|
title: {
|
|
16
14
|
rendered: string;
|
|
17
15
|
};
|
|
16
|
+
acf: {
|
|
17
|
+
language: string;
|
|
18
|
+
};
|
|
18
19
|
type: string;
|
|
19
20
|
link: string;
|
|
20
21
|
excerpt: string;
|
|
@@ -23,6 +24,7 @@ export type ArchivePost = {
|
|
|
23
24
|
audio_url: string;
|
|
24
25
|
duration: string;
|
|
25
26
|
};
|
|
27
|
+
authors: any; // I'm not sure if this field actually exists, but we're trying to use it so let's include it in the type
|
|
26
28
|
_embedded: {
|
|
27
29
|
author: Array<ArchivePostAuthor>;
|
|
28
30
|
["wp:term"]: Array<
|
|
@@ -70,7 +72,8 @@ export type FilterMenuNames =
|
|
|
70
72
|
| "contentType"
|
|
71
73
|
| "dates"
|
|
72
74
|
| "authors"
|
|
73
|
-
| "categories"
|
|
75
|
+
| "categories"
|
|
76
|
+
| "language";
|
|
74
77
|
|
|
75
78
|
export type Filters = {
|
|
76
79
|
[key in FilterMenuNames]: any[];
|
|
@@ -95,4 +98,5 @@ export type FilterMenuData = {
|
|
|
95
98
|
dates: Array<FilterMenuItem>;
|
|
96
99
|
categories: Array<FilterMenuItem>;
|
|
97
100
|
authors: Array<FilterMenuItem>;
|
|
101
|
+
language: Array<FilterMenuItem>;
|
|
98
102
|
};
|
|
@@ -15,6 +15,18 @@ const ARCHIVE_CONTENT_URL = `${ARCHIVE_BASE_URL}/latest-post-per-site`;
|
|
|
15
15
|
const ARCHIVE_FILTER_LIST_URL = `${ARCHIVE_BASE_URL}/archives-filters?order=DESC`;
|
|
16
16
|
export const PER_PAGE_COUNT = 10;
|
|
17
17
|
|
|
18
|
+
const normalizePostLink = (post: {
|
|
19
|
+
acf: { language: string };
|
|
20
|
+
link: string;
|
|
21
|
+
}) => {
|
|
22
|
+
switch (post.acf.language) {
|
|
23
|
+
case "japanese":
|
|
24
|
+
return post.link.replace("/blogs/", "/jpblogs/");
|
|
25
|
+
default:
|
|
26
|
+
return post.link;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
18
30
|
async function postsFetchHandler(url: string) {
|
|
19
31
|
if (postsController) {
|
|
20
32
|
postsController.abort();
|
|
@@ -36,7 +48,7 @@ async function postsFetchHandler(url: string) {
|
|
|
36
48
|
console.error("Error fetching posts");
|
|
37
49
|
|
|
38
50
|
return {
|
|
39
|
-
posts: []
|
|
51
|
+
posts: [] as Array<ArchivePost>,
|
|
40
52
|
totalResults: 0,
|
|
41
53
|
totalPages: 0
|
|
42
54
|
};
|
|
@@ -61,18 +73,16 @@ function normalizePosts(posts: Array<ArchivePost>, contentType: string) {
|
|
|
61
73
|
title: post.title.rendered,
|
|
62
74
|
date: post.date,
|
|
63
75
|
contentType: post.sitename.toLowerCase(),
|
|
64
|
-
href: post
|
|
76
|
+
href: normalizePostLink(post),
|
|
65
77
|
...(contentType === "expanded" && {
|
|
66
78
|
excerpt: post.excerpt,
|
|
67
79
|
duration: getAudioDuration(post.podcast_audio.duration),
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
)
|
|
75
|
-
})
|
|
80
|
+
authors: post.authors,
|
|
81
|
+
...(post._embedded && {
|
|
82
|
+
topics: post._embedded["wp:term"][0].map(
|
|
83
|
+
(term: any) => term.name
|
|
84
|
+
)
|
|
85
|
+
})
|
|
76
86
|
})
|
|
77
87
|
}));
|
|
78
88
|
}
|
|
@@ -85,7 +95,8 @@ export async function getArchivePosts({
|
|
|
85
95
|
contentType: [],
|
|
86
96
|
dates: [],
|
|
87
97
|
authors: [],
|
|
88
|
-
categories: []
|
|
98
|
+
categories: [],
|
|
99
|
+
language: []
|
|
89
100
|
}
|
|
90
101
|
}: {
|
|
91
102
|
count: number;
|
|
@@ -105,6 +116,9 @@ export async function getArchivePosts({
|
|
|
105
116
|
),
|
|
106
117
|
category: filterMenuData.categories.map(
|
|
107
118
|
(category: FilterMenuItem) => category.id
|
|
119
|
+
),
|
|
120
|
+
language: filterMenuData.language.map(
|
|
121
|
+
(language: FilterMenuItem) => language.id
|
|
108
122
|
)
|
|
109
123
|
};
|
|
110
124
|
|
|
@@ -114,7 +128,9 @@ export async function getArchivePosts({
|
|
|
114
128
|
"date",
|
|
115
129
|
"sitename",
|
|
116
130
|
"link",
|
|
117
|
-
"
|
|
131
|
+
"acf",
|
|
132
|
+
"podcast_audio",
|
|
133
|
+
"authors"
|
|
118
134
|
];
|
|
119
135
|
const EXPANDED_FIELDS = [
|
|
120
136
|
"excerpt",
|
|
@@ -125,7 +141,7 @@ export async function getArchivePosts({
|
|
|
125
141
|
|
|
126
142
|
const query: any = {
|
|
127
143
|
...filterQuery,
|
|
128
|
-
_fields: ["id", "title", "date", "sitename", "link"],
|
|
144
|
+
_fields: ["id", "title", "date", "sitename", "link", "acf"],
|
|
129
145
|
per_page: count,
|
|
130
146
|
page
|
|
131
147
|
};
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
:host {
|
|
2
|
+
--dx-c-button-custom-background: var(--dx-g-blue-vibrant-50);
|
|
3
|
+
--dx-c-button-custom-color: white;
|
|
4
|
+
--dx-c-button-custom-border: var(--dx-g-blue-vibrant-50);
|
|
5
|
+
--dx-c-button-custom-color-hover: white;
|
|
6
|
+
--dx-c-button-custom-background-hover: var(--dx-g-blue-vibrant-40);
|
|
7
|
+
--dx-c-button-custom-border-hover: var(--dx-g-blue-vibrant-40);
|
|
8
|
+
|
|
2
9
|
display: block;
|
|
3
10
|
}
|
|
4
11
|
|
|
@@ -25,7 +32,10 @@ span {
|
|
|
25
32
|
}
|
|
26
33
|
|
|
27
34
|
dx-checkbox,
|
|
28
|
-
|
|
35
|
+
.privacy-notice,
|
|
36
|
+
span.privacy-terms,
|
|
37
|
+
span.marketing-terms {
|
|
38
|
+
width: 100%;
|
|
29
39
|
margin-bottom: var(--dx-g-spacing-lg);
|
|
30
40
|
}
|
|
31
41
|
|
|
@@ -48,19 +58,10 @@ form > .full-name-field {
|
|
|
48
58
|
width: calc(50% - var(--dx-g-spacing-lg) / 2);
|
|
49
59
|
}
|
|
50
60
|
|
|
51
|
-
.legal-terms {
|
|
52
|
-
margin-top: var(--dx-g-spacing-lg);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
61
|
.submit-button {
|
|
56
62
|
width: 100%;
|
|
57
63
|
}
|
|
58
64
|
|
|
59
|
-
.form-submit:hover {
|
|
60
|
-
background-color: var(--dx-g-blue-vibrant-40);
|
|
61
|
-
border-color: var(--dx-g-blue-vibrant-40);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
65
|
@media screen and (min-width: 641px) {
|
|
65
66
|
form > .full-name-field:first-of-type {
|
|
66
67
|
margin-right: var(--dx-g-spacing-lg);
|
|
@@ -51,8 +51,18 @@
|
|
|
51
51
|
options={countries}
|
|
52
52
|
placeholder="Select Country/Region"
|
|
53
53
|
required
|
|
54
|
-
value=
|
|
55
|
-
onchange={
|
|
54
|
+
value={country}
|
|
55
|
+
onchange={handleConsent}
|
|
56
|
+
></dx-select>
|
|
57
|
+
<dx-select
|
|
58
|
+
if:true={showStateSelect}
|
|
59
|
+
label="State/Province"
|
|
60
|
+
message-when-value-missing="Select your state/province"
|
|
61
|
+
name="state"
|
|
62
|
+
options={states}
|
|
63
|
+
placeholder="Select State/Province"
|
|
64
|
+
required
|
|
65
|
+
value={state}
|
|
56
66
|
></dx-select>
|
|
57
67
|
<dx-input
|
|
58
68
|
label="Postal Code"
|
|
@@ -76,36 +86,40 @@
|
|
|
76
86
|
validity-on-blur={checkUsernameValidity}
|
|
77
87
|
onchange={handleUsernameChange}
|
|
78
88
|
></dx-input>
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
value="explicit"
|
|
83
|
-
>
|
|
84
|
-
<span lwc:dom="manual" class="marketing-terms"></span>
|
|
89
|
+
|
|
90
|
+
<dx-checkbox required name="eula" value="accepted" if:true={legalText}>
|
|
91
|
+
<span lwc:dom="manual" class="legal-terms"></span>
|
|
85
92
|
</dx-checkbox>
|
|
93
|
+
|
|
94
|
+
<template if:false={showMarketingCheckbox}>
|
|
95
|
+
<span lwc:dom="manual" class="marketing-terms"></span>
|
|
96
|
+
</template>
|
|
97
|
+
<template if:true={showMarketingCheckbox}>
|
|
98
|
+
<dx-checkbox
|
|
99
|
+
name="marketingCheckbox"
|
|
100
|
+
class="marketing-terms"
|
|
101
|
+
value="false"
|
|
102
|
+
onchange={handleMarketingCheckbox}
|
|
103
|
+
>
|
|
104
|
+
<span>{marketingText}</span>
|
|
105
|
+
</dx-checkbox>
|
|
106
|
+
</template>
|
|
107
|
+
|
|
108
|
+
<template if:false={showLegalCheckbox}>
|
|
109
|
+
<span lwc:dom="manual" class="legal-checkbox privacy-terms"></span>
|
|
110
|
+
</template>
|
|
86
111
|
<dx-checkbox
|
|
87
112
|
if:true={showLegalCheckbox}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
113
|
+
class="privacy-terms"
|
|
114
|
+
value={legalCheckbox}
|
|
115
|
+
required="true"
|
|
91
116
|
>
|
|
92
|
-
<span lwc:dom="manual" class="legal-terms"></span>
|
|
93
|
-
<span
|
|
94
|
-
if:true={learnMore}
|
|
95
|
-
lwc:dom="manual"
|
|
96
|
-
class="learn-more"
|
|
97
|
-
></span>
|
|
117
|
+
<span lwc:dom="manual" class="legal-checkbox privacy-terms"></span>
|
|
98
118
|
</dx-checkbox>
|
|
99
|
-
|
|
100
|
-
<span lwc:dom="manual" class="legal-terms"></span>
|
|
101
|
-
<span
|
|
102
|
-
if:true={learnMore}
|
|
103
|
-
lwc:dom="manual"
|
|
104
|
-
class="learn-more"
|
|
105
|
-
></span>
|
|
106
|
-
</template>
|
|
119
|
+
|
|
107
120
|
<dx-button
|
|
108
121
|
class="submit-button"
|
|
122
|
+
variant="custom"
|
|
109
123
|
disabled={disableSubmit}
|
|
110
124
|
size="large"
|
|
111
125
|
type="submit"
|