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

Simulator functionality #558

Merged
merged 21 commits into from
Oct 8, 2020
Merged

Simulator functionality #558

merged 21 commits into from
Oct 8, 2020

Conversation

rathorevaibhav
Copy link
Contributor

Summary

Simulator functionality

Test Plan

Added

@rathorevaibhav rathorevaibhav self-assigned this Oct 6, 2020
@rathorevaibhav rathorevaibhav added this to the v0.4 milestone Oct 6, 2020
@rathorevaibhav rathorevaibhav linked an issue Oct 6, 2020 that may be closed by this pull request
@rathorevaibhav rathorevaibhav modified the milestones: v0.4, v0.3.4 Oct 6, 2020
@rathorevaibhav rathorevaibhav marked this pull request as ready for review October 7, 2020 11:06
@codecov-io
Copy link

codecov-io commented Oct 7, 2020

Codecov Report

Merging #558 into master will decrease coverage by 0.05%.
The diff coverage is 62.90%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #558      +/-   ##
==========================================
- Coverage   75.88%   75.82%   -0.06%     
==========================================
  Files         132      133       +1     
  Lines        2641     2697      +56     
  Branches      495      508      +13     
==========================================
+ Hits         2004     2045      +41     
- Misses        455      464       +9     
- Partials      182      188       +6     
Impacted Files Coverage Δ
...ners/Chat/ChatMessages/ChatMessage/ChatMessage.tsx 76.38% <20.00%> (ø)
src/containers/Chat/Chat.tsx 69.76% <50.00%> (-2.03%) ⬇️
...iners/Chat/ChatConversations/ChatConversations.tsx 53.73% <66.66%> (+0.50%) ⬆️
src/components/simulator/Simulator.tsx 69.04% <69.04%> (ø)
src/common/constants.ts 100.00% <100.00%> (ø)
src/components/UI/Timer/Timer.tsx 68.18% <0.00%> (-9.10%) ⬇️
src/graphql/mutations/Automation.ts 100.00% <0.00%> (ø)
...rc/containers/Collection/Collection.test.helper.ts 100.00% <0.00%> (ø)
src/containers/Collection/Collection.tsx 45.76% <0.00%> (+0.30%) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 32053ce...42f7550. Read the comment docs.

src/containers/Chat/Chat.tsx Outdated Show resolved Hide resolved
.env.example Outdated
@@ -1,3 +1,4 @@
REACT_APP_API_PREFIX="api"
SENTRY_DSN=""
REACT_APP_GLIFIC_API_PORT=4000
REACT_APP_SIMULATOR_CONTACT_NUMBER="9876543210"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to define the phone number here? Since it will be used internally should we define it in constant?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is something we're unsure of what exactly would be the number. So added this flexibility that it can easily changed in Glific installations by others

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are not sending actual messages, so in a way, the number does not matter right?

Copy link
Contributor Author

@rathorevaibhav rathorevaibhav Oct 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the number needs to be tracked by the backend as it is treated as a contact and the messages are stored.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove "REACT_APP_SIMULATOR_CONTACT_NUMBER" from .env.example as it is defined in constant

src/components/simulator/Simulator.tsx Outdated Show resolved Hide resolved
src/components/simulator/Simulator.tsx Show resolved Hide resolved
@kurund
Copy link
Contributor

kurund commented Oct 7, 2020

@rathorevaibhav Also I am getting some weird errors in the console when I send a message in the simulator. Sorry, forgot to upload it earlier.

Screenshot 2020-10-07 at 10 08 27 PM

@rathorevaibhav rathorevaibhav requested review from kurund and removed request for kurund and DigneshGujarathi October 8, 2020 05:41
@rathorevaibhav rathorevaibhav requested a review from kurund October 8, 2020 07:00
@@ -25,3 +25,5 @@ export const USER_SESSION = GLIFIC_API_URL + '/v1/session';
export const RESET_PASSWORD = GLIFIC_API_URL + '/v1/registration/reset-password';
export const RENEW_TOKEN = USER_SESSION + '/renew';
export const FLOW_EDITOR_CONFIGURE_LINK = `${PROTOCOL}//${window.location.host}/automation/configure`;
export const GUPSHUP_CALLBACK_URL = GLIFIC_BACKEND_URL + '/gupshup';
export const SIMULATOR_CONTACT = envVariables.REACT_APP_SIMULATOR_CONTACT_NUMBER;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remove this as it is defined in constant

@rathorevaibhav rathorevaibhav requested a review from kurund October 8, 2020 14:28
Copy link
Contributor

@kurund kurund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good now 👍

@kurund kurund merged commit 243a662 into master Oct 8, 2020
@kurund kurund deleted the feature/simulator-ui branch October 8, 2020 14:33
@kurund kurund modified the milestones: v0.3.4, v0.5 Oct 11, 2020
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 this pull request may close these issues.

Simulator support
3 participants