-
Notifications
You must be signed in to change notification settings - Fork 65
List Card Support in NodeJs Sample App #61
base: master
Are you sure you want to change the base?
Conversation
let list = Array<builderteams.ListCardItem>(); | ||
|
||
// list item1 | ||
let item1 = new builderteams.ListCardItem(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use session, and chain the fluent methods.
new builderteams.ListCardItem(session)
.title(Strings.left_card_item1_title)
...
|
||
// list item1 | ||
let item1 = new builderteams.ListCardItem(); | ||
item1.type(builderteams.ListCardItemType.resultItem); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default type is resultItem, so strictly speaking this isn't necessary.
item2.subtitle(session.gettext(Strings.list_card_item1_subtitle)); | ||
|
||
// we have added only two items for this sample, list card support multiple items as needed | ||
list.push(item1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use addItem() method on ListCard.
list.push(item1); | ||
list.push(item2); | ||
|
||
let card = new builderteams.ListCard(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too, use session and chain the fluent methods.
new ListCard(session)
.title(Strings.list_card_title)
.addItem(xxx)
....
card.items(list); | ||
|
||
let message = new builder.Message(session); | ||
message.addAttachment(card.toAttachment()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chain this to the new, and there's no need to call toAttachment()
new builder.Message(session)
.addAttachment(card)
import { TriggerActionDialog } from "../../../utils/TriggerActionDialog"; | ||
import { DialogIds } from "../../../utils/DialogIds"; | ||
import { DialogMatches } from "../../../utils/DialogMatches"; | ||
// import { ListCard, ListCardItem, ListCardItemType } from "../basic/ListCard"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete
@msftdherron @jotrick @MattSFT @aosolis @jialic @goelashish7 @robin-liao