@salesforcedevs/dw-components 1.1.2-alpha.7 → 1.2.4-alpha.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 CHANGED
@@ -5,7 +5,6 @@
5
5
  ],
6
6
  "expose": [
7
7
  "dw/blogsGrid",
8
- "dw/browseTrials",
9
8
  "dw/cardBlogPostProvider",
10
9
  "dw/cardPodcastEpisodeProvider",
11
10
  "dw/codeSamplesGrid",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dw-components",
3
- "version": "1.1.2-alpha.7",
3
+ "version": "1.2.4-alpha.0",
4
4
  "description": "Lightning web components for https://developer.salesforce.com",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -83,11 +83,6 @@ dx-section:first-of-type {
83
83
  margin: 50px auto;
84
84
  }
85
85
 
86
- dx-type-badge.platform {
87
- --dx-c-type-badge-color: var(--dx-g-green-vibrant-40);
88
- --dx-c-type-badge-background: var(--dx-g-green-vibrant-90);
89
- }
90
-
91
86
  @media screen and (max-width: 1024px) {
92
87
  .code-samples-feature {
93
88
  --dx-c-feature-description-font-size: 14px;
@@ -102,10 +102,10 @@
102
102
  >
103
103
  <div class="badge-link-container">
104
104
  <div class="badge-container">
105
- <dx-type-badge
105
+ <dx-metadata-badge
106
106
  value={item.product}
107
- class={item.product}
108
- ></dx-type-badge>
107
+ size="small"
108
+ ></dx-metadata-badge>
109
109
  </div>
110
110
  <div class="external-link-container">
111
111
  <dx-button
@@ -123,7 +123,6 @@ export default class CodeSamplesGrid extends LightningElement {
123
123
 
124
124
  @api
125
125
  set samples(value: string) {
126
- console.log(value);
127
126
  const jsonSamples = toJson(value) || [];
128
127
  this._samplesList = jsonSamples.map((sample, i) => ({
129
128
  id: i,
@@ -363,7 +363,11 @@ export default class ContentArchive extends LightningElement {
363
363
  this.categoryList = categories;
364
364
  this.filtersLoading = false;
365
365
 
366
- requestAnimationFrame(() => this.updateAllFiltersFromUrl());
366
+ // note... this is super hacky... but necessary in order to both
367
+ // 1. actually filter the content
368
+ // 2. update the filter checkboxes to show that we filtered the content
369
+ this.updateAllFiltersFromUrl();
370
+ requestAnimationFrame(() => this.updateCheckedStatus());
367
371
  }
368
372
  }
369
373
 
@@ -465,8 +469,9 @@ export default class ContentArchive extends LightningElement {
465
469
  this.mobileMatchMedia.addEventListener("change", this.onMobileChange);
466
470
 
467
471
  if (this.posts.length === 0) {
468
- this.fetchArchiveFilterList();
469
- this.fetchPostsByCardType();
472
+ this.fetchArchiveFilterList().then(() => {
473
+ this.fetchPostsByCardType();
474
+ });
470
475
  }
471
476
  }
472
477
 
@@ -60,7 +60,7 @@ function normalizePosts(posts: Array<ArchivePost>, contentType: string) {
60
60
  id: post.id,
61
61
  title: post.title.rendered,
62
62
  date: post.date,
63
- contentType: post.sitename,
63
+ contentType: post.sitename.toLowerCase(),
64
64
  href: post.link,
65
65
  ...(contentType === "expanded" && {
66
66
  excerpt: post.excerpt,
@@ -225,7 +225,12 @@ export default class DeSignupForm extends LightningElement {
225
225
  const formData: SignupForm = {
226
226
  user: userData as UserData,
227
227
  eula: this.showLegalCheckbox ? checkboxes.values.eula : ACCEPTED,
228
- default_driver: DEFAULT_DRIVER
228
+ default_driver: DEFAULT_DRIVER,
229
+ InfoEmail__c: this.showLegalCheckbox
230
+ ? checkboxes.values.eula === ACCEPTED
231
+ ? "True"
232
+ : "False"
233
+ : "True"
229
234
  };
230
235
 
231
236
  return formData;
@@ -20,6 +20,7 @@ export type SignupForm = {
20
20
  user: UserData;
21
21
  eula: string;
22
22
  default_driver: string;
23
+ InfoEmail__c: "True" | "False";
23
24
  };
24
25
 
25
26
  type OrgStatus = "New" | "In Progress" | "Error";
@@ -21,7 +21,7 @@ export default class PodcastSubscription extends LightningElement {
21
21
 
22
22
  secondaryLinks = [
23
23
  {
24
- href: "https://app.stitcher.com/browse/feed/470480/details",
24
+ href: "https://www.stitcher.com/show/salesforce-developer-podcast",
25
25
  text: "Stitcher"
26
26
  },
27
27
  {
@@ -1,60 +0,0 @@
1
- @import "dxHelpers/reset";
2
- @import "dxHelpers/text";
3
-
4
- :host {
5
- --dw-browse-trials-padding-top: 0;
6
- --dw-browse-trials-padding-bottom: 0;
7
- }
8
-
9
- .title {
10
- color: var(--dx-g-blue-vibrant-20);
11
- font-family: var(--dx-g-font-display);
12
- font-weight: var(--dx-g-font-weight-demi);
13
- font-size: 32px;
14
- letter-spacing: -0.4px;
15
- line-height: 40px;
16
- margin-bottom: var(--dx-g-spacing-md);
17
- }
18
-
19
- .panel-list-container {
20
- padding: var(--dw-browse-trials-padding-top)
21
- var(--dx-g-page-padding-horizontal)
22
- var(--dw-browse-trials-padding-bottom)
23
- var(--dx-g-page-padding-horizontal);
24
- }
25
-
26
- dx-tab-panel-list {
27
- --dx-c-tab-panel-list-horizontal-padding: 0;
28
- }
29
-
30
- dx-card-trial {
31
- width: 400px;
32
- max-width: 100%;
33
- min-width: 240px;
34
- }
35
-
36
- .category-text-container {
37
- width: 100%;
38
- }
39
-
40
- .category-subtitle {
41
- color: var(--dx-g-font-sans);
42
- margin-top: var(--dx-g-spacing-smd);
43
- max-width: 560px;
44
- }
45
-
46
- .button-toggle-container {
47
- display: flex;
48
- gap: var(--dx-g-spacing-md);
49
- margin-top: var(--dx-g-spacing-3xl);
50
- }
51
-
52
- .category-container {
53
- display: flex;
54
- flex-wrap: wrap;
55
- gap: 40px;
56
- }
57
-
58
- .category-container {
59
- margin-top: var(--dx-g-spacing-4xl);
60
- }
@@ -1,83 +0,0 @@
1
- <template>
2
- <div class="panel-list-container">
3
- <h2 class="title">{title}</h2>
4
- <dx-tab-panel-list tabs={tabLabels} onchange={handleTabChange}>
5
- <template for:each={trials} for:item="trial">
6
- <dx-tab-panel key={trial.label}>
7
- <div
8
- key={trial.label}
9
- class="button-toggle-container"
10
- if:false={trial.hideFilters}
11
- >
12
- <template
13
- for:each={buttonToggleStates}
14
- for:item="buttonToggleState"
15
- >
16
- <dx-button-toggle
17
- label={buttonToggleState.label}
18
- key={buttonToggleState.label}
19
- value={buttonToggleState.value}
20
- ontoggle={handleFilters}
21
- ></dx-button-toggle>
22
- </template>
23
- </div>
24
- <template for:each={filteredCategories} for:item="category">
25
- <div key={category.title} class="category-container">
26
- <div
27
- if:true={category.title}
28
- class="category-text-container"
29
- >
30
- <h2 class="dx-text-heading-4 category-title">
31
- {category.title}
32
- </h2>
33
- <p
34
- if:true={category.subtitle}
35
- class="category-subtitle"
36
- >
37
- {category.subtitle}
38
- </p>
39
- </div>
40
- <template for:each={category.cards} for:item="card">
41
- <template if:true={card.hasModal}>
42
- <dx-card-trial
43
- key={card.title}
44
- badge-background-color={card.badgeBackgroundColor}
45
- badge-symbol={card.badgeSymbol}
46
- body={card.body}
47
- details={card.details}
48
- modal-title={card.modalTitle}
49
- modal-details={card.modalDetails}
50
- href={card.href}
51
- label={card.label}
52
- terms={card.terms}
53
- title={card.title}
54
- button-one-cta={card.buttonOneCta}
55
- button-one-href={card.buttonOneHref}
56
- button-one-icon={card.buttonOneIcon}
57
- button-two-cta={card.buttonTwoCta}
58
- hide-card-details="true"
59
- ></dx-card-trial>
60
- </template>
61
- <template if:false={card.hasModal}>
62
- <dx-card-trial
63
- key={card.title}
64
- badge-background-color={card.badgeBackgroundColor}
65
- badge-symbol={card.badgeSymbol}
66
- body={card.body}
67
- href={card.href}
68
- label={card.label}
69
- terms={card.terms}
70
- title={card.title}
71
- button-one-cta={card.buttonOneCta}
72
- button-one-href={card.buttonOneHref}
73
- button-one-icon={card.buttonOneIcon}
74
- ></dx-card-trial>
75
- </template>
76
- </template>
77
- </div>
78
- </template>
79
- </dx-tab-panel>
80
- </template>
81
- </dx-tab-panel-list>
82
- </div>
83
- </template>
@@ -1,104 +0,0 @@
1
- import { LightningElement, api, track } from "lwc";
2
- import { toJson } from "dxUtils/normalizers";
3
-
4
- export default class BrowseTrials extends LightningElement {
5
- @api title = "Browse Trials";
6
-
7
- @api
8
- get trials() {
9
- return this._trials;
10
- }
11
- set trials(
12
- value: [{ label: string; hideFilters: boolean; buttonLabels: string[] }]
13
- ) {
14
- this._trials = toJson(value);
15
- this.tabLabels = this._trials.map((trial) => ({ label: trial.label }));
16
- this.buttonLabels = this._trials.map((trial) =>
17
- !trial.hideFilters ? trial.buttonLabels : []
18
- );
19
- this._filteredTitles = this._trials.map(() => []);
20
- this._filteredCategories = this._trials.map(
21
- (trial) => trial.categories
22
- );
23
- }
24
-
25
- get buttonToggleStates() {
26
- return this.buttonLabels[this.activeTabIndex].map((label) => ({
27
- label,
28
- value: this.activeFilteredTitles.includes(label)
29
- }));
30
- }
31
-
32
- get activeFilteredTitles() {
33
- return this._filteredTitles[this.activeTabIndex];
34
- }
35
- set activeFilteredTitles(value: string[]) {
36
- this._filteredTitles[this.activeTabIndex] = value;
37
- }
38
-
39
- get activeCategories() {
40
- return this._trials[this.activeTabIndex].categories;
41
- }
42
-
43
- get filteredCategories() {
44
- return this._filteredCategories[this.activeTabIndex];
45
- }
46
- set filteredCategories(value: any) {
47
- this._filteredCategories[this.activeTabIndex] = value;
48
- }
49
-
50
- @track
51
- private _filteredCategories!: Array<any>;
52
-
53
- private activeTabIndex = 0;
54
- private buttonLabels!: string[][];
55
- private _filteredTitles!: string[][];
56
- private tabLabels!: Array<{ label: string }>;
57
- private _trials!: [
58
- {
59
- label: string;
60
- hideFilters: boolean;
61
- buttonLabels: string[];
62
- categories: Array<{ title: string }>;
63
- }
64
- ];
65
-
66
- handleTabChange(e: CustomEvent) {
67
- this.activeTabIndex = e.detail;
68
- }
69
-
70
- filterCategories() {
71
- this.filteredCategories = this.activeCategories.filter((category) =>
72
- this.activeFilteredTitles.includes(category.title)
73
- );
74
- }
75
-
76
- addLabelToFilter(label: string) {
77
- this.activeFilteredTitles.push(label);
78
- this.filterCategories();
79
- }
80
-
81
- removeLabelFromFilter(label: string) {
82
- this.activeFilteredTitles = this.activeFilteredTitles.filter(
83
- (filterTitle) => filterTitle !== label
84
- );
85
- this.filterCategories();
86
- }
87
-
88
- resetFilters() {
89
- this.activeFilteredTitles = [];
90
- this.filteredCategories = this.activeCategories;
91
- }
92
-
93
- handleFilters(e: CustomEvent) {
94
- const { label, value } = e.detail;
95
-
96
- if (value) {
97
- this.addLabelToFilter(label);
98
- } else if (this.activeFilteredTitles.length !== 1) {
99
- this.removeLabelFromFilter(label);
100
- } else {
101
- this.resetFilters();
102
- }
103
- }
104
- }