Skip to content
This repository was archived by the owner on Aug 29, 2022. It is now read-only.

Commit a0cdc6b

Browse files
authored
Merge pull request #222 from navigateconsulting/convo-pages-changes
Conversations Page Changes
2 parents e0a96c7 + dba0fcf commit a0cdc6b

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

ui-trainer/src/app/conversations/conversations.component.ts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ import { ApiService } from '../common/services/apis.service';
1414
export class ConversationsComponent implements OnInit, OnDestroy {
1515

1616
constructor(public apiService: ApiService,
17-
public notificationsService: NotificationsService,
18-
public sharedDataService: SharedDataService,
19-
public _router: Router) { }
17+
public notificationsService: NotificationsService,
18+
public sharedDataService: SharedDataService,
19+
public _router: Router) { }
2020

2121
// tslint:disable-next-line: max-line-length
2222
conversationsDisplayedColumns: string[] = ['conversation_id', 'conversation_timestamp', 'icon'];
@@ -38,15 +38,18 @@ export class ConversationsComponent implements OnInit, OnDestroy {
3838
getConversations() {
3939
this.apiService.requestConversations().subscribe(conversations => {
4040
if (conversations) {
41-
this.conversations_json = conversations.slice().reverse();
41+
this.conversations_json = conversations.sort(function (a, b) {
42+
var x = a['latest_event_time']; var y = b['latest_event_time'];
43+
return ((x > y) ? -1 : ((x < y) ? 1 : 0));
44+
});
4245
this.conversations_json_backup = JSON.parse(JSON.stringify(this.conversations_json));
4346
this.conversationsDataSource = new MatTableDataSource(this.conversations_json);
4447
this.conversationsDataSource.paginator = this.paginator;
4548
this.applyConversationsFilter(this.filterConversationText);
4649
}
4750
},
48-
err => console.error('Observer got an error: ' + err),
49-
() => console.log('Observer got a complete notification'));
51+
err => console.error('Observer got an error: ' + err),
52+
() => console.log('Observer got a complete notification'));
5053
}
5154

5255
applyConversationsFilter(filterValue: string) {
@@ -55,11 +58,11 @@ export class ConversationsComponent implements OnInit, OnDestroy {
5558
const converted_ts = this.convertTimestamp(value['latest_event_time']);
5659
// tslint:disable-next-line: max-line-length
5760
if (value['sender_id'].includes(filterValue.trim()) ||
58-
value['sender_id'].toLowerCase().includes(filterValue.trim()) ||
59-
value['sender_id'].toUpperCase().includes(filterValue.trim()) ||
60-
converted_ts.includes(filterValue.trim()) ||
61-
converted_ts.includes(filterValue.trim()) ||
62-
converted_ts.includes(filterValue.trim())) {
61+
value['sender_id'].toLowerCase().includes(filterValue.trim()) ||
62+
value['sender_id'].toUpperCase().includes(filterValue.trim()) ||
63+
converted_ts.includes(filterValue.trim()) ||
64+
converted_ts.includes(filterValue.trim()) ||
65+
converted_ts.includes(filterValue.trim())) {
6366
return value;
6467
}
6568
});

ui-trainer/src/app/manage-projects/manage-projects.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ export class ManageProjectsComponent implements OnInit, OnDestroy {
5555
for (let i = 0; i < this.projects_json.length; i ++) {
5656
this.showSpinner.push(false);
5757
}
58-
console.log(this.showSpinner);
5958
this.projectsDataSource = new MatTableDataSource(this.projects_json);
6059
this.projectsDataSource.paginator = this.paginator;
6160
},

ui-trainer/src/app/try-now/try-now.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
<div mat-card-avatar color="white" font-size="4" class="bot">{{userBotCardType}}</div>
6868
<mat-card-title>{{userBotCardText}}</mat-card-title>
6969
<mat-card-subtitle>
70-
{{userBotCardTime | date : 'shortTime'}} <span *ngIf="userBotCardIntent!==''">|</span> {{userBotCardIntent}} <span *ngIf="userBotCardConfidence!==''">|</span> {{userBotCardConfidence}}
70+
{{userBotCardTime | date : 'medium'}} <span *ngIf="userBotCardIntent!==''">|</span> {{userBotCardIntent}} <span *ngIf="userBotCardConfidence!==''">|</span> {{userBotCardConfidence}}
7171
</mat-card-subtitle>
7272
</mat-card-header>
7373
</mat-card>

0 commit comments

Comments
 (0)