mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2024-12-05 02:11:32 +00:00
Add support for sending arbitrary TFW message on bot message click
This commit is contained in:
parent
f17fe18cef
commit
f7a2182ba6
@ -4,6 +4,7 @@ export interface MessageData {
|
||||
originator?: string;
|
||||
timestamp?: Date;
|
||||
typing?: boolean;
|
||||
command?: any;
|
||||
message: string;
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
<div class="tfw-messages-main">
|
||||
<div class="tfw-grid-message"
|
||||
*ngFor="let message of messages.slice(); let last = last"
|
||||
[class.highlighted-message]="last">
|
||||
[class.highlighted-message]="last"
|
||||
(click)="sendMessageCommand(message)">
|
||||
<div class="tfw-grid-message-header">
|
||||
<img class="tao-grid-center-left" src="images/avataobot.svg"/>
|
||||
<div class="tao-grid-center-left originator">{{message.originator}}</div>
|
||||
|
@ -65,4 +65,10 @@ export class MessagesComponent implements OnInit {
|
||||
'key': 'message.queue.drain'
|
||||
});
|
||||
}
|
||||
|
||||
sendMessageCommand(message: MessageData) {
|
||||
if ('command' in message) {
|
||||
this.websocketService.send(message.command);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user