microsoft / botframework-sdk

Bot Framework provides the most comprehensive experience for building conversation applications.
MIT License
7.51k stars 2.45k forks source link

[WebChat] Customization with Extending TypeScripts? #3417

Closed sreeharikm closed 7 years ago

sreeharikm commented 7 years ago

We are using WebChat to build a custom UI for the bot. There are some requirements to display thumbnail/hero cards with additional text fields and image fields. Currently, we tried updating the tsx files from the repository, built it and created the botchat.js. Kindly clarify the below queries.

  1. Is this the recommended method of extending the TypeScripts? If yes, how do we make the src code up to date with the updates in repository?
  2. Tried extending a file (say ActivityView.tsx and created ActivityViewExt.tsx) for implementing our custom changes, but the new file is not being taken up in the build.

Regards Sreehari

nwhitmont commented 7 years ago

@danmarshall thoughts?

nwhitmont commented 7 years ago

@sreeharikm If you need to design custom card layouts, use the Adaptive Cards JSON spec.

You can find examples and a layout visualizer here: http://adaptivecards.io/visualizer/

sreeharikm commented 7 years ago

Thanks for the update, will check on Adaptive Cards.

sreeharikm commented 7 years ago

@danmarshall Tried the sample code give in the Adaptive Cards documentation and noted, the HttpAction is not supported.

Also, would like to know is there suggestions on the extending type scripts (without using Adaptive Cards, since we have a WebChat version already running without Adaptive Cards) for custom functionalities? The worry is how do we merge further updates if we directly modify the source code. Thank you.

danmarshall commented 7 years ago

Hi @sreeharikm if you are only needing to add text and image fields then using AdaptiveCards will be an easier situation for you if you are concerned with code maintenance.

The worry is how do we merge further updates if we directly modify the source code

This is a primary function of GitHub. Recommend you read GitHub's Working with forks pages, with attention to Syncing a fork.

I'm going to close this issue here in BotBuilder, since this is related to Web Chat only. Feel free to open a new issue in the Web Chat repo.