Send box renderer
Fixes #3526 Fixes #3038
Description
Added a prop that is sent down into BasicWebChat and is used to render the send box if not undefined.
Specific Changes
Added a prop to BasicWebChat defaultProps.
Added a check in the BasicWebChat render to use the new prop instead of rendering the BasicSendBox
Review Checklist
This section is for contributors to review your work.
- [ ] Accessibility reviewed (tab order, content readability, alt text, color contrast)
- [ ] Browser and platform compatibilities reviewed
- [ ] CSS styles reviewed (minimal rules, no
z-index) - [ ] Documents reviewed (docs, samples, live demo)
- [ ] Internationalization reviewed (strings, unit formatting)
- [ ]
package.jsonandpackage-lock.jsonreviewed - [ ] Security reviewed (no data URIs, check for nonce leak)
- [ ] Tests reviewed (coverage, legitimacy)
Thanks for the PR!!
- Please fill out the CLA
- Could you add the passing snapshots to the committed files? They need to be present in order for the CI to pass.
I'll take a closer look at this sometime this week.
I've updated the snaps but the CI still fails. When I try to check the "Details" I get a 401.
How do I check why my CI is failing?
@felixvanleeuwen thanks for the updates! Unfortunately non-internal developers are unable to check the CI. Some of them are DL timeouts, so I'm rerunning right now and after that I'll make a list of the failing tests. Thanks for your patience.
@compulim ping
Any news on the failing CI?
Both failing tests were issues resolved yesterday. Merged main in and restarted CI.
CI still fails, anything I can solve?
CI is failing on my PR too -- both have lots of failures and look to be the same. Something else is going on, which I'll investigate today. Are you able to run the tests locally? Will you be able to change to middleware for this PR?
Are you able to run the tests locally?
Yes I can. I have to run them on a machine that is different from my regular work station so it'll take some extra effort.
Will you be able to change to middleware for this PR?
In the current way it's implemented returning false from the sendBoxMiddleware would have the BasicWebChat default to the BasicSendBox.
How would you like me to change it?
Will get back today, I got some ideas on how to make it better.
One thing, can you please look at our other middleware to understand how it works? Web Chat use middleware pattern for custom-rendering components.
For example, reaction button sample demonstrates how to custom-render activity. It can be similarly applied to custom-render of send box, so developers can add a new button to the left of the upload button.
I think I can look at any createCoreMiddleware to get a general idea of how it should work.
Hopefully I can set some time aside next week to work on this.
Starting work on this
@compulim Is this how you imagined it?
@felixvanleeuwen Thanks for the updates! FYI, compulim is currently on vacation and will be unavailable for a few weeks. Since he wanted to go through the code, I'll go through and possibly leave a few comments, but we'll wait until he's back for the approval.
We just finished a release milestone, and our next is scheduled for next year, so presumably we'll still be able to get this into the next release.
Thanks for your patience!
You don't need to do this immediately, since there will be frequent changes to CHANGELOG.md that will cause merge conflicts, but before this gets merged in, you will need to give yourself credit and add the changes to the Changelog :) I would include a line under Added in Unreleased for the SendBox changes, and an entry under Samples for the new sample.
Please also add this sample to the /samples/README.md table. Thanks again :)
Hello, is there anything blocking about this PR still? I'd like to hear what's wrong so I can take steps to remedy.
Hello?
Hi @felixvanleeuwen sorry I missed your reply. We still need @compulim to do a pass review, but there are still issues unaddresed above that should be fixed. Please take a look at those.
I think all of the issues have been addressed. If you feel that some have not been addressed: could you specifically list them?
Reopening - I'm assuming close was unintentional :) Please let me know if not.
Sorry for bringing up this PR again, but is there still any interest in being able to implement a custom search box? From a developers perspective it makes perfect sense to have a middleware for this just like we have for all other crucial parts of the UI.
Or is there some sample of solving it with current tools, as I saw that there's a hideSendBox style option?
Obsoleted by #5120.