@salesforcedevs/dw-components 1.3.304-alpha.1 → 1.3.305-canary.2

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.304-alpha.1",
3
+ "version": "1.3.305-canary.2",
4
4
  "description": "Lightning web components for https://developer.salesforce.com",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -3,7 +3,6 @@ import StepSequence from "dx/stepSequence";
3
3
  import { getListWithUuids } from "dxUtils/list";
4
4
  import { toJson } from "dxUtils/normalizers";
5
5
  import J2sCardSequenceStep from "dw/j2sCardSequenceStep";
6
- import { AlertInfo } from "typings/custom";
7
6
 
8
7
  const DRM_SUCCESS_STRING = "success";
9
8
 
@@ -19,8 +18,8 @@ export type StepDatum = {
19
18
  formId?: string;
20
19
  j2sTerms?: string;
21
20
  notAvailableAlertInfo?: {
22
- default: AlertInfo;
23
- [key: string]: AlertInfo;
21
+ title: string;
22
+ body: string;
24
23
  };
25
24
  participatingCountryCodes?: string[];
26
25
  salesforceEmployeeAlertInfo?: {
@@ -45,7 +45,6 @@
45
45
  </div>
46
46
  <div slot="primary-action-section">
47
47
  <dx-button
48
- if:true={showPrimaryAction}
49
48
  class="primary-action"
50
49
  disabled={isPrimaryActionDisabled}
51
50
  href={primaryActionLink}
@@ -16,17 +16,15 @@ export default class J2sCardSequenceStep extends LightningElement {
16
16
 
17
17
  @api
18
18
  public notifyFormSubmitFailure(formFailureData: Partial<DrmFormData>) {
19
- ((this.template.querySelector(
20
- "dw-j2s-form"
21
- ) as unknown) as J2sForm)?.notifySubmitFailure(formFailureData);
19
+ (
20
+ this.template.querySelector("dw-j2s-form") as unknown as J2sForm
21
+ )?.notifySubmitFailure(formFailureData);
22
22
  }
23
23
 
24
24
  private isJ2sFormInvalid = false;
25
25
 
26
26
  private get stepClassName() {
27
- return this.stepIndex === 2 && this.selectedCountry === "IN"
28
- ? "final-card-with-action"
29
- : "";
27
+ return this.stepIndex === 2 ? "final-card-with-action" : "";
30
28
  }
31
29
 
32
30
  private get isPrimaryActionDisabled() {
@@ -60,14 +58,6 @@ export default class J2sCardSequenceStep extends LightningElement {
60
58
  return this.stepDatum.primaryAction.linkTarget || "_blank";
61
59
  }
62
60
 
63
- private get showPrimaryAction() {
64
- return this.stepIndex !== 2 || this.selectedCountry === "IN";
65
- }
66
-
67
- private get showSecondaryAction() {
68
- return this.showPrimaryAction; // same requirement as above for now
69
- }
70
-
71
61
  renderedCallback() {
72
62
  this.updateStaticInnerHtml();
73
63
  }
@@ -86,9 +76,9 @@ export default class J2sCardSequenceStep extends LightningElement {
86
76
  if (this.stepIndex === 0) {
87
77
  this.dispatchEvent(new CustomEvent("getstarted"));
88
78
  } else if (this.stepIndex === 1) {
89
- const j2sFormEl = (this.template.querySelector(
79
+ const j2sFormEl = this.template.querySelector(
90
80
  "dw-j2s-form"
91
- ) as unknown) as J2sForm;
81
+ ) as unknown as J2sForm;
92
82
  const formData = j2sFormEl.formDataForDrm;
93
83
 
94
84
  // For some countries, explicit approvals will be present; for others, it is implicitly assumed
@@ -109,9 +99,8 @@ export default class J2sCardSequenceStep extends LightningElement {
109
99
 
110
100
  private updateStaticInnerHtml() {
111
101
  const { bodyHtml, secondaryActionHtml } = this.stepDatum;
112
- const bodyMarkupContainer = this.template.querySelector(
113
- "span.body-markup"
114
- );
102
+ const bodyMarkupContainer =
103
+ this.template.querySelector("span.body-markup");
115
104
  const secondaryActionMarkupContainer = this.template.querySelector(
116
105
  "span.secondary-action-markup"
117
106
  );
@@ -135,11 +124,7 @@ export default class J2sCardSequenceStep extends LightningElement {
135
124
  }
136
125
 
137
126
  if (secondaryActionMarkupContainer) {
138
- // new special exception on step 2 to only show secondary action for IN
139
- secondaryActionMarkupContainer.innerHTML =
140
- secondaryActionHtml && this.showSecondaryAction
141
- ? secondaryActionHtml
142
- : "";
127
+ secondaryActionMarkupContainer.innerHTML = secondaryActionHtml || "";
143
128
  }
144
129
  }
145
130
 
@@ -1,15 +1,10 @@
1
1
  import { toJson } from "dxUtils/normalizers";
2
2
  import { stateMap } from "dwUtils/forms";
3
- import { DateTime } from "luxon";
4
3
  import { api } from "lwc";
5
4
  import debounce from "debounce";
6
5
  import { LightningElementWithState } from "dxBaseElements/lightningElementWithState";
7
6
  import { DrmFormData } from "dw/j2sCardSequence";
8
7
 
9
- const closingTimeUSCanada = DateTime.fromISO("2024-05-09", {
10
- zone: "America/Los_Angeles"
11
- });
12
-
13
8
  // Hard-coding for now because we can't get information about an endpoint for this
14
9
  const tbidValidRoles = [
15
10
  "Developer",
@@ -101,17 +96,11 @@ export default class J2sForm extends LightningElementWithState<J2sFormState> {
101
96
  }
102
97
  }
103
98
 
104
- private countriesWithReferralInput = ["IN"];
99
+ private participatingCountryCodes = ["US", "CA", "IN"];
100
+ private countriesWithReferralInput = ["US", "CA", "IN"];
105
101
  private requiredFormFields: HTMLElement[] = [];
106
102
  private showSubmitFailureAlert = false;
107
103
 
108
- get participatingCountryCodes() {
109
- if (DateTime.local() >= closingTimeUSCanada) {
110
- return ["IN"];
111
- }
112
- return ["US", "CA", "IN"];
113
- }
114
-
115
104
  get isNotParticipatingCountry() {
116
105
  return !this.isParticipatingCountry(this.state.MailingCountry);
117
106
  }
@@ -135,9 +124,7 @@ export default class J2sForm extends LightningElementWithState<J2sFormState> {
135
124
  }
136
125
 
137
126
  get notAvailableAlertInfo() {
138
- return this.formMetadata.notAvailableAlertInfo[
139
- this.state.MailingCountry || "default"
140
- ];
127
+ return this.formMetadata.notAvailableAlertInfo;
141
128
  }
142
129
 
143
130
  get salesforceEmployeeAlertInfo() {