@meetelise/chat 1.43.0 → 1.43.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.
@@ -11,14 +11,9 @@ import fetchBuildingWebchatView, {
11
11
  import Analytics, { logSignal, LogType, sendLoggingEvent } from "../analytics";
12
12
  import {
13
13
  FeatureFlagsShowDropdown,
14
- fetchFeatureFlagInsertDNIWebsite,
15
- fetchFeatureFlagReplaceScheduleTourCtaWebsite,
16
- fetchFeatureFlagShowMarketingSourceDropdown,
17
14
  fetchFeatureFlagUseApplicationsLinkReplacement,
18
15
  fetchFeatureFlagUseOverrideContactUsForm,
19
- fetchFeatureFlagUsePhoneNumberBySource,
20
16
  } from "../fetchFeatureFlag";
21
- import fetchBuildingABTestType from "../fetchBuildingABTestType";
22
17
  import fetchPhoneNumberFromSource, {
23
18
  NumberForSelectedSource,
24
19
  } from "../fetchPhoneNumberFromSource";
@@ -329,32 +324,29 @@ export class MEChat extends LitElement {
329
324
  );
330
325
  }
331
326
 
332
- const [
333
- buildingABTest,
334
- leadSources,
335
- featureFlagShowDropdown,
336
- featureFlagUseDNI,
337
- featureFlagInsertDNIWebsite,
338
- featureFlagReplaceScheduleTourCtaWebsite,
339
- featureFlagUseApplicationsLinkReplacement,
340
- ] = await Promise.all([
341
- fetchBuildingABTestType(this.buildingSlug),
342
- fetchLeadSources(this.orgSlug, this.buildingSlug),
343
- fetchFeatureFlagShowMarketingSourceDropdown(this.buildingSlug),
344
- fetchFeatureFlagUsePhoneNumberBySource(this.buildingSlug),
345
- fetchFeatureFlagInsertDNIWebsite(this.buildingSlug),
346
- fetchFeatureFlagReplaceScheduleTourCtaWebsite(this.buildingSlug),
347
- fetchFeatureFlagUseApplicationsLinkReplacement(this.buildingSlug),
348
- ]);
327
+ const featureFlagShowDropdown =
328
+ buildingDetails.featureFlagWebchatMarketingSourceDropdownConfiguration;
329
+ const featureFlagUseDNI =
330
+ buildingDetails.featureFlagWebchatUseDniPhoneNumberBySource;
331
+ const featureFlagInsertDNIWebsite =
332
+ buildingDetails.featureFlagInsertDniIntoWebsite;
333
+ const featureFlagReplaceScheduleTourCtaWebsite =
334
+ buildingDetails.featureFlagWebchatReplaceAnyScheduleTourCtaWebsite;
335
+
336
+ const [leadSources, featureFlagUseApplicationsLinkReplacement] =
337
+ await Promise.all([
338
+ fetchLeadSources(this.orgSlug, this.buildingSlug),
339
+ fetchFeatureFlagUseApplicationsLinkReplacement(this.buildingSlug),
340
+ ]);
349
341
 
350
342
  if (this.buildingWebchatView) {
351
343
  this.buildingWebchatView.phoneNumber = formatPhoneNumber(
352
344
  buildingDetails.phoneNumber
353
345
  );
354
346
  }
355
- this.designConcept = buildingABTest?.abTestType ?? "";
356
347
  this.leadSources = leadSources;
357
- this.featureFlagShowDropdown = featureFlagShowDropdown;
348
+ this.featureFlagShowDropdown =
349
+ featureFlagShowDropdown as FeatureFlagsShowDropdown;
358
350
 
359
351
  // The backend is cached for ~4 hours, so falling back to the existing api request until the cache propagates all the changes
360
352
  const buildingPhoneNumber = buildingDetails.textWithUsPhoneNumber
@@ -139,6 +139,10 @@ export interface BuildingWebchatView {
139
139
  autoOpenChat: boolean | null;
140
140
  isInheritingFromOrg: boolean | null;
141
141
  isGlobalDefault: boolean | null;
142
+ featureFlagWebchatMarketingSourceDropdownConfiguration: string;
143
+ featureFlagWebchatUseDniPhoneNumberBySource: boolean;
144
+ featureFlagInsertDniIntoWebsite: boolean;
145
+ featureFlagWebchatReplaceAnyScheduleTourCtaWebsite: boolean;
142
146
  }
143
147
 
144
148
  /**
@@ -8,12 +8,6 @@ const featureFlagEndpointV1 = (buildingSlug: string): string => {
8
8
  return `${host}/platformApi/webchat/${buildingSlug}/chat-ui-feature-flag`;
9
9
  };
10
10
 
11
- // V2 reads from conversation flag table (preferred)
12
- const featureFlagEndpointV2 = (buildingSlug: string): string => {
13
- const host = "https://app.meetelise.com";
14
- return `${host}/platformApi/webchat/${buildingSlug}/v2/chat-ui-feature-flag`;
15
- };
16
-
17
11
  export enum FeatureFlagsShowDropdown {
18
12
  onAttributionFailure = "on-attribution-failure",
19
13
  never = "never", // note, the dropdown will NOT show up if there are also no lead sources (list)!
@@ -45,62 +39,6 @@ export async function fetchFeatureFlagMaintenanceMode(
45
39
  }
46
40
  }
47
41
 
48
- export async function fetchFeatureFlagShowMarketingSourceDropdown(
49
- buildingSlug: string
50
- ): Promise<FeatureFlagsShowDropdown> {
51
- if (!buildingSlug) {
52
- return FeatureFlagsShowDropdown.always;
53
- }
54
- try {
55
- const featureFlagResponse = await axios.get(
56
- featureFlagEndpointV1(buildingSlug),
57
- {
58
- params: {
59
- building_slug: buildingSlug,
60
- flag_type: "string",
61
- feature_flag: "webchat-marketing-source-dropdown-configuration",
62
- default_str: "always",
63
- default_bool: true,
64
- },
65
- }
66
- );
67
- if (featureFlagResponse.data === "on-attribution-failure") {
68
- return FeatureFlagsShowDropdown.onAttributionFailure;
69
- }
70
- if (featureFlagResponse.data === "never") {
71
- return FeatureFlagsShowDropdown.never;
72
- }
73
- return FeatureFlagsShowDropdown.always;
74
- } catch (_) {
75
- return FeatureFlagsShowDropdown.always;
76
- }
77
- }
78
-
79
- export async function fetchFeatureFlagUsePhoneNumberBySource(
80
- buildingSlug: string
81
- ): Promise<boolean> {
82
- if (!buildingSlug) {
83
- return false;
84
- }
85
- try {
86
- const featureFlagResponse = await axios.get(
87
- featureFlagEndpointV1(buildingSlug),
88
- {
89
- params: {
90
- building_slug: buildingSlug,
91
- flag_type: "bool",
92
- feature_flag: "webchat-use-dni-phone-number-by-source",
93
- default_str: null,
94
- default_bool: false,
95
- },
96
- }
97
- );
98
- return featureFlagResponse.data;
99
- } catch (_) {
100
- return false;
101
- }
102
- }
103
-
104
42
  export async function fetchFeatureFlagUseOverrideContactUsForm(
105
43
  buildingSlug: string
106
44
  ): Promise<boolean> {
@@ -125,53 +63,6 @@ export async function fetchFeatureFlagUseOverrideContactUsForm(
125
63
  return false;
126
64
  }
127
65
  }
128
- export async function fetchFeatureFlagUsePubnub(
129
- buildingSlug?: string
130
- ): Promise<boolean> {
131
- if (!buildingSlug) {
132
- return false;
133
- }
134
- try {
135
- const featureFlagResponse = await axios.get(
136
- featureFlagEndpointV1(buildingSlug),
137
- {
138
- params: {
139
- building_slug: buildingSlug,
140
- flag_type: "bool",
141
- feature_flag: "use-pubnub-chat-provider",
142
- default_str: null,
143
- default_bool: false,
144
- },
145
- }
146
- );
147
- return featureFlagResponse.data;
148
- } catch (_) {
149
- return false;
150
- }
151
- }
152
-
153
- export async function fetchFeatureFlagInsertDNIWebsite(
154
- buildingSlug?: string
155
- ): Promise<boolean> {
156
- if (!buildingSlug) {
157
- return false;
158
- }
159
- try {
160
- const featureFlagResponse = await axios.get(
161
- featureFlagEndpointV2(buildingSlug),
162
- {
163
- params: {
164
- building_slug: buildingSlug,
165
- feature_flag_name: "insert_dni_into_website",
166
- default_value: false,
167
- },
168
- }
169
- );
170
- return featureFlagResponse.data;
171
- } catch (_) {
172
- return false;
173
- }
174
- }
175
66
 
176
67
  export async function fetchFeatureFlagShowUtilities(
177
68
  orgSlug: string
@@ -199,31 +90,6 @@ export async function fetchFeatureFlagShowUtilities(
199
90
  }
200
91
  }
201
92
 
202
- export async function fetchFeatureFlagReplaceScheduleTourCtaWebsite(
203
- buildingSlug: string
204
- ): Promise<boolean> {
205
- if (!buildingSlug) {
206
- return false;
207
- }
208
- try {
209
- const featureFlagResponse = await axios.get(
210
- featureFlagEndpointV1(buildingSlug),
211
- {
212
- params: {
213
- building_slug: buildingSlug,
214
- flag_type: "bool",
215
- feature_flag: "webchat-replace-any-schedule-tour-cta-website",
216
- default_str: null,
217
- default_bool: false,
218
- },
219
- }
220
- );
221
- return featureFlagResponse.data;
222
- } catch (_) {
223
- return false;
224
- }
225
- }
226
-
227
93
  export async function fetchFeatureFlagUseApplicationsLinkReplacement(
228
94
  buildingSlug: string
229
95
  ): Promise<boolean> {
@@ -19,6 +19,7 @@ export const replaceSelectButtonsWithNewLink = (
19
19
  /\/onlineleasing.*\/oleapplication\.aspx(\?.*)?$/,
20
20
  /vsc\.myresman\.com\/Portal\/Applicants\/Availability(\?.*)?$/,
21
21
  /vsc\.myresman\.com\/Portal\/Applicants\/New\/.*(\?.*)?$/,
22
+ /busboomgroup\.myresman\.com\/Portal\/Applicants\/Availability(\?.*)?$/,
22
23
  ];
23
24
 
24
25
  const allElements = document.body.getElementsByTagName("a");
@@ -82,7 +83,13 @@ const getMutatedApplicationLink = (
82
83
  buttonText: string,
83
84
  newApplicationLink: string
84
85
  ) => {
85
- const relevantText = ["floor plan", "floorplan", "floor plans", "floorplans"];
86
+ const relevantText = [
87
+ "floor plan",
88
+ "floorplan",
89
+ "floor plans",
90
+ "floorplans",
91
+ "apply here",
92
+ ];
86
93
  if (relevantText.some((t) => buttonText.toLowerCase().includes(t))) {
87
94
  return `${newApplicationLink}/units`;
88
95
  }
@@ -1,8 +0,0 @@
1
- interface BuildingABType {
2
- abTestType: string;
3
- }
4
- export declare enum abTestTypes {
5
- "ConceptEmoji" = "Concept 2 (Blue/White)"
6
- }
7
- export default function fetchBuildingABTestType(buildingSlug: string): Promise<BuildingABType | null>;
8
- export {};