@salesforcedevs/dw-components 0.56.2 → 0.57.1-alpha.3
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 -2
- package/src/modules/dw/blogsGrid/blogsGrid.css +14 -5
- package/src/modules/dw/blogsGrid/blogsGrid.html +27 -12
- package/src/modules/dw/contentArchive/contentArchive.html +1 -0
- package/src/modules/dw/contentArchive/contentArchive.ts +38 -23
- package/src/modules/dw/contentArchive/contentArchive.types.ts +81 -0
- package/src/modules/dw/contentArchive/utils.ts +1 -1
- package/src/modules/dw/eventsList/eventsList.css +4 -0
- package/src/modules/dw/eventsList/eventsList.html +9 -0
- package/src/modules/dw/podcastsGrid/podcastsGrid.html +1 -1
- package/src/modules/dwBaseElements/postsGrid/postsGrid.ts +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/dw-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.57.1-alpha.3+cdb39321",
|
|
4
4
|
"description": "Lightning web components for https://developer.salesforce.com",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
"@types/lodash.orderby": "^4.6.7",
|
|
24
24
|
"@types/lodash.uniqby": "^4.7.7"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "cdb39321a024284380127490c9a07f81dbfd0f36"
|
|
27
27
|
}
|
|
@@ -25,7 +25,6 @@ dx-section.section-reduced-padding {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.box {
|
|
28
|
-
width: 548px;
|
|
29
28
|
height: 162px;
|
|
30
29
|
}
|
|
31
30
|
}
|
|
@@ -40,8 +39,8 @@ dx-section.section-reduced-padding {
|
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
.box {
|
|
43
|
-
width: 354px;
|
|
44
42
|
height: 162px;
|
|
43
|
+
background-position: 0% 25%, 90% 75%;
|
|
45
44
|
}
|
|
46
45
|
}
|
|
47
46
|
|
|
@@ -50,7 +49,7 @@ dx-section.section-reduced-padding {
|
|
|
50
49
|
font-weight: 500;
|
|
51
50
|
letter-spacing: 0;
|
|
52
51
|
height: 48px;
|
|
53
|
-
|
|
52
|
+
padding: 10px;
|
|
54
53
|
}
|
|
55
54
|
|
|
56
55
|
.subscription-box {
|
|
@@ -63,11 +62,21 @@ dx-section.section-reduced-padding {
|
|
|
63
62
|
align-items: center;
|
|
64
63
|
display: flex;
|
|
65
64
|
flex-direction: column;
|
|
66
|
-
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.cta-container {
|
|
68
|
+
width: 100%;
|
|
69
|
+
display: flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
justify-content: center;
|
|
67
72
|
}
|
|
68
73
|
|
|
69
74
|
.box {
|
|
70
|
-
background-image: url("/assets/
|
|
75
|
+
background-image: url("/assets/svg/subscribe-background-left.svg"),
|
|
76
|
+
url("/assets/svg/subscribe-background-right.svg");
|
|
77
|
+
background-position: 4% 25%, 90% 60%;
|
|
78
|
+
background-repeat: no-repeat;
|
|
79
|
+
width: 100%;
|
|
71
80
|
}
|
|
72
81
|
|
|
73
82
|
.icon {
|
|
@@ -1,22 +1,37 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<dx-hr spacing="
|
|
2
|
+
<dx-hr spacing="2xl"></dx-hr>
|
|
3
3
|
|
|
4
4
|
<dx-section class="section-padding-lg section-reduced-padding">
|
|
5
5
|
<div class="subscription-box">
|
|
6
6
|
<div class="box">
|
|
7
7
|
<div class="content">
|
|
8
8
|
<h2 class="title">
|
|
9
|
-
|
|
9
|
+
Get the latest Salesforce Developer posts exactly how you want.
|
|
10
10
|
</h2>
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
<div class="cta-container">
|
|
12
|
+
<dx-button
|
|
13
|
+
size="small"
|
|
14
|
+
variant="secondary"
|
|
15
|
+
icon-symbol="slack"
|
|
16
|
+
icon-sprite="salesforcebrand"
|
|
17
|
+
icon-position="left"
|
|
18
|
+
href="https://slack.com/oauth/v2/authorize?scope=chat%3Awrite%2Ccommands&user_scope=&redirect_uri=https%3A%2F%2Fdsc-slack-app.herokuapp.com%2Fslack%2Foauth_redirect&client_id=1814240140212.2864842743411"
|
|
19
|
+
class="button"
|
|
20
|
+
>
|
|
21
|
+
Send posts to Slack
|
|
22
|
+
</dx-button>
|
|
23
|
+
<dx-button
|
|
24
|
+
size="small"
|
|
25
|
+
variant="secondary"
|
|
26
|
+
icon-symbol="rss"
|
|
27
|
+
icon-position="left"
|
|
28
|
+
icon-sprite="general"
|
|
29
|
+
href="https://developer.salesforce.com/blogs/feed"
|
|
30
|
+
class="button"
|
|
31
|
+
>
|
|
32
|
+
Subscribe to RSS
|
|
33
|
+
</dx-button>
|
|
34
|
+
</div>
|
|
20
35
|
</div>
|
|
21
36
|
</div>
|
|
22
37
|
</div>
|
|
@@ -41,7 +56,7 @@
|
|
|
41
56
|
</template>
|
|
42
57
|
</dx-grid>
|
|
43
58
|
<dx-hr
|
|
44
|
-
if:true={
|
|
59
|
+
if:true={showLoadMore}
|
|
45
60
|
onclick={onClick}
|
|
46
61
|
variant="load-more"
|
|
47
62
|
text="SHOW MORE"
|
|
@@ -3,11 +3,11 @@ import cx from "classnames";
|
|
|
3
3
|
import { getArchivePosts, getArchiveFilterList } from "./utils";
|
|
4
4
|
import { sortSplittedPostsByMonth } from "dxUtils/dates";
|
|
5
5
|
import { Filters } from "./contentArchive.types";
|
|
6
|
-
import {
|
|
6
|
+
import { getUrlParamValue, setUrlParamValue } from "dxUtils/queryCoordinator";
|
|
7
7
|
|
|
8
8
|
const MOBILE_MATCH = "767px";
|
|
9
9
|
|
|
10
|
-
const QUERY_SITE_FILTER = "
|
|
10
|
+
const QUERY_SITE_FILTER = "content-type";
|
|
11
11
|
const PODCASTS = { id: 2, name: "Podcasts" };
|
|
12
12
|
const BLOGS = { id: 1, name: "Blogs" };
|
|
13
13
|
export default class ContentArchive extends LightningElement {
|
|
@@ -168,7 +168,8 @@ export default class ContentArchive extends LightningElement {
|
|
|
168
168
|
if (selectedFilters?.length === 0) {
|
|
169
169
|
selectedFilters = null;
|
|
170
170
|
}
|
|
171
|
-
|
|
171
|
+
|
|
172
|
+
setUrlParamValue(QUERY_SITE_FILTER, selectedFilters);
|
|
172
173
|
|
|
173
174
|
this.updateSelectedFilters(value, name, checked);
|
|
174
175
|
}
|
|
@@ -306,7 +307,8 @@ export default class ContentArchive extends LightningElement {
|
|
|
306
307
|
|
|
307
308
|
this.updateCheckedStatus();
|
|
308
309
|
this.fetchPostsByCardType();
|
|
309
|
-
|
|
310
|
+
|
|
311
|
+
setUrlParamValue(QUERY_SITE_FILTER, null);
|
|
310
312
|
}
|
|
311
313
|
|
|
312
314
|
private goToPage(e: CustomEvent) {
|
|
@@ -425,19 +427,17 @@ export default class ContentArchive extends LightningElement {
|
|
|
425
427
|
this.onMobileChange(this.mobileMatchMedia);
|
|
426
428
|
this.mobileMatchMedia.addEventListener("change", this.onMobileChange);
|
|
427
429
|
|
|
428
|
-
const presetFilters: string
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
)
|
|
439
|
-
) {
|
|
440
|
-
this.presetSiteFilter(PODCASTS);
|
|
430
|
+
const presetFilters: Array<string> =
|
|
431
|
+
getUrlParamValue(QUERY_SITE_FILTER);
|
|
432
|
+
|
|
433
|
+
if (presetFilters.length === 1) {
|
|
434
|
+
if (presetFilters[0] === BLOGS.name) {
|
|
435
|
+
this.presetSiteFilter(BLOGS);
|
|
436
|
+
} else {
|
|
437
|
+
this.presetSiteFilter(PODCASTS);
|
|
438
|
+
}
|
|
439
|
+
} else if (presetFilters.length === 2) {
|
|
440
|
+
this.presetSiteFilter();
|
|
441
441
|
}
|
|
442
442
|
|
|
443
443
|
if (this.posts.length === 0) {
|
|
@@ -446,12 +446,27 @@ export default class ContentArchive extends LightningElement {
|
|
|
446
446
|
}
|
|
447
447
|
}
|
|
448
448
|
|
|
449
|
-
presetSiteFilter(
|
|
450
|
-
|
|
451
|
-
|
|
449
|
+
presetSiteFilter(
|
|
450
|
+
filter: { id: number; name: string } | undefined = undefined
|
|
451
|
+
) {
|
|
452
|
+
// check both content types when no filter is provided
|
|
453
|
+
if (!filter) {
|
|
454
|
+
this.selectedFilterMenuData = {
|
|
455
|
+
...this.selectedFilterMenuData,
|
|
456
|
+
site: [BLOGS, PODCASTS]
|
|
457
|
+
};
|
|
458
|
+
this._contentTypeList.forEach((option) => {
|
|
452
459
|
option.checked = true;
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
|
|
460
|
+
});
|
|
461
|
+
this.updateCheckedStatus();
|
|
462
|
+
} else {
|
|
463
|
+
// set either blogs OR podcasts
|
|
464
|
+
this._contentTypeList.forEach((option) => {
|
|
465
|
+
if (option.name === filter.name) {
|
|
466
|
+
option.checked = true;
|
|
467
|
+
}
|
|
468
|
+
});
|
|
469
|
+
this.updateSelectedFilters(filter, "site", true);
|
|
470
|
+
}
|
|
456
471
|
}
|
|
457
472
|
}
|
|
@@ -4,3 +4,84 @@ export interface Filters {
|
|
|
4
4
|
authors: any[];
|
|
5
5
|
categories: any[];
|
|
6
6
|
}
|
|
7
|
+
|
|
8
|
+
export type ArchivePostAuthor = {
|
|
9
|
+
id: number;
|
|
10
|
+
link: string;
|
|
11
|
+
name: string;
|
|
12
|
+
slug: string;
|
|
13
|
+
url: string;
|
|
14
|
+
avatar_urls: {
|
|
15
|
+
[key: string]: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export type ArchivePost = {
|
|
20
|
+
id: number;
|
|
21
|
+
date: string;
|
|
22
|
+
title: {
|
|
23
|
+
rendered: string;
|
|
24
|
+
};
|
|
25
|
+
type: string;
|
|
26
|
+
link: string;
|
|
27
|
+
excerpt: string;
|
|
28
|
+
sitename: string;
|
|
29
|
+
podcast_audio: {
|
|
30
|
+
audio_url: string;
|
|
31
|
+
duration: string;
|
|
32
|
+
};
|
|
33
|
+
_embedded: {
|
|
34
|
+
author: Array<ArchivePostAuthor>;
|
|
35
|
+
["wp:term"]: Array<
|
|
36
|
+
Array<{
|
|
37
|
+
id: number;
|
|
38
|
+
link: string;
|
|
39
|
+
name: string;
|
|
40
|
+
slug: string;
|
|
41
|
+
taxonomy: string;
|
|
42
|
+
_links: any;
|
|
43
|
+
}>
|
|
44
|
+
>;
|
|
45
|
+
};
|
|
46
|
+
_links: [
|
|
47
|
+
{
|
|
48
|
+
embeddable: boolean;
|
|
49
|
+
href: string;
|
|
50
|
+
}
|
|
51
|
+
];
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export type ArchivePostNormalized = {
|
|
55
|
+
posts: Array<{
|
|
56
|
+
id: number;
|
|
57
|
+
title: string;
|
|
58
|
+
date: string;
|
|
59
|
+
contentType: string;
|
|
60
|
+
href: string;
|
|
61
|
+
excerpt?: string;
|
|
62
|
+
author?: ArchivePostAuthor;
|
|
63
|
+
authorImgSrc?: string;
|
|
64
|
+
topics?: Array<string>;
|
|
65
|
+
}>;
|
|
66
|
+
totalPages: number;
|
|
67
|
+
totalResults: number;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export type ArchiveContent = {
|
|
71
|
+
posts: Array<ArchivePost>;
|
|
72
|
+
totalResults: number;
|
|
73
|
+
totalPages: number;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export type FilterMenuItem = {
|
|
77
|
+
id: string;
|
|
78
|
+
name: string;
|
|
79
|
+
shortName?: string;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export type FilterMenuData = {
|
|
83
|
+
site: Array<FilterMenuItem>;
|
|
84
|
+
dates: Array<FilterMenuItem>;
|
|
85
|
+
categories: Array<FilterMenuItem>;
|
|
86
|
+
authors: Array<FilterMenuItem>;
|
|
87
|
+
};
|
|
@@ -66,6 +66,15 @@
|
|
|
66
66
|
featured="true"
|
|
67
67
|
></dx-card-event>
|
|
68
68
|
</dx-section>
|
|
69
|
+
|
|
70
|
+
<dx-hr spacing="2xl"></dx-hr>
|
|
71
|
+
|
|
72
|
+
<dw-slack-cta class="slack-cta">
|
|
73
|
+
Get notified of new events with the new Salesforce Developers Slack app
|
|
74
|
+
</dw-slack-cta>
|
|
75
|
+
|
|
76
|
+
<div class="buffer"></div>
|
|
77
|
+
|
|
69
78
|
<dx-section class="events-list past-events" title="Past Events" if:true={pastEvents.length}>
|
|
70
79
|
<dx-card-event
|
|
71
80
|
for:each={pastEvents}
|
|
@@ -64,6 +64,10 @@ export abstract class PostsGrid extends LightningElement {
|
|
|
64
64
|
return this._morePostsViewed;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
get showLoadMore(): boolean {
|
|
68
|
+
return this.archives && this.hasMorePosts;
|
|
69
|
+
}
|
|
70
|
+
|
|
67
71
|
get showArchives(): boolean {
|
|
68
72
|
return this._morePostsViewed && this.archives;
|
|
69
73
|
}
|