@salesforcedevs/dw-components 1.3.148-canary.16 → 1.3.148-canary.17

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/dw-components",
3
- "version": "1.3.148-canary.16",
3
+ "version": "1.3.148-canary.17",
4
4
  "description": "Lightning web components for https://developer.salesforce.com",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -109,17 +109,23 @@ export default class J2sCardSequence extends LightningElement {
109
109
 
110
110
  private get formIncomingUserInfo() {
111
111
  if (!this.tbidUserInfo) {
112
- return "{}";
112
+ return {};
113
113
  }
114
114
 
115
- return JSON.stringify({
116
- firstName: this.tbidUserInfo.given_name,
117
- lastName: this.tbidUserInfo.family_name,
118
- email: this.tbidUserInfo.email,
119
- jobRole: this.tbidUserInfo.custom_attributes?.Role,
120
- companyName: this.tbidUserInfo.custom_attributes?.CompanyName,
121
- country: this.tbidUserInfo.custom_attributes?.Country
122
- });
115
+ return {
116
+ firstName: decodeURIComponent(this.tbidUserInfo.given_name),
117
+ lastName: decodeURIComponent(this.tbidUserInfo.family_name),
118
+ email: decodeURIComponent(this.tbidUserInfo.email),
119
+ jobRole: decodeURIComponent(
120
+ this.tbidUserInfo.custom_attributes?.Role
121
+ ),
122
+ companyName: decodeURIComponent(
123
+ this.tbidUserInfo.custom_attributes?.CompanyName
124
+ ),
125
+ country: decodeURIComponent(
126
+ this.tbidUserInfo.custom_attributes?.Country
127
+ )
128
+ };
123
129
  }
124
130
 
125
131
  private get initialStepIndex() {
@@ -57,9 +57,9 @@
57
57
  label="Email"
58
58
  missing-error-message="Enter your email address"
59
59
  validity-on-blur="true"
60
+ readonly="true"
60
61
  required
61
62
  value={state.email}
62
- onchange={handleFormFieldChange}
63
63
  ></dx-input>
64
64
  <dx-select
65
65
  label="Country/Region"
@@ -35,12 +35,12 @@ export default class J2sForm extends LightningElementWithState<J2sFormState> {
35
35
  private _countriesJson = "";
36
36
  private _countriesLookup: any = {}; // TODO typings
37
37
  private _didSetFormId = false;
38
- private _incomingUserInfo: any = {}; // TODO typings
39
38
  private _isInitialRender = true;
40
39
  private _recaptchaToken = "";
41
40
 
42
- @api id = "";
43
41
  @api formMetadata: any = {};
42
+ @api id = "";
43
+ @api incomingUserInfo: any = {};
44
44
  @api referralText = "";
45
45
 
46
46
  @api
@@ -59,14 +59,6 @@ export default class J2sForm extends LightningElementWithState<J2sFormState> {
59
59
  this._countriesLookup = countriesLookup;
60
60
  }
61
61
 
62
- @api
63
- get incomingUserInfo() {
64
- return this._incomingUserInfo;
65
- }
66
- set incomingUserInfo(value: string) {
67
- this._incomingUserInfo = toJson(value);
68
- }
69
-
70
62
  @api
71
63
  get formDataForDrm() {
72
64
  // We should be able to just get the formData from the form automatically using `new FormData(theForm)`,
@@ -126,7 +118,7 @@ export default class J2sForm extends LightningElementWithState<J2sFormState> {
126
118
 
127
119
  connectedCallback() {
128
120
  const initialState: Partial<J2sFormState> = {
129
- ...this._incomingUserInfo,
121
+ ...this.incomingUserInfo,
130
122
  isFormValid: false,
131
123
  showMarketingText: true
132
124
  };
@@ -136,6 +128,8 @@ export default class J2sForm extends LightningElementWithState<J2sFormState> {
136
128
  if (initialCountryData) {
137
129
  initialState.showLegalCheckbox =
138
130
  initialCountryData.showLegalCheckbox;
131
+ initialState.showMarketingText =
132
+ initialCountryData.showMarketingText;
139
133
  initialState.legalText = initialCountryData.legalText;
140
134
  initialState.marketingText = initialCountryData.marketingText;
141
135
  initialState.learnMore = initialCountryData.learnMore;
@@ -251,7 +245,8 @@ export default class J2sForm extends LightningElementWithState<J2sFormState> {
251
245
  learnMore: countryData.learnMore,
252
246
  legalText: countryData.legalText,
253
247
  marketingText: countryData.marketingText,
254
- showLegalCheckbox: countryData.showLegalCheckbox
248
+ showLegalCheckbox: countryData.showLegalCheckbox,
249
+ showMarketingText: countryData.showMarketingText
255
250
  });
256
251
 
257
252
  // Because updating the country can update the required fields, we need to re-set form