Skip to content

Commit ec4a9fa

Browse files
author
ftreml
committed
Form asserter sample. Image/Media arrays.
1 parent 89f041b commit ec4a9fa

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ 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.length > 1 && a.content.images.slice(1).map(mapImage),
146146
sourceData: a
147147
})
148148
} else if (a.contentType === 'application/vnd.microsoft.card.adaptive') {
@@ -154,6 +154,7 @@ class BotiumConnectorDirectline3 {
154154
text: textBlocks && textBlocks.map(t => t.text),
155155
image: imageBlocks && imageBlocks.length > 0 && mapImage(imageBlocks[0]),
156156
buttons: ((a.content.actions && a.content.actions.map(mapButton)) || []).concat((buttonBlocks && buttonBlocks.map(mapButton)) || []),
157+
media: imageBlocks && imageBlocks.length > 1 && imageBlocks.slice(1).map(mapImage),
157158
sourceData: a
158159
})
159160
const inputs = this._deepFilter(a.content.body, (t) => t.type, (t) => t.type.startsWith('Input.'))
@@ -184,7 +185,7 @@ class BotiumConnectorDirectline3 {
184185
content: a.content.text,
185186
image: a.content.images && a.content.images.length > 0 && mapImage(a.content.images[0]),
186187
buttons: a.content.buttons && a.content.buttons.map(mapButton),
187-
media: a.content.images && a.content.images.map(mapImage),
188+
media: a.content.images && a.content.images.length > 1 && a.content.images.slice(1).map(mapImage),
188189
sourceData: a
189190
})
190191
} else if (a.contentType && a.contentUrl) {
@@ -234,7 +235,8 @@ class BotiumConnectorDirectline3 {
234235
}
235236
}
236237

237-
setTimeout(() => this.queueBotSays(botMsg), 0)
238+
// give userSays some time
239+
setTimeout(() => this.queueBotSays(botMsg), 200)
238240
}
239241
}
240242
)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "botium-connector-directline3",
3-
"version": "0.0.18",
3+
"version": "0.0.19",
44
"description": "Botium Connector for Bot Framework Direct Line 3 API",
55
"main": "dist/botium-connector-directline3-cjs.js",
66
"module": "dist/botium-connector-directline3-es.js",

samples/convo/spec/convo/form.convo.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ BUTTON card inputs
55

66
#bot
77
BUTTONS Open Url|Submit|Show Card
8+
FORMS SimpleVal|UrlVal|EmailVal|...
89

910
#me
1011
FORM SimpleVal|myname
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
login with custom hook
1+
imageupload
22

33
#me
4-
Hi
4+
upload
55

66
#bot
7-
I heard you say:
7+
You have uploaded no files.
88

99
#me
10+
upload
1011
MEDIA https://www.botium.at/images/logo.png
1112

12-
#bot
13-
with 1 attachments
13+
#bot

0 commit comments

Comments
 (0)