Add OAuth card attachment to JS using-cards sample

This commit is contained in:
Santiago Grangetto 2020-06-19 10:52:06 -03:00
Родитель 83eae3827c
Коммит 10332934dd
1 изменённых файлов: 16 добавлений и 0 удалений

Просмотреть файл

@ -81,6 +81,9 @@ class MainDialog extends ComponentDialog {
case 'Hero Card':
await stepContext.context.sendActivity({ attachments: [this.createHeroCard()] });
break;
case 'OAuth Card':
await stepContext.context.sendActivity({ attachments: [this.createOAuthCard()] });
break;
case 'Receipt Card':
await stepContext.context.sendActivity({ attachments: [this.createReceiptCard()] });
break;
@ -100,6 +103,7 @@ class MainDialog extends ComponentDialog {
this.createAnimationCard(),
this.createAudioCard(),
this.createHeroCard(),
this.createOAuthCard(),
this.createReceiptCard(),
this.createSignInCard(),
this.createThumbnailCard(),
@ -134,6 +138,10 @@ class MainDialog extends ComponentDialog {
value: 'Audio Card',
synonyms: ['audio']
},
{
value: 'OAuth Card',
synonyms: ['oauth']
},
{
value: 'Hero Card',
synonyms: ['hero']
@ -217,6 +225,14 @@ class MainDialog extends ComponentDialog {
);
}
createOAuthCard() {
return CardFactory.oauthCard(
'OAuth connection', // Replace with the name of your Azure AD connection
'Sign In',
'BotFramework OAuth Card'
);
}
createReceiptCard() {
return CardFactory.receiptCard({
title: 'John Doe',