Skip to content

Commit 00c7e89

Browse files
CorinaCorina
authored andcommitted
Update CardAction to make image or title required
1 parent ef98ebc commit 00c7e89

2 files changed

Lines changed: 23 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,18 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
<!-- CHANGELOG line template
8+
### Added/Changed/Removed
9+
- Added something, by [@johndoe](https://github.com/johndoe), in PR [#XXX](https://github.com/Microsoft/BotFramework-WebChat/pull/XXX)
10+
### Changed (for dependency bumps)
11+
- `core`: Bumps to [`abc@1.2.3`](https://npmjs.com/package/abc/), in PR [#XXX](https://github.com/Microsoft/BotFramework-WebChat/pull/XXX)
12+
### Fixed
13+
- Fix [#XXX](https://github.com/Microsoft/BotFramework-WebChat/issues/XXX). Patched something, by [@johndoe](https://github.com/johndoe) in PR [#XXX](https://github.com/Microsoft/BotFramework-WebChat/pull/XXX)
14+
-->
715
## [Unreleased]
816

17+
- Added `messageBack` to `CardActionTypes` and updated `CardAction` fields, by [@corinagum](https://github.com/corinagum), in PR [#138](https://github.com/Microsoft/BotFramework-DirectLineJS/pull/138)
18+
919
## [0.10.1] - 2018-12-21
1020
### Changed
1121

src/directLine.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,26 @@ export interface UnknownMedia{
5353

5454
export type CardActionTypes = "call" | "downloadFile" | "imBack" | "messageBack" | "openUrl" | "playAudio" | "playVideo" | "postBack" | "signin" | "showImage";
5555

56-
export interface CardAction {
56+
export type CardAction = CardActionWithImage | CardActionWithTitle;
57+
58+
export interface CardActionWithImage {
5759
displayText?: string,
58-
image?: string,
60+
image: string,
5961
text?: string,
6062
title?: string,
6163
type: CardActionTypes,
6264
value?: any
6365
}
6466

67+
export interface CardActionWithTitle {
68+
displayText?: string,
69+
image?: string,
70+
text?: string,
71+
title: string,
72+
type: CardActionTypes,
73+
value?: any
74+
}
75+
6576
export interface CardImage {
6677
alt?: string,
6778
url: string,

0 commit comments

Comments
 (0)