Skip to content

Commit 39ab333

Browse files
author
Botium
authored
Merge pull request #37 from codeforequity-at/feature/BOT-972-box-adaptive-card-rendering
BOT-972-box-adaptive-card-rendering
2 parents 2dcba7c + 5c1d826 commit 39ab333

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,4 @@ dist
6161
package-lock.json
6262
yarn.lock
6363
botium.local.json
64+
/.idea

index.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ class BotiumConnectorDirectline3 {
142142
content: a.content.text,
143143
image: a.content.images && a.content.images.length > 0 && mapImage(a.content.images[0]),
144144
buttons: a.content.buttons && a.content.buttons.map(mapButton),
145-
media: a.content.images && a.content.images.map(mapImage)
145+
media: a.content.images && a.content.images.map(mapImage),
146+
sourceData: a
146147
})
147148
} else if (a.contentType === 'application/vnd.microsoft.card.adaptive') {
148149
const textBlocks = this._deepFilter(a.content.body, (t) => t.type, (t) => t.type === 'TextBlock')
@@ -152,7 +153,8 @@ class BotiumConnectorDirectline3 {
152153
botMsg.cards.push({
153154
text: textBlocks && textBlocks.map(t => t.text),
154155
image: imageBlocks && imageBlocks.length > 0 && mapImage(imageBlocks[0]),
155-
buttons: ((a.content.actions && a.content.actions.map(mapButton)) || []).concat((buttonBlocks && buttonBlocks.map(mapButton)) || [])
156+
buttons: ((a.content.actions && a.content.actions.map(mapButton)) || []).concat((buttonBlocks && buttonBlocks.map(mapButton)) || []),
157+
sourceData: a
156158
})
157159
} else if (a.contentType === 'application/vnd.microsoft.card.animation' ||
158160
a.contentType === 'application/vnd.microsoft.card.audio' ||
@@ -163,7 +165,8 @@ class BotiumConnectorDirectline3 {
163165
content: a.content.text,
164166
image: a.content.image && mapImage(a.content.image),
165167
buttons: a.content.buttons && a.content.buttons.map(mapButton),
166-
media: a.content.media && a.content.media.map(mapMedia)
168+
media: a.content.media && a.content.media.map(mapMedia),
169+
sourceData: a
167170
})
168171
} else if (a.contentType === 'application/vnd.microsoft.card.thumbnail') {
169172
botMsg.cards.push({
@@ -172,7 +175,8 @@ class BotiumConnectorDirectline3 {
172175
content: a.content.text,
173176
image: a.content.images && a.content.images.length > 0 && mapImage(a.content.images[0]),
174177
buttons: a.content.buttons && a.content.buttons.map(mapButton),
175-
media: a.content.images && a.content.images.map(mapImage)
178+
media: a.content.images && a.content.images.map(mapImage),
179+
sourceData: a
176180
})
177181
} else if (a.contentType && a.contentUrl) {
178182
botMsg.media.push({

0 commit comments

Comments
 (0)