@salesforcedevs/dw-components 0.56.1 → 0.57.1-alpha.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": "0.56.1",
3
+ "version": "0.57.1-alpha.2+ba23c283",
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": "49fdd771cee3f6d50a27cd505ca2a612f1887493"
26
+ "gitHead": "ba23c2834f6fdb8d222e308013b3f0cd92440f77"
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
- width: 123px;
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
- padding: 12px 20px 0 0;
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/images/background.svg");
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="3xl"></dx-hr>
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
- Stay up to date with the latest news from the Salesforce Developers Blog
9
+ Get the latest Salesforce Developer posts exactly how you want.
10
10
  </h2>
11
- <dx-button
12
- size="small"
13
- icon-symbol="rss"
14
- icon-sprite="general"
15
- class="button"
16
- onclick={rssOnClick}
17
- >
18
- Subscribe
19
- </dx-button>
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&amp;user_scope=&amp;redirect_uri=https%3A%2F%2Fdsc-slack-app.herokuapp.com%2Fslack%2Foauth_redirect&amp;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={hasMorePosts}
59
+ if:true={showLoadMore}
45
60
  onclick={onClick}
46
61
  variant="load-more"
47
62
  text="SHOW MORE"
@@ -170,6 +170,7 @@
170
170
  value={postType}
171
171
  onclick={removeFilterItem}
172
172
  variant="inline"
173
+ font="sans"
173
174
  >
174
175
  &#10005;
175
176
  </dx-button>
@@ -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 { QueryCoordinator } from "dxUtils/queryCoordinator";
6
+ import { getUrlParamValue, setUrlParamValue } from "dxUtils/queryCoordinator";
7
7
 
8
8
  const MOBILE_MATCH = "767px";
9
9
 
10
- const QUERY_SITE_FILTER = "c__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
- QueryCoordinator.setUrlParamValue(QUERY_SITE_FILTER, selectedFilters);
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
- QueryCoordinator.setUrlParamValue(QUERY_SITE_FILTER, null);
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
- QueryCoordinator.getUrlParamValue(QUERY_SITE_FILTER);
430
- if (
431
- presetFilters?.some((filterString) => filterString === BLOGS.name)
432
- ) {
433
- this.presetSiteFilter(BLOGS);
434
- }
435
- if (
436
- presetFilters?.some(
437
- (filterString) => filterString === PODCASTS.name
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(filter: any) {
450
- this._contentTypeList.forEach((option) => {
451
- if (option.name === filter.name) {
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
- this.updateSelectedFilters(filter, "site", true);
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
+ };
@@ -3,7 +3,7 @@ import {
3
3
  ArchivePost,
4
4
  ArchivePostNormalized,
5
5
  FilterMenuData
6
- } from "typings/custom";
6
+ } from "./contentArchive.types";
7
7
  import altData from "./altData.js";
8
8
 
9
9
  let controller: AbortController | null = null;
@@ -35,12 +35,13 @@ const ANALYTICS_INFO = {
35
35
  clickText: "Sign me Up",
36
36
  itemTitle: "Dev Edition Sign Up Button",
37
37
  formType: "Dev Edition Sign Up",
38
- formName: "Developer Edition",
38
+ formName: "DEVELOPER:xx:signup:Developer-Edition",
39
39
  method: "email",
40
40
  clickUrl: "/signup/success",
41
41
  elementType: "button",
42
42
  destinationType: "internal",
43
- ctaClick: true
43
+ ctaClick: true,
44
+ offerType: "Free Trial"
44
45
  };
45
46
  export default class DeSignupForm extends LightningElement {
46
47
  @api
@@ -163,7 +164,7 @@ export default class DeSignupForm extends LightningElement {
163
164
  .then(() => {
164
165
  trackGtm(event.target!, "custEv_signUp", {
165
166
  ...ANALYTICS_INFO,
166
- formId: formData.user.username
167
+ formId: 'form-builder|DEVELOPER:xx:signup|<null>'
167
168
  });
168
169
  window.location.href = ANALYTICS_INFO.clickUrl;
169
170
  })
@@ -5,7 +5,6 @@ import qs from "query-string";
5
5
  import uniqBy from "lodash.uniqby";
6
6
  import orderBy from "lodash.orderby";
7
7
  import { isGivenLanguageSupported } from "dxUtils/language";
8
- import { DEFAULT_LANGUAGES } from "dxUtils/constants";
9
8
 
10
9
  const DSC_API_URL = {
11
10
  "en-us": "/docs/get_index/en-us/000.0/false/All%20Services/all",
@@ -41,7 +40,7 @@ export default abstract class DocsGrid extends LightningElement {
41
40
  private deviceType: "desktop" | "mobile" | "mobile-small" = "desktop";
42
41
  private _searchTimeout?: number;
43
42
  private _couchDbDocTileExclusions?: Set<any>;
44
- private _allLanguages: Array<Language> = DEFAULT_LANGUAGES;
43
+ private _allLanguages: Array<Language> = [];
45
44
 
46
45
  connectedCallback(): void {
47
46
  this.retrieveDscApis(true);
@@ -7,6 +7,10 @@
7
7
  z-index: 49;
8
8
  }
9
9
 
10
+ .buffer {
11
+ margin-bottom: 100px;
12
+ }
13
+
10
14
  dx-section::part(container) {
11
15
  margin: 0 auto;
12
16
  max-width: 880px;
@@ -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
+ <dx-slack-cta class="slack-cta">
73
+ Get notified of new events with the new Salesforce Developers Slack app
74
+ </dx-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}
@@ -13,7 +13,7 @@
13
13
  </template>
14
14
  </dx-grid>
15
15
  <dx-hr
16
- if:true={hasMorePosts}
16
+ if:true={showLoadMore}
17
17
  onclick={onClick}
18
18
  variant="load-more"
19
19
  text="LOAD MORE"
@@ -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
  }