Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Livechat] Refactor setGuestPhone to remove entry upon empty string #1139

Closed
ear-dev opened this issue Apr 12, 2022 · 4 comments
Closed

[Livechat] Refactor setGuestPhone to remove entry upon empty string #1139

ear-dev opened this issue Apr 12, 2022 · 4 comments
Assignees

Comments

@ear-dev
Copy link

ear-dev commented Apr 12, 2022

We added setGuestPhone() to livechat so that we could set that with our test widget. It turns out that the livechat data is persistent and stored on the server side, so we need a new method unsetGuestPhone() in order to have the ability to clear the number when we don't want to use it.

@ear-dev
Copy link
Author

ear-dev commented Apr 14, 2022

Design: do not create an unset function.... factor the current function remove the telephoneNumber entry in mongodb if we send it an empty string.

  • we will adjust the test widget to always call setGuestPhone()

@ear-dev ear-dev changed the title [Livechat] Add function to unset guestPhone [Livechat] Refactor setGuestPhone to remove entry upon empty string Apr 14, 2022
@AlexanderKanakis
Copy link
Collaborator

Updated PRs:
https://github.com/WideChat/Rocket.Chat.IntegrationTests/pull/3
#1142
WideChat/Rocket.Chat.Livechat#141

Created unsetGuestPhone function, which is used on the IntegrationTest widget when the guest phone number is empty.

@Shailesh351
Copy link

@ear-dev As discussed in the meeting yesterday, because @AlexanderKanakis is currently away due to medical treatment I have created below PRs to fix this issue. Thanks!

Rocket.Chat: #1178
Rocket.Chat.Livechat: WideChat/Rocket.Chat.Livechat#143

  • To set visitor phone: this.setGuestPhone(<phoneNumber>)
  • To unset visitor phone pass ''/null/undefined or just blank as fn argument: this.setGuestPhone()/this.setGuestPhone('')

@ear-dev
Copy link
Author

ear-dev commented May 13, 2022

Thanks @Shailesh351 I will test as well....

@ear-dev ear-dev closed this as completed May 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants