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 Card Choice Lists not respecting the expanded / collapsed settings #1431

Closed
garypretty opened this issue Apr 16, 2019 · 8 comments
Closed
Labels
Customer As opposed to development work item.

Comments

@garypretty
Copy link

Adaptive Cards with lists of choices within them are always showing the choices as radio buttons instead of drop down lists, even when they have been designed to show as collapsed. Choice lists were working correctly a few weeks ago so this seems to be an issue introduced recently.

The below adaptive card JSON displays choices correctly as drop downs in the Adaptive Cards Designer, but incorrectly in the emulator. I believe choices should only as radio buttons if you have used "style": "expanded" when configuring the choice set on the card.

{
  "type": "AdaptiveCard",
  "body": [
    {
      "type": "Container",
      "items": [
        {
          "type": "TextBlock",
          "size": "Medium",
          "weight": "Bolder",
          "text": "Help us improve this service"
        }
      ]
    },
    {
      "type": "Container",
      "items": [
        {
          "type": "TextBlock",
          "text": "How would you rate the virtual assistant chat?",
          "wrap": true
        }
      ]
    },
    {
      "type": "Input.ChoiceSet",
      "id": "Rating",
      "placeholder": "Please select an answer",
      "choices": [
        {
          "title": "Excellent",
          "value": "Excellent"
        },
        {
          "title": "Very Good",
          "value": "Very Good"
        },
        {
          "title": "Good",
          "value": "Good"
        },
        {
          "title": "Poor",
          "value": "Poor"
        },
        {
          "title": "Very poor",
          "value": "Very poor"
        }
      ]
    },
    {
      "type": "Container",
      "items": [
        {
          "type": "TextBlock",
          "text": "Did virtual assistant chat answer your query today?",
          "wrap": true
        }
      ]
    },
    {
      "type": "Input.ChoiceSet",
      "id": "QueryAnswered",
      "placeholder": "Please select an answer",
      "choices": [
        {
          "title": "Yes - Fully",
          "value": "Yes - Fully"
        },
        {
          "title": "Yes - Partially",
          "value": "Yes - Partially"
        },
        {
          "title": "No - Not at all",
          "value": "No  - No at all"
        }
      ]
    },
    {
      "type": "Container",
      "items": [
        {
          "type": "TextBlock",
          "text": "If you had not talked to us through live chat, how would you have found the information you need?",
          "wrap": true
        }
      ]
    },
    {
      "type": "Input.ChoiceSet",
      "id": "AlternativeMedium",
      "placeholder": "Please select an answer",
      "choices": [
        {
          "title": "Phone",
          "value": "Phone"
        },
        {
          "title": "Email",
          "value": "Email"
        },
        {
          "title": "Web search",
          "value": "Web search"
        },
        {
          "title": "Competitor site",
          "value": "Competitor site"
        },
        {
          "title": "Would give up",
          "value": "Would give up"
        },
        {
          "title": "None of these",
          "value": "None of these"
        }
      ]
    }
  ],
  "actions": [
    {
      "type": "Action.Submit",
      "id": "ExitSurvey",
      "title": "Send feedback",
      "data": {
        "source": "ExitSurvey"
      }
    }
  ],
  "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
  "version": "1.0"
}
@justinwilaby
Copy link
Contributor

@garypretty - Which version of the emulator are you using? I'm seeing the cards correctly displayed in the latest version of the Emulator:
image

@garypretty
Copy link
Author

I am using the latest version - checked for updates - as you can see in the background the card is showing radio buttons.

2019-04-16_16-26-39

@tonyanziano
Copy link
Contributor

Hi @garypretty ,

I was unable to repro this on latest as well:

image

If you are on version 4.3.3, try going into the app settings and checking "Use pre-release versons" underneath the "Application Updates" section. Then go to Help -> Check for update and try out one of the nightly builds (also available here).

image

@garypretty
Copy link
Author

So, tried that, but now when I try to open a bot file by entering the secret and click the 'submit' button, the dialog refreshes and the secret clears from the box - so I can't open any bot files at all? :) This is version 4.3.3-54762.

I am going to uninstall / reinstall the non pre-release version and see if that makes any difference.

@tonyanziano
Copy link
Contributor

tonyanziano commented Apr 17, 2019

Hi @garypretty ,

I've tried decrypting a bot with version 4.3.3-54762 as well and it seems there has been a regression in the decryption logic.

After looking into it, it seems like this was caused by us upgrading the Electron version to v4.1.1. In short, the crypto library shipped with Electron 4 recognizes a much smaller number of hashing functions compared to Electron < 4. One of these hashing functions was being used by our bot decryption logic, and so it is no longer recognized and is now broken. (Source #1) (Source #2)

===

So the work-around for now would be to not encrypt your bot file, or alternatively, use a nightly version that does not contain the commit that bumped the Electron version. I'll try to find a link to the latter.

===

EDIT: A fix has been merged in our dependency that performs bot de/encryption. Now we just have to wait until that package is published and then the Emulator can bump the dependency and everything should work again.

@garypretty
Copy link
Author

@tonyanziano Thanks for the update. I'll wait for the working build to come and test again. Still able to repro my issue on the release version of 4.3.3, so not sure what is going on and why you don't see the same thing.

@tonyanziano
Copy link
Contributor

@garypretty The change has finally propagated into the emulator codebase with #1521. The new bits will be available in a new nightly build after 10 PM PST tonight.

@jameslew jameslew added the Customer As opposed to development work item. label Jul 23, 2019
@cwhitten
Copy link
Member

Closing due to inactivity - @garypretty reach out if you're still having trouble!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Customer As opposed to development work item.
Projects
None yet
Development

No branches or pull requests

5 participants