@salesforcedevs/dw-components 1.3.26 → 1.3.29
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/deSignupForm/deSignupForm.css +2 -5
- package/src/modules/dw/deSignupForm/deSignupForm.html +11 -18
- package/src/modules/dw/deSignupForm/deSignupForm.ts +17 -56
- package/src/modules/dw/podcastsPromo/podcastsPromo.html +10 -1
- package/src/modules/dw/podcastsPromo/podcastsPromo.ts +11 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/dw-components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.29",
|
|
4
4
|
"description": "Lightning web components for https://developer.salesforce.com",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -22,5 +22,5 @@
|
|
|
22
22
|
"@types/lodash.orderby": "^4.6.7",
|
|
23
23
|
"@types/lodash.uniqby": "^4.7.7"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "5d0d8e8ae99896c6f2da9afd8f826a5c37ae45a1"
|
|
26
26
|
}
|
|
@@ -25,7 +25,8 @@ span {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
dx-checkbox,
|
|
28
|
-
|
|
28
|
+
.privacy-notice {
|
|
29
|
+
width: 100%;
|
|
29
30
|
margin-bottom: var(--dx-g-spacing-lg);
|
|
30
31
|
}
|
|
31
32
|
|
|
@@ -48,10 +49,6 @@ form > .full-name-field {
|
|
|
48
49
|
width: calc(50% - var(--dx-g-spacing-lg) / 2);
|
|
49
50
|
}
|
|
50
51
|
|
|
51
|
-
.legal-terms {
|
|
52
|
-
margin-top: var(--dx-g-spacing-lg);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
52
|
.submit-button {
|
|
56
53
|
width: 100%;
|
|
57
54
|
}
|
|
@@ -70,39 +70,32 @@
|
|
|
70
70
|
description-markup='Your username must be in the form of an email address (it does not have to be real). It must be unique and cannot be associated with another Salesforce login credential. <a href="https://help.salesforce.com/s/articleView?id=sf.basics_intro_usernames_passwords.htm&type=5" target="_blank">Read more about username recommendations.</a>'
|
|
71
71
|
label="Username"
|
|
72
72
|
name="username"
|
|
73
|
-
placeholder="
|
|
73
|
+
placeholder="miles.vandewetering@salesforce.com"
|
|
74
74
|
required
|
|
75
75
|
type="email"
|
|
76
76
|
validity-on-blur={checkUsernameValidity}
|
|
77
77
|
onchange={handleUsernameChange}
|
|
78
78
|
></dx-input>
|
|
79
|
+
<dx-checkbox required name="eula" value="accepted">
|
|
80
|
+
<span lwc:dom="manual" class="legal-terms"></span>
|
|
81
|
+
</dx-checkbox>
|
|
79
82
|
<dx-checkbox
|
|
80
|
-
if:true={
|
|
83
|
+
if:true={showMarketingCheckbox}
|
|
81
84
|
name="opt_in"
|
|
82
85
|
value="explicit"
|
|
83
86
|
>
|
|
84
87
|
<span lwc:dom="manual" class="marketing-terms"></span>
|
|
85
88
|
</dx-checkbox>
|
|
86
89
|
<dx-checkbox
|
|
87
|
-
if:true={
|
|
90
|
+
if:true={showPrivacyCheckbox}
|
|
88
91
|
required
|
|
89
|
-
name="
|
|
90
|
-
value="
|
|
92
|
+
name="privacy"
|
|
93
|
+
value="privacy_accepted"
|
|
91
94
|
>
|
|
92
|
-
<span lwc:dom="manual" class="
|
|
93
|
-
<span
|
|
94
|
-
if:true={learnMore}
|
|
95
|
-
lwc:dom="manual"
|
|
96
|
-
class="learn-more"
|
|
97
|
-
></span>
|
|
95
|
+
<span lwc:dom="manual" class="privacy-terms"></span>
|
|
98
96
|
</dx-checkbox>
|
|
99
|
-
<template if:false={
|
|
100
|
-
<span lwc:dom="manual" class="
|
|
101
|
-
<span
|
|
102
|
-
if:true={learnMore}
|
|
103
|
-
lwc:dom="manual"
|
|
104
|
-
class="learn-more"
|
|
105
|
-
></span>
|
|
97
|
+
<template if:false={showPrivacyCheckbox}>
|
|
98
|
+
<span lwc:dom="manual" class="privacy-terms privacy-notice"></span>
|
|
106
99
|
</template>
|
|
107
100
|
<dx-button
|
|
108
101
|
class="submit-button"
|
|
@@ -11,24 +11,14 @@ import {
|
|
|
11
11
|
|
|
12
12
|
type SelectOption = { value: string; label: string };
|
|
13
13
|
type Country = SelectOption & {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
type CheckboxSet = {
|
|
20
|
-
marketingText: string;
|
|
21
|
-
legalText: string;
|
|
22
|
-
learnMore?: string;
|
|
23
|
-
};
|
|
24
|
-
type CheckboxTextMap = {
|
|
25
|
-
[key: string]: CheckboxSet;
|
|
14
|
+
showMarketingCheckbox: boolean;
|
|
15
|
+
privacyText?: string;
|
|
16
|
+
privacyOptIn?: boolean;
|
|
26
17
|
};
|
|
27
18
|
|
|
28
19
|
const DEFAULT_DRIVER = "7013000000005wb";
|
|
29
20
|
const DUPLICATE_USERNAME_MESSAGE =
|
|
30
21
|
"You are already using that username in another Salesforce login credential. Your username needs to be unique and in the form of an email address.";
|
|
31
|
-
const ACCEPTED = "accepted";
|
|
32
22
|
const SIGN_UP_LABEL = "Sign me Up";
|
|
33
23
|
|
|
34
24
|
const ANALYTICS_INFO = {
|
|
@@ -62,20 +52,14 @@ export default class DeSignupForm extends LightningElement {
|
|
|
62
52
|
this._roles = toJson(value);
|
|
63
53
|
}
|
|
64
54
|
|
|
65
|
-
@api
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
set checkboxTextMap(value) {
|
|
71
|
-
this._checkboxTextMap = toJson(value);
|
|
72
|
-
}
|
|
55
|
+
@api marketingText: string = "";
|
|
56
|
+
@api privacyText: string = "";
|
|
57
|
+
@api legalText: string = "";
|
|
73
58
|
|
|
74
59
|
private country: Country = null;
|
|
75
60
|
private disableSubmit = false;
|
|
76
61
|
private username = "";
|
|
77
62
|
private updateCheckboxLabels = true;
|
|
78
|
-
private _checkboxTextMap: CheckboxTextMap = null;
|
|
79
63
|
private _countries: Array<Country>;
|
|
80
64
|
private _roles: Array<SelectOption>;
|
|
81
65
|
@track knownDuplicateUsers = [];
|
|
@@ -90,35 +74,12 @@ export default class DeSignupForm extends LightningElement {
|
|
|
90
74
|
return !this.knownDuplicateUsers.includes(this.username);
|
|
91
75
|
}
|
|
92
76
|
|
|
93
|
-
get
|
|
94
|
-
return this.country && this.country.
|
|
77
|
+
get showMarketingCheckbox(): boolean {
|
|
78
|
+
return this.country && this.country.showMarketingCheckbox;
|
|
95
79
|
}
|
|
96
80
|
|
|
97
|
-
get
|
|
98
|
-
return
|
|
99
|
-
this.checkboxSetByCountry && this.checkboxSetByCountry.marketingText
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
get showLegalCheckbox(): boolean {
|
|
104
|
-
return this.country && this.country.showLegalCheckbox;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
get legalText(): string {
|
|
108
|
-
return this.checkboxSetByCountry && this.checkboxSetByCountry.legalText;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
get learnMore(): string | undefined {
|
|
112
|
-
return this.checkboxSetByCountry && this.checkboxSetByCountry.learnMore;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
get checkboxSetByCountry(): CheckboxSet {
|
|
116
|
-
return (
|
|
117
|
-
(this.country &&
|
|
118
|
-
this.country.checkboxTextSet &&
|
|
119
|
-
this.checkboxTextMap[this.country.checkboxTextSet]) ||
|
|
120
|
-
this.checkboxTextMap.default
|
|
121
|
-
);
|
|
81
|
+
get showPrivacyCheckbox(): boolean {
|
|
82
|
+
return this.country && !!this.country.privacyOptIn;
|
|
122
83
|
}
|
|
123
84
|
|
|
124
85
|
get buttonLabel(): string {
|
|
@@ -135,12 +96,11 @@ export default class DeSignupForm extends LightningElement {
|
|
|
135
96
|
this.updateInnerHtml(
|
|
136
97
|
"span.marketing-terms",
|
|
137
98
|
this.marketingText,
|
|
138
|
-
this.
|
|
99
|
+
this.showMarketingCheckbox
|
|
139
100
|
) ||
|
|
140
101
|
this.updateInnerHtml(
|
|
141
|
-
"span.
|
|
142
|
-
this.
|
|
143
|
-
!!this.learnMore
|
|
102
|
+
"span.privacy-terms",
|
|
103
|
+
this.country?.privacyText || this.privacyText
|
|
144
104
|
);
|
|
145
105
|
}
|
|
146
106
|
|
|
@@ -218,18 +178,19 @@ export default class DeSignupForm extends LightningElement {
|
|
|
218
178
|
userData[field.name] = field.value;
|
|
219
179
|
});
|
|
220
180
|
|
|
221
|
-
(userData as UserData).opt_in = this.country.
|
|
181
|
+
(userData as UserData).opt_in = this.country.showMarketingCheckbox
|
|
222
182
|
? checkboxes.values.opt_in
|
|
223
183
|
: "implied";
|
|
224
184
|
|
|
225
185
|
const InfoEmail__c =
|
|
226
|
-
this.country.
|
|
186
|
+
this.country.showMarketingCheckbox &&
|
|
187
|
+
checkboxes.values.opt_in === ""
|
|
227
188
|
? "False"
|
|
228
189
|
: "True";
|
|
229
190
|
|
|
230
191
|
const formData: SignupForm = {
|
|
231
192
|
user: userData as UserData,
|
|
232
|
-
eula:
|
|
193
|
+
eula: checkboxes.values.eula,
|
|
233
194
|
default_driver: DEFAULT_DRIVER,
|
|
234
195
|
InfoEmail__c
|
|
235
196
|
};
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<dx-section
|
|
2
|
+
<dx-section
|
|
3
|
+
title="Developer Podcast"
|
|
4
|
+
part="section"
|
|
5
|
+
cta-label={ctaLabel}
|
|
6
|
+
cta-href={ctaHref}
|
|
7
|
+
cta-btn-target={ctaBtnTarget}
|
|
8
|
+
cta-btn-variant="inline"
|
|
9
|
+
cta-btn-symbol="forward"
|
|
10
|
+
>
|
|
3
11
|
<slot name="section"></slot>
|
|
4
12
|
<dx-grid columns="one">
|
|
5
13
|
<dx-grid columns="two-slim-left">
|
|
@@ -26,6 +34,7 @@
|
|
|
26
34
|
</dx-grid>
|
|
27
35
|
</dx-grid>
|
|
28
36
|
<dx-hr
|
|
37
|
+
if:false={isHomepage}
|
|
29
38
|
part="hr"
|
|
30
39
|
variant="link"
|
|
31
40
|
href="/podcast"
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
import { LightningElement } from "lwc";
|
|
1
|
+
import { LightningElement, api } from "lwc";
|
|
2
2
|
|
|
3
|
-
export default class PodcastsPromo extends LightningElement {
|
|
3
|
+
export default class PodcastsPromo extends LightningElement {
|
|
4
|
+
@api variant: "default" | "homepage" = "default";
|
|
5
|
+
@api ctaLabel: string = "";
|
|
6
|
+
@api ctaHref: string = "";
|
|
7
|
+
@api ctaBtnTarget: string = "_self";
|
|
8
|
+
|
|
9
|
+
get isHomepage() {
|
|
10
|
+
return this.variant === "homepage";
|
|
11
|
+
}
|
|
12
|
+
}
|