@salesforcedevs/dw-components 1.3.72-canary.2 → 1.3.75-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/LICENSE
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Copyright (c) 2020, Salesforce.com, Inc.
|
|
2
|
+
All rights reserved.
|
|
3
|
+
|
|
4
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
5
|
+
|
|
6
|
+
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
7
|
+
|
|
8
|
+
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
9
|
+
|
|
10
|
+
* Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
11
|
+
|
|
12
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/dw-components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.75-alpha.0",
|
|
4
4
|
"description": "Lightning web components for https://developer.salesforce.com",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -23,5 +23,6 @@
|
|
|
23
23
|
"@types/lodash.uniqby": "^4.7.7",
|
|
24
24
|
"@types/setimmediate": "^1.0.2",
|
|
25
25
|
"setimmediate": "^1.0.5"
|
|
26
|
-
}
|
|
26
|
+
},
|
|
27
|
+
"gitHead": "19140a33b630ef36adfc3f30ab3cd590d81ea34c"
|
|
27
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 & {
|
|
@@ -172,13 +166,11 @@ export default class DeSignupForm extends LightningElement {
|
|
|
172
166
|
|
|
173
167
|
console.log(userData);
|
|
174
168
|
|
|
175
|
-
(userData as UserData).
|
|
176
|
-
?
|
|
177
|
-
: "
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
this.country.showMarketingCheckbox &&
|
|
181
|
-
checkboxes.values.opt_in === ""
|
|
169
|
+
(userData as UserData).consent = this.country.showMarketingCheckbox
|
|
170
|
+
? "Explicit"
|
|
171
|
+
: "Implied ";
|
|
172
|
+
const InfoEmail =
|
|
173
|
+
this.country.showMarketingCheckbox && !checkboxes.values.opt_in
|
|
182
174
|
? "False"
|
|
183
175
|
: "True";
|
|
184
176
|
|
|
@@ -186,7 +178,7 @@ export default class DeSignupForm extends LightningElement {
|
|
|
186
178
|
user: userData as UserData,
|
|
187
179
|
eula: checkboxes.values.eula,
|
|
188
180
|
default_driver: DEFAULT_DRIVER,
|
|
189
|
-
|
|
181
|
+
InfoEmail: InfoEmail
|
|
190
182
|
};
|
|
191
183
|
|
|
192
184
|
return formData;
|
|
@@ -194,19 +186,19 @@ export default class DeSignupForm extends LightningElement {
|
|
|
194
186
|
|
|
195
187
|
private getCheckboxesResult(): {
|
|
196
188
|
valid: boolean;
|
|
197
|
-
values: { eula: string; opt_in:
|
|
189
|
+
values: { eula: string; opt_in: "true" | "false" };
|
|
198
190
|
} {
|
|
199
191
|
let valid = true;
|
|
200
|
-
const values: { eula: string; opt_in:
|
|
192
|
+
const values: { eula: string; opt_in: "true" | "false" } = {
|
|
201
193
|
eula: "",
|
|
202
|
-
opt_in: ""
|
|
194
|
+
opt_in: "false"
|
|
203
195
|
};
|
|
204
196
|
|
|
205
197
|
Array.from(
|
|
206
198
|
this.template.querySelectorAll<HTMLInputElement>("dx-checkbox")
|
|
207
199
|
).forEach((checkbox) => {
|
|
208
200
|
valid = valid && checkbox.reportValidity();
|
|
209
|
-
values[checkbox.name] =
|
|
201
|
+
values[checkbox.name] = checkbox.checked;
|
|
210
202
|
});
|
|
211
203
|
|
|
212
204
|
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
|
+
InfoEmail: "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(
|