-
Notifications
You must be signed in to change notification settings - Fork 78
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
feat: Disabling buttons components once clicked #1245
Conversation
d2a0f6a
to
562b3e7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! Some things to take into account.
Nice! I agree with both of you so next points will be:
|
2a8dc09
to
d97aeb1
Compare
Codecov Report
@@ Coverage Diff @@
## master #1245 +/- ##
==========================================
+ Coverage 64.73% 65.51% +0.77%
==========================================
Files 236 237 +1
Lines 6471 6518 +47
Branches 1118 1116 -2
==========================================
+ Hits 4189 4270 +81
+ Misses 1968 1923 -45
- Partials 314 325 +11
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
1331499
to
5f69e54
Compare
Unit Test Results 1 files 5 suites 15s ⏱️ Results for commit 5f69e54. |
ac75133
to
cc75b25
Compare
cc75b25
to
83124a1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!! Just a few small comments/suggestions
c0174b5
to
6cac414
Compare
6cac414
to
63ec07d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Description
autodisable
anddisabledstyle
(they are in lowercase to avoid annoying warnings, as these props will be rendered in the server side also).ButtonsDisabler
with static methods inside/util/webchat.js
to handle all the related logic of this new featureContext
We need a way to disable buttons in webchat once they are clicked for some customers
Approach taken / Explain the design
In this case, each button receives a
parentId
which is used to know what is the parent needed to have their buttons disabled. Once clicked, the message is updated with its buttons set with the propertydisabled: {true|false}
. On next renders, the button will be rendered depending on this property.To document / Usage example
Buttons
Carousel
As you can observe, properties defined at component level, overwrite the ones defined in the webchat theme. If
autodisable
is set inwebchat.theme
, then the components that do not have disabling properties will have the defined ones in the theme (appended in their props).Testing