@salesforcedevs/dw-components 1.3.52 → 1.3.54
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 +1 -1
- package/src/modules/dw/blogsGrid/blogsGrid.html +1 -0
- package/src/modules/dw/blogsGrid/blogsGrid.ts +6 -7
- package/src/modules/dw/codeSamplesGrid/codeSamplesGrid.html +1 -0
- package/src/modules/dw/codeSamplesGrid/codeSamplesGrid.ts +28 -0
- package/src/modules/dw/deSignupForm/deSignupForm.ts +5 -15
- package/src/modules/dw/docsGrid/docsGrid.html +1 -0
- package/src/modules/dw/docsGrid/docsGrid.ts +28 -0
- package/src/modules/dw/newsletterForm/newsletterForm.ts +18 -13
- package/src/modules/dw/tbidLoginMenu/tbidLoginMenu.ts +11 -20
- package/src/modules/dwBaseElements/postsGrid/postsGrid.ts +12 -8
package/package.json
CHANGED
|
@@ -6,12 +6,11 @@ import { PostsGrid } from "dwBaseElements/postsGrid";
|
|
|
6
6
|
const BLOG_SUBSCRIBE_HREF = "https://developer.salesforce.com/blogs/feed";
|
|
7
7
|
|
|
8
8
|
const ANALYTICS_INFO = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
ctaClick: true
|
|
9
|
+
click_text: "Subscribe to RSS",
|
|
10
|
+
element_title: "dx-button",
|
|
11
|
+
click_url: BLOG_SUBSCRIBE_HREF,
|
|
12
|
+
element_type: "link",
|
|
13
|
+
content_category: "cta"
|
|
15
14
|
};
|
|
16
15
|
|
|
17
16
|
export default class BlogsGrid extends PostsGrid {
|
|
@@ -23,6 +22,6 @@ export default class BlogsGrid extends PostsGrid {
|
|
|
23
22
|
|
|
24
23
|
rssOnClick(event: Event): void {
|
|
25
24
|
track(event.target!, "custEv_ctaButtonClick", ANALYTICS_INFO);
|
|
26
|
-
|
|
25
|
+
track(event.target!, "custEv_linkClick", ANALYTICS_INFO);
|
|
27
26
|
}
|
|
28
27
|
}
|
|
@@ -5,6 +5,7 @@ import orderBy from "lodash.orderby";
|
|
|
5
5
|
import cloneDeep from "lodash.clonedeep";
|
|
6
6
|
import { DocsTile, DropdownItem, CodeSample } from "typings/custom";
|
|
7
7
|
import { toJson } from "dxUtils/normalizers";
|
|
8
|
+
import { track } from "dxUtils/analytics";
|
|
8
9
|
|
|
9
10
|
const PRODUCT_FILTER_ALL_PRODUCTS = "all products";
|
|
10
11
|
const LANGUAGE_FILTER_LABEL = "Type";
|
|
@@ -36,6 +37,7 @@ export default class CodeSamplesGrid extends LightningElement {
|
|
|
36
37
|
private isMobile = "(min-width: 401px) and (max-width: 1023px)";
|
|
37
38
|
private isMobileSmall = "(max-width: 400px)";
|
|
38
39
|
private showSourcesFilter = false;
|
|
40
|
+
private filteredItemsSelected: boolean = false;
|
|
39
41
|
private filtersDefaultValue = {
|
|
40
42
|
selectedSourceFilter: [],
|
|
41
43
|
selectedTypeFilter: [],
|
|
@@ -111,6 +113,18 @@ export default class CodeSamplesGrid extends LightningElement {
|
|
|
111
113
|
this.matchMobile.removeEventListener("change", this.handleView);
|
|
112
114
|
this.matchMobileSmall.removeEventListener("change", this.handleView);
|
|
113
115
|
window.removeEventListener("popstate", this.handleURLStateChange);
|
|
116
|
+
|
|
117
|
+
if (!this.filteredItemsSelected) {
|
|
118
|
+
this.selectedProductFilter?.forEach((filter) => {
|
|
119
|
+
track(document, "custEv_filterAbandoned", {
|
|
120
|
+
click_text: filter,
|
|
121
|
+
click_url: filter,
|
|
122
|
+
element_title: "CodeSamplesGrid",
|
|
123
|
+
element_type: "filter abandoned",
|
|
124
|
+
content_category: "filter"
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
}
|
|
114
128
|
}
|
|
115
129
|
|
|
116
130
|
@api
|
|
@@ -336,6 +350,7 @@ export default class CodeSamplesGrid extends LightningElement {
|
|
|
336
350
|
this.selectedProductFilter = newList;
|
|
337
351
|
}
|
|
338
352
|
this.calculatePagination();
|
|
353
|
+
this.filteredItemsSelected = false;
|
|
339
354
|
}
|
|
340
355
|
|
|
341
356
|
handleLanguageFilterChange(event: CustomEvent): void {
|
|
@@ -427,4 +442,17 @@ export default class CodeSamplesGrid extends LightningElement {
|
|
|
427
442
|
const newurl = `${window.location.pathname}?${searchParams}`;
|
|
428
443
|
window.history.pushState({ path: newurl }, "", newurl);
|
|
429
444
|
}
|
|
445
|
+
|
|
446
|
+
handleReadItClick() {
|
|
447
|
+
this.filteredItemsSelected = true;
|
|
448
|
+
this.selectedProductFilter?.forEach((filter) => {
|
|
449
|
+
track(document, "custEv_filterApplied", {
|
|
450
|
+
click_text: filter,
|
|
451
|
+
click_url: filter,
|
|
452
|
+
element_title: "dx-button",
|
|
453
|
+
element_type: "filter applied",
|
|
454
|
+
content_category: "filter"
|
|
455
|
+
});
|
|
456
|
+
});
|
|
457
|
+
}
|
|
430
458
|
}
|
|
@@ -31,18 +31,6 @@ const DUPLICATE_USERNAME_MESSAGE =
|
|
|
31
31
|
const ACCEPTED = "accepted";
|
|
32
32
|
const SIGN_UP_LABEL = "Sign me Up";
|
|
33
33
|
|
|
34
|
-
const ANALYTICS_INFO = {
|
|
35
|
-
clickText: "Sign me Up",
|
|
36
|
-
itemTitle: "Dev Edition Sign Up Button",
|
|
37
|
-
formType: "Dev Edition Sign Up",
|
|
38
|
-
formName: "DEVELOPER:xx:signup:Developer-Edition",
|
|
39
|
-
method: "email",
|
|
40
|
-
clickUrl: "/signup/success",
|
|
41
|
-
elementType: "button",
|
|
42
|
-
destinationType: "internal",
|
|
43
|
-
ctaClick: true,
|
|
44
|
-
offerType: "Free Trial"
|
|
45
|
-
};
|
|
46
34
|
export default class DeSignupForm extends LightningElement {
|
|
47
35
|
@api
|
|
48
36
|
get countries() {
|
|
@@ -163,10 +151,12 @@ export default class DeSignupForm extends LightningElement {
|
|
|
163
151
|
submitForm(formData)
|
|
164
152
|
.then(() => {
|
|
165
153
|
trackGtm(event.target!, "custEv_signUp", {
|
|
166
|
-
|
|
167
|
-
|
|
154
|
+
authenticationMethod: "dev edition sign up form",
|
|
155
|
+
authenticationType: "dev edition",
|
|
156
|
+
userId: this.username,
|
|
157
|
+
newRegistration: true
|
|
168
158
|
});
|
|
169
|
-
window.location.href =
|
|
159
|
+
window.location.href = "/signup/success";
|
|
170
160
|
})
|
|
171
161
|
.catch((error) => {
|
|
172
162
|
if (error.message === ErrorCode.DUPLICATE) {
|
|
@@ -5,6 +5,7 @@ import qs from "query-string";
|
|
|
5
5
|
import uniqBy from "lodash.uniqby";
|
|
6
6
|
import orderBy from "lodash.orderby";
|
|
7
7
|
import { isGivenLanguageSupported } from "dxUtils/language";
|
|
8
|
+
import { track } from "dxUtils/analytics";
|
|
8
9
|
|
|
9
10
|
const DSC_API_URL = {
|
|
10
11
|
"en-us": "/docs/get_index/en-us/000.0/false/All%20Services/all",
|
|
@@ -41,6 +42,7 @@ export default abstract class DocsGrid extends LightningElement {
|
|
|
41
42
|
private _searchTimeout?: number;
|
|
42
43
|
private _couchDbDocTileExclusions?: Set<any>;
|
|
43
44
|
private _allLanguages: Array<Language> = [];
|
|
45
|
+
private filteredItemsSelected: boolean = false;
|
|
44
46
|
|
|
45
47
|
connectedCallback(): void {
|
|
46
48
|
this.retrieveDscApis(true);
|
|
@@ -76,6 +78,18 @@ export default abstract class DocsGrid extends LightningElement {
|
|
|
76
78
|
"change",
|
|
77
79
|
this.handleMobileSmallView
|
|
78
80
|
);
|
|
81
|
+
|
|
82
|
+
if (!this.filteredItemsSelected) {
|
|
83
|
+
this.selectedProductFilters?.forEach((filter) => {
|
|
84
|
+
track(document, "custEv_filterAbandoned", {
|
|
85
|
+
click_text: filter,
|
|
86
|
+
click_url: filter,
|
|
87
|
+
element_title: "CodeSamplesGrid",
|
|
88
|
+
element_type: "filter abandoned",
|
|
89
|
+
content_category: "filter"
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
}
|
|
79
93
|
}
|
|
80
94
|
|
|
81
95
|
@api apiDomain = "https://developer.salesforce.com";
|
|
@@ -403,6 +417,7 @@ export default abstract class DocsGrid extends LightningElement {
|
|
|
403
417
|
this.selectedProductFilters = newList;
|
|
404
418
|
}
|
|
405
419
|
this.calculatePagination();
|
|
420
|
+
this.filteredItemsSelected = false;
|
|
406
421
|
}
|
|
407
422
|
|
|
408
423
|
handleLanguageFilterChange(event): void {
|
|
@@ -537,4 +552,17 @@ export default abstract class DocsGrid extends LightningElement {
|
|
|
537
552
|
this.calculatePagination(urlParams.page, true);
|
|
538
553
|
}
|
|
539
554
|
};
|
|
555
|
+
|
|
556
|
+
handleReadItClick() {
|
|
557
|
+
this.filteredItemsSelected = true;
|
|
558
|
+
this.selectedProductFilters?.forEach((filter) => {
|
|
559
|
+
track(document, "custEv_filterApplied", {
|
|
560
|
+
click_text: filter,
|
|
561
|
+
click_url: filter,
|
|
562
|
+
element_title: "dx-button",
|
|
563
|
+
element_type: "filter applied",
|
|
564
|
+
content_category: "filter"
|
|
565
|
+
});
|
|
566
|
+
});
|
|
567
|
+
}
|
|
540
568
|
}
|
|
@@ -2,17 +2,6 @@ import { LightningElement, api } from "lwc";
|
|
|
2
2
|
import { track } from "dxUtils/analytics";
|
|
3
3
|
import { CountryOptions, CheckboxTextSet } from "typings/custom";
|
|
4
4
|
|
|
5
|
-
const ANALYTICS_INFO = {
|
|
6
|
-
itemTitle: "newsletter sign up submit",
|
|
7
|
-
formName: "newsletter",
|
|
8
|
-
formType: "newsletter",
|
|
9
|
-
method: "email",
|
|
10
|
-
destinationType: "internal",
|
|
11
|
-
clickText: "Subscribe Now",
|
|
12
|
-
clickUrl: "/newsletter/success",
|
|
13
|
-
elementType: "button",
|
|
14
|
-
ctaClick: true
|
|
15
|
-
};
|
|
16
5
|
const LOCAL_STORAGE_KEY = "subscriberEmail";
|
|
17
6
|
|
|
18
7
|
export default class Form extends LightningElement {
|
|
@@ -159,8 +148,24 @@ export default class Form extends LightningElement {
|
|
|
159
148
|
}
|
|
160
149
|
|
|
161
150
|
// GTM event
|
|
162
|
-
track(submitButtonEl, "custEv_formCompletion",
|
|
163
|
-
|
|
151
|
+
track(submitButtonEl, "custEv_formCompletion", {
|
|
152
|
+
itemTitle: "newsletter sign up submit",
|
|
153
|
+
formName: "newsletter",
|
|
154
|
+
formType: "newsletter",
|
|
155
|
+
method: "email",
|
|
156
|
+
destinationType: "internal",
|
|
157
|
+
clickText: "Subscribe Now",
|
|
158
|
+
clickUrl: "/newsletter/success",
|
|
159
|
+
elementType: "button",
|
|
160
|
+
ctaClick: true
|
|
161
|
+
});
|
|
162
|
+
track(submitButtonEl, "custEv_linkClick", {
|
|
163
|
+
click_text: "Subscribe Now",
|
|
164
|
+
element_title: "button",
|
|
165
|
+
click_url: "/newsletter/success",
|
|
166
|
+
element_type: "button",
|
|
167
|
+
content_category: "cta"
|
|
168
|
+
});
|
|
164
169
|
window.location.assign("/newsletter/success");
|
|
165
170
|
} catch (error) {
|
|
166
171
|
if (submitButtonEl) {
|
|
@@ -109,40 +109,31 @@ export default class TbidLoginMenu extends LightningElement {
|
|
|
109
109
|
// Shared utility for tracking link clicks.
|
|
110
110
|
private trackMenuClick = (
|
|
111
111
|
target: HTMLAnchorElement | null,
|
|
112
|
-
eventName: string
|
|
113
|
-
navItemPrefix: string
|
|
112
|
+
eventName: string
|
|
114
113
|
) => {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
trackingPayload.clickText = target.textContent?.trim() || "";
|
|
123
|
-
trackingPayload.clickUrl = target.href;
|
|
124
|
-
const [firstWord, ...remainingText] =
|
|
125
|
-
trackingPayload.clickText.split(" ");
|
|
126
|
-
trackingPayload.nav_item = `${navItemPrefix}${firstWord.toLowerCase()}${remainingText.join()}`;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
track(target || document, eventName, trackingPayload);
|
|
114
|
+
track(target || document, eventName, {
|
|
115
|
+
click_text: target.textContent?.trim() || "",
|
|
116
|
+
click_url: target.href || "",
|
|
117
|
+
element_title: "a",
|
|
118
|
+
element_type: "link",
|
|
119
|
+
content_category: "tbid"
|
|
120
|
+
});
|
|
130
121
|
};
|
|
131
122
|
|
|
132
123
|
// Track link clicks on the "logged out" version of the dropdown.
|
|
133
124
|
private trackLoginMenuClick = (event: Event) => {
|
|
134
125
|
const target = event.currentTarget as HTMLAnchorElement | null;
|
|
135
|
-
this.trackMenuClick(target, "custEv_loginClick"
|
|
126
|
+
this.trackMenuClick(target, "custEv_loginClick");
|
|
136
127
|
};
|
|
137
128
|
|
|
138
129
|
// Track link clicks on the "logged in" version of the dropdown.
|
|
139
130
|
private trackLoggedInMenuClick = (event: Event) => {
|
|
140
131
|
const target = event.currentTarget as HTMLAnchorElement | null;
|
|
141
|
-
this.trackMenuClick(target, "custEv_loginMenuClick"
|
|
132
|
+
this.trackMenuClick(target, "custEv_loginMenuClick");
|
|
142
133
|
};
|
|
143
134
|
|
|
144
135
|
// Special tracking for clicking on "Logout" specifically
|
|
145
136
|
private trackLogoutClick = (target: HTMLAnchorElement | null) => {
|
|
146
|
-
this.trackMenuClick(target, "custEv_userLogout"
|
|
137
|
+
this.trackMenuClick(target, "custEv_userLogout");
|
|
147
138
|
};
|
|
148
139
|
}
|
|
@@ -4,9 +4,9 @@ import { track } from "dxUtils/analytics";
|
|
|
4
4
|
import { WordpressPost, NormalizedPost } from "typings/custom";
|
|
5
5
|
|
|
6
6
|
const ANALYTICS_INFO = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
element_type: "link",
|
|
8
|
+
destination_type: "internal",
|
|
9
|
+
cta_click: true
|
|
10
10
|
};
|
|
11
11
|
export abstract class PostsGrid extends LightningElement {
|
|
12
12
|
@api columns = "three";
|
|
@@ -47,15 +47,19 @@ export abstract class PostsGrid extends LightningElement {
|
|
|
47
47
|
this._morePostsViewed = true;
|
|
48
48
|
track(e.target, "custEv_ctaLinkClick", {
|
|
49
49
|
...ANALYTICS_INFO,
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
click_text: "show more",
|
|
51
|
+
element_title: "dx-button",
|
|
52
|
+
element_type: "button",
|
|
53
|
+
content_category: "cta"
|
|
52
54
|
});
|
|
53
55
|
} else {
|
|
54
56
|
track(e.target, "custEv_ctaLinkClick", {
|
|
55
57
|
...ANALYTICS_INFO,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
click_text: "view archives",
|
|
59
|
+
click_url: "https://developer.salesforce.com/content-archive",
|
|
60
|
+
element_title: "dx-button",
|
|
61
|
+
element_type: "button",
|
|
62
|
+
content_category: "cta"
|
|
59
63
|
});
|
|
60
64
|
}
|
|
61
65
|
}
|