diff --git a/CHANGELOG.md b/CHANGELOG.md index be9d09652f..2d8e367d64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -117,6 +117,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - `core-js@3.5.0` - Resolves [#2748](https://github.com/microsoft/BotFramework-WebChat/issues/2748), updated build scripts and CI pipeline, by [@compulim](https://github.com/compulim), in PR [#2767](https://github.com/microsoft/BotFramework-WebChat/pull/2767) - `component`: Bumps [`react-film@2.0.2`](https://npmjs.com/package/react-film/), by [@tdurnford](https://github.com/tdurnford) in PR [#2801](https://github.com/microsoft/BotFramework-WebChat/pull/2801) +- Removes `sendTyping` and deprecation notes in PR [#2845](https://github.com/microsoft/BotFramework-WebChat/pull/2845), by [@corinagum](https://github.com/corinagum), in PR [#2918](https://github.com/microsoft/BotFramework-WebChat/pull/2918) ### Samples diff --git a/__tests__/sendTypingIndicator.js b/__tests__/sendTypingIndicator.js index 2870fe8b96..fae387f3a4 100644 --- a/__tests__/sendTypingIndicator.js +++ b/__tests__/sendTypingIndicator.js @@ -26,24 +26,6 @@ test('Send typing indicator', async () => { await driver.wait(typingActivityReceived(), timeouts.directLine); }); -// TODO: [P3] Take this deprecation code out when releasing on or after January 13 2020 -test('Send typing indicator using deprecated props', async () => { - const { driver, pageObjects } = await setupWebDriver({ - props: { sendTyping: true } - }); - - await driver.wait(uiConnected(), timeouts.directLine); - - await pageObjects.sendMessageViaSendBox('echo-typing', { waitForSend: true }); - - const input = await driver.findElement(By.css('input[type="text"]')); - - await input.sendKeys('ABC'); - - // Typing indicator takes longer to come back - await driver.wait(typingActivityReceived(), timeouts.directLine); -}); - test('typing indicator should display in SendBox', async () => { const { driver, pageObjects } = await setupWebDriver({ props: { styleOptions: { typingAnimationBackgroundImage } } }); diff --git a/packages/bundle/src/createCognitiveServicesSpeechServicesPonyfillFactory.js b/packages/bundle/src/createCognitiveServicesSpeechServicesPonyfillFactory.js index fd2e46545a..6f565b636f 100644 --- a/packages/bundle/src/createCognitiveServicesSpeechServicesPonyfillFactory.js +++ b/packages/bundle/src/createCognitiveServicesSpeechServicesPonyfillFactory.js @@ -19,7 +19,7 @@ export default function createCognitiveServicesSpeechServicesPonyfillFactory({ }) { if (!credentials && (authorizationToken || region || subscriptionKey)) { console.warn( - 'botframework-webchat: "authorizationToken", "region", and "subscriptionKey" are being deprecated and will be removed on or after 2020-12-17. Please use "credentials" instead.' + 'botframework-webchat: "authorizationToken", "region", and "subscriptionKey" are deprecated and will be removed on or after 2020-12-17. Please use "credentials" instead.' ); credentials = async () => { diff --git a/packages/bundle/src/createCognitiveServicesSpeechServicesPonyfillFactory.spec.js b/packages/bundle/src/createCognitiveServicesSpeechServicesPonyfillFactory.spec.js index e9b2efb7e5..6871697928 100644 --- a/packages/bundle/src/createCognitiveServicesSpeechServicesPonyfillFactory.spec.js +++ b/packages/bundle/src/createCognitiveServicesSpeechServicesPonyfillFactory.spec.js @@ -45,7 +45,7 @@ test('upgrading string-based authorizationToken to credentials', async () => { }); expect(consoleWarns[0]).toMatchInlineSnapshot( - `"botframework-webchat: \\"authorizationToken\\", \\"region\\", and \\"subscriptionKey\\" are being deprecated and will be removed on or after 2020-12-17. Please use \\"credentials\\" instead."` + `"botframework-webchat: \\"authorizationToken\\", \\"region\\", and \\"subscriptionKey\\" are deprecated and will be removed on or after 2020-12-17. Please use \\"credentials\\" instead."` ); }); @@ -65,7 +65,7 @@ test('upgrading Promise-based authorizationToken to credentials', async () => { }); expect(consoleWarns[0]).toMatchInlineSnapshot( - `"botframework-webchat: \\"authorizationToken\\", \\"region\\", and \\"subscriptionKey\\" are being deprecated and will be removed on or after 2020-12-17. Please use \\"credentials\\" instead."` + `"botframework-webchat: \\"authorizationToken\\", \\"region\\", and \\"subscriptionKey\\" are deprecated and will be removed on or after 2020-12-17. Please use \\"credentials\\" instead."` ); }); @@ -85,7 +85,7 @@ test('upgrading function-based authorizationToken to credentials', async () => { }); expect(consoleWarns[0]).toMatchInlineSnapshot( - `"botframework-webchat: \\"authorizationToken\\", \\"region\\", and \\"subscriptionKey\\" are being deprecated and will be removed on or after 2020-12-17. Please use \\"credentials\\" instead."` + `"botframework-webchat: \\"authorizationToken\\", \\"region\\", and \\"subscriptionKey\\" are deprecated and will be removed on or after 2020-12-17. Please use \\"credentials\\" instead."` ); }); @@ -105,7 +105,7 @@ test('upgrading Promise function-based authorizationToken to credentials', async }); expect(consoleWarns[0]).toMatchInlineSnapshot( - `"botframework-webchat: \\"authorizationToken\\", \\"region\\", and \\"subscriptionKey\\" are being deprecated and will be removed on or after 2020-12-17. Please use \\"credentials\\" instead."` + `"botframework-webchat: \\"authorizationToken\\", \\"region\\", and \\"subscriptionKey\\" are deprecated and will be removed on or after 2020-12-17. Please use \\"credentials\\" instead."` ); }); @@ -125,7 +125,7 @@ test('upgrading string-based subscriptionKey to credentials', async () => { }); expect(consoleWarns[0]).toMatchInlineSnapshot( - `"botframework-webchat: \\"authorizationToken\\", \\"region\\", and \\"subscriptionKey\\" are being deprecated and will be removed on or after 2020-12-17. Please use \\"credentials\\" instead."` + `"botframework-webchat: \\"authorizationToken\\", \\"region\\", and \\"subscriptionKey\\" are deprecated and will be removed on or after 2020-12-17. Please use \\"credentials\\" instead."` ); }); @@ -145,7 +145,7 @@ test('upgrading string-based subscriptionKey to credentials', async () => { }); expect(consoleWarns[0]).toMatchInlineSnapshot( - `"botframework-webchat: \\"authorizationToken\\", \\"region\\", and \\"subscriptionKey\\" are being deprecated and will be removed on or after 2020-12-17. Please use \\"credentials\\" instead."` + `"botframework-webchat: \\"authorizationToken\\", \\"region\\", and \\"subscriptionKey\\" are deprecated and will be removed on or after 2020-12-17. Please use \\"credentials\\" instead."` ); }); @@ -165,7 +165,7 @@ test('upgrading function-based subscriptionKey to credentials', async () => { }); expect(consoleWarns[0]).toMatchInlineSnapshot( - `"botframework-webchat: \\"authorizationToken\\", \\"region\\", and \\"subscriptionKey\\" are being deprecated and will be removed on or after 2020-12-17. Please use \\"credentials\\" instead."` + `"botframework-webchat: \\"authorizationToken\\", \\"region\\", and \\"subscriptionKey\\" are deprecated and will be removed on or after 2020-12-17. Please use \\"credentials\\" instead."` ); }); @@ -185,7 +185,7 @@ test('upgrading Promise function-based subscriptionKey to credentials', async () }); expect(consoleWarns[0]).toMatchInlineSnapshot( - `"botframework-webchat: \\"authorizationToken\\", \\"region\\", and \\"subscriptionKey\\" are being deprecated and will be removed on or after 2020-12-17. Please use \\"credentials\\" instead."` + `"botframework-webchat: \\"authorizationToken\\", \\"region\\", and \\"subscriptionKey\\" are deprecated and will be removed on or after 2020-12-17. Please use \\"credentials\\" instead."` ); }); diff --git a/packages/component/src/Composer.js b/packages/component/src/Composer.js index 1d1e498b6e..210c99e43e 100644 --- a/packages/component/src/Composer.js +++ b/packages/component/src/Composer.js @@ -144,7 +144,6 @@ const Composer = ({ selectVoice, sendBoxRef, sendTimeout, - sendTyping, sendTypingIndicator, styleOptions, styleSet, @@ -159,18 +158,6 @@ const Composer = ({ const patchedDir = useMemo(() => (dir === 'ltr' || dir === 'rtl' ? dir : 'auto'), [dir]); const patchedGrammars = useMemo(() => grammars || [], [grammars]); - const patchedSendTypingIndicator = useMemo(() => { - if (typeof sendTyping === 'undefined') { - return sendTypingIndicator; - } - - // TODO: [P3] Take this deprecation code out when releasing on or after January 13 2020 - console.warn( - 'Web Chat: "sendTyping" has been renamed to "sendTypingIndicator". Please use "sendTypingIndicator" instead. This deprecation migration will be removed on or after January 13 2020.' - ); - - return sendTyping; - }, [sendTyping, sendTypingIndicator]); const patchedStyleOptions = useMemo(() => { const patchedStyleOptions = { ...styleOptions }; @@ -209,8 +196,8 @@ const Composer = ({ }, [dispatch, sendTimeout]); useEffect(() => { - dispatch(setSendTypingIndicator(!!patchedSendTypingIndicator)); - }, [dispatch, patchedSendTypingIndicator]); + dispatch(setSendTypingIndicator(!!sendTypingIndicator)); + }, [dispatch, sendTypingIndicator]); useEffect(() => { dispatch( @@ -308,7 +295,7 @@ const Composer = ({ scrollToEnd, selectVoice: patchedSelectVoice, sendBoxRef, - sendTypingIndicator: patchedSendTypingIndicator, + sendTypingIndicator, setDictateAbortable, styleOptions, styleSet: patchedStyleSet, @@ -332,7 +319,7 @@ const Composer = ({ internalRenderMarkdownInline, patchedGrammars, patchedSelectVoice, - patchedSendTypingIndicator, + sendTypingIndicator, patchedStyleSet, renderMarkdown, scrollToEnd, @@ -402,7 +389,6 @@ Composer.defaultProps = { selectVoice: undefined, sendBoxRef: undefined, sendTimeout: undefined, - sendTyping: undefined, sendTypingIndicator: false, styleOptions: {}, styleSet: undefined, @@ -444,7 +430,6 @@ Composer.propTypes = { current: PropTypes.any }), sendTimeout: PropTypes.number, - sendTyping: PropTypes.bool, sendTypingIndicator: PropTypes.bool, styleOptions: PropTypes.any, styleSet: PropTypes.any, diff --git a/packages/component/src/Middleware/ActivityStatus/Timestamp.js b/packages/component/src/Middleware/ActivityStatus/Timestamp.js index 207789b034..000e2447f5 100644 --- a/packages/component/src/Middleware/ActivityStatus/Timestamp.js +++ b/packages/component/src/Middleware/ActivityStatus/Timestamp.js @@ -13,7 +13,7 @@ const Timestamp = ({ activity: { timestamp }, 'aria-hidden': ariaHidden, classNa timestampStyleSet && console.warn( - 'Web Chat: styleSet.timestamp is being deprecated. Please use styleSet.sendStatus. This deprecation migration will be removed on or after December 31, 2021.' + 'Web Chat: styleSet.timestamp is deprecated. Please use styleSet.sendStatus. This deprecation migration will be removed on or after December 31, 2021.' ); return ( diff --git a/packages/component/src/Styles/StyleSet/SpinnerAnimation.js b/packages/component/src/Styles/StyleSet/SpinnerAnimation.js index 3628ae611d..28d76a8b16 100644 --- a/packages/component/src/Styles/StyleSet/SpinnerAnimation.js +++ b/packages/component/src/Styles/StyleSet/SpinnerAnimation.js @@ -12,7 +12,7 @@ export default function createSpinnerAnimationStyle({ // since defaultStyleOptions has a predefined value for spinnerAnimationPadding by default, the console.warn will appear if both it and spinnerAnimationPaddingRight are set if (spinnerAnimationPadding && spinnerAnimationPaddingRight) { console.warn( - 'botframework-webchat: "spinnerAnimationPaddingRight" is being deprecated and will be removed on or after 2021-02-01. Please use "spinnerAnimationPadding" instead.' + 'botframework-webchat: "spinnerAnimationPaddingRight" is deprecated and will be removed on or after 2021-02-01. Please use "spinnerAnimationPadding" instead.' ); } return { diff --git a/packages/component/src/Styles/createStyleSet.js b/packages/component/src/Styles/createStyleSet.js index c90e342dd9..3d14fe69b0 100644 --- a/packages/component/src/Styles/createStyleSet.js +++ b/packages/component/src/Styles/createStyleSet.js @@ -79,7 +79,7 @@ export default function createStyleSet(options) { if (bubbleBorder) { console.warn( - 'Web Chat: styleSet.bubbleBorder is being deprecated. Please use bubbleBorderColor, bubbleBorderStyle, and, bubbleBorderWidth.' + 'Web Chat: styleSet.bubbleBorder is deprecated. Please use bubbleBorderColor, bubbleBorderStyle, and, bubbleBorderWidth.' ); const { color, style, width } = parseBorder(bubbleBorder); @@ -99,7 +99,7 @@ export default function createStyleSet(options) { if (bubbleFromUserBorder) { console.warn( - 'Web Chat: styleSet.bubbleFromUserBorder is being deprecated. Please use bubbleFromUserBorderColor, bubbleFromUserBorderStyle, and, bubbleFromUserBorderWidth.' + 'Web Chat: styleSet.bubbleFromUserBorder is deprecated. Please use bubbleFromUserBorderColor, bubbleFromUserBorderStyle, and, bubbleFromUserBorderWidth.' ); const { color, style, width } = parseBorder(bubbleFromUserBorder); @@ -119,7 +119,7 @@ export default function createStyleSet(options) { if (suggestedActionBorder) { console.warn( - 'Web Chat: styleSet.suggestedActionBorder is being deprecated. Please use suggestedActionBorderColor, suggestedActionBorderStyle, and, suggestedActionBorderWidth.' + 'Web Chat: styleSet.suggestedActionBorder is deprecated. Please use suggestedActionBorderColor, suggestedActionBorderStyle, and, suggestedActionBorderWidth.' ); const { color, style, width } = parseBorder(suggestedActionBorder); @@ -139,7 +139,7 @@ export default function createStyleSet(options) { if (suggestedActionDisabledBorder) { console.warn( - 'Web Chat: styleSet.suggestedActionDisabledBorder is being deprecated. Please use suggestedActionDisabledBorderColor, suggestedActionDisabledBorderStyle, and, suggestedActionDisabledBorderWidth.' + 'Web Chat: styleSet.suggestedActionDisabledBorder is deprecated. Please use suggestedActionDisabledBorderColor, suggestedActionDisabledBorderStyle, and, suggestedActionDisabledBorderWidth.' ); const { color, style, width } = parseBorder(suggestedActionDisabledBorder); diff --git a/packages/core/src/actions/setSendTyping.js b/packages/core/src/actions/setSendTyping.js deleted file mode 100644 index 3d55b71f33..0000000000 --- a/packages/core/src/actions/setSendTyping.js +++ /dev/null @@ -1,12 +0,0 @@ -// TODO: [P3] Take this deprecation code out when releasing on or after 2020 January 13 -const SET_SEND_TYPING = 'WEB_CHAT/SET_SEND_TYPING'; - -export default function setSendTyping(value) { - // Deprecation notes added to reducer - return { - type: SET_SEND_TYPING, - payload: { sendTyping: !!value } - }; -} - -export { SET_SEND_TYPING }; diff --git a/packages/core/src/index.js b/packages/core/src/index.js index 0a784a7755..d1a6a0fc58 100644 --- a/packages/core/src/index.js +++ b/packages/core/src/index.js @@ -19,7 +19,6 @@ import setLanguage from './actions/setLanguage'; import setNotification from './actions/setNotification'; import setSendBox from './actions/setSendBox'; import setSendTimeout from './actions/setSendTimeout'; -import setSendTyping from './actions/setSendTyping'; import setSendTypingIndicator from './actions/setSendTypingIndicator'; import startDictate from './actions/startDictate'; import startSpeakingActivity from './actions/startSpeakingActivity'; @@ -60,7 +59,5 @@ export { stopDictate, stopSpeakingActivity, submitSendBox, - version, - // TODO: [P3] Take this deprecation code out when releasing on or after January 13 2020 - setSendTyping + version }; diff --git a/packages/core/src/reducer.ts b/packages/core/src/reducer.ts index 8c623d5495..3251adf98b 100644 --- a/packages/core/src/reducer.ts +++ b/packages/core/src/reducer.ts @@ -31,8 +31,5 @@ export default combineReducers({ sendTimeout, sendTypingIndicator, shouldSpeakIncomingActivity, - suggestedActions, - - // TODO: [P3] Take this deprecation code out when releasing on or after January 13 2020 - sendTyping: sendTypingIndicator + suggestedActions }); diff --git a/packages/core/src/reducers/sendTypingIndicator.js b/packages/core/src/reducers/sendTypingIndicator.js index 6e2288a82f..30c6c1b52b 100644 --- a/packages/core/src/reducers/sendTypingIndicator.js +++ b/packages/core/src/reducers/sendTypingIndicator.js @@ -1,18 +1,9 @@ -import { SET_SEND_TYPING } from '../actions/setSendTyping'; import { SET_SEND_TYPING_INDICATOR } from '../actions/setSendTypingIndicator'; const DEFAULT_STATE = false; export default function sendTypingIndicator(state = DEFAULT_STATE, { payload, type }) { switch (type) { - // TODO: [P3] Take this deprecation code out when releasing on or after 2020 January 13 - case SET_SEND_TYPING: - console.warn( - 'Web Chat: "sendTyping" has been renamed to "sendTypingIndicator". Please use "sendTypingIndicator" instead. This deprecation migration will be removed on or after January 13 2020.' - ); - state = payload.sendTyping; - break; - case SET_SEND_TYPING_INDICATOR: state = payload.sendTypingIndicator; break; diff --git a/packages/core/src/sagas/sendTypingIndicatorOnSetSendBoxSaga.js b/packages/core/src/sagas/sendTypingIndicatorOnSetSendBoxSaga.js index 6db9590a90..11027de4d4 100644 --- a/packages/core/src/sagas/sendTypingIndicatorOnSetSendBoxSaga.js +++ b/packages/core/src/sagas/sendTypingIndicatorOnSetSendBoxSaga.js @@ -4,7 +4,6 @@ import { call, cancel, put, select, take, takeLatest } from 'redux-saga/effects'; import { SET_SEND_BOX } from '../actions/setSendBox'; -import { SET_SEND_TYPING } from '../actions/setSendTyping'; import { SET_SEND_TYPING_INDICATOR } from '../actions/setSendTypingIndicator'; import { POST_ACTIVITY } from '../actions/postActivity'; import emitTypingIndicator from '../actions/emitTypingIndicator'; @@ -15,12 +14,7 @@ import whileConnected from './effects/whileConnected'; const SEND_INTERVAL = 3000; function takeSendTypingIndicator(value) { - return take( - ({ payload, type }) => - (type === SET_SEND_TYPING_INDICATOR && !payload.sendTypingIndicator === !value) || - // TODO: [P3] Take this deprecation code out when releasing on or after January 13 2020 - (type === SET_SEND_TYPING && !payload.sendTyping === !value) - ); + return take(({ payload, type }) => type === SET_SEND_TYPING_INDICATOR && !payload.sendTypingIndicator === !value); } function* sendTypingIndicatorOnSetSendBox() {