From 28bcfcfb92cad8ec70a129c5e1f9ff0464702722 Mon Sep 17 00:00:00 2001 From: Nishant Shuke Date: Wed, 2 Sep 2020 20:52:33 +0530 Subject: [PATCH] Conversation Chat Entity Addition --- RELEASE.md | 5 +++++ .../conversation-chat.component.html | 16 +++++++++++++++- .../conversation-chat.component.ts | 10 +++++++++- .../app/conversations/conversations.component.ts | 2 -- 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index edd87356..186bf6ce 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -29,6 +29,11 @@ Bug fixes ## Major Features and Improvements +* [223](https://github.com/navigateconsulting/eva/pull/223) Added authentication for mongo, and redis containers
+Lazy loading for conversations API and UI
+Changes In Routes (Separate for each component eg: Actions, Conversations, Projects, etc.)
+CSS Tweaks in Conversations Chat Components +Added Entity Display feature respective to the intent selected in the chat ## Bug Fixes and Other Changes diff --git a/ui-trainer/src/app/conversation-chat/conversation-chat.component.html b/ui-trainer/src/app/conversation-chat/conversation-chat.component.html index 81e9ab40..d80d3672 100644 --- a/ui-trainer/src/app/conversation-chat/conversation-chat.component.html +++ b/ui-trainer/src/app/conversation-chat/conversation-chat.component.html @@ -161,7 +161,7 @@
- +
@@ -176,6 +176,20 @@
Key
+ + + + + + + + + + + + + +
KeyValue
{{ entity.entity }}{{ entity.value }}
diff --git a/ui-trainer/src/app/conversation-chat/conversation-chat.component.ts b/ui-trainer/src/app/conversation-chat/conversation-chat.component.ts index 3caed30c..a4dd8214 100644 --- a/ui-trainer/src/app/conversation-chat/conversation-chat.component.ts +++ b/ui-trainer/src/app/conversation-chat/conversation-chat.component.ts @@ -23,9 +23,11 @@ export class ConversationChatComponent implements OnInit { predictions: any; userBotCardType: string; userBotCardText: string; - private userBotCardTime; + userBotCardTime; userBotCardIntent: string; userBotCardConfidence: string; + showAllIntentEntities = true; + showIntentEntitiesData: []; constructor(public sharedDataService: SharedDataService, public _router: Router, @@ -74,6 +76,12 @@ export class ConversationChatComponent implements OnInit { this.userBotCardTime = new Date(Math.floor(this.chats[chat_row_index]['timestamp']) * 1000); this.userBotCardIntent = this.chats[chat_row_index]['parse_data']['intent']['name']; this.userBotCardConfidence = this.chats[chat_row_index]['parse_data']['intent']['confidence']; + if (this.chats[chat_row_index]['parse_data']['entities'].length >= 1) { + this.showIntentEntitiesData = this.chats[chat_row_index]['parse_data']['entities'] + } else { + this.showIntentEntitiesData = []; + } + this.showAllIntentEntities = false; // tslint:disable-next-line: max-line-length this.predictions = { text: this.chats[chat_row_index]['parse_data']['text'], intent_ranking: this.chats[chat_row_index]['parse_data']['intent_ranking'] }; this.showUserBotCardDetails = true; diff --git a/ui-trainer/src/app/conversations/conversations.component.ts b/ui-trainer/src/app/conversations/conversations.component.ts index 1e070fce..c1b389d8 100644 --- a/ui-trainer/src/app/conversations/conversations.component.ts +++ b/ui-trainer/src/app/conversations/conversations.component.ts @@ -48,10 +48,8 @@ export class ConversationsComponent implements OnInit, OnDestroy { } } getConversations() { - console.log(+localStorage.getItem('conversations_pageIndex'), +localStorage.getItem('conversations_pageSize')); this.apiService.requestConversations(+localStorage.getItem('conversations_pageIndex'), +localStorage.getItem('conversations_pageSize')).subscribe(conversations => { if (conversations) { - console.log(conversations); this.conversations_json = conversations.sort(function (a, b) { var x = a['latest_event_time']; var y = b['latest_event_time']; return ((x > y) ? -1 : ((x < y) ? 1 : 0));