@salesforcedevs/dw-components 0.55.3-dw-locales2 → 0.57.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 +12 -0
- package/package.json +3 -2
- package/src/modules/dw/contentArchive/contentArchive.html +1 -0
- package/src/modules/dw/contentArchive/contentArchive.ts +38 -23
- package/src/modules/dw/contentArchive/contentArchive.types.ts +81 -0
- package/src/modules/dw/contentArchive/utils.ts +1 -1
- package/src/modules/dw/deSignupForm/deSignupForm.ts +4 -3
- package/src/modules/dw/docsGrid/docsGrid.ts +1 -2
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": "0.
|
|
3
|
+
"version": "0.57.0",
|
|
4
4
|
"description": "Lightning web components for https://developer.salesforce.com",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -22,5 +22,6 @@
|
|
|
22
22
|
"@types/lodash.clonedeep": "^4.5.7",
|
|
23
23
|
"@types/lodash.orderby": "^4.6.7",
|
|
24
24
|
"@types/lodash.uniqby": "^4.7.7"
|
|
25
|
-
}
|
|
25
|
+
},
|
|
26
|
+
"gitHead": "ec519d645639c13fab52eb62663930901f66b2fe"
|
|
26
27
|
}
|
|
@@ -3,11 +3,11 @@ import cx from "classnames";
|
|
|
3
3
|
import { getArchivePosts, getArchiveFilterList } from "./utils";
|
|
4
4
|
import { sortSplittedPostsByMonth } from "dxUtils/dates";
|
|
5
5
|
import { Filters } from "./contentArchive.types";
|
|
6
|
-
import {
|
|
6
|
+
import { getUrlParamValue, setUrlParamValue } from "dxUtils/queryCoordinator";
|
|
7
7
|
|
|
8
8
|
const MOBILE_MATCH = "767px";
|
|
9
9
|
|
|
10
|
-
const QUERY_SITE_FILTER = "
|
|
10
|
+
const QUERY_SITE_FILTER = "content-type";
|
|
11
11
|
const PODCASTS = { id: 2, name: "Podcasts" };
|
|
12
12
|
const BLOGS = { id: 1, name: "Blogs" };
|
|
13
13
|
export default class ContentArchive extends LightningElement {
|
|
@@ -168,7 +168,8 @@ export default class ContentArchive extends LightningElement {
|
|
|
168
168
|
if (selectedFilters?.length === 0) {
|
|
169
169
|
selectedFilters = null;
|
|
170
170
|
}
|
|
171
|
-
|
|
171
|
+
|
|
172
|
+
setUrlParamValue(QUERY_SITE_FILTER, selectedFilters);
|
|
172
173
|
|
|
173
174
|
this.updateSelectedFilters(value, name, checked);
|
|
174
175
|
}
|
|
@@ -306,7 +307,8 @@ export default class ContentArchive extends LightningElement {
|
|
|
306
307
|
|
|
307
308
|
this.updateCheckedStatus();
|
|
308
309
|
this.fetchPostsByCardType();
|
|
309
|
-
|
|
310
|
+
|
|
311
|
+
setUrlParamValue(QUERY_SITE_FILTER, null);
|
|
310
312
|
}
|
|
311
313
|
|
|
312
314
|
private goToPage(e: CustomEvent) {
|
|
@@ -425,19 +427,17 @@ export default class ContentArchive extends LightningElement {
|
|
|
425
427
|
this.onMobileChange(this.mobileMatchMedia);
|
|
426
428
|
this.mobileMatchMedia.addEventListener("change", this.onMobileChange);
|
|
427
429
|
|
|
428
|
-
const presetFilters: string
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
)
|
|
439
|
-
) {
|
|
440
|
-
this.presetSiteFilter(PODCASTS);
|
|
430
|
+
const presetFilters: Array<string> =
|
|
431
|
+
getUrlParamValue(QUERY_SITE_FILTER);
|
|
432
|
+
|
|
433
|
+
if (presetFilters.length === 1) {
|
|
434
|
+
if (presetFilters[0] === BLOGS.name) {
|
|
435
|
+
this.presetSiteFilter(BLOGS);
|
|
436
|
+
} else {
|
|
437
|
+
this.presetSiteFilter(PODCASTS);
|
|
438
|
+
}
|
|
439
|
+
} else if (presetFilters.length === 2) {
|
|
440
|
+
this.presetSiteFilter();
|
|
441
441
|
}
|
|
442
442
|
|
|
443
443
|
if (this.posts.length === 0) {
|
|
@@ -446,12 +446,27 @@ export default class ContentArchive extends LightningElement {
|
|
|
446
446
|
}
|
|
447
447
|
}
|
|
448
448
|
|
|
449
|
-
presetSiteFilter(
|
|
450
|
-
|
|
451
|
-
|
|
449
|
+
presetSiteFilter(
|
|
450
|
+
filter: { id: number; name: string } | undefined = undefined
|
|
451
|
+
) {
|
|
452
|
+
// check both content types when no filter is provided
|
|
453
|
+
if (!filter) {
|
|
454
|
+
this.selectedFilterMenuData = {
|
|
455
|
+
...this.selectedFilterMenuData,
|
|
456
|
+
site: [BLOGS, PODCASTS]
|
|
457
|
+
};
|
|
458
|
+
this._contentTypeList.forEach((option) => {
|
|
452
459
|
option.checked = true;
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
|
|
460
|
+
});
|
|
461
|
+
this.updateCheckedStatus();
|
|
462
|
+
} else {
|
|
463
|
+
// set either blogs OR podcasts
|
|
464
|
+
this._contentTypeList.forEach((option) => {
|
|
465
|
+
if (option.name === filter.name) {
|
|
466
|
+
option.checked = true;
|
|
467
|
+
}
|
|
468
|
+
});
|
|
469
|
+
this.updateSelectedFilters(filter, "site", true);
|
|
470
|
+
}
|
|
456
471
|
}
|
|
457
472
|
}
|
|
@@ -4,3 +4,84 @@ export interface Filters {
|
|
|
4
4
|
authors: any[];
|
|
5
5
|
categories: any[];
|
|
6
6
|
}
|
|
7
|
+
|
|
8
|
+
export type ArchivePostAuthor = {
|
|
9
|
+
id: number;
|
|
10
|
+
link: string;
|
|
11
|
+
name: string;
|
|
12
|
+
slug: string;
|
|
13
|
+
url: string;
|
|
14
|
+
avatar_urls: {
|
|
15
|
+
[key: string]: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export type ArchivePost = {
|
|
20
|
+
id: number;
|
|
21
|
+
date: string;
|
|
22
|
+
title: {
|
|
23
|
+
rendered: string;
|
|
24
|
+
};
|
|
25
|
+
type: string;
|
|
26
|
+
link: string;
|
|
27
|
+
excerpt: string;
|
|
28
|
+
sitename: string;
|
|
29
|
+
podcast_audio: {
|
|
30
|
+
audio_url: string;
|
|
31
|
+
duration: string;
|
|
32
|
+
};
|
|
33
|
+
_embedded: {
|
|
34
|
+
author: Array<ArchivePostAuthor>;
|
|
35
|
+
["wp:term"]: Array<
|
|
36
|
+
Array<{
|
|
37
|
+
id: number;
|
|
38
|
+
link: string;
|
|
39
|
+
name: string;
|
|
40
|
+
slug: string;
|
|
41
|
+
taxonomy: string;
|
|
42
|
+
_links: any;
|
|
43
|
+
}>
|
|
44
|
+
>;
|
|
45
|
+
};
|
|
46
|
+
_links: [
|
|
47
|
+
{
|
|
48
|
+
embeddable: boolean;
|
|
49
|
+
href: string;
|
|
50
|
+
}
|
|
51
|
+
];
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export type ArchivePostNormalized = {
|
|
55
|
+
posts: Array<{
|
|
56
|
+
id: number;
|
|
57
|
+
title: string;
|
|
58
|
+
date: string;
|
|
59
|
+
contentType: string;
|
|
60
|
+
href: string;
|
|
61
|
+
excerpt?: string;
|
|
62
|
+
author?: ArchivePostAuthor;
|
|
63
|
+
authorImgSrc?: string;
|
|
64
|
+
topics?: Array<string>;
|
|
65
|
+
}>;
|
|
66
|
+
totalPages: number;
|
|
67
|
+
totalResults: number;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export type ArchiveContent = {
|
|
71
|
+
posts: Array<ArchivePost>;
|
|
72
|
+
totalResults: number;
|
|
73
|
+
totalPages: number;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export type FilterMenuItem = {
|
|
77
|
+
id: string;
|
|
78
|
+
name: string;
|
|
79
|
+
shortName?: string;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export type FilterMenuData = {
|
|
83
|
+
site: Array<FilterMenuItem>;
|
|
84
|
+
dates: Array<FilterMenuItem>;
|
|
85
|
+
categories: Array<FilterMenuItem>;
|
|
86
|
+
authors: Array<FilterMenuItem>;
|
|
87
|
+
};
|
|
@@ -35,12 +35,13 @@ const ANALYTICS_INFO = {
|
|
|
35
35
|
clickText: "Sign me Up",
|
|
36
36
|
itemTitle: "Dev Edition Sign Up Button",
|
|
37
37
|
formType: "Dev Edition Sign Up",
|
|
38
|
-
formName: "Developer
|
|
38
|
+
formName: "DEVELOPER:xx:signup:Developer-Edition",
|
|
39
39
|
method: "email",
|
|
40
40
|
clickUrl: "/signup/success",
|
|
41
41
|
elementType: "button",
|
|
42
42
|
destinationType: "internal",
|
|
43
|
-
ctaClick: true
|
|
43
|
+
ctaClick: true,
|
|
44
|
+
offerType: "Free Trial"
|
|
44
45
|
};
|
|
45
46
|
export default class DeSignupForm extends LightningElement {
|
|
46
47
|
@api
|
|
@@ -163,7 +164,7 @@ export default class DeSignupForm extends LightningElement {
|
|
|
163
164
|
.then(() => {
|
|
164
165
|
trackGtm(event.target!, "custEv_signUp", {
|
|
165
166
|
...ANALYTICS_INFO,
|
|
166
|
-
formId:
|
|
167
|
+
formId: 'form-builder|DEVELOPER:xx:signup|<null>'
|
|
167
168
|
});
|
|
168
169
|
window.location.href = ANALYTICS_INFO.clickUrl;
|
|
169
170
|
})
|
|
@@ -5,7 +5,6 @@ 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 { DEFAULT_LANGUAGES } from "dxUtils/constants";
|
|
9
8
|
|
|
10
9
|
const DSC_API_URL = {
|
|
11
10
|
"en-us": "/docs/get_index/en-us/000.0/false/All%20Services/all",
|
|
@@ -41,7 +40,7 @@ export default abstract class DocsGrid extends LightningElement {
|
|
|
41
40
|
private deviceType: "desktop" | "mobile" | "mobile-small" = "desktop";
|
|
42
41
|
private _searchTimeout?: number;
|
|
43
42
|
private _couchDbDocTileExclusions?: Set<any>;
|
|
44
|
-
private _allLanguages: Array<Language> =
|
|
43
|
+
private _allLanguages: Array<Language> = [];
|
|
45
44
|
|
|
46
45
|
connectedCallback(): void {
|
|
47
46
|
this.retrieveDscApis(true);
|