@meetelise/chat 1.13.6 → 1.13.9

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.
@@ -80,17 +80,11 @@ export class Launcher extends LitElement {
80
80
  this.attachOnClickToTextUsWindow();
81
81
  this.attachOnClickToSSTWindow();
82
82
  if (this.buildingId) {
83
- try {
84
- const registeredPhoneNumbers = await getRegisteredPhoneNumbers(
85
- this.buildingId
86
- );
87
- this.hasTextUsEnabled =
88
- registeredPhoneNumbers.length > 0 && this.buildingId !== 4895;
89
- } catch (e) {
90
- // TEMPORARY until we can fix the ivr endpoint to use https
91
- // eslint-disable-next-line no-console
92
- console.warn(e);
93
- }
83
+ const registeredPhoneNumbers = await getRegisteredPhoneNumbers(
84
+ this.buildingId
85
+ );
86
+ this.hasTextUsEnabled =
87
+ registeredPhoneNumbers.length > 0 && this.buildingId !== 4895;
94
88
  if (this.buildingId === 3660) {
95
89
  this.hasSSTEnabled = true;
96
90
  }
@@ -185,6 +185,9 @@ export class TourScheduler extends LitElement {
185
185
  };
186
186
 
187
187
  handlePhoneKeyup = (e: KeyboardEvent): void => {
188
+ if (!e.key) {
189
+ return;
190
+ }
188
191
  // After formatting, place the cursor where it was before, defined as "before the digit that followed it before formatting, if any, otherwise at the end".
189
192
  // (We never want the cursor to be before a punctuation mark because the next digit typed will appear after the punctuation mark, not before.)
190
193
  // If we don't do this, the cursor automatically goes to the end when we set `this.phoneNumber`.
@@ -230,12 +233,15 @@ export class TourScheduler extends LitElement {
230
233
  validators = {
231
234
  tourType: (): boolean => !isNaN(this.tourType),
232
235
  dateAndTime: (): boolean => !!this.selectedDate && !!this.selectedTime,
233
- leadInfo: (): boolean =>
234
- !!this.nameInput?.value &&
235
- this.emailInput?.value.includes("@") &&
236
- // TODO: deleting phone number doesn't cause validation to fail, at least on mobile
237
- !!this.phoneNumber &&
238
- this.phoneNumber.length === 14,
236
+ leadInfo: (): boolean => {
237
+ return (
238
+ !!this.nameInput?.value &&
239
+ this.emailInput?.value.includes("@") &&
240
+ // TODO: deleting phone number doesn't cause validation to fail, at least on mobile
241
+ !!this.phoneNumber &&
242
+ this.phoneNumber.length === 14
243
+ );
244
+ },
239
245
  };
240
246
 
241
247
  formIsValidForSubmission = (): boolean => {
@@ -803,14 +809,19 @@ export class TourScheduler extends LitElement {
803
809
  userInfoAndLayoutMenu(): TemplateResult {
804
810
  return html`<h2 id="yourInformation">Your information</h2>
805
811
  <div id="yourInformationMenu">
806
- <input type="text" placeholder="Name" id="name" />
812
+ <input
813
+ type="text"
814
+ placeholder="Name"
815
+ id="name"
816
+ @input=${() => this.requestUpdate()}
817
+ />
807
818
  <input
808
819
  type="email"
809
820
  inputmode="email"
810
821
  placeholder="Email"
811
822
  id="email"
812
823
  .value=${this.email}
813
- @keyup=${this.onChangeEmail}
824
+ @input=${this.onChangeEmail}
814
825
  />
815
826
  <input
816
827
  type="tel"
@@ -821,7 +832,14 @@ export class TourScheduler extends LitElement {
821
832
  .value=${this.phoneNumber}
822
833
  @keydown=${this.handlePhoneKeydown}
823
834
  @keyup=${this.handlePhoneKeyup}
824
- @change=${() => this.requestUpdate()}
835
+ @input=${(e: Event) => {
836
+ if (!e.target) {
837
+ return;
838
+ }
839
+ this.phoneNumber = formatToPhone(
840
+ (e.target as HTMLInputElement).value
841
+ );
842
+ }}
825
843
  />
826
844
  </div>
827
845
 
@@ -49,7 +49,7 @@ export const getRegisteredPhoneNumbers = async (
49
49
  if (registeredPhoneNumbersCache[buildingId]) {
50
50
  return registeredPhoneNumbersCache[buildingId];
51
51
  }
52
- const url = `http://ivr.internal-meetelise.com/sms_management_numbers/webchat/building/${buildingId}/numbers`;
52
+ const url = `https://app.meetelise.com/sms_management_numbers/webchat/building/${buildingId}/numbers`;
53
53
  const result = await axios.get<ManagementSmsNumber[]>(url);
54
54
  registeredPhoneNumbersCache[buildingId] = result.data;
55
55
  return result.data;