@salesforcedevs/dw-components 1.3.252 → 1.3.259

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.252",
3
+ "version": "1.3.259",
4
4
  "description": "Lightning web components for https://developer.salesforce.com",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -24,5 +24,5 @@
24
24
  "@types/setimmediate": "^1.0.2",
25
25
  "setimmediate": "^1.0.5"
26
26
  },
27
- "gitHead": "8379eb747571af22dfdfc3c440e8c23c85d1fe8b"
27
+ "gitHead": "5096835f5d0a2d8cd5bf67ab844b919a89c40758"
28
28
  }
@@ -3,6 +3,7 @@ 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";
6
7
 
7
8
  const DRM_SUCCESS_STRING = "success";
8
9
 
@@ -18,8 +19,8 @@ export type StepDatum = {
18
19
  formId?: string;
19
20
  j2sTerms?: string;
20
21
  notAvailableAlertInfo?: {
21
- title: string;
22
- body: string;
22
+ default: AlertInfo;
23
+ [key: string]: AlertInfo;
23
24
  };
24
25
  participatingCountryCodes?: string[];
25
26
  salesforceEmployeeAlertInfo?: {
@@ -1,10 +1,15 @@
1
1
  import { toJson } from "dxUtils/normalizers";
2
2
  import { stateMap } from "dwUtils/forms";
3
+ import { DateTime } from "luxon";
3
4
  import { api } from "lwc";
4
5
  import debounce from "debounce";
5
6
  import { LightningElementWithState } from "dxBaseElements/lightningElementWithState";
6
7
  import { DrmFormData } from "dw/j2sCardSequence";
7
8
 
9
+ const closingTimeUSCanada = DateTime.fromISO("2024-05-09", {
10
+ zone: "America/Los_Angeles"
11
+ });
12
+
8
13
  // Hard-coding for now because we can't get information about an endpoint for this
9
14
  const tbidValidRoles = [
10
15
  "Developer",
@@ -96,11 +101,17 @@ export default class J2sForm extends LightningElementWithState<J2sFormState> {
96
101
  }
97
102
  }
98
103
 
99
- private participatingCountryCodes = ["US", "CA", "IN"];
100
104
  private countriesWithReferralInput = ["IN"];
101
105
  private requiredFormFields: HTMLElement[] = [];
102
106
  private showSubmitFailureAlert = false;
103
107
 
108
+ get participatingCountryCodes() {
109
+ if (DateTime.local() >= closingTimeUSCanada) {
110
+ return ["IN"];
111
+ }
112
+ return ["US", "CA", "IN"];
113
+ }
114
+
104
115
  get isNotParticipatingCountry() {
105
116
  return !this.isParticipatingCountry(this.state.MailingCountry);
106
117
  }
@@ -124,7 +135,9 @@ export default class J2sForm extends LightningElementWithState<J2sFormState> {
124
135
  }
125
136
 
126
137
  get notAvailableAlertInfo() {
127
- return this.formMetadata.notAvailableAlertInfo;
138
+ return this.formMetadata.notAvailableAlertInfo[
139
+ this.state.MailingCountry || "default"
140
+ ];
128
141
  }
129
142
 
130
143
  get salesforceEmployeeAlertInfo() {
@@ -253,10 +266,8 @@ export default class J2sForm extends LightningElementWithState<J2sFormState> {
253
266
  handleFormFieldChange = (evt: CustomEvent) => {
254
267
  // Event target information must be read prior to debouncing; the target is gone after the debounce.
255
268
  const { target = {}, detail } = evt;
256
- const {
257
- name: targetName,
258
- required: isRequiredField
259
- } = target as HTMLInputElement;
269
+ const { name: targetName, required: isRequiredField } =
270
+ target as HTMLInputElement;
260
271
  const value =
261
272
  typeof detail === "string"
262
273
  ? detail