NGRP / node-red-contrib-viseo

Node-RED nodes OpenSourced by VISEO Technologies
Apache License 2.0
227 stars 83 forks source link

add image to AdaptiveCard & refactor addTextBlockToAdaptiveCard and a… #149

Closed siyaod closed 4 years ago

siyaod commented 4 years ago

Why: Client expectes a new feature, which is to add an image to AdaptiveCard. Refer to this screen shot: image

How:

  1. About new feature demanded: Card element 'Image' is added to response body when building AdaptiveCard JSON, as per MS botframework document https://adaptivecards.io/explorer/Image.html
  2. About refactor of previous fat function 'buildAdaptiveCardJson':
    • Refactor of function 'addButtonToAdaptiveCard', encapsulates JSON construction of AdaptiveCard buttons;
    • Refactor of function 'addTextBlockToAdaptiveCard', encapsulates JSON construction of AdaptiveCard text block.