@meetelise/chat 1.20.46 → 1.20.47
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/src/MEChat.ts
CHANGED
|
@@ -19,7 +19,7 @@ export default class MEChat {
|
|
|
19
19
|
static meChat: MEChatLitElement | null = null;
|
|
20
20
|
|
|
21
21
|
static start(opts: Options): void {
|
|
22
|
-
// If our clients are Yardi and have a resident portal with rentcafe
|
|
22
|
+
// If our clients are Yardi and have a resident portal with rentcafe then
|
|
23
23
|
// we do NOT want to display the launcher (if following in shows up anywhere in url)
|
|
24
24
|
if (
|
|
25
25
|
window.location.pathname.includes("residentservices") ||
|
|
@@ -319,13 +319,16 @@ export class TourScheduler extends LitElement {
|
|
|
319
319
|
this.phoneNumber.length === 14
|
|
320
320
|
);
|
|
321
321
|
},
|
|
322
|
+
leadSource: (): boolean =>
|
|
323
|
+
this.leadSources.length > 0 ? !!this.selectedLeadSource?.value : true,
|
|
322
324
|
};
|
|
323
325
|
|
|
324
326
|
formIsValidForSubmission = (): boolean => {
|
|
325
327
|
const isValid =
|
|
326
328
|
this.validators.tourType() &&
|
|
327
329
|
this.validators.dateAndTime() &&
|
|
328
|
-
this.validators.leadInfo()
|
|
330
|
+
this.validators.leadInfo() &&
|
|
331
|
+
this.validators.leadSource();
|
|
329
332
|
return isValid;
|
|
330
333
|
};
|
|
331
334
|
|
|
@@ -141,6 +141,8 @@ export class EmailUsWindow extends LitElement {
|
|
|
141
141
|
@state()
|
|
142
142
|
hasMessageError = false;
|
|
143
143
|
@state()
|
|
144
|
+
hasLeadSourceError = false;
|
|
145
|
+
@state()
|
|
144
146
|
hasSubmittedForm = false;
|
|
145
147
|
@state()
|
|
146
148
|
windowHeight = 525;
|
|
@@ -206,6 +208,7 @@ export class EmailUsWindow extends LitElement {
|
|
|
206
208
|
this.hasEmailError = false;
|
|
207
209
|
this.hasPhoneNumberError = false;
|
|
208
210
|
this.hasMessageError = false;
|
|
211
|
+
this.hasLeadSourceError = false;
|
|
209
212
|
this.hasSubmissionError = false;
|
|
210
213
|
if (!this.firstName || !this.lastName) {
|
|
211
214
|
this.hasNameError = true;
|
|
@@ -219,6 +222,12 @@ export class EmailUsWindow extends LitElement {
|
|
|
219
222
|
if (!this.message) {
|
|
220
223
|
this.hasMessageError = true;
|
|
221
224
|
}
|
|
225
|
+
if (
|
|
226
|
+
this.leadSources.length > 0 &&
|
|
227
|
+
(!this.selectedLeadSource || !this.selectedLeadSource.value)
|
|
228
|
+
) {
|
|
229
|
+
this.hasLeadSourceError = true;
|
|
230
|
+
}
|
|
222
231
|
this.windowHeight = 525 + 30 * this.getNumErrors();
|
|
223
232
|
};
|
|
224
233
|
|
|
@@ -231,7 +240,8 @@ export class EmailUsWindow extends LitElement {
|
|
|
231
240
|
this.hasNameError ||
|
|
232
241
|
this.hasEmailError ||
|
|
233
242
|
this.hasPhoneNumberError ||
|
|
234
|
-
this.hasMessageError
|
|
243
|
+
this.hasMessageError ||
|
|
244
|
+
this.hasLeadSourceError
|
|
235
245
|
) {
|
|
236
246
|
return;
|
|
237
247
|
}
|
|
@@ -280,6 +290,7 @@ export class EmailUsWindow extends LitElement {
|
|
|
280
290
|
this.hasEmailError,
|
|
281
291
|
this.hasPhoneNumberError,
|
|
282
292
|
this.hasMessageError,
|
|
293
|
+
this.hasLeadSourceError,
|
|
283
294
|
this.hasSubmissionError,
|
|
284
295
|
].filter((v) => v).length;
|
|
285
296
|
};
|
|
@@ -412,6 +423,11 @@ export class EmailUsWindow extends LitElement {
|
|
|
412
423
|
}}
|
|
413
424
|
>
|
|
414
425
|
</me-select>
|
|
426
|
+
${this.hasLeadSourceError
|
|
427
|
+
? html`
|
|
428
|
+
<div class="email-us__error-text">Include a source</div>
|
|
429
|
+
`
|
|
430
|
+
: ""}
|
|
415
431
|
`
|
|
416
432
|
: ""}
|
|
417
433
|
<div class="email-us__vertical-spacer"></div>
|