@salesforcedevs/dw-components 0.0.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/lwc.config.json +24 -0
- package/package.json +26 -0
- package/src/modules/dw/blogsGrid/blogsGrid.css +89 -0
- package/src/modules/dw/blogsGrid/blogsGrid.html +73 -0
- package/src/modules/dw/blogsGrid/blogsGrid.ts +28 -0
- package/src/modules/dw/cardBlogPostProvider/cardBlogPostProvider.css +3 -0
- package/src/modules/dw/cardBlogPostProvider/cardBlogPostProvider.html +16 -0
- package/src/modules/dw/cardBlogPostProvider/cardBlogPostProvider.ts +29 -0
- package/src/modules/dw/cardPodcastEpisodeProvider/cardPodcastEpisodeProvider.css +3 -0
- package/src/modules/dw/cardPodcastEpisodeProvider/cardPodcastEpisodeProvider.html +12 -0
- package/src/modules/dw/cardPodcastEpisodeProvider/cardPodcastEpisodeProvider.ts +29 -0
- package/src/modules/dw/codeSamplesGrid/codeSamplesGrid.css +171 -0
- package/src/modules/dw/codeSamplesGrid/codeSamplesGrid.html +138 -0
- package/src/modules/dw/codeSamplesGrid/codeSamplesGrid.ts +431 -0
- package/src/modules/dw/contentArchive/altData.js +3 -0
- package/src/modules/dw/contentArchive/contentArchive.css +242 -0
- package/src/modules/dw/contentArchive/contentArchive.html +340 -0
- package/src/modules/dw/contentArchive/contentArchive.ts +519 -0
- package/src/modules/dw/contentArchive/contentArchive.types.ts +98 -0
- package/src/modules/dw/contentArchive/utils.ts +193 -0
- package/src/modules/dw/deSignupForm/deSignupForm.css +75 -0
- package/src/modules/dw/deSignupForm/deSignupForm.html +117 -0
- package/src/modules/dw/deSignupForm/deSignupForm.ts +269 -0
- package/src/modules/dw/deSignupForm/submitForm.ts +93 -0
- package/src/modules/dw/docsGrid/docsGrid.css +83 -0
- package/src/modules/dw/docsGrid/docsGrid.html +89 -0
- package/src/modules/dw/docsGrid/docsGrid.ts +540 -0
- package/src/modules/dw/eventsList/eventsList.css +113 -0
- package/src/modules/dw/eventsList/eventsList.html +98 -0
- package/src/modules/dw/eventsList/eventsList.ts +192 -0
- package/src/modules/dw/instrumentation/instrumentation.html +1 -0
- package/src/modules/dw/instrumentation/instrumentation.ts +97 -0
- package/src/modules/dw/newsletterForm/newsletterForm.css +74 -0
- package/src/modules/dw/newsletterForm/newsletterForm.html +67 -0
- package/src/modules/dw/newsletterForm/newsletterForm.ts +233 -0
- package/src/modules/dw/podcastSubscription/podcastSubscription.css +91 -0
- package/src/modules/dw/podcastSubscription/podcastSubscription.html +24 -0
- package/src/modules/dw/podcastSubscription/podcastSubscription.ts +52 -0
- package/src/modules/dw/podcastsGrid/podcastsGrid.css +5 -0
- package/src/modules/dw/podcastsGrid/podcastsGrid.html +29 -0
- package/src/modules/dw/podcastsGrid/podcastsGrid.ts +9 -0
- package/src/modules/dw/podcastsPromo/podcastsPromo.css +32 -0
- package/src/modules/dw/podcastsPromo/podcastsPromo.html +36 -0
- package/src/modules/dw/podcastsPromo/podcastsPromo.ts +3 -0
- package/src/modules/dw/rcgTable/altData.ts +78 -0
- package/src/modules/dw/rcgTable/getTableData.ts +10 -0
- package/src/modules/dw/rcgTable/rcgTable.css +39 -0
- package/src/modules/dw/rcgTable/rcgTable.html +31 -0
- package/src/modules/dw/rcgTable/rcgTable.ts +34 -0
- package/src/modules/dw/slackCta/slackCta.css +47 -0
- package/src/modules/dw/slackCta/slackCta.html +17 -0
- package/src/modules/dw/slackCta/slackCta.ts +12 -0
- package/src/modules/dw/slackSuccess/slackSuccess.css +65 -0
- package/src/modules/dw/slackSuccess/slackSuccess.html +32 -0
- package/src/modules/dw/slackSuccess/slackSuccess.ts +34 -0
- package/src/modules/dwBaseElements/postsGrid/postsGrid.ts +80 -0
- package/src/modules/dwHelpers/postsGrid/postsGrid.css +9 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
const CREATE_PATH = `/deorgs/trialforce`;
|
|
2
|
+
const BASE_STATUS_PATH = `/deorgs/check_org_status`;
|
|
3
|
+
const WAIT_TIME = 200;
|
|
4
|
+
|
|
5
|
+
export type OptIn = "" | "implied" | "explicit";
|
|
6
|
+
|
|
7
|
+
export type UserData = {
|
|
8
|
+
company: string;
|
|
9
|
+
country: string;
|
|
10
|
+
email: string;
|
|
11
|
+
first_name: string;
|
|
12
|
+
job_role: string;
|
|
13
|
+
last_name: string;
|
|
14
|
+
opt_in: OptIn;
|
|
15
|
+
postal_code: string;
|
|
16
|
+
username: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export type SignupForm = {
|
|
20
|
+
user: UserData;
|
|
21
|
+
eula: string;
|
|
22
|
+
default_driver: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
type OrgStatus = "New" | "In Progress" | "Error";
|
|
26
|
+
|
|
27
|
+
type OrgStatusResponse = {
|
|
28
|
+
Status: OrgStatus;
|
|
29
|
+
Message: string;
|
|
30
|
+
ErrorCode?: "C-1007" | string;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export enum ErrorCode {
|
|
34
|
+
GENERIC = "generic",
|
|
35
|
+
DUPLICATE = "duplicate"
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const fetchOrgStatus = async (id: string): Promise<OrgStatus> => {
|
|
39
|
+
const response = await fetch(`${BASE_STATUS_PATH}/${id}`);
|
|
40
|
+
if (!response.ok) {
|
|
41
|
+
throw new Error("Something went wrong");
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const { Status: status, ErrorCode: errorCode }: OrgStatusResponse =
|
|
45
|
+
await response.json();
|
|
46
|
+
|
|
47
|
+
if (status === "Error") {
|
|
48
|
+
throw new Error(
|
|
49
|
+
errorCode === "C-1007" ? ErrorCode.DUPLICATE : ErrorCode.GENERIC
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return status;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const checkOrgStatus = (id: string, retries = 0): Promise<void> => {
|
|
57
|
+
return new Promise<void>((resolve, reject) => {
|
|
58
|
+
if (retries > 5) {
|
|
59
|
+
// it assumes the org will be created
|
|
60
|
+
resolve();
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
setTimeout(() => {
|
|
64
|
+
fetchOrgStatus(id)
|
|
65
|
+
.then((status) => {
|
|
66
|
+
if (status !== "New") {
|
|
67
|
+
resolve();
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
resolve(checkOrgStatus(id, ++retries));
|
|
72
|
+
})
|
|
73
|
+
.catch(reject);
|
|
74
|
+
}, WAIT_TIME);
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const submitForm = async (formData: SignupForm): Promise<void> => {
|
|
79
|
+
const response = await fetch(CREATE_PATH, {
|
|
80
|
+
method: "POST",
|
|
81
|
+
headers: {
|
|
82
|
+
"Content-Type": "application/json"
|
|
83
|
+
},
|
|
84
|
+
body: JSON.stringify(formData)
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
if (!response.ok) {
|
|
88
|
+
throw new Error(ErrorCode.GENERIC);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const { Id: trackId } = await response.json();
|
|
92
|
+
await checkOrgStatus(trackId);
|
|
93
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
.docs-grid-container {
|
|
2
|
+
position: relative;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.docs-action-bar {
|
|
6
|
+
display: flex;
|
|
7
|
+
justify-content: space-between;
|
|
8
|
+
align-items: flex-end;
|
|
9
|
+
padding: var(--dx-g-spacing-md) 0 var(--dx-g-spacing-lg);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.docs-action-bar > .records-container {
|
|
13
|
+
margin-right: auto;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.docs-action-bar .filters-container {
|
|
17
|
+
display: flex;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.docs-action-bar .filters-container > *:not(:first-child),
|
|
21
|
+
.docs-search-input {
|
|
22
|
+
margin-left: var(--dx-g-spacing-sm);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.docs-search-input {
|
|
26
|
+
--dx-c-input-width: 285px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.docs-card {
|
|
30
|
+
--dx-c-body-max-lines: 4;
|
|
31
|
+
--dx-c-heading-max-lines: 2;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.pagination-container {
|
|
35
|
+
max-width: fit-content;
|
|
36
|
+
max-width: -moz-fit-content;
|
|
37
|
+
margin: var(--dx-g-spacing-lg) auto;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@media screen and (max-width: 1024px) {
|
|
41
|
+
.docs-card {
|
|
42
|
+
--dx-c-body-max-lines: 3;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@media screen and (max-width: 768px) {
|
|
47
|
+
.docs-action-bar {
|
|
48
|
+
flex-direction: column-reverse;
|
|
49
|
+
width: 100%;
|
|
50
|
+
padding: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.docs-search-input {
|
|
54
|
+
--dx-c-input-width: 100%;
|
|
55
|
+
|
|
56
|
+
width: 100%;
|
|
57
|
+
margin-bottom: var(--dx-g-spacing-md);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.docs-action-bar .records-container {
|
|
61
|
+
transform: translateY(-100%);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@media screen and (max-width: 600px) {
|
|
66
|
+
.pagination-container {
|
|
67
|
+
width: 100%;
|
|
68
|
+
overflow: hidden;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.pagination-container > * {
|
|
72
|
+
position: absolute;
|
|
73
|
+
left: 50%;
|
|
74
|
+
transform: translateX(-50%);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@media screen and (max-width: 460px) {
|
|
79
|
+
.docs-action-bar .records-container {
|
|
80
|
+
transform: initial;
|
|
81
|
+
padding: var(--dx-g-spacing-md) 0;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="docs-grid-container">
|
|
3
|
+
<div class="docs-action-bar">
|
|
4
|
+
<div class="records-container">
|
|
5
|
+
<span if:true={endingRecord}>
|
|
6
|
+
Showing { startingRecord } to { endingRecord } of {
|
|
7
|
+
filteredDocs.length }
|
|
8
|
+
</span>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="filters-container">
|
|
11
|
+
<dx-popover width="max-content">
|
|
12
|
+
<dx-button
|
|
13
|
+
class="filter-button"
|
|
14
|
+
variant="tertiary"
|
|
15
|
+
icon-symbol="chevrondown"
|
|
16
|
+
slot="control"
|
|
17
|
+
>
|
|
18
|
+
Products
|
|
19
|
+
</dx-button>
|
|
20
|
+
<template if:true={showProductFilters}>
|
|
21
|
+
<dx-checkbox-group
|
|
22
|
+
legend="Products"
|
|
23
|
+
options={productFiltersList}
|
|
24
|
+
slot="content"
|
|
25
|
+
onchange={handleProductFilterChange}
|
|
26
|
+
value={selectedProductFilters}
|
|
27
|
+
class="filter-checkbox-group"
|
|
28
|
+
></dx-checkbox-group>
|
|
29
|
+
</template>
|
|
30
|
+
</dx-popover>
|
|
31
|
+
</div>
|
|
32
|
+
<dx-input
|
|
33
|
+
size="small"
|
|
34
|
+
placeholder="Search..."
|
|
35
|
+
icon-symbol="search"
|
|
36
|
+
shortcut-key="j"
|
|
37
|
+
class="docs-search-input"
|
|
38
|
+
onchange={handleSearchChange}
|
|
39
|
+
value={searchTerm}
|
|
40
|
+
></dx-input>
|
|
41
|
+
</div>
|
|
42
|
+
<dx-grid columns={tileColumns} if:false={showEmptyState}>
|
|
43
|
+
<dx-card-docs
|
|
44
|
+
for:each={currentPageDocs}
|
|
45
|
+
for:item="item"
|
|
46
|
+
for:index="i"
|
|
47
|
+
key={item.id}
|
|
48
|
+
title={item.title}
|
|
49
|
+
body={item.description}
|
|
50
|
+
href={item.guidesHref}
|
|
51
|
+
class="docs-card"
|
|
52
|
+
target={item.target}
|
|
53
|
+
>
|
|
54
|
+
<dx-button
|
|
55
|
+
variant="inline"
|
|
56
|
+
href={item.guidesHref}
|
|
57
|
+
if:false={item.links}
|
|
58
|
+
>
|
|
59
|
+
Read It
|
|
60
|
+
</dx-button>
|
|
61
|
+
<template if:true={item.links}>
|
|
62
|
+
<dx-button
|
|
63
|
+
for:each={item.links}
|
|
64
|
+
for:item="link"
|
|
65
|
+
key={link.id}
|
|
66
|
+
href={link.href}
|
|
67
|
+
variant="inline"
|
|
68
|
+
>
|
|
69
|
+
{ link.title }
|
|
70
|
+
</dx-button>
|
|
71
|
+
</template>
|
|
72
|
+
</dx-card-docs>
|
|
73
|
+
</dx-grid>
|
|
74
|
+
<div class="pagination-container" if:false={showEmptyState}>
|
|
75
|
+
<dx-pagination
|
|
76
|
+
current-page={page}
|
|
77
|
+
total-pages={totalPages}
|
|
78
|
+
pages-to-show={pagesToShow}
|
|
79
|
+
onpagechange={goToPage}
|
|
80
|
+
if:false={hidePagination}
|
|
81
|
+
></dx-pagination>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
<dx-empty-state
|
|
85
|
+
title="Beep boop. That did not compute."
|
|
86
|
+
subtitle={emptyStateSubtitle}
|
|
87
|
+
if:true={showEmptyState}
|
|
88
|
+
></dx-empty-state>
|
|
89
|
+
</template>
|