-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
[IMPROVE][Omnichannel] More info and better design of Past Chats List #17346
Conversation
|
There was a problem hiding this 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({ | ||
|
There was a problem hiding this comment.
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}} |
There was a problem hiding this comment.
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}} |
There was a problem hiding this comment.
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 }} |
There was a problem hiding this comment.
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}} |
There was a problem hiding this comment.
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}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
historyResult = await APIClient.v1.get(`livechat/messages.history/${ id }?token=${token}`); | |
{ messages } = await APIClient.v1.get(`livechat/messages.history/${ id }?token=${token}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
}) | ||
|
||
Template.customerChatHistoryMessages.events({ |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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){ |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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){ |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
app/livechat/client/views/regular.js
Outdated
@@ -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'; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
This pull request introduces 12 alerts when merging 6ec867f into 5a1ef96 - view on LGTM.com new alerts:
|
There was a problem hiding this 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> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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"> |
There was a problem hiding this comment.
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.
<div class="list-view"> | |
{{#if chatHistoryEmpty}} | |
{{_ "Customer_has_no_chat_history"}} | |
{{else}} | |
<div class="list-view"> |
There was a problem hiding this comment.
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}}' > |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<li class='list-chat' id='{{_id}}' aria='{{v.token}}' > | |
{{#each room in previousChats}} {{> chatRoomHistoryItem room }} {{/each}} |
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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 = [] |
There was a problem hiding this comment.
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 = []; |
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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}`); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 = [] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
This pull request introduces 7 alerts when merging 45ee0dd into 536ee97 - view on LGTM.com new alerts:
|
There was a problem hiding this 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'; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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),
There was a problem hiding this comment.
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'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 }` |
There was a problem hiding this comment.
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.
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);
};
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var roomid = history[i]._id; | |
var roomId = history[i]._id; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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'){ |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
This pull request introduces 1 alert when merging 4a7e476 into 5c993fe - view on LGTM.com new alerts:
|
<div class="visitor-history-details"> | ||
<div class="visitor-details"> | ||
<h1>{{responseBy.username}}</h1> | ||
{{#if open}} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<p>{{room.msgs}} messages</p> | |
<p>{{msgs}} messages</p> |
There was a problem hiding this comment.
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"> |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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.
<p class="comment-text">"{{lastMessage.msg}}"</p> | |
<p class="comment-text">"{{closingRoomMessage}}"</p> |
There was a problem hiding this comment.
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--) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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'; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
}); | ||
}); | ||
} | ||
if (closedChatsOnly) { |
There was a problem hiding this comment.
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:
if (closedChatsOnly) { | |
const options = { sort: sort || { ts: -1 }, skip: offset, limit: count }; | |
const cursor = closedChatsOnly ? LivechatRooms.findClosedByVisitorId(visitorId, options) : LivechatRooms.findByVisitorId(visitorId, options); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
history.map(function(val) { | |
history.map((val) => { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
result.map(function(e) { | |
result.map((e) => resultArray.push(e)); |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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:
<p>Close at time {{closedAt}}</p> | |
<p>Close at {{closedAt}}</p> |
There was a problem hiding this comment.
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') { |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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'; |
There was a problem hiding this comment.
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'> |
There was a problem hiding this comment.
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 thecustomerChatRoomHistoryItem
template;
When you're searching or listing in thecustomerChatHistoryMessages
template you'll display the results using thecustomerChatHistoryMessagesItem
template;
}, | ||
}); | ||
|
||
const DEBOUNCE_TIME_FOR_SEARCH_DEPARTMENTS_IN_MS = 300; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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}} |
There was a problem hiding this comment.
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.
package-lock.json
Outdated
@@ -2941,6 +2941,11 @@ | |||
"uuid": "^3.2.1" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
app/theme/client/main.css
Outdated
@@ -58,3 +58,429 @@ | |||
|
|||
/* RTL */ | |||
@import 'imports/general/rtl.css'; | |||
|
There was a problem hiding this 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 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
:
We can't approve these changes.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the blank line
There was a problem hiding this comment.
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
The main goal expected from this improvement is to replace the current UI/UX of the Omnichannel
Past Chats List
feature.From:
To: