Activity middleware hooks - Angular
I would like to change some of the UI parts of the bot in a bit more extensive way than just styling available via stylingOptions (placing user/bot name and timestamp at the top, using full timestamp instead of just X time ago). Can I modify UI by adding angular components through activity middleware hooks? Also would it be possible to add additional actions to input box? I.e. I want to override upload attachment to only accept text files and add separate icon to turn on camera with barcode scanner.
Or is it only reserved to react?
Thank you for the questions, @Mkurkow
Web Chat does have an Angular sample here: https://github.com/microsoft/BotFramework-WebChat/tree/master/samples/01.getting-started/f.host-with-angular
You can see an example of using activity middleware in this sample here: https://github.com/microsoft/BotFramework-WebChat/tree/master/samples/05.custom-components/c.user-highlighting
And I don't see a way to modify the upload button like that, but there's a sample showing how to hide the upload button here: https://github.com/microsoft/BotFramework-WebChat/tree/master/samples/02.branding-styling-and-customization/f.hide-upload-button
Thank you for the response @v-kydela I am well aware about angular sample and it got me up and running with webchat via angular. Now I am trying to add some more customization to it, and it seems that natively, through react, it can be done using activites middlewares, but all examples of these are in react using ReactDOM renderer.
I have not seen any examples of using Angular and activity middleware. And, although the main page displays Custom render activities as possible only in react, this hook is still available via Angular and CDN bundle. I can place static text or something instead of normal activity bubble, so it got me thinking that maybe it would be possible to somehow use these hooks with angular components/angular renderer but everytime I get a React error
instrument.js:102 Invariant Violation: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=%5Bobject%20HTMLDivElement%5D&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
Hi @Mkurkow
Web Chat is a React component regardless of how it's hosted. The CDN provides a way to use Web Chat without worrying about its implementation or using JSX, but even the Angular sample you've seen is still using React Web Chat.
If you want to use Angular to put your own components in that Angular-hosted Web Chat, you'd have Angular components in a React component in an Angular app. And if you want to leverage Redux middleware to modify Web Chat's existing React-based elements by putting them in Angular components, then you'd have React components in Angular components in a React component in an Angular app. Is that possible? Maybe. Is that a good idea? That's for you to decide.
My recommendation is of course to stick with React. The sample shows that Web Chat can be hosted in an Angular app, but as you've seen the sample is very basic and doesn't perform any fancy modifications. If you'd still like help implementing activity middleware in your Angular app, please show what you've tried so far and I may be able to work from there. Can you explain what you mean when you say "this hook is still available via Angular and CDN bundle"?
@Mkurkow - Are you still working on this?
Closing due to inactivity.