Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adaptive Cards' Action Set does not work on Web Chat #2268

Closed
corinagum opened this issue Aug 5, 2019 · 3 comments
Closed

Adaptive Cards' Action Set does not work on Web Chat #2268

corinagum opened this issue Aug 5, 2019 · 3 comments
Assignees
Labels
bug Indicates an unexpected problem or an unintended behavior. external-others

Comments

@corinagum
Copy link
Contributor

corinagum commented Aug 5, 2019

Version

4.5.1

Describe the bug

Adaptive Cards with action sets are not rendered in Web Chat

To Reproduce

Steps to reproduce the behavior:

{"schema":" http://adaptivecards.io/schemas/adaptive-card.json","version":"1.2","type":"AdaptiveCard","speak":null,"body":[{"type":"TextBlock","text":"Area Zenith","weight":"Bolder","separator":false,"columns":null,"spacing":null},{"type":"ColumnSet","text":null,"weight":null,"separator":true,"columns":[{"type":"Column","width":1,"items":[{"type":"TextBlock","text":"Tiepido di gamberi e calamari","altText":null,"url":null,"size":null,"id":null,"horizontalAlignment":null,"isSubtle":false,"actions":null,"weight":null},{"type":"Image","text":null,"altText":null,"url":"https://areazenith01.scm.azurewebsites.net/dev/api/files/wwwroot/wwwroot/images/Items/ItemDefault.jpeg","size":"Medium","id":null,"horizontalAlignment":null,"isSubtle":false,"actions":null,"weight":null}],"verticalContentAlignment":null},{"type":"Column","width":1,"items":[{"type":"TextBlock","text":"₹ 14.00","altText":null,"url":null,"size":null,"id":null,"horizontalAlignment":"right","isSubtle":true,"actions":null,"weight":null},{"type":"ActionSet","text":null,"altText":null,"url":null,"size":null,"id":null,"horizontalAlignment":null,"isSubtle":false,"actions":[{"type":"Action.Submit","title":"Delete","data":{"action":"DELETE_2449769"}}],"weight":null}],"verticalContentAlignment":"Bottom"}],"spacing":null},{"type":"ColumnSet","text":null,"weight":null,"separator":false,"columns":[{"type":"Column","width":1,"items":[{"type":"TextBlock","text":"Total","altText":null,"url":null,"size":"Medium","id":null,"horizontalAlignment":null,"isSubtle":true,"actions":null,"weight":null}],"verticalContentAlignment":null},{"type":"Column","width":1,"items":[{"type":"TextBlock","text":"₹ 14.00","altText":null,"url":null,"size":"Medium","id":null,"horizontalAlignment":"Right","isSubtle":false,"actions":null,"weight":"Bolder"}],"verticalContentAlignment":null}],"spacing":"Medium"}]}

Expected behavior

image

Additional context

[Bug]

@corinagum corinagum added bug Indicates an unexpected problem or an unintended behavior. Pending labels Aug 5, 2019
@corinagum corinagum removed the Pending label Aug 5, 2019
@tdurnford
Copy link
Contributor

This seems to be related to microsoft/BotFramework-Services#87 and appears to work correctly in Web Chat with the workaround mentioned in the thread. This should be resolved when the Direct Line Connector Service's Adaptive Cards dependency is updated to v1.2.

image

@corinagum
Copy link
Contributor Author

Closing this issue since it's external to Web Chat. Please use the above link for tracking. :)

@Bhushangholap
Copy link

Bhushangholap commented Aug 9, 2019

this is directline client :

<!DOCTYPE html>
<html>
   <body>
      <div id="webchat" role="main">
      <script src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>
      <script>
	   const attachmentMiddleware = () => next => card => {
  if (card.attachment.contentType === 'application/vnd.microsoft.card.custom'){
    card.attachment.contentType = 'application/vnd.microsoft.card.adaptive'
  }
  return next(card)
};

         window.WebChat.renderWebChat(
            {
               directLine: window.WebChat.createDirectLine({
                  token: 'SECRET'
               }),
			    attachmentMiddleware, 
               userID: 'YOUR_USER_ID',
               username: 'Web Chat User',
               locale: 'en-US',
               botAvatarInitials: 'WC',
               userAvatarInitials: 'WW'
			   
			},
			document.getElementById('webchat')
         );
      </script>
	  </div>
   </body>
</html>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or an unintended behavior. external-others
Projects
None yet
Development

No branches or pull requests

3 participants