@salesforcedevs/dw-components 0.79.1 → 1.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/lwc.config.json +10 -1
- package/package.json +16 -12
- package/src/modules/dw/blogsGrid/blogsGrid.css +14 -7
- package/src/modules/dw/blogsGrid/blogsGrid.html +15 -12
- package/src/modules/dw/blogsGrid/blogsGrid.ts +23 -9
- package/src/modules/dw/browseTrials/browseTrials.css +35 -0
- package/src/modules/dw/browseTrials/browseTrials.html +86 -0
- package/src/modules/dw/browseTrials/browseTrials.ts +116 -0
- package/src/modules/dw/cardBlogPostProvider/cardBlogPostProvider.css +2 -0
- package/src/modules/dw/cardBlogPostProvider/cardBlogPostProvider.html +3 -3
- package/src/modules/dw/cardPodcastEpisodeProvider/cardPodcastEpisodeProvider.css +2 -0
- package/src/modules/dw/cardPodcastEpisodeProvider/cardPodcastEpisodeProvider.html +2 -1
- package/src/modules/dw/codeSamplesGrid/codeSamplesGrid.css +85 -9
- package/src/modules/dw/codeSamplesGrid/codeSamplesGrid.html +74 -112
- package/src/modules/dw/codeSamplesGrid/codeSamplesGrid.ts +14 -376
- package/src/modules/dw/contentArchive/contentArchive.css +5 -4
- package/src/modules/dw/contentArchive/contentArchive.html +58 -24
- package/src/modules/dw/contentArchive/contentArchive.ts +46 -8
- package/src/modules/dw/contentArchive/contentArchive.types.ts +8 -4
- package/src/modules/dw/contentArchive/utils.ts +30 -14
- package/src/modules/dw/deSignupForm/deSignupForm.css +11 -10
- package/src/modules/dw/deSignupForm/deSignupForm.html +39 -25
- package/src/modules/dw/deSignupForm/deSignupForm.ts +205 -133
- package/src/modules/dw/deSignupForm/submitForm.ts +7 -3
- package/src/modules/dw/docsGrid/docsGrid.css +0 -1
- package/src/modules/dw/docsGrid/docsGrid.html +6 -2
- package/src/modules/dw/docsGrid/docsGrid.ts +103 -38
- package/src/modules/dw/eventsList/eventsList.css +4 -4
- package/src/modules/dw/eventsList/eventsList.html +5 -5
- package/src/modules/dw/eventsList/eventsList.ts +47 -48
- package/src/modules/dw/j2sCardSequence/j2sCardSequence.css +14 -0
- package/src/modules/dw/j2sCardSequence/j2sCardSequence.html +41 -0
- package/src/modules/dw/j2sCardSequence/j2sCardSequence.ts +487 -0
- package/src/modules/dw/j2sCardSequenceStep/j2sCardSequenceStep.css +76 -0
- package/src/modules/dw/j2sCardSequenceStep/j2sCardSequenceStep.html +64 -0
- package/src/modules/dw/j2sCardSequenceStep/j2sCardSequenceStep.ts +157 -0
- package/src/modules/dw/j2sForm/j2sForm.css +65 -0
- package/src/modules/dw/j2sForm/j2sForm.html +217 -0
- package/src/modules/dw/j2sForm/j2sForm.ts +371 -0
- package/src/modules/dw/j2sForm/mockProps.ts +3102 -0
- package/src/modules/dw/languageSelector/languageSelector.css +86 -0
- package/src/modules/dw/languageSelector/languageSelector.html +36 -0
- package/src/modules/dw/languageSelector/languageSelector.ts +119 -0
- package/src/modules/dw/newsletterForm/newsletterForm.css +2 -2
- package/src/modules/dw/newsletterForm/newsletterForm.html +35 -10
- package/src/modules/dw/newsletterForm/newsletterForm.ts +107 -78
- package/src/modules/dw/podcastSubscription/podcastSubscription.css +8 -8
- package/src/modules/dw/podcastSubscription/podcastSubscription.html +2 -2
- package/src/modules/dw/podcastSubscription/podcastSubscription.ts +4 -4
- package/src/modules/dw/podcastsGrid/podcastsGrid.css +7 -0
- package/src/modules/dw/podcastsGrid/podcastsGrid.html +6 -1
- package/src/modules/dw/podcastsGrid/podcastsGrid.ts +3 -3
- package/src/modules/dw/podcastsPromo/podcastsPromo.css +14 -0
- package/src/modules/dw/podcastsPromo/podcastsPromo.html +16 -8
- package/src/modules/dw/podcastsPromo/podcastsPromo.ts +11 -2
- package/src/modules/dw/rcgTable/altData.ts +72 -9
- package/src/modules/dw/rcgTable/getTableData.ts +1 -1
- package/src/modules/dw/rcgTable/rcgTable.ts +3 -3
- package/src/modules/dw/slackCta/slackCta.css +5 -6
- package/src/modules/dw/slackCta/slackCta.html +1 -1
- package/src/modules/dw/slackSuccess/slackSuccess.css +1 -1
- package/src/modules/dw/slackSuccess/slackSuccess.html +2 -2
- package/src/modules/dw/tbidLoginMenu/tbidLoginMenu.css +119 -0
- package/src/modules/dw/tbidLoginMenu/tbidLoginMenu.html +192 -0
- package/src/modules/dw/tbidLoginMenu/tbidLoginMenu.ts +148 -0
- package/src/modules/dw/videoGrid/types.ts +12 -0
- package/src/modules/dw/videoGrid/videoGrid.css +24 -0
- package/src/modules/dw/videoGrid/videoGrid.html +41 -0
- package/src/modules/dw/videoGrid/videoGrid.ts +41 -0
- package/src/modules/dw/youtubeVideoGrid/types.ts +8 -0
- package/src/modules/dw/youtubeVideoGrid/youtubeVideoGrid.css +18 -0
- package/src/modules/dw/youtubeVideoGrid/youtubeVideoGrid.html +40 -0
- package/src/modules/dw/youtubeVideoGrid/youtubeVideoGrid.ts +66 -0
- package/src/modules/dwHelpers/mobileDividers/mobileDividers.css +19 -0
- package/src/modules/dwUtils/forms/forms.ts +514 -0
- package/src/modules/{dwBaseElements → dwUtils}/postsGrid/postsGrid.ts +10 -13
|
@@ -1,84 +1,54 @@
|
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
SignupForm,
|
|
8
|
-
UserData,
|
|
9
|
-
OptIn
|
|
10
|
-
} from "./submitForm";
|
|
4
|
+
import { submitForm, ErrorCode, SignupForm, UserData } from "./submitForm";
|
|
5
|
+
import { CountryOptions } from "typings/custom";
|
|
6
|
+
import { stateMap } from "dwUtils/forms";
|
|
11
7
|
|
|
12
8
|
type SelectOption = { value: string; label: string };
|
|
13
9
|
type Country = SelectOption & {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
type CheckboxSet = {
|
|
20
|
-
marketingText: string;
|
|
21
|
-
legalText: string;
|
|
22
|
-
learnMore?: string;
|
|
23
|
-
};
|
|
24
|
-
type CheckboxTextMap = {
|
|
25
|
-
[key: string]: CheckboxSet;
|
|
10
|
+
showMarketingCheckbox: boolean;
|
|
11
|
+
privacyText?: string;
|
|
12
|
+
privacyOptIn?: boolean;
|
|
26
13
|
};
|
|
27
14
|
|
|
28
15
|
const DEFAULT_DRIVER = "7013000000005wb";
|
|
29
16
|
const DUPLICATE_USERNAME_MESSAGE =
|
|
30
17
|
"You are already using that username in another Salesforce login credential. Your username needs to be unique and in the form of an email address.";
|
|
31
|
-
const ACCEPTED = "accepted";
|
|
32
18
|
const SIGN_UP_LABEL = "Sign me Up";
|
|
19
|
+
const SIGN_UP_FORM_TIMEOUT_MS = 18.5 * 1000; // Something in trialforce/DRM's backend (still under investigation) is causing requests to timeout around 20 seconds; we use 18.5 here in case it's sometimes a little faster than that
|
|
33
20
|
|
|
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
21
|
export default class DeSignupForm extends LightningElement {
|
|
47
|
-
@api
|
|
48
|
-
get countries() {
|
|
49
|
-
return this._countries;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
set countries(value) {
|
|
53
|
-
this._countries = toJson(value);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
22
|
@api
|
|
57
23
|
get roles() {
|
|
58
24
|
return this._roles;
|
|
59
25
|
}
|
|
60
26
|
|
|
61
27
|
set roles(value) {
|
|
62
|
-
this._roles = toJson(value);
|
|
28
|
+
this._roles = toJson(value!);
|
|
63
29
|
}
|
|
64
|
-
|
|
65
30
|
@api
|
|
66
|
-
get
|
|
67
|
-
return this.
|
|
31
|
+
get countries() {
|
|
32
|
+
return this._countries;
|
|
68
33
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
this._checkboxTextMap = toJson(value);
|
|
34
|
+
set countries(value) {
|
|
35
|
+
this._countries = value;
|
|
72
36
|
}
|
|
37
|
+
@api drmDomain: string = "";
|
|
38
|
+
@api legalText: string = "";
|
|
73
39
|
|
|
74
|
-
private country: Country = null;
|
|
40
|
+
private country: Country | null = null;
|
|
41
|
+
private _countries: string = "";
|
|
75
42
|
private disableSubmit = false;
|
|
76
43
|
private username = "";
|
|
77
|
-
private
|
|
78
|
-
private
|
|
79
|
-
private
|
|
80
|
-
private
|
|
81
|
-
|
|
44
|
+
private _roles: Array<SelectOption> | undefined;
|
|
45
|
+
private showMarketingCheckbox: boolean = false;
|
|
46
|
+
private marketingCheckbox: boolean = false;
|
|
47
|
+
private marketingText: string = "";
|
|
48
|
+
private showLegalCheckbox: boolean = false;
|
|
49
|
+
private privacyText: string = "";
|
|
50
|
+
|
|
51
|
+
@track knownDuplicateUsers: string[] = [];
|
|
82
52
|
|
|
83
53
|
get usernameError(): string {
|
|
84
54
|
return this.knownDuplicateUsers.includes(this.username)
|
|
@@ -90,58 +60,78 @@ export default class DeSignupForm extends LightningElement {
|
|
|
90
60
|
return !this.knownDuplicateUsers.includes(this.username);
|
|
91
61
|
}
|
|
92
62
|
|
|
93
|
-
get
|
|
94
|
-
return this.
|
|
63
|
+
get buttonLabel(): string {
|
|
64
|
+
return this.disableSubmit ? "Beep boop processing" : SIGN_UP_LABEL;
|
|
95
65
|
}
|
|
96
66
|
|
|
97
|
-
get
|
|
98
|
-
return (
|
|
99
|
-
this.checkboxSetByCountry && this.checkboxSetByCountry.marketingText
|
|
100
|
-
);
|
|
67
|
+
get showStateSelect(): boolean {
|
|
68
|
+
return !!(this.country && (this.country as any) in stateMap);
|
|
101
69
|
}
|
|
102
70
|
|
|
103
|
-
get
|
|
104
|
-
|
|
71
|
+
get states(): string[] {
|
|
72
|
+
// @ts-ignore we're doing something dumb here where we use an entire object as the key of the stateMap
|
|
73
|
+
return stateMap[this.country] || [];
|
|
105
74
|
}
|
|
106
75
|
|
|
107
|
-
|
|
108
|
-
|
|
76
|
+
connectedCallback(): void {
|
|
77
|
+
this.getCountryList();
|
|
109
78
|
}
|
|
110
79
|
|
|
111
|
-
|
|
112
|
-
|
|
80
|
+
renderedCallback(): void {
|
|
81
|
+
this.updateInnerHtml("span.legal-terms", this.legalText);
|
|
82
|
+
this.updateInnerHtml("span.marketing-terms", this.marketingText);
|
|
83
|
+
this.updateInnerHtml("span.legal-checkbox", this.privacyText);
|
|
113
84
|
}
|
|
114
85
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
(
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
86
|
+
createUUID() {
|
|
87
|
+
if ("crypto" in window && "randomUUID" in crypto) {
|
|
88
|
+
return crypto.randomUUID();
|
|
89
|
+
}
|
|
90
|
+
let dt = new Date().getTime();
|
|
91
|
+
const uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
|
|
92
|
+
/[xy]/g,
|
|
93
|
+
function (c) {
|
|
94
|
+
var r = (dt + Math.random() * 16) % 16 | 0;
|
|
95
|
+
dt = Math.floor(dt / 16);
|
|
96
|
+
return (c === "x" ? r : (r & 0x3) | 0x8).toString(16);
|
|
97
|
+
}
|
|
121
98
|
);
|
|
99
|
+
return uuid;
|
|
122
100
|
}
|
|
123
101
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
102
|
+
setSubmitButtonDisabled(isDisabled: boolean): void {
|
|
103
|
+
this.disableSubmit = isDisabled;
|
|
127
104
|
|
|
128
|
-
|
|
129
|
-
if (
|
|
130
|
-
|
|
105
|
+
let backgroundAndBorderColor: string;
|
|
106
|
+
if (isDisabled) {
|
|
107
|
+
backgroundAndBorderColor = "var(--dx-g-gray-80)";
|
|
108
|
+
} else {
|
|
109
|
+
backgroundAndBorderColor = "var(--dx-g-blue-vibrant-50)";
|
|
131
110
|
}
|
|
132
111
|
|
|
133
|
-
this.
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
112
|
+
this.template.host.style.setProperty(
|
|
113
|
+
"--dx-c-button-custom-background",
|
|
114
|
+
backgroundAndBorderColor
|
|
115
|
+
);
|
|
116
|
+
this.template.host.style.setProperty(
|
|
117
|
+
"--dx-c-button-custom-border",
|
|
118
|
+
backgroundAndBorderColor
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
trackFormCompletion(target: EventTarget, formData: SignupForm, convertingPage = "success") {
|
|
123
|
+
trackGtm(target!, "custEv_formCompletion", {
|
|
124
|
+
converting_page: `SFDC:us:signup:${convertingPage}`,
|
|
125
|
+
converting_page_url:
|
|
126
|
+
`https://developer.salesforce.com/signup/${convertingPage}`,
|
|
127
|
+
form_country: formData.user.country,
|
|
128
|
+
form_name: "Dev Edition Signup",
|
|
129
|
+
form_primary_product_interest: "Developer Edition",
|
|
130
|
+
offer_id: `form-builder|dev-edition-signup|${DEFAULT_DRIVER}AAA`,
|
|
131
|
+
offer_type: "free trial",
|
|
132
|
+
name_capture_campaign_id: `${DEFAULT_DRIVER}AAA`,
|
|
133
|
+
form_join_id_unique: formData.form_join_id_unique
|
|
134
|
+
});
|
|
145
135
|
}
|
|
146
136
|
|
|
147
137
|
handleSubmit(event: Event): void {
|
|
@@ -159,24 +149,54 @@ export default class DeSignupForm extends LightningElement {
|
|
|
159
149
|
return;
|
|
160
150
|
}
|
|
161
151
|
|
|
162
|
-
|
|
152
|
+
// Due to Heroku's non-configurable 30 second request timeout, the POST request that
|
|
153
|
+
// submits the form can "fail" even though org creation is actually succeeding (but
|
|
154
|
+
// taking longer than 30 seconds). The back-end only gives us a "generic" error in that
|
|
155
|
+
// case, so we use a "good enough" heuristic here and direct the user to an "account-verification"
|
|
156
|
+
// page that doesn't ultimately say things worked, but tells them to watch their email.
|
|
157
|
+
// This should be a temporary bandaid, not a full solution.
|
|
158
|
+
let didSubmitTimeout = false;
|
|
159
|
+
let formSubmissionTimeoutId: number | undefined = window.setTimeout(
|
|
160
|
+
() => {
|
|
161
|
+
didSubmitTimeout = true;
|
|
162
|
+
},
|
|
163
|
+
SIGN_UP_FORM_TIMEOUT_MS
|
|
164
|
+
);
|
|
165
|
+
|
|
166
|
+
this.setSubmitButtonDisabled(true);
|
|
163
167
|
submitForm(formData)
|
|
164
168
|
.then(() => {
|
|
165
169
|
trackGtm(event.target!, "custEv_signUp", {
|
|
166
|
-
|
|
167
|
-
|
|
170
|
+
authentication_method: "email",
|
|
171
|
+
authentication_type: "dev edition",
|
|
172
|
+
new_registration: true
|
|
168
173
|
});
|
|
169
|
-
|
|
174
|
+
this.trackFormCompletion(event.target!, formData, "success");
|
|
175
|
+
window.location.href = "/signup/success";
|
|
170
176
|
})
|
|
171
177
|
.catch((error) => {
|
|
172
|
-
if (error.message === ErrorCode.
|
|
173
|
-
this.
|
|
174
|
-
|
|
178
|
+
if (error.message === ErrorCode.GENERIC && didSubmitTimeout) {
|
|
179
|
+
this.trackFormCompletion(event.target!, formData, "account-verification");
|
|
180
|
+
// If the timeout time has passed at the point of error, and the error code is simply "GENERIC",
|
|
181
|
+
// we do not know whether the org will ultimately be created (and we have no current way of confirming),
|
|
182
|
+
// so we navigate the user to an interim page that tells them to watch their email.
|
|
183
|
+
window.location.href = "/signup/account-verification";
|
|
184
|
+
} else {
|
|
185
|
+
this.setSubmitButtonDisabled(false);
|
|
186
|
+
if (error.message === ErrorCode.DUPLICATE) {
|
|
187
|
+
this.knownDuplicateUsers.push(formData.user.username);
|
|
188
|
+
} else {
|
|
189
|
+
console.warn(
|
|
190
|
+
"Oops, something went wrong",
|
|
191
|
+
error.message
|
|
192
|
+
);
|
|
193
|
+
}
|
|
175
194
|
}
|
|
176
|
-
|
|
177
|
-
console.log("Oops, something went wrong", error.message);
|
|
178
195
|
})
|
|
179
|
-
.finally(() =>
|
|
196
|
+
.finally(() => {
|
|
197
|
+
clearTimeout(formSubmissionTimeoutId);
|
|
198
|
+
formSubmissionTimeoutId = undefined;
|
|
199
|
+
});
|
|
180
200
|
}
|
|
181
201
|
|
|
182
202
|
handleKeyDown(e: KeyboardEvent): void {
|
|
@@ -189,13 +209,6 @@ export default class DeSignupForm extends LightningElement {
|
|
|
189
209
|
this.username = event.detail;
|
|
190
210
|
}
|
|
191
211
|
|
|
192
|
-
handleCountryChange(event: CustomEvent<{ value: string }>): void {
|
|
193
|
-
this.country = this.countries.find(
|
|
194
|
-
({ value }) => value === event.detail.value
|
|
195
|
-
);
|
|
196
|
-
this.updateCheckboxLabels = true;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
212
|
private prepareUserData(): SignupForm | null {
|
|
200
213
|
const fields = Array.from(
|
|
201
214
|
this.template.querySelectorAll<HTMLFormElement>(
|
|
@@ -207,48 +220,107 @@ export default class DeSignupForm extends LightningElement {
|
|
|
207
220
|
value: element.value
|
|
208
221
|
}));
|
|
209
222
|
|
|
210
|
-
|
|
223
|
+
let validCheckboxes = true;
|
|
224
|
+
Array.from(
|
|
225
|
+
this.template.querySelectorAll<HTMLInputElement>("dx-checkbox")
|
|
226
|
+
).forEach((checkbox) => {
|
|
227
|
+
validCheckboxes = validCheckboxes && checkbox.reportValidity();
|
|
228
|
+
});
|
|
211
229
|
|
|
212
|
-
if (fields.some((field) => !field.valid) || !
|
|
230
|
+
if (fields.some((field) => !field.valid) || !validCheckboxes) {
|
|
213
231
|
return null;
|
|
214
232
|
}
|
|
215
233
|
|
|
216
|
-
const userData = {};
|
|
234
|
+
const userData: any = {};
|
|
217
235
|
fields.forEach((field) => {
|
|
218
236
|
userData[field.name] = field.value;
|
|
219
237
|
});
|
|
220
238
|
|
|
221
|
-
(userData as UserData).
|
|
222
|
-
?
|
|
223
|
-
: "
|
|
224
|
-
|
|
239
|
+
(userData as UserData).consent = this.showMarketingCheckbox
|
|
240
|
+
? "Explicit"
|
|
241
|
+
: "Implied";
|
|
242
|
+
const InfoEmail =
|
|
243
|
+
this.showMarketingCheckbox && !this.marketingCheckbox
|
|
244
|
+
? "False"
|
|
245
|
+
: "True";
|
|
225
246
|
const formData: SignupForm = {
|
|
226
247
|
user: userData as UserData,
|
|
227
|
-
|
|
228
|
-
|
|
248
|
+
default_driver: DEFAULT_DRIVER,
|
|
249
|
+
info_email: InfoEmail,
|
|
250
|
+
form_join_id_unique: this.createUUID()
|
|
229
251
|
};
|
|
230
252
|
|
|
231
253
|
return formData;
|
|
232
254
|
}
|
|
233
255
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
256
|
+
handleConsent(countrySelectElement: any) {
|
|
257
|
+
this.country = countrySelectElement.target.value;
|
|
258
|
+
countrySelectElement = countrySelectElement.target;
|
|
259
|
+
const countryOptions = countrySelectElement.options.find(
|
|
260
|
+
(option: any) => option.value === countrySelectElement.value
|
|
261
|
+
);
|
|
262
|
+
this.setLegalAndMarketingData(countryOptions);
|
|
263
|
+
this.marketingCheckbox = false;
|
|
264
|
+
}
|
|
243
265
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
valid = valid && checkbox.reportValidity();
|
|
248
|
-
values[checkbox.name] = (checkbox.checked && checkbox.value) || "";
|
|
249
|
-
});
|
|
266
|
+
handleMarketingCheckbox(marketingCheckbox: any) {
|
|
267
|
+
this.marketingCheckbox = marketingCheckbox.target.checked;
|
|
268
|
+
}
|
|
250
269
|
|
|
251
|
-
|
|
270
|
+
setLegalAndMarketingData(countryOptions: CountryOptions) {
|
|
271
|
+
// Set the checkbox text
|
|
272
|
+
this.setCheckboxTextSet(
|
|
273
|
+
countryOptions.marketingText,
|
|
274
|
+
countryOptions.learnMore
|
|
275
|
+
? `${countryOptions.legalText} </br> ${countryOptions.learnMore}`
|
|
276
|
+
: countryOptions.legalText
|
|
277
|
+
);
|
|
278
|
+
|
|
279
|
+
// Toggle visibility of legal/marketing data
|
|
280
|
+
this.toggleLegalAndMarketingVisibility(
|
|
281
|
+
countryOptions.showMarketingText,
|
|
282
|
+
countryOptions.showLegalCheckbox
|
|
283
|
+
);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
setCheckboxTextSet(marketingText: string, privacyText: string) {
|
|
287
|
+
this.marketingText = marketingText;
|
|
288
|
+
this.privacyText = privacyText;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
toggleLegalAndMarketingVisibility(
|
|
292
|
+
showMarketingCheckbox: boolean,
|
|
293
|
+
showLegalCheckbox: boolean
|
|
294
|
+
) {
|
|
295
|
+
this.showMarketingCheckbox = showMarketingCheckbox;
|
|
296
|
+
this.showLegalCheckbox = showLegalCheckbox;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
setInnerHtml(element: HTMLElement, value: string) {
|
|
300
|
+
// disable lwc warning because text received from json has HTML
|
|
301
|
+
// eslint-disable-next-line @lwc/lwc/no-inner-html
|
|
302
|
+
element.innerHTML = value;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
async getCountryList() {
|
|
306
|
+
if (!this.drmDomain) {
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
const errorMsg = "Error while getting country list";
|
|
310
|
+
try {
|
|
311
|
+
const res = await fetch(
|
|
312
|
+
`${this.drmDomain}/utilities/services/apexrest/countries`
|
|
313
|
+
);
|
|
314
|
+
|
|
315
|
+
if (!res.ok) {
|
|
316
|
+
throw new Error(errorMsg);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
const data = await res.json();
|
|
320
|
+
this._countries = JSON.stringify(data);
|
|
321
|
+
} catch (error) {
|
|
322
|
+
console.error(error);
|
|
323
|
+
}
|
|
252
324
|
}
|
|
253
325
|
|
|
254
326
|
private updateInnerHtml(
|
|
@@ -256,7 +328,7 @@ export default class DeSignupForm extends LightningElement {
|
|
|
256
328
|
html: string,
|
|
257
329
|
shouldUpdate = true
|
|
258
330
|
): boolean {
|
|
259
|
-
let element: HTMLElement;
|
|
331
|
+
let element: HTMLElement | null = null;
|
|
260
332
|
if (shouldUpdate) {
|
|
261
333
|
element = this.template.querySelector(selector);
|
|
262
334
|
if (element) {
|
|
@@ -2,24 +2,28 @@ 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;
|
|
11
|
+
state?: string;
|
|
10
12
|
email: string;
|
|
11
13
|
first_name: string;
|
|
12
14
|
job_role: string;
|
|
15
|
+
job_title: string;
|
|
13
16
|
last_name: string;
|
|
14
|
-
opt_in:
|
|
17
|
+
opt_in: boolean;
|
|
15
18
|
postal_code: string;
|
|
16
19
|
username: string;
|
|
17
20
|
};
|
|
18
21
|
|
|
19
22
|
export type SignupForm = {
|
|
20
23
|
user: UserData;
|
|
21
|
-
eula: string;
|
|
22
24
|
default_driver: string;
|
|
25
|
+
info_email: "True" | "False";
|
|
26
|
+
form_join_id_unique: string;
|
|
23
27
|
};
|
|
24
28
|
|
|
25
29
|
type OrgStatus = "New" | "In Progress" | "Error";
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
for:item="item"
|
|
46
46
|
for:index="i"
|
|
47
47
|
key={item.id}
|
|
48
|
-
|
|
48
|
+
header={item.title}
|
|
49
49
|
body={item.description}
|
|
50
50
|
href={item.guidesHref}
|
|
51
51
|
class="docs-card"
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
<dx-button
|
|
55
55
|
variant="inline"
|
|
56
56
|
href={item.guidesHref}
|
|
57
|
+
onclick={handleReadItClick}
|
|
57
58
|
if:false={item.links}
|
|
58
59
|
>
|
|
59
60
|
Read It
|
|
@@ -82,8 +83,11 @@
|
|
|
82
83
|
</div>
|
|
83
84
|
</div>
|
|
84
85
|
<dx-empty-state
|
|
85
|
-
|
|
86
|
+
variant="alt"
|
|
87
|
+
header="Beep boop. That did not compute."
|
|
86
88
|
subtitle={emptyStateSubtitle}
|
|
89
|
+
body={emptyStateBody}
|
|
90
|
+
suggestions={emptyStateSuggestions}
|
|
87
91
|
if:true={showEmptyState}
|
|
88
92
|
></dx-empty-state>
|
|
89
93
|
</template>
|