@salesforcedevs/dw-components 1.3.85 → 1.3.87
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/codeSamplesGrid/codeSamplesGrid.ts +6 -4
- package/src/modules/dw/deSignupForm/deSignupForm.html +2 -1
- package/src/modules/dw/deSignupForm/deSignupForm.ts +21 -23
- package/src/modules/dw/deSignupForm/submitForm.ts +6 -7
- package/src/modules/dw/docsGrid/docsGrid.ts +5 -5
- package/src/modules/dw/newsletterForm/newsletterForm.ts +10 -9
- package/src/modules/dw/tbidLoginMenu/tbidLoginMenu.ts +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/dw-components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.87",
|
|
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": "ba1b6c0b4fd5401487e817635bf3843089ed5558"
|
|
28
28
|
}
|
|
@@ -76,9 +76,12 @@ export default class CodeSamplesGrid extends LightningElement {
|
|
|
76
76
|
evaluateQueryParams(resetFilters: boolean): void {
|
|
77
77
|
let page = "1";
|
|
78
78
|
if (resetFilters) {
|
|
79
|
-
this.selectedSourceFilter =
|
|
80
|
-
|
|
81
|
-
this.
|
|
79
|
+
this.selectedSourceFilter =
|
|
80
|
+
this.filtersDefaultValue.selectedSourceFilter;
|
|
81
|
+
this.selectedTypeFilter =
|
|
82
|
+
this.filtersDefaultValue.selectedTypeFilter;
|
|
83
|
+
this.selectedProductFilter =
|
|
84
|
+
this.filtersDefaultValue.selectedProductFilter;
|
|
82
85
|
}
|
|
83
86
|
const urlParams = new URLSearchParams(window.location.search);
|
|
84
87
|
if (urlParams.toString()) {
|
|
@@ -446,7 +449,6 @@ export default class CodeSamplesGrid extends LightningElement {
|
|
|
446
449
|
track(document, "custEv_filterApplied", {
|
|
447
450
|
click_text: filter,
|
|
448
451
|
click_url: filter,
|
|
449
|
-
element_title: "dx-button",
|
|
450
452
|
element_type: "filter applied",
|
|
451
453
|
content_category: "filter"
|
|
452
454
|
});
|
|
@@ -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 & {
|
|
@@ -111,11 +105,19 @@ export default class DeSignupForm extends LightningElement {
|
|
|
111
105
|
submitForm(formData)
|
|
112
106
|
.then(() => {
|
|
113
107
|
trackGtm(event.target!, "custEv_signUp", {
|
|
114
|
-
authentication_method: "
|
|
108
|
+
authentication_method: "email",
|
|
115
109
|
authentication_type: "dev edition",
|
|
116
|
-
user_id: this.username,
|
|
117
110
|
new_registration: true
|
|
118
111
|
});
|
|
112
|
+
trackGtm(event.target!, "custEv_formCompletion", {
|
|
113
|
+
converting_page: "SFDC:us:signup:success",
|
|
114
|
+
converting_page_url:
|
|
115
|
+
"https://developer.salesforce.com/signup/success",
|
|
116
|
+
form_country: formData.user.country,
|
|
117
|
+
form_name: "Dev Edition Signup",
|
|
118
|
+
form_primary_product_interest: "Developer Edition",
|
|
119
|
+
offer_type: "free trial"
|
|
120
|
+
});
|
|
119
121
|
window.location.href = "/signup/success";
|
|
120
122
|
})
|
|
121
123
|
.catch((error) => {
|
|
@@ -157,8 +159,6 @@ export default class DeSignupForm extends LightningElement {
|
|
|
157
159
|
value: element.value
|
|
158
160
|
}));
|
|
159
161
|
|
|
160
|
-
console.log(fields);
|
|
161
|
-
|
|
162
162
|
const checkboxes = this.getCheckboxesResult();
|
|
163
163
|
|
|
164
164
|
if (fields.some((field) => !field.valid) || !checkboxes.valid) {
|
|
@@ -170,13 +170,11 @@ export default class DeSignupForm extends LightningElement {
|
|
|
170
170
|
userData[field.name] = field.value;
|
|
171
171
|
});
|
|
172
172
|
|
|
173
|
-
(userData as UserData).
|
|
174
|
-
?
|
|
175
|
-
: "
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
this.country.showMarketingCheckbox &&
|
|
179
|
-
checkboxes.values.opt_in === ""
|
|
173
|
+
(userData as UserData).consent = this.country.showMarketingCheckbox
|
|
174
|
+
? "Explicit"
|
|
175
|
+
: "Implied ";
|
|
176
|
+
const InfoEmail =
|
|
177
|
+
this.country.showMarketingCheckbox && !checkboxes.values.opt_in
|
|
180
178
|
? "False"
|
|
181
179
|
: "True";
|
|
182
180
|
|
|
@@ -184,7 +182,7 @@ export default class DeSignupForm extends LightningElement {
|
|
|
184
182
|
user: userData as UserData,
|
|
185
183
|
eula: checkboxes.values.eula,
|
|
186
184
|
default_driver: DEFAULT_DRIVER,
|
|
187
|
-
|
|
185
|
+
info_email: InfoEmail
|
|
188
186
|
};
|
|
189
187
|
|
|
190
188
|
return formData;
|
|
@@ -192,19 +190,19 @@ export default class DeSignupForm extends LightningElement {
|
|
|
192
190
|
|
|
193
191
|
private getCheckboxesResult(): {
|
|
194
192
|
valid: boolean;
|
|
195
|
-
values: { eula: string; opt_in:
|
|
193
|
+
values: { eula: string; opt_in: "true" | "false" };
|
|
196
194
|
} {
|
|
197
195
|
let valid = true;
|
|
198
|
-
const values: { eula: string; opt_in:
|
|
196
|
+
const values: { eula: string; opt_in: "true" | "false" } = {
|
|
199
197
|
eula: "",
|
|
200
|
-
opt_in: ""
|
|
198
|
+
opt_in: "false"
|
|
201
199
|
};
|
|
202
200
|
|
|
203
201
|
Array.from(
|
|
204
202
|
this.template.querySelectorAll<HTMLInputElement>("dx-checkbox")
|
|
205
203
|
).forEach((checkbox) => {
|
|
206
204
|
valid = valid && checkbox.reportValidity();
|
|
207
|
-
values[checkbox.name] =
|
|
205
|
+
values[checkbox.name] = checkbox.checked;
|
|
208
206
|
});
|
|
209
207
|
|
|
210
208
|
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(
|
|
@@ -69,7 +69,7 @@ export default abstract class DocsGrid extends LightningElement {
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
window.addEventListener("popstate", this.handleURLStateChange);
|
|
72
|
-
window.addEventListener("beforeunload",
|
|
72
|
+
window.addEventListener("beforeunload", this.sendGtmOnFilterAbandon);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
disconnectedCallback(): void {
|
|
@@ -297,9 +297,10 @@ export default abstract class DocsGrid extends LightningElement {
|
|
|
297
297
|
this.productFiltersList = json.available_services;
|
|
298
298
|
|
|
299
299
|
if (!this.selectedProductFilters.length) {
|
|
300
|
-
this.selectedProductFilters =
|
|
301
|
-
(
|
|
302
|
-
|
|
300
|
+
this.selectedProductFilters =
|
|
301
|
+
this.productFiltersList.map(
|
|
302
|
+
(filter) => filter.value
|
|
303
|
+
);
|
|
303
304
|
}
|
|
304
305
|
}
|
|
305
306
|
|
|
@@ -562,7 +563,6 @@ export default abstract class DocsGrid extends LightningElement {
|
|
|
562
563
|
track(document, "custEv_filterApplied", {
|
|
563
564
|
click_text: filter,
|
|
564
565
|
click_url: e?.currentTarget?.href,
|
|
565
|
-
element_title: filter,
|
|
566
566
|
element_type: "filter applied",
|
|
567
567
|
content_category: "filter"
|
|
568
568
|
});
|
|
@@ -149,15 +149,13 @@ export default class Form extends LightningElement {
|
|
|
149
149
|
|
|
150
150
|
// GTM event
|
|
151
151
|
track(submitButtonEl, "custEv_formCompletion", {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
elementType: "button",
|
|
160
|
-
ctaClick: true
|
|
152
|
+
converting_page: "SFDC:us:newsletter:success",
|
|
153
|
+
converting_page_url:
|
|
154
|
+
"https://developer.salesforce.com/newsletter/success",
|
|
155
|
+
form_country: formData?.Country,
|
|
156
|
+
form_name: "Newsletter Signup",
|
|
157
|
+
form_primary_product_interest: "Newsletter",
|
|
158
|
+
offer_type: "Newsletter"
|
|
161
159
|
});
|
|
162
160
|
track(submitButtonEl, "custEv_linkClick", {
|
|
163
161
|
click_text: "Subscribe Now",
|
|
@@ -166,6 +164,9 @@ export default class Form extends LightningElement {
|
|
|
166
164
|
element_type: "button",
|
|
167
165
|
content_category: "cta"
|
|
168
166
|
});
|
|
167
|
+
track(submitButtonEl, "custEv_subscribe", {
|
|
168
|
+
subscription_type: "newsletter"
|
|
169
|
+
});
|
|
169
170
|
window.location.assign("/newsletter/success");
|
|
170
171
|
} catch (error) {
|
|
171
172
|
if (submitButtonEl) {
|
|
@@ -118,7 +118,9 @@ export default class TbidLoginMenu extends LightningElement {
|
|
|
118
118
|
track(target || document, eventName, {
|
|
119
119
|
click_text: target?.textContent?.trim() || "",
|
|
120
120
|
click_url: target?.href || "",
|
|
121
|
-
element_title: target
|
|
121
|
+
element_title: target
|
|
122
|
+
?.closest(".login-container")
|
|
123
|
+
?.querySelector(".heading")?.textContent,
|
|
122
124
|
element_type: "link",
|
|
123
125
|
content_category: "tbid"
|
|
124
126
|
});
|