Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMPROVE][Omnichannel] More info and better design of Past Chats List #17346

Merged

Conversation

nitinkumartiwari
Copy link
Contributor

@nitinkumartiwari nitinkumartiwari commented Apr 17, 2020

The main goal expected from this improvement is to replace the current UI/UX of the Omnichannel Past Chats List feature.

From:
Screen Shot 2020-06-19 at 10 48 09

To:
Screen Shot 2020-06-19 at 10 53 13

Screen Shot 2020-06-19 at 10 53 21

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@RocketChat RocketChat deleted a comment from lgtm-com bot Apr 21, 2020
@RocketChat RocketChat deleted a comment from lgtm-com bot Apr 21, 2020
@RocketChat RocketChat deleted a comment from lgtm-com bot Apr 21, 2020
Copy link
Contributor

@renatobecker renatobecker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nitinkumartiwari There is a lot of unnecessary code.
You need to make it more simple and readable, I saw unused import files, indentation issues and so on.
This is my first review, I'll be waiting for your changes and then I will review it again.

Thanks.

let allHistoryChat ;

Template.customerChatHistory.helpers({

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove all of the blank lines like this.

<input type="text" id="searchInput" class="" placeholder="Search" aria-label="Search">
</div>
</div>
{{#if isAllChat}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need this {{#if isAllChat}}?

</ul>
</div>
{{else}}
{{#if isChatClicked}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can move this to the top of the template, don't need any if/else statement.

{{> customerChatHistoryMessages}}
{{else}}
<div class='visitor-history-block'>
{{#if isfound }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need this {#if isfound }}?

{{#if isfound }}
<ul class='searchresults' id='searchresul'>

{{#each searchResults}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whi do you need another list to display the search results? You can use only one list and apply the filters through the same endpoint you fetch the data from the server.

var id = Session.get('FetchID');
var token = Session.get('FetchToken')
this.autorun(async () => {
historyResult = await APIClient.v1.get(`livechat/messages.history/${ id }?token=${token}`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
historyResult = await APIClient.v1.get(`livechat/messages.history/${ id }?token=${token}`);
{ messages } = await APIClient.v1.get(`livechat/messages.history/${ id }?token=${token}`);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


})

Template.customerChatHistoryMessages.events({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you declare this if it's empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i have removed this


})

function getTime(newTs){
Copy link
Contributor

@renatobecker renatobecker Apr 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need this method, you can use moment, the lib you imported in this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i have removed this function and now using moment

return time = `${hr}:${min} PM`;
}
}
function getDay(obj){
Copy link
Contributor

@renatobecker renatobecker Apr 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need this method, you can use moment, the lib you imported in this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i have removed these function and now using moment

@@ -8,6 +8,7 @@ import './app/tabbar/agentInfo';
import './app/tabbar/externalSearch';
import './app/tabbar/visitorEdit';
import './app/tabbar/visitorForward';
import './app/tabbar/visitorHistory';
import './app/tabbar/customerChatHistory';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're replacing the old template you'll need to remove the old file as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i have removed the file as well

@lgtm-com
Copy link

lgtm-com bot commented Apr 22, 2020

This pull request introduces 12 alerts when merging 6ec867f into 5a1ef96 - view on LGTM.com

new alerts:

  • 9 for Unused variable, import, function or class
  • 3 for Missing variable declaration

Copy link
Contributor

@renatobecker renatobecker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a lot of indentation problems.
Also, I left again new comments trying to explain the correct way this implementation.

<i class="glyphicon glyphicon-search icon-search"></i>
<input type="text" id="searchInput" class="" placeholder="Search" aria-label="Search">
</div>
</div>
Copy link
Contributor

@renatobecker renatobecker Apr 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the indentation.
Your indentation has both spaces and tabs. We use tabs for the indentation code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -0,0 +1,73 @@
<template name='customerChatHistory'>
<div class="content">
<div class="list-view">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's check if the customer already has chat history, if not, let's display a message.

Suggested change
<div class="list-view">
{{#if chatHistoryEmpty}}
{{_ "Customer_has_no_chat_history"}}
{{else}}
<div class="list-view">

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a check if there is chat history available or not

{{/if}}
{{else}}
{{#each previousChats}}
<li class='list-chat' id='{{_id}}' aria='{{v.token}}' >
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<li class='list-chat' id='{{_id}}' aria='{{v.token}}' >
{{#each room in previousChats}} {{> chatRoomHistoryItem room }} {{/each}}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

created A template called chatRoomHistoyItem

},
searchResults(){
// will return search result
var r = Session.get('searchResult');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need this?
Also, you don't use var, we use let. In addition, when you assign a value to a variable that will not be reassigned, you can use const.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

previousChats() {
// will return pervious chats list
let history = Template.instance().history.get();
let newHisTory = []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can create a helper method to return the history item, as I mentioned above(customerChatHistoryItem) and then you can have a method like:

    getRoom(item) {
          // do what you need here and return...
    }

}, 200),
'keyup #searchInput': async function(event,template){

searchResults = [];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I mentioned, all of this code below is unnecessary.
You need to create a loadRooms method that supports an optional parameter: searchTerm.
The method will call the livechat/visitors.chatHistory/ endpoint. When you are searching, you will call loadRooms(searchTerm).

Is not much more simple?
I shared with you an example on how to implement this, why not just follow this instruction?

There is no reason for this loop, well you call the endpoint, searching or not, then you'll get the rooms you need to render.
If you need to change the object before rendering, you can create a helper method to do it, the this will be the object you pass to the chatRoomHistoryItem template.

// will return all the messages in history room
return Template.instance().historyResult.get().reverse();
},
len() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The helper method is still there.

import { APIClient, t } from '../../../../../utils/client';
import { Session } from 'meteor/session';

let Messages
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove all of these variables.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

var id = Session.get('FetchID');
var token = Session.get('FetchToken')
this.autorun(async () => {
Messages = await APIClient.v1.get(`livechat/messages.history/${ id }?token=${token}`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create a ReactiveVar to store the endpoint result.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Messages = await APIClient.v1.get(`livechat/messages.history/${ id }?token=${token}`);
// will return pervious chats list
let history = Messages.messages;
let newHisTory = []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the code below is unnecessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed the unnecessary code only required code is here

@lgtm-com
Copy link

lgtm-com bot commented Apr 27, 2020

This pull request introduces 7 alerts when merging 45ee0dd into 536ee97 - view on LGTM.com

new alerts:

  • 6 for Unused variable, import, function or class
  • 1 for Useless assignment to local variable

Copy link
Contributor

@renatobecker renatobecker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are making progress, but we still need improvements.
Please use ESLint to fix your code, there are a lot of minor problems with your code that would be identified by ESLint extension.

import { ReactiveVar } from 'meteor/reactive-var';
import './customerChatHistory.html';
import './chatRoomHistoryItem.html';
import { APIClient, t } from '../../../../../utils/client';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

't' is defined but never used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

},
previousChats() {
// will return pervious chats list
return addTime(Template.instance().history.get(),'true');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My editor(VS CODE) is displaying this => "'addTime' is not defined".
Do you guys have the ESLint installed on your code editor?

In addition, this is happening because the addTime method is declared without context, there is no const assigned, etc.

In addition, you don't need that function(addTime). You have created a new template -> chatRoomHistoryItem, right? So, what you need to do is to add this as a helper method in that template, you don't need this method here in this template.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

},
});

const DEBOUNCE_TIME_FOR_SEARCH_DEPARTMENTS_IN_MS = 300;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're not using this const anywhere, you aren't applying the debounce on the method keyup #searchInput.
You need to do something like:

    ...
	'keyup #searchInput': _.debounce((e, t) => {
		e.stopPropagation();
		e.preventDefault();
		// your-code-here...        
	}, DEBOUNCE_TIME_FOR_SEARCH_CHATS_IN_MS),
    

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

return;
}
const offset = this.offset.get();
const searchText='null';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const searchText='null';
const searchText='null';

Please, don't do this. You just need to declare the loadRooms(searchTerm) method inside the customerChatHistory.onCreated method, just like this:

	this.loadRooms(searchTerm) { ...

Inside this method, you will call the endpoint, and then you'll just apply a ternary operator to add the search term as parameters only when necessary.

}
const offset = this.offset.get();
const searchText='null';
let baseUrl = `livechat/visitors.chatHistory/room/${ currentData.rid}/visitor/${ this.visitorId.get() }?searchText=${searchText}&count=${ ITEMS_COUNT }&offset=${ offset }`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this code inside the this.loadRooms(searchTerm) method.

Suggested change
let baseUrl = `livechat/visitors.chatHistory/room/${ currentData.rid}/visitor/${ this.visitorId.get() }?searchText=${searchText}&count=${ ITEMS_COUNT }&offset=${ offset }`
let baseUrl = `livechat/visitors.chatHistory/room/${ currentData.rid}/visitor/${ this.visitorId.get() }?count=${ ITEMS_COUNT }&offset=${ offset }`

this.loadRooms(searchTerm) {
instance.ready.set(false);

let baseUrl = `livechat/visitors.chatHistory/room/${ currentData.rid}/visitor/${ this.visitorId.get() }?count=${ ITEMS_COUNT }&offset=${ offset }`

if (searchTerm) {
	baseUrl += `&searchText=${ searchTerm }`;
}

const { history, total } = await APIClient.v1.get(baseUrl);
this.history.set(this.history.get().concat(history));	
this.total.set(total);
thisready.set(true);

};

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

let resultArray=[];
Meteor.runAsUser(userId,()=>{
for(var i=0; i<history.length; i++){
var roomid = history[i]._id;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var roomid = history[i]._id;
var roomId = history[i]._id;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Meteor.runAsUser(userId,()=>{
for(var i=0; i<history.length; i++){
var roomid = history[i]._id;
var count = 1000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why 1000?
You just one match to know that the room has at least one message with the search term.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay now count is 1

offset,
total,
};
if(text == 'null'){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need any if/else condition, you just need an if condition.
If the text variable is assigned, then you will perform the additional search of each room.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

package.json Outdated
@@ -139,7 +139,7 @@
"@rocket.chat/ui-kit": "^0.7.1",
"@slack/client": "^4.8.0",
"adm-zip": "RocketChat/adm-zip",
"apn": "2.2.0",
"apn": "^2.2.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this update really needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think its has updated automatically but i have changed as previous

package.json Outdated
@@ -205,7 +205,7 @@
"moment-timezone": "^0.5.27",
"mongodb": "^3.5.6",
"node-dogstatsd": "^0.0.7",
"node-gcm": "0.14.4",
"node-gcm": "^0.14.4",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this update really needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think its has updated automatically but i have changed as previous

@lgtm-com
Copy link

lgtm-com bot commented Apr 28, 2020

This pull request introduces 1 alert when merging 4a7e476 into 5c993fe - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

<div class="visitor-history-details">
<div class="visitor-details">
<h1>{{responseBy.username}}</h1>
{{#if open}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This template will only display closed conversations, so this if condition does not make sense.
Please, remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

{{#if open}}
<p class='open'>Open</p>
{{else}}
<p>Close at time {{time}}</p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create a helper method to return the formatted closedAt field.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

{{/if}}
</div>
<div class="total-messages">
<p>{{room.msgs}} messages</p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<p>{{room.msgs}} messages</p>
<p>{{msgs}} messages</p>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done but this also includes the one as a connected message and one as a promptscript so there will be always +2 then the original message

<div class="total-messages">
<p>{{room.msgs}} messages</p>
</div>
<div class="agent-comment">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The closing room message is not mandatory, there is a setting that forces the agent to leave a message when closing the conversation. So, this block of code is conditional, the template will need to provide a helper method that will be used to check if the closing message exists or not.
Something like:

  • hasClosingRoomMessage

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

</div>
<div class="agent-comment">
<p class="comment-heading">Agent comment:</p>
<p class="comment-text">"{{lastMessage.msg}}"</p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lastMessage.msg is not the message that will be displayed here. The closing room message needs to be fetched from the DB, so you will need a helper method to return the message to the template.

Suggested change
<p class="comment-text">"{{lastMessage.msg}}"</p>
<p class="comment-text">"{{closingRoomMessage}}"</p>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

performed a check if the lastMesaage is livechat-close message only then it will be displayed

// will return pervious chats list
this.history.set(messages);
const allMessages = [];
for (let j = messages.length - 2; j >= 1; j--) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to this here, you need to create a customerChatHistoryMessagesItem template and add a helper method there to display this kind of value.

Please, remove this loop and apply it in the right place.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -3,6 +3,7 @@ import { check } from 'meteor/check';

import { API } from '../../../../api';
import { findVisitorInfo, findVisitedPages, findChatHistory } from '../../../server/api/lib/visitors';
import { normalizeMessagesForUser } from '/app/utils/server/lib/normalizeMessagesForUser';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you import this method if you're not using it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

});
});
}
if (closedChatsOnly) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to fetch only closed rooms from the database, not test it after fetching the data from the DB.
Suggestion: Create a new method on the LivechatRooms model similar to the findByVisitorId, you can create a LivechatRooms.findClosedByVisitorId and then you can use the correct method according to the query parameter value:

Suggested change
if (closedChatsOnly) {
const options = { sort: sort || { ts: -1 }, skip: offset, limit: count };
const cursor = closedChatsOnly ? LivechatRooms.findClosedByVisitorId(visitorId, options) : LivechatRooms.findByVisitorId(visitorId, options);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

const resultArray = [];
if (text !== undefined) {
Meteor.runAsUser(userId, () => {
history.map(function(val) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
history.map(function(val) {
history.map((val) => {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

const count = 1;
const result = Meteor.call('messageSearch', text, roomId, count).message.docs;
if (result.length > 0) {
result.map(function(e) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
result.map(function(e) {
result.map((e) => resultArray.push(e));

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

<div class="visitor-history-details">
<div class="visitor-details">
<h1>{{responseBy.username}}</h1>
<p>Close at time {{closedAt}}</p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, follow the prototype spec:

Suggested change
<p>Close at time {{closedAt}}</p>
<p>Close at {{closedAt}}</p>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

},
hasClosingRoomMessage() {
const { lastMessage } = Template.instance().room.get();
if (lastMessage.t === 'livechat-close') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not working and it's not the right way to implement it.
You need to fetch the livechat-close from the database and set this to the closingRoomMessage ReactiveVar.

Then, you can check here if the closingRoomMessage exists or not.


Template.chatRoomHistoryItem.onCreated(function() {
this.room = new ReactiveVar();
this.closingRoomMessage = new ReactiveVar();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fetch the livechat-close from the database.

@@ -0,0 +1,31 @@
import moment from 'moment';
import './chatRoomHistoryItem.html';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename both js/html files template to customerChatRoomHistoryItem.

@@ -0,0 +1,18 @@
<template name='chatRoomSearchItem'>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have explained before:

  • When you're searching or listing in the customerChatRoomHistory template, you'll display the results using the customerChatRoomHistoryItem template;
    When you're searching or listing in the customerChatHistoryMessages template you'll display the results using the customerChatHistoryMessagesItem template;

},
});

const DEBOUNCE_TIME_FOR_SEARCH_DEPARTMENTS_IN_MS = 300;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not using a correct name for this CONST?
DEBOUNCE_TIME_FOR_SEARCH_DEPARTMENTS_IN_MS -> DEBOUNCE_TIME_FOR_SEARCH_CHATS_IN_MS

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

this.isSearching = new ReactiveVar(false);
this.isChatClicked = new ReactiveVar(true);
this.clickRid = new ReactiveVar();
this.clickToken = new ReactiveVar();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need this information here, you can pass it through the Template data.

{{#if isSearching}}
{{#if isfound }}
{{#each room in searchResults}}
{{> chatRoomSearchItem room}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You NEED To use the same template -> chatRoomHistoryItem you're search in the customerChatHistory template.
Here, the user wants to see the ROOMS that have a message that matches the filter.

@@ -2941,6 +2941,11 @@
"uuid": "^3.2.1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to update this file, please undo it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is not updated as i can see on Rocket chat github it is same as mine

@@ -58,3 +58,429 @@

/* RTL */
@import 'imports/general/rtl.css';

Copy link
Contributor

@renatobecker renatobecker May 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a lot of indentation problems here, your code has spaces and tabs.
Also, add these changes to the livechat.css file, not the main.css.

Another important thing to mention is related to CSS stuff. These changes messed up the styling of the other components, as you can see the Room Info. Panel:

  • Correct version(develop):
    Screen Shot 2020-05-04 at 19 17 46

  • Your version:
    Screen Shot 2020-05-04 at 19 14 07

We can't approve these changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have created livechat css and solved the issue of messing issue but for the indention issue on css i was trying to resolve but i wont be able to . I am now only using indention of tab only but it always showing needed 1 indention weather i have added indention or not it always shows add indention i dont know how to resolve this issue

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the blank line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed the blank lines from the code

@renatobecker renatobecker added this to the 3.4.0 milestone Jun 2, 2020
@renatobecker renatobecker self-assigned this Jun 2, 2020
@renatobecker renatobecker changed the title Refactor past chat history [IMPROVE] Refactor Omnichannel Past Chats List Jun 2, 2020
@renatobecker renatobecker merged commit 4a10a42 into RocketChat:develop Jun 19, 2020
@sampaiodiego sampaiodiego mentioned this pull request Jun 30, 2020
@rodrigok rodrigok changed the title [IMPROVE] Refactor Omnichannel Past Chats List [IMPROVE] More info and better design of Omnichannel Past Chats List Jul 3, 2020
@rodrigok rodrigok changed the title [IMPROVE] More info and better design of Omnichannel Past Chats List [IMPROVE][Omnichannel] More info and better design of Past Chats List Jul 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants