From 14c4d4d7762fb556c8f4f3e2de86a1e709c4b02b Mon Sep 17 00:00:00 2001 From: Corina <14900841+corinagum@users.noreply.github.com> Date: Sat, 28 Dec 2019 12:43:21 -0800 Subject: [PATCH] delete leftover piggyback sample --- .../README.md | 133 ------------------ .../index.html | 78 ---------- 2 files changed, 211 deletions(-) delete mode 100644 samples/15.a.backchannel-piggyback-on-outgoing-activities/README.md delete mode 100644 samples/15.a.backchannel-piggyback-on-outgoing-activities/index.html diff --git a/samples/15.a.backchannel-piggyback-on-outgoing-activities/README.md b/samples/15.a.backchannel-piggyback-on-outgoing-activities/README.md deleted file mode 100644 index e4e83c6246..0000000000 --- a/samples/15.a.backchannel-piggyback-on-outgoing-activities/README.md +++ /dev/null @@ -1,133 +0,0 @@ -# Sample - Piggyback Data on Every Outgoing Activity - -This sample shows how to add data to every outgoing activities as channel data. - -Channel data is a channel-specific property bag that can be used to send non-standard in-band data. - -> _Note: This is just a proof of concept thus should not be used in production -> and lacks security considerations._ - -If you haven't viewed it already, review and understanding of sample 11, which talks about middleware, would be extremely beneficial for this sample, linked in [further reading](#further-reading). - -# Test out the hosted sample - -- [Try out MockBot](https://microsoft.github.io/BotFramework-WebChat/04.api/b.piggyback-on-outgoing-activities) - -# How to run locally - -- Fork this repository -- Navigate to `/Your-Local-WebChat/samples/04.api/b.piggyback-on-outgoing-activities` in command line -- Run `npx serve` in the full-bundle directory -- Browse to [http://localhost:5000/](http://localhost:5000/) - -# Things to try out - -- Type `channel-data` - - This command will dump the channel data property bag received on the bot side - -# Code - -> Jump to [completed code](#completed-code) to see the end-result `index.html`. - -## Overview - -In this sample, we will be using the package `simple-update-in` to update our immutable action objects. Let's add the minified js file from unpkg.com to the `` of our html: - -```diff -… - - Web Chat: Inject data on post activity - -+ -… -``` - -This will allow us to use middleware to customize `DIRECT_LINE/POST_ACTIVITY` by updating the action with deep cloning. - -```diff -… -const store = window.WebChat.createStore( - {}, - ({ dispatch }) => next => action => { - if (action.type === 'DIRECT_LINE/POST_ACTIVITY') { -+ action = window.simpleUpdateIn(action, ['payload', 'activity', 'channelData', 'email'], () => 'johndoe@example.com'); - } - - return next(action); - } -); -… -``` - -All 'DIRECT_LINE/POST_ACTIVITY' sent on this bot will now have an email added to the channel data. - -## Completed Code - -Here is the finished `index.html`: - -```diff - - - - Web Chat: Inject data on post activity - - - - - - - -
- - - - -``` - -# Further reading - -- [simple-update-in](https://www.npmjs.com/package/simple-update-in) on npmjs - -[Customization of Redux Actions bot](https://microsoft.github.io/BotFramework-WebChat/11.customization-redux-actions) | [Customization of Redux Actions source code](./../11.customization-redux-actions) - -## Full list of Web Chat hosted samples - -View the list of [available Web Chat samples](https://github.com/microsoft/BotFramework-WebChat/tree/master/samples) diff --git a/samples/15.a.backchannel-piggyback-on-outgoing-activities/index.html b/samples/15.a.backchannel-piggyback-on-outgoing-activities/index.html deleted file mode 100644 index 5a81543049..0000000000 --- a/samples/15.a.backchannel-piggyback-on-outgoing-activities/index.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - Web Chat: Inject data on post activity - - - - - - - - - - -
- - -