Skip to content

Commit

Permalink
change OAuthPrompt default to AcceptingInput
Browse files Browse the repository at this point in the history
  • Loading branch information
stevengum committed Jul 10, 2019
1 parent 16944a5 commit 618f768
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 37 deletions.
33 changes: 0 additions & 33 deletions libraries/botbuilder-azure/package.json.lerna_backup

This file was deleted.

6 changes: 3 additions & 3 deletions libraries/botbuilder-dialogs/src/prompts/oauthPrompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ export class OAuthPrompt extends Dialog {
// Ensure prompts have input hint set
const o: Partial<PromptOptions> = {...options};
if (o.prompt && typeof o.prompt === 'object' && typeof o.prompt.inputHint !== 'string') {
o.prompt.inputHint = InputHints.ExpectingInput;
o.prompt.inputHint = InputHints.AcceptingInput;
}
if (o.retryPrompt && typeof o.retryPrompt === 'object' && typeof o.retryPrompt.inputHint !== 'string') {
o.retryPrompt.inputHint = InputHints.ExpectingInput;
o.retryPrompt.inputHint = InputHints.AcceptingInput;
}

// Initialize prompt state
Expand Down Expand Up @@ -242,7 +242,7 @@ export class OAuthPrompt extends Dialog {

// Initialize outgoing message
const msg: Partial<Activity> =
typeof prompt === 'object' ? {...prompt} : MessageFactory.text(prompt, undefined, InputHints.ExpectingInput);
typeof prompt === 'object' ? {...prompt} : MessageFactory.text(prompt, undefined, InputHints.AcceptingInput);
if (!Array.isArray(msg.attachments)) { msg.attachments = []; }

// Add login card as needed
Expand Down
3 changes: 2 additions & 1 deletion libraries/botbuilder-dialogs/tests/oauthPrompt.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { ActivityTypes, ConversationState, MemoryStorage, TestAdapter, CardFactory } = require('botbuilder-core');
const { ActivityTypes, CardFactory, ConversationState, InputHints, MemoryStorage, TestAdapter } = require('botbuilder-core');
const { OAuthPrompt, OAuthPromptSettings, DialogSet, DialogTurnStatus, ListStyle } = require('../');
const assert = require('assert');

Expand Down Expand Up @@ -47,6 +47,7 @@ describe('OAuthPrompt', function () {
.assertReply(activity => {
assert(activity.attachments.length === 1);
assert(activity.attachments[0].contentType === CardFactory.contentTypes.oauthCard);
assert(activity.inputHint === InputHints.AcceptingInput);

// send a mock EventActivity back to the bot with the token
adapter.addUserToken(connectionName, activity.channelId, activity.recipient.id, token);
Expand Down

0 comments on commit 618f768

Please sign in to comment.