@meetelise/chat 1.51.3 → 1.51.5
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/dist/src/WebComponent/Scheduler/tour-scheduler.d.ts +2 -0
- package/dist/src/WebComponent/launcher/Launcher.d.ts +1 -0
- package/dist/src/WebComponent/me-chat.d.ts +1 -0
- package/dist/src/analytics.d.ts +2 -1
- package/dist/src/fetchFeatureFlag.d.ts +1 -0
- package/package.json +1 -1
- package/public/dist/index.js +229 -227
- package/src/MyPubnub.ts +6 -0
- package/src/WebComponent/FeeCalculator/fee-calculator.ts +1 -0
- package/src/WebComponent/Scheduler/tour-scheduler.ts +11 -2
- package/src/WebComponent/launcher/Launcher.ts +3 -0
- package/src/WebComponent/me-chat.ts +16 -6
- package/src/analytics.ts +4 -1
- package/src/fetchBuildingUnitsSummary.ts +1 -0
- package/src/fetchFeatureFlag.ts +22 -0
- package/src/getBuildingPhoneNumber.ts +1 -0
- package/src/insertDNIIntoWebsite.ts +1 -0
- package/src/services/fees/calculateQuote.ts +1 -0
- package/src/services/fees/downloadQuotePdf.ts +1 -0
- package/src/services/fees/fetchBuildingFees.ts +1 -0
- package/src/services/fees/fetchBuildingFeesV2.ts +1 -0
- package/src/services/fees/fetchBuildingFloorplans.ts +1 -0
- package/src/services/fees/fetchBuildingUnits.ts +1 -0
package/src/MyPubnub.ts
CHANGED
|
@@ -241,6 +241,7 @@ class MyPubnub {
|
|
|
241
241
|
logType: LogType.error,
|
|
242
242
|
buildingSlug: this.buildingSlug,
|
|
243
243
|
orgSlug: this.orgSlug,
|
|
244
|
+
error,
|
|
244
245
|
});
|
|
245
246
|
}
|
|
246
247
|
return null;
|
|
@@ -369,6 +370,7 @@ class MyPubnub {
|
|
|
369
370
|
logType: LogType.error,
|
|
370
371
|
buildingSlug: this.buildingSlug,
|
|
371
372
|
orgSlug: this.orgSlug,
|
|
373
|
+
error,
|
|
372
374
|
});
|
|
373
375
|
}
|
|
374
376
|
}
|
|
@@ -388,6 +390,7 @@ class MyPubnub {
|
|
|
388
390
|
logType: LogType.error,
|
|
389
391
|
buildingSlug: this.buildingSlug,
|
|
390
392
|
orgSlug: this.orgSlug,
|
|
393
|
+
error,
|
|
391
394
|
});
|
|
392
395
|
}
|
|
393
396
|
}
|
|
@@ -424,6 +427,7 @@ class MyPubnub {
|
|
|
424
427
|
logType: LogType.error,
|
|
425
428
|
buildingSlug: this.buildingSlug,
|
|
426
429
|
orgSlug: this.orgSlug,
|
|
430
|
+
error: retryError,
|
|
427
431
|
});
|
|
428
432
|
}
|
|
429
433
|
}
|
|
@@ -555,6 +559,7 @@ class MyPubnub {
|
|
|
555
559
|
logType: LogType.warn,
|
|
556
560
|
buildingSlug: this.buildingSlug,
|
|
557
561
|
orgSlug: this.orgSlug,
|
|
562
|
+
error,
|
|
558
563
|
});
|
|
559
564
|
}
|
|
560
565
|
}
|
|
@@ -578,6 +583,7 @@ class MyPubnub {
|
|
|
578
583
|
logType: LogType.error,
|
|
579
584
|
buildingSlug: this.buildingSlug,
|
|
580
585
|
orgSlug: this.orgSlug,
|
|
586
|
+
error,
|
|
581
587
|
});
|
|
582
588
|
}
|
|
583
589
|
}
|
|
@@ -124,6 +124,8 @@ export class TourScheduler extends LitElement {
|
|
|
124
124
|
orgSlug = "";
|
|
125
125
|
@property({ attribute: true })
|
|
126
126
|
hasDynamicSchedulingEnabled = false;
|
|
127
|
+
@property({ attribute: true })
|
|
128
|
+
bedroomPreferenceRequired = false;
|
|
127
129
|
|
|
128
130
|
@property({ attribute: true })
|
|
129
131
|
private leadSourceClient: LeadSourceClient | null = null;
|
|
@@ -352,6 +354,7 @@ export class TourScheduler extends LitElement {
|
|
|
352
354
|
logType: LogType.error,
|
|
353
355
|
buildingSlug: this.buildingSlug,
|
|
354
356
|
orgSlug: this.orgSlug,
|
|
357
|
+
error: e,
|
|
355
358
|
});
|
|
356
359
|
}
|
|
357
360
|
};
|
|
@@ -483,6 +486,7 @@ export class TourScheduler extends LitElement {
|
|
|
483
486
|
logType: LogType.error,
|
|
484
487
|
buildingSlug: this.buildingSlug,
|
|
485
488
|
orgSlug: this.orgSlug,
|
|
489
|
+
error: e,
|
|
486
490
|
});
|
|
487
491
|
}
|
|
488
492
|
};
|
|
@@ -658,13 +662,16 @@ export class TourScheduler extends LitElement {
|
|
|
658
662
|
!!this.phoneNumberE164
|
|
659
663
|
);
|
|
660
664
|
},
|
|
665
|
+
layout: (): boolean =>
|
|
666
|
+
!this.bedroomPreferenceRequired || !!this.selectedLayoutValue,
|
|
661
667
|
};
|
|
662
668
|
|
|
663
669
|
formIsValidForSubmission = (): boolean => {
|
|
664
670
|
const isValid =
|
|
665
671
|
this.validators.tourType() &&
|
|
666
672
|
this.validators.dateAndTime() &&
|
|
667
|
-
this.validators.leadInfo()
|
|
673
|
+
this.validators.leadInfo() &&
|
|
674
|
+
this.validators.layout();
|
|
668
675
|
return isValid;
|
|
669
676
|
};
|
|
670
677
|
|
|
@@ -1301,7 +1308,9 @@ export class TourScheduler extends LitElement {
|
|
|
1301
1308
|
${this.layoutOptions.length > 0
|
|
1302
1309
|
? html` <me-select
|
|
1303
1310
|
id="layout"
|
|
1304
|
-
placeholder
|
|
1311
|
+
placeholder=${this.bedroomPreferenceRequired
|
|
1312
|
+
? "Bedroom preference"
|
|
1313
|
+
: "Bedroom preference (optional)"}
|
|
1305
1314
|
.options="${this.layoutOptions.map((o) => ({
|
|
1306
1315
|
label: o.label,
|
|
1307
1316
|
value: layoutValueToCanonical(o.value),
|
|
@@ -151,6 +151,8 @@ export class Launcher extends LitElement {
|
|
|
151
151
|
@property({ attribute: false })
|
|
152
152
|
layoutOptions: LayoutOption[] = [];
|
|
153
153
|
@property({ attribute: true })
|
|
154
|
+
bedroomPreferenceRequired = false;
|
|
155
|
+
@property({ attribute: true })
|
|
154
156
|
hasDynamicSchedulingEnabled = false;
|
|
155
157
|
|
|
156
158
|
@property({ attribute: true })
|
|
@@ -1310,6 +1312,7 @@ export class Launcher extends LitElement {
|
|
|
1310
1312
|
.leadSources="${this.leadSources}"
|
|
1311
1313
|
.tourTypeOptions=${this.tourTypeOptions}
|
|
1312
1314
|
.layoutOptions=${this.layoutOptions}
|
|
1315
|
+
.bedroomPreferenceRequired=${this.bedroomPreferenceRequired}
|
|
1313
1316
|
.orgLegalName=${this.orgLegalName}
|
|
1314
1317
|
.country=${this.country}
|
|
1315
1318
|
buildingId=${this.buildingId}
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
FeatureFlagsShowDropdown,
|
|
15
15
|
fetchFeatureFlagUseApplicationsLinkReplacement,
|
|
16
16
|
fetchFeatureFlagUseOverrideContactUsForm,
|
|
17
|
+
fetchTrackedRolloutBedroomPreferenceRequired,
|
|
17
18
|
} from "../fetchFeatureFlag";
|
|
18
19
|
import { HIDE_DATA_LAYER_PII_ORG_IDS, setGtmPiiRedaction } from "../gtm";
|
|
19
20
|
import fetchPhoneNumberFromSource, {
|
|
@@ -173,6 +174,8 @@ export class MEChat extends LitElement {
|
|
|
173
174
|
private featureFlagShowDropdown: FeatureFlagsShowDropdown =
|
|
174
175
|
FeatureFlagsShowDropdown.always;
|
|
175
176
|
@state()
|
|
177
|
+
private bedroomPreferenceRequired = false;
|
|
178
|
+
@state()
|
|
176
179
|
private phoneNumberForSource: NumberForSelectedSource | null = null;
|
|
177
180
|
@state()
|
|
178
181
|
private hasMounted = false;
|
|
@@ -360,12 +363,17 @@ export class MEChat extends LitElement {
|
|
|
360
363
|
HIDE_DATA_LAYER_PII_ORG_IDS.includes(buildingDetails.orgId)
|
|
361
364
|
);
|
|
362
365
|
|
|
363
|
-
const [
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
366
|
+
const [
|
|
367
|
+
leadSources,
|
|
368
|
+
featureFlagUseApplicationsLinkReplacement,
|
|
369
|
+
isAip,
|
|
370
|
+
bedroomPreferenceRequired,
|
|
371
|
+
] = await Promise.all([
|
|
372
|
+
fetchLeadSources(this.orgSlug, this.buildingSlug),
|
|
373
|
+
fetchFeatureFlagUseApplicationsLinkReplacement(this.buildingSlug),
|
|
374
|
+
fetchBuildingAip(this.buildingSlug),
|
|
375
|
+
fetchTrackedRolloutBedroomPreferenceRequired(this.buildingSlug),
|
|
376
|
+
]);
|
|
369
377
|
|
|
370
378
|
if (this.buildingWebchatView) {
|
|
371
379
|
this.buildingWebchatView.phoneNumber = formatPhoneNumber(
|
|
@@ -376,6 +384,7 @@ export class MEChat extends LitElement {
|
|
|
376
384
|
this.leadSources = leadSources;
|
|
377
385
|
this.featureFlagShowDropdown =
|
|
378
386
|
featureFlagShowDropdown as FeatureFlagsShowDropdown;
|
|
387
|
+
this.bedroomPreferenceRequired = bedroomPreferenceRequired;
|
|
379
388
|
|
|
380
389
|
// The backend is cached for ~4 hours, so falling back to the existing api request until the cache propagates all the changes
|
|
381
390
|
const buildingPhoneNumber = buildingDetails.textWithUsPhoneNumber
|
|
@@ -1022,6 +1031,7 @@ export class MEChat extends LitElement {
|
|
|
1022
1031
|
?.tourTypeOptions ?? []}
|
|
1023
1032
|
.layoutOptions=${this.buildingWebchatView?.layoutOptions ??
|
|
1024
1033
|
[]}
|
|
1034
|
+
.bedroomPreferenceRequired=${this.bedroomPreferenceRequired}
|
|
1025
1035
|
.launcherStyles=${this.launcherStyles}
|
|
1026
1036
|
.primaryColor=${this.primaryColor}
|
|
1027
1037
|
.backgroundColor=${this.backgroundColor}
|
package/src/analytics.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import axios from "axios";
|
|
1
|
+
import axios, { AxiosError } from "axios";
|
|
2
2
|
import { getCookieValue } from "./utils";
|
|
3
3
|
|
|
4
4
|
declare global {
|
|
@@ -154,13 +154,16 @@ export const sendLoggingEvent = async ({
|
|
|
154
154
|
orgSlug,
|
|
155
155
|
logTitle,
|
|
156
156
|
logData,
|
|
157
|
+
error,
|
|
157
158
|
}: {
|
|
158
159
|
logType?: LogType;
|
|
159
160
|
buildingSlug?: string;
|
|
160
161
|
orgSlug?: string;
|
|
161
162
|
logTitle: string;
|
|
162
163
|
logData: Record<string, unknown> | null;
|
|
164
|
+
error?: unknown;
|
|
163
165
|
}): Promise<void> => {
|
|
166
|
+
if (error instanceof AxiosError && error.response?.status === 403) return;
|
|
164
167
|
const host = "https://app.meetelise.com";
|
|
165
168
|
await axios.post(
|
|
166
169
|
`${host}/platformApi/webchat/logging`,
|
package/src/fetchFeatureFlag.ts
CHANGED
|
@@ -114,3 +114,25 @@ export async function fetchFeatureFlagUseApplicationsLinkReplacement(
|
|
|
114
114
|
return false;
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
+
|
|
118
|
+
const trackedRolloutEndpoint = (buildingSlug: string): string => {
|
|
119
|
+
const host = "https://app.meetelise.com";
|
|
120
|
+
return `${host}/platformApi/webchat/${buildingSlug}/tracked-rollout`;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export async function fetchTrackedRolloutBedroomPreferenceRequired(
|
|
124
|
+
buildingSlug: string
|
|
125
|
+
): Promise<boolean> {
|
|
126
|
+
if (!buildingSlug) return false;
|
|
127
|
+
try {
|
|
128
|
+
const response = await axios.get(trackedRolloutEndpoint(buildingSlug), {
|
|
129
|
+
params: {
|
|
130
|
+
rollout_name: "webchat_bedroom_preference_required",
|
|
131
|
+
default_value: false,
|
|
132
|
+
},
|
|
133
|
+
});
|
|
134
|
+
return response.data;
|
|
135
|
+
} catch (_) {
|
|
136
|
+
return false;
|
|
137
|
+
}
|
|
138
|
+
}
|