From 26a083bf86ea9008bcf579a5d6f7886c63450c94 Mon Sep 17 00:00:00 2001 From: jimmyjames177414 Date: Fri, 16 Aug 2019 18:54:07 -0500 Subject: [PATCH 1/7] Updating submitSendBoxSaga.js Suggested fix by tdurnford for issue #2330 Trimming sendBoxValue on enter key submit --- packages/core/src/sagas/submitSendBoxSaga.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/sagas/submitSendBoxSaga.js b/packages/core/src/sagas/submitSendBoxSaga.js index 47a073eed3..344142e823 100644 --- a/packages/core/src/sagas/submitSendBoxSaga.js +++ b/packages/core/src/sagas/submitSendBoxSaga.js @@ -11,7 +11,7 @@ function* submitSendBox() { const sendBoxValue = yield select(sendBoxValueSelector); if (sendBoxValue) { - yield put(sendMessage(sendBoxValue, method)); + yield put(sendMessage(sendBoxValue.trim(), method)); yield put(setSendBox('')); } }); From 7fc164f588bb59418d1ab0e43b6ce87a4d744a06 Mon Sep 17 00:00:00 2001 From: jimmyjames177414 Date: Mon, 19 Aug 2019 10:16:46 -0500 Subject: [PATCH 2/7] Updating CHANGELOG.md --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b098f2f82e..eaf514307c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,6 +65,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed +- Fix [#2328](https://github.com/microsoft/BotFramework-WebChat/issues/2328). Updating submitSendBoxSaga.js to send sendBoxValue.trim(), by [@jimmyjames177414](https://github.com/jimmyjames177414) in PR [#2331](https://github.com/microsoft/BotFramework-WebChat/pull/2331) - Fix [#2160](https://github.com/microsoft/BotFramework-WebChat/issues/2160). Clear suggested actions after clicking on a suggested actions of type `openUrl`, by [@tdurnford](https://github.com/tdurnford) in PR [#2190](https://github.com/microsoft/BotFramework-WebChat/pull/2190) - Fix [#1954](https://github.com/microsoft/BotFramework-WebChat/issues/1954). Estimate clock skew and adjust timestamp for outgoing activity, by [@compulim](https://github.com/compulim) in PR [#2208](https://github.com/microsoft/BotFramework-WebChat/pull/2208) - Fix [#2240](https://github.com/microsoft/BotFramework-WebChat/issues/2240). Fix microphone button should be re-enabled after error, by [@compulim](https://github.com/compulim) in PR [#2241](https://github.com/microsoft/BotFramework-WebChat/pull/2241) @@ -96,6 +97,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - [Single sign-on for Microsoft Teams apps](https://microsoft.github.io/BotFramework-WebChat/19.c.single-sign-on-for-teams-apps/), by [@compulim](https://github.com/compulim) in [#2196](https://github.com/microsoft/BotFramework-WebChat/pull/2196) - [Customize Web Chat with Reaction Buttons](https://microsoft.github.io/BotFramework-WebChat/09.customization-reaction-buttons/). Updated reaction handlers to send `messageReaction` activities, by [@tdurnford](https://github.com/tdurnford) in [#2239](https://github.com/microsoft/BotFramework-WebChat/pull/2239) +## [4.5.3] - 2019-16-07 + +- Fix [#2328](https://github.com/microsoft/BotFramework-WebChat/issues/2328). Updating submitSendBoxSaga.js to send sendBoxValue.trim(), by [@jimmyjames177414](https://github.com/jimmyjames177414) in PR [#2331](https://github.com/microsoft/BotFramework-WebChat/pull/2331) + ## [4.5.2] - 2019-08-07 - Fix [#2273](https://github.com/microsoft/BotFramework-WebChat/issues/2273). Add `ScreenReaderText` component, by [@corinagum](https://github.com/corinagum) in PR [#2278](https://github.com/microsoft/BotFramework-WebChat/pull/2278) From 2c122806d0900859c6b62fcb2df2b526a51dc0ff Mon Sep 17 00:00:00 2001 From: jimmyjames177414 Date: Mon, 19 Aug 2019 11:32:44 -0500 Subject: [PATCH 3/7] Updating CHANGELOG.md Removing incorrect reference to minor patch in the CHANGELOG.md --- CHANGELOG.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eaf514307c..811a6f0af9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -97,10 +97,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - [Single sign-on for Microsoft Teams apps](https://microsoft.github.io/BotFramework-WebChat/19.c.single-sign-on-for-teams-apps/), by [@compulim](https://github.com/compulim) in [#2196](https://github.com/microsoft/BotFramework-WebChat/pull/2196) - [Customize Web Chat with Reaction Buttons](https://microsoft.github.io/BotFramework-WebChat/09.customization-reaction-buttons/). Updated reaction handlers to send `messageReaction` activities, by [@tdurnford](https://github.com/tdurnford) in [#2239](https://github.com/microsoft/BotFramework-WebChat/pull/2239) -## [4.5.3] - 2019-16-07 - -- Fix [#2328](https://github.com/microsoft/BotFramework-WebChat/issues/2328). Updating submitSendBoxSaga.js to send sendBoxValue.trim(), by [@jimmyjames177414](https://github.com/jimmyjames177414) in PR [#2331](https://github.com/microsoft/BotFramework-WebChat/pull/2331) - ## [4.5.2] - 2019-08-07 - Fix [#2273](https://github.com/microsoft/BotFramework-WebChat/issues/2273). Add `ScreenReaderText` component, by [@corinagum](https://github.com/corinagum) in PR [#2278](https://github.com/microsoft/BotFramework-WebChat/pull/2278) From 9bfeb462d7004af07d872e70383146ebbe64a143 Mon Sep 17 00:00:00 2001 From: jimmyjames177414 Date: Mon, 19 Aug 2019 11:48:53 -0500 Subject: [PATCH 4/7] Removing redundancy in SendButton.js Removing setSendBox(sendBoxValue.trim()) from SendButton.js --- packages/component/src/SendBox/SendButton.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/component/src/SendBox/SendButton.js b/packages/component/src/SendBox/SendButton.js index 0d88c1f510..5c7a1ef424 100644 --- a/packages/component/src/SendBox/SendButton.js +++ b/packages/component/src/SendBox/SendButton.js @@ -10,7 +10,6 @@ const connectSendButton = (...selectors) => connectToWebChat( ({ disabled, language, sendBoxValue, setSendBox, submitSendBox }) => ({ click: () => { - setSendBox(sendBoxValue.trim()); submitSendBox(); }, disabled, From 81a92ea1850bee9e28e2a2eef31d75de09f907c3 Mon Sep 17 00:00:00 2001 From: jimmyjames177414 Date: Mon, 19 Aug 2019 11:51:07 -0500 Subject: [PATCH 5/7] Removing redundancy in TextBox.js Removing setSendBox(sendBoxValue.trim()) from TextBox.js --- packages/component/src/SendBox/TextBox.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/component/src/SendBox/TextBox.js b/packages/component/src/SendBox/TextBox.js index b61173aa5f..2438535707 100644 --- a/packages/component/src/SendBox/TextBox.js +++ b/packages/component/src/SendBox/TextBox.js @@ -31,7 +31,6 @@ const connectSendTextBox = (...selectors) => event.preventDefault(); if (sendBoxValue) { - setSendBox(sendBoxValue.trim()); scrollToEnd(); submitSendBox(); focusSendBox(); From 0474d1c413e59f23a0ac64f5b61fef8052a92ef5 Mon Sep 17 00:00:00 2001 From: jimmyjames177414 Date: Mon, 19 Aug 2019 13:17:16 -0500 Subject: [PATCH 6/7] Refactoring SendButton.js Implementing @tdurnford's refactoring request for SendButton.js: -Removing setSendBox and sendBoxValue from function declaration since it is no longer used. -Since we are only making one function call in the click method, we are removing it and passing submitSendBox to the button's onClick handler. --- packages/component/src/SendBox/SendButton.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/packages/component/src/SendBox/SendButton.js b/packages/component/src/SendBox/SendButton.js index 5c7a1ef424..a72e04d337 100644 --- a/packages/component/src/SendBox/SendButton.js +++ b/packages/component/src/SendBox/SendButton.js @@ -8,18 +8,16 @@ import SendIcon from './Assets/SendIcon'; const connectSendButton = (...selectors) => connectToWebChat( - ({ disabled, language, sendBoxValue, setSendBox, submitSendBox }) => ({ - click: () => { - submitSendBox(); - }, + ({ disabled, language, submitSendBox }) => ({ disabled, - language + language, + submitSendBox }), ...selectors ); const SendButton = ({ click, disabled, language }) => ( - + ); @@ -29,9 +27,9 @@ SendButton.defaultProps = { }; SendButton.propTypes = { - click: PropTypes.func.isRequired, disabled: PropTypes.bool, - language: PropTypes.string.isRequired + language: PropTypes.string.isRequired, + submitSendBox: PropTypes.func.isRequired }; export default connectSendButton()(SendButton); From 511f30c6daa666a6a8445f27ab78f874edb5a4f8 Mon Sep 17 00:00:00 2001 From: jimmyjames177414 Date: Tue, 20 Aug 2019 17:47:43 -0500 Subject: [PATCH 7/7] Correcting Lint errors in SendButton.js Correcting Lint errors in SendButton.js --- packages/component/src/SendBox/SendButton.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/component/src/SendBox/SendButton.js b/packages/component/src/SendBox/SendButton.js index a72e04d337..e6ec53515f 100644 --- a/packages/component/src/SendBox/SendButton.js +++ b/packages/component/src/SendBox/SendButton.js @@ -16,7 +16,7 @@ const connectSendButton = (...selectors) => ...selectors ); -const SendButton = ({ click, disabled, language }) => ( +const SendButton = ({ disabled, language, submitSendBox }) => (