@salesforcedevs/dw-components 1.3.73 → 1.3.76-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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/dw-components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.76-alpha.0",
|
|
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": "3d618c9e70aadfa1f05276110b0024868a402442"
|
|
28
28
|
}
|
|
@@ -76,13 +76,14 @@
|
|
|
76
76
|
validity-on-blur={checkUsernameValidity}
|
|
77
77
|
onchange={handleUsernameChange}
|
|
78
78
|
></dx-input>
|
|
79
|
+
|
|
79
80
|
<dx-checkbox required name="eula" value="accepted">
|
|
80
81
|
<span lwc:dom="manual" class="legal-terms"></span>
|
|
81
82
|
</dx-checkbox>
|
|
82
83
|
<dx-checkbox
|
|
83
84
|
if:true={showMarketingCheckbox}
|
|
84
85
|
name="opt_in"
|
|
85
|
-
value="
|
|
86
|
+
value="False"
|
|
86
87
|
>
|
|
87
88
|
<span lwc:dom="manual" class="marketing-terms"></span>
|
|
88
89
|
</dx-checkbox>
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { LightningElement, api, track } from "lwc";
|
|
2
2
|
import { toJson } from "dxUtils/normalizers";
|
|
3
3
|
import { track as trackGtm } from "dxUtils/analytics";
|
|
4
|
-
import {
|
|
5
|
-
submitForm,
|
|
6
|
-
ErrorCode,
|
|
7
|
-
SignupForm,
|
|
8
|
-
UserData,
|
|
9
|
-
OptIn
|
|
10
|
-
} from "./submitForm";
|
|
4
|
+
import { submitForm, ErrorCode, SignupForm, UserData } from "./submitForm";
|
|
11
5
|
|
|
12
6
|
type SelectOption = { value: string; label: string };
|
|
13
7
|
type Country = SelectOption & {
|
|
@@ -157,8 +151,6 @@ export default class DeSignupForm extends LightningElement {
|
|
|
157
151
|
value: element.value
|
|
158
152
|
}));
|
|
159
153
|
|
|
160
|
-
console.log(fields);
|
|
161
|
-
|
|
162
154
|
const checkboxes = this.getCheckboxesResult();
|
|
163
155
|
|
|
164
156
|
if (fields.some((field) => !field.valid) || !checkboxes.valid) {
|
|
@@ -170,15 +162,11 @@ export default class DeSignupForm extends LightningElement {
|
|
|
170
162
|
userData[field.name] = field.value;
|
|
171
163
|
});
|
|
172
164
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
const InfoEmail__c =
|
|
180
|
-
this.country.showMarketingCheckbox &&
|
|
181
|
-
checkboxes.values.opt_in === ""
|
|
165
|
+
(userData as UserData).consent = this.country.showMarketingCheckbox
|
|
166
|
+
? "Explicit"
|
|
167
|
+
: "Implied ";
|
|
168
|
+
const InfoEmail =
|
|
169
|
+
this.country.showMarketingCheckbox && !checkboxes.values.opt_in
|
|
182
170
|
? "False"
|
|
183
171
|
: "True";
|
|
184
172
|
|
|
@@ -186,7 +174,7 @@ export default class DeSignupForm extends LightningElement {
|
|
|
186
174
|
user: userData as UserData,
|
|
187
175
|
eula: checkboxes.values.eula,
|
|
188
176
|
default_driver: DEFAULT_DRIVER,
|
|
189
|
-
|
|
177
|
+
info_email: InfoEmail
|
|
190
178
|
};
|
|
191
179
|
|
|
192
180
|
return formData;
|
|
@@ -194,19 +182,19 @@ export default class DeSignupForm extends LightningElement {
|
|
|
194
182
|
|
|
195
183
|
private getCheckboxesResult(): {
|
|
196
184
|
valid: boolean;
|
|
197
|
-
values: { eula: string; opt_in:
|
|
185
|
+
values: { eula: string; opt_in: "true" | "false" };
|
|
198
186
|
} {
|
|
199
187
|
let valid = true;
|
|
200
|
-
const values: { eula: string; opt_in:
|
|
188
|
+
const values: { eula: string; opt_in: "true" | "false" } = {
|
|
201
189
|
eula: "",
|
|
202
|
-
opt_in: ""
|
|
190
|
+
opt_in: "false"
|
|
203
191
|
};
|
|
204
192
|
|
|
205
193
|
Array.from(
|
|
206
194
|
this.template.querySelectorAll<HTMLInputElement>("dx-checkbox")
|
|
207
195
|
).forEach((checkbox) => {
|
|
208
196
|
valid = valid && checkbox.reportValidity();
|
|
209
|
-
values[checkbox.name] =
|
|
197
|
+
values[checkbox.name] = checkbox.checked;
|
|
210
198
|
});
|
|
211
199
|
|
|
212
200
|
return { valid, values };
|
|
@@ -2,9 +2,10 @@ const CREATE_PATH = `/deorgs/trialforce`;
|
|
|
2
2
|
const BASE_STATUS_PATH = `/deorgs/check_org_status`;
|
|
3
3
|
const WAIT_TIME = 200;
|
|
4
4
|
|
|
5
|
-
export type OptIn = "" | "implied" | "explicit";
|
|
5
|
+
// export type OptIn = "" | "implied" | "explicit";
|
|
6
6
|
|
|
7
7
|
export type UserData = {
|
|
8
|
+
consent: string;
|
|
8
9
|
company: string;
|
|
9
10
|
country: string;
|
|
10
11
|
email: string;
|
|
@@ -12,7 +13,7 @@ export type UserData = {
|
|
|
12
13
|
job_role: string;
|
|
13
14
|
job_title: string;
|
|
14
15
|
last_name: string;
|
|
15
|
-
opt_in:
|
|
16
|
+
opt_in: boolean;
|
|
16
17
|
postal_code: string;
|
|
17
18
|
username: string;
|
|
18
19
|
};
|
|
@@ -21,7 +22,7 @@ export type SignupForm = {
|
|
|
21
22
|
user: UserData;
|
|
22
23
|
eula: string;
|
|
23
24
|
default_driver: string;
|
|
24
|
-
|
|
25
|
+
info_email: "True" | "False";
|
|
25
26
|
};
|
|
26
27
|
|
|
27
28
|
type OrgStatus = "New" | "In Progress" | "Error";
|
|
@@ -43,10 +44,8 @@ const fetchOrgStatus = async (id: string): Promise<OrgStatus> => {
|
|
|
43
44
|
throw new Error("Something went wrong");
|
|
44
45
|
}
|
|
45
46
|
|
|
46
|
-
const {
|
|
47
|
-
|
|
48
|
-
ErrorCode: errorCode
|
|
49
|
-
}: OrgStatusResponse = await response.json();
|
|
47
|
+
const { Status: status, ErrorCode: errorCode }: OrgStatusResponse =
|
|
48
|
+
await response.json();
|
|
50
49
|
|
|
51
50
|
if (status === "Error") {
|
|
52
51
|
throw new Error(
|