@salesforcedevs/dw-components 1.3.179 → 1.3.180-canary.1

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.179",
3
+ "version": "1.3.180-canary.1",
4
4
  "description": "Lightning web components for https://developer.salesforce.com",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -23,6 +23,5 @@
23
23
  "@types/lodash.uniqby": "^4.7.7",
24
24
  "@types/setimmediate": "^1.0.2",
25
25
  "setimmediate": "^1.0.5"
26
- },
27
- "gitHead": "ef5efd7169e688009ba79bd74e69c42adb277e09"
26
+ }
28
27
  }
@@ -13,10 +13,11 @@
13
13
  <dx-step-sequence-step key={stepDatum.id}>
14
14
  <dw-j2s-card-sequence-step
15
15
  country-options={countries}
16
+ has-already-registered={hasAlreadyRegistered}
16
17
  is-loading={isLoading}
17
18
  oncountrychange={handleCountryChange}
18
- ongetstarted={handleGetStarted}
19
19
  onformsubmit={handleFormSubmit}
20
+ ongetstarted={handleGetStarted}
20
21
  recaptcha-token={recaptchaToken}
21
22
  selected-country={selectedCountry}
22
23
  step-datum={stepDatum}
@@ -13,7 +13,6 @@ export type StepDatum = {
13
13
  };
14
14
  formData?: {
15
15
  countriesWithReferralInput?: string[];
16
- countriesWithRequiredJobRole?: string[];
17
16
  formId?: string;
18
17
  j2sTerms?: string;
19
18
  notAvailableAlertInfo?: {
@@ -111,6 +110,7 @@ export default class J2sCardSequence extends LightningElement {
111
110
 
112
111
  private countries: any[] = [];
113
112
  private currentSequenceStep = 0;
113
+ private hasAlreadyRegistered = false;
114
114
  private forceInitiallyVisible = false;
115
115
  private formSubmissionFailureState: Partial<DrmFormData> | null = null;
116
116
  private recaptchaToken = "";
@@ -308,6 +308,9 @@ export default class J2sCardSequence extends LightningElement {
308
308
  this.jumpToStepIndex(2, false);
309
309
  this.initialStepIndex = 0; // don't save final step in storage; rather, reset the starting step
310
310
  this.resetRecaptcha();
311
+ this.selectedCountry =
312
+ this.formIncomingUserInfo.MailingCountry || ""; // reset selected country after form submission since this impact's form behavior
313
+ this.hasAlreadyRegistered = true;
311
314
  } else {
312
315
  throw new Error(
313
316
  `Form submission failed. (status: ${resOutput.status}, message: ${resOutput.errorMessage})`
@@ -24,6 +24,7 @@
24
24
  id={stepDatum.formData.formId}
25
25
  countries={countryOptions}
26
26
  form-metadata={stepDatum.formData}
27
+ has-already-registered={hasAlreadyRegistered}
27
28
  incoming-user-info={userInfo}
28
29
  onformvaliditychange={handleFormValidityChange}
29
30
  recaptcha-token={recaptchaToken}
@@ -46,7 +47,7 @@
46
47
  <dx-button
47
48
  if:true={showPrimaryAction}
48
49
  class="primary-action"
49
- disabled={isJ2sFormInvalid}
50
+ disabled={isPrimaryActionDisabled}
50
51
  href={primaryActionLink}
51
52
  icon-sprite={stepDatum.primaryAction.iconSprite}
52
53
  icon-symbol={stepDatum.primaryAction.iconSymbol}
@@ -5,6 +5,7 @@ import J2sForm from "dw/j2sForm";
5
5
 
6
6
  export default class J2sCardSequenceStep extends LightningElement {
7
7
  @api countryOptions: any[] = [];
8
+ @api hasAlreadyRegistered = false;
8
9
  @api isLoading = false;
9
10
  @api recaptchaToken = "";
10
11
  @api selectedCountry = "";
@@ -20,7 +21,7 @@ export default class J2sCardSequenceStep extends LightningElement {
20
21
  )?.notifySubmitFailure(formFailureData);
21
22
  }
22
23
 
23
- private _isJ2sFormInvalid = false;
24
+ private isJ2sFormInvalid = false;
24
25
 
25
26
  private get stepClassName() {
26
27
  return this.stepIndex === 2 && this.selectedCountry === "IN"
@@ -28,11 +29,11 @@ export default class J2sCardSequenceStep extends LightningElement {
28
29
  : "";
29
30
  }
30
31
 
31
- private get isJ2sFormInvalid() {
32
- return this.stepIndex === 1 && this._isJ2sFormInvalid;
33
- }
34
- private set isJ2sFormInvalid(value: boolean) {
35
- this._isJ2sFormInvalid = value;
32
+ private get isPrimaryActionDisabled() {
33
+ return (
34
+ this.stepIndex === 1 &&
35
+ (this.hasAlreadyRegistered || this.isJ2sFormInvalid)
36
+ );
36
37
  }
37
38
 
38
39
  private get primaryActionLink() {
@@ -50,10 +51,9 @@ export default class J2sCardSequenceStep extends LightningElement {
50
51
  }
51
52
 
52
53
  private get primaryActionVariant() {
53
- if (this.stepIndex === 1 && this.isJ2sFormInvalid) {
54
- return "custom"; // override for disabled button styling
55
- }
56
- return this.stepDatum.primaryAction.variant;
54
+ return this.isPrimaryActionDisabled
55
+ ? "custom"
56
+ : this.stepDatum.primaryAction.variant;
57
57
  }
58
58
 
59
59
  private get primaryActionLinkTarget() {
@@ -81,7 +81,7 @@ export default class J2sCardSequenceStep extends LightningElement {
81
81
 
82
82
  if (this.stepIndex === 0) {
83
83
  this.dispatchEvent(new CustomEvent("getstarted"));
84
- } else if (this.stepIndex === 1 && !this.isJ2sFormInvalid) {
84
+ } else if (this.stepIndex === 1) {
85
85
  const j2sFormEl = this.template.querySelector(
86
86
  "dw-j2s-form"
87
87
  ) as unknown as J2sForm;
@@ -132,6 +132,13 @@
132
132
  variant="accented"
133
133
  ></dx-alert>
134
134
  </div>
135
+ <div class="form-row" if:true={hasAlreadyRegistered}>
136
+ <dx-alert
137
+ alert-info={alreadyRegisteredAlertInfo}
138
+ type="danger"
139
+ variant="accented"
140
+ ></dx-alert>
141
+ </div>
135
142
  <div class="form-row" if:true={isSalesforceEmployee}>
136
143
  <dx-alert
137
144
  alert-info={salesforceEmployeeAlertInfo}
@@ -42,6 +42,7 @@ export default class J2sForm extends LightningElementWithState<J2sFormState> {
42
42
  private _isInitialRender = true;
43
43
  private _recaptchaToken = "";
44
44
 
45
+ @api hasAlreadyRegistered = false;
45
46
  @api formMetadata: any = {};
46
47
  @api id = "";
47
48
  @api incomingUserInfo = {} as DrmFormData;
@@ -118,6 +119,10 @@ export default class J2sForm extends LightningElementWithState<J2sFormState> {
118
119
  return this.state.RelationshipToSalesforce === "Salesforce Employee";
119
120
  }
120
121
 
122
+ get alreadyRegisteredAlertInfo() {
123
+ return this.formMetadata.alreadyRegisteredAlertInfo;
124
+ }
125
+
121
126
  get notAvailableAlertInfo() {
122
127
  return this.formMetadata.notAvailableAlertInfo;
123
128
  }
@@ -3075,7 +3075,6 @@ const tbidUserInfo = {
3075
3075
 
3076
3076
  export const formMetadata = {
3077
3077
  countriesWithReferralInput: ["IN"],
3078
- countriewWithRequiredJobRole: ["CA"],
3079
3078
  j2sTerms:
3080
3079
  'I agree to the Journey to Salesforce Program Terms, subject to the <a href="http://www.google.com">Salesforce Program Agreement</a>.',
3081
3080
  notAvailableAlertInfo: {
package/LICENSE DELETED
@@ -1,12 +0,0 @@
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.