@salesforcedevs/dw-components 1.3.57 → 1.3.58
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": "1.3.
|
|
3
|
+
"version": "1.3.58",
|
|
4
4
|
"description": "Lightning web components for https://developer.salesforce.com",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
"@types/setimmediate": "^1.0.2",
|
|
25
25
|
"setimmediate": "^1.0.5"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "e81141ae776ba2517b1a307f4adbffea106d701a"
|
|
28
28
|
}
|
|
@@ -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
|
}
|
|
@@ -36,6 +36,14 @@
|
|
|
36
36
|
required
|
|
37
37
|
value=""
|
|
38
38
|
></dx-select>
|
|
39
|
+
<dx-input
|
|
40
|
+
label="Title"
|
|
41
|
+
missing-error-message="Enter your job title"
|
|
42
|
+
name="email"
|
|
43
|
+
placeholder="Your job title"
|
|
44
|
+
required
|
|
45
|
+
validity-on-blur
|
|
46
|
+
></dx-input>
|
|
39
47
|
<dx-input
|
|
40
48
|
label="Company"
|
|
41
49
|
missing-error-message="Enter your company name"
|
|
@@ -70,39 +78,32 @@
|
|
|
70
78
|
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
79
|
label="Username"
|
|
72
80
|
name="username"
|
|
73
|
-
placeholder="
|
|
81
|
+
placeholder="miles.vandewetering@salesforce.com"
|
|
74
82
|
required
|
|
75
83
|
type="email"
|
|
76
84
|
validity-on-blur={checkUsernameValidity}
|
|
77
85
|
onchange={handleUsernameChange}
|
|
78
86
|
></dx-input>
|
|
87
|
+
<dx-checkbox required name="eula" value="accepted">
|
|
88
|
+
<span lwc:dom="manual" class="legal-terms"></span>
|
|
89
|
+
</dx-checkbox>
|
|
79
90
|
<dx-checkbox
|
|
80
|
-
if:true={
|
|
91
|
+
if:true={showMarketingCheckbox}
|
|
81
92
|
name="opt_in"
|
|
82
93
|
value="explicit"
|
|
83
94
|
>
|
|
84
95
|
<span lwc:dom="manual" class="marketing-terms"></span>
|
|
85
96
|
</dx-checkbox>
|
|
86
97
|
<dx-checkbox
|
|
87
|
-
if:true={
|
|
98
|
+
if:true={showPrivacyCheckbox}
|
|
88
99
|
required
|
|
89
|
-
name="
|
|
90
|
-
value="
|
|
100
|
+
name="privacy"
|
|
101
|
+
value="privacy_accepted"
|
|
91
102
|
>
|
|
92
|
-
<span lwc:dom="manual" class="
|
|
93
|
-
<span
|
|
94
|
-
if:true={learnMore}
|
|
95
|
-
lwc:dom="manual"
|
|
96
|
-
class="learn-more"
|
|
97
|
-
></span>
|
|
103
|
+
<span lwc:dom="manual" class="privacy-terms"></span>
|
|
98
104
|
</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>
|
|
105
|
+
<template if:false={showPrivacyCheckbox}>
|
|
106
|
+
<span lwc:dom="manual" class="privacy-terms privacy-notice"></span>
|
|
106
107
|
</template>
|
|
107
108
|
<dx-button
|
|
108
109
|
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
|
export default class DeSignupForm extends LightningElement {
|
|
@@ -50,20 +40,14 @@ export default class DeSignupForm extends LightningElement {
|
|
|
50
40
|
this._roles = toJson(value);
|
|
51
41
|
}
|
|
52
42
|
|
|
53
|
-
@api
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
set checkboxTextMap(value) {
|
|
59
|
-
this._checkboxTextMap = toJson(value);
|
|
60
|
-
}
|
|
43
|
+
@api marketingText: string = "";
|
|
44
|
+
@api privacyText: string = "";
|
|
45
|
+
@api legalText: string = "";
|
|
61
46
|
|
|
62
47
|
private country: Country = null;
|
|
63
48
|
private disableSubmit = false;
|
|
64
49
|
private username = "";
|
|
65
50
|
private updateCheckboxLabels = true;
|
|
66
|
-
private _checkboxTextMap: CheckboxTextMap = null;
|
|
67
51
|
private _countries: Array<Country>;
|
|
68
52
|
private _roles: Array<SelectOption>;
|
|
69
53
|
@track knownDuplicateUsers = [];
|
|
@@ -78,35 +62,12 @@ export default class DeSignupForm extends LightningElement {
|
|
|
78
62
|
return !this.knownDuplicateUsers.includes(this.username);
|
|
79
63
|
}
|
|
80
64
|
|
|
81
|
-
get
|
|
82
|
-
return this.country && this.country.
|
|
65
|
+
get showMarketingCheckbox(): boolean {
|
|
66
|
+
return this.country && this.country.showMarketingCheckbox;
|
|
83
67
|
}
|
|
84
68
|
|
|
85
|
-
get
|
|
86
|
-
return
|
|
87
|
-
this.checkboxSetByCountry && this.checkboxSetByCountry.marketingText
|
|
88
|
-
);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
get showLegalCheckbox(): boolean {
|
|
92
|
-
return this.country && this.country.showLegalCheckbox;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
get legalText(): string {
|
|
96
|
-
return this.checkboxSetByCountry && this.checkboxSetByCountry.legalText;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
get learnMore(): string | undefined {
|
|
100
|
-
return this.checkboxSetByCountry && this.checkboxSetByCountry.learnMore;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
get checkboxSetByCountry(): CheckboxSet {
|
|
104
|
-
return (
|
|
105
|
-
(this.country &&
|
|
106
|
-
this.country.checkboxTextSet &&
|
|
107
|
-
this.checkboxTextMap[this.country.checkboxTextSet]) ||
|
|
108
|
-
this.checkboxTextMap.default
|
|
109
|
-
);
|
|
69
|
+
get showPrivacyCheckbox(): boolean {
|
|
70
|
+
return this.country && !!this.country.privacyOptIn;
|
|
110
71
|
}
|
|
111
72
|
|
|
112
73
|
get buttonLabel(): string {
|
|
@@ -123,12 +84,11 @@ export default class DeSignupForm extends LightningElement {
|
|
|
123
84
|
this.updateInnerHtml(
|
|
124
85
|
"span.marketing-terms",
|
|
125
86
|
this.marketingText,
|
|
126
|
-
this.
|
|
87
|
+
this.showMarketingCheckbox
|
|
127
88
|
) ||
|
|
128
89
|
this.updateInnerHtml(
|
|
129
|
-
"span.
|
|
130
|
-
this.
|
|
131
|
-
!!this.learnMore
|
|
90
|
+
"span.privacy-terms",
|
|
91
|
+
this.country?.privacyText || this.privacyText
|
|
132
92
|
);
|
|
133
93
|
}
|
|
134
94
|
|
|
@@ -208,18 +168,19 @@ export default class DeSignupForm extends LightningElement {
|
|
|
208
168
|
userData[field.name] = field.value;
|
|
209
169
|
});
|
|
210
170
|
|
|
211
|
-
(userData as UserData).opt_in = this.country.
|
|
171
|
+
(userData as UserData).opt_in = this.country.showMarketingCheckbox
|
|
212
172
|
? checkboxes.values.opt_in
|
|
213
173
|
: "implied";
|
|
214
174
|
|
|
215
175
|
const InfoEmail__c =
|
|
216
|
-
this.country.
|
|
176
|
+
this.country.showMarketingCheckbox &&
|
|
177
|
+
checkboxes.values.opt_in === ""
|
|
217
178
|
? "False"
|
|
218
179
|
: "True";
|
|
219
180
|
|
|
220
181
|
const formData: SignupForm = {
|
|
221
182
|
user: userData as UserData,
|
|
222
|
-
eula:
|
|
183
|
+
eula: checkboxes.values.eula,
|
|
223
184
|
default_driver: DEFAULT_DRIVER,
|
|
224
185
|
InfoEmail__c
|
|
225
186
|
};
|