Enhancement: Paginate conversation calls in tabs (#560)
* Use conversationPage module for pagination * Load more conversations * Reset list if conversation status is changed * Add specs to conversationPage * Reset filter when page is re-mounted * Update text * Update text
This commit is contained in:
@@ -19,7 +19,7 @@ describe ::ConversationFinder do
|
||||
|
||||
describe '#perform' do
|
||||
context 'with status' do
|
||||
let(:params) { { status: 'open', assignee_type_id: 0 } }
|
||||
let(:params) { { status: 'open', assignee_type: 'me' } }
|
||||
|
||||
it 'filter conversations by status' do
|
||||
result = conversation_finder.perform
|
||||
@@ -28,7 +28,7 @@ describe ::ConversationFinder do
|
||||
end
|
||||
|
||||
context 'with assignee' do
|
||||
let(:params) { { assignee_type_id: 2 } }
|
||||
let(:params) { { assignee_type: 'all' } }
|
||||
|
||||
it 'filter conversations by assignee' do
|
||||
result = conversation_finder.perform
|
||||
@@ -49,7 +49,7 @@ describe ::ConversationFinder do
|
||||
end
|
||||
|
||||
context 'with pagination' do
|
||||
let(:params) { { status: 'open', assignee_type_id: 0, page: 1 } }
|
||||
let(:params) { { status: 'open', assignee_type: 'me', page: 1 } }
|
||||
|
||||
it 'returns paginated conversations' do
|
||||
create_list(:conversation, 50, account: account, inbox: inbox, assignee: user_1)
|
||||
|
||||
@@ -221,7 +221,7 @@ RSpec.describe Conversation, type: :model do
|
||||
id: conversation.display_id,
|
||||
messages: [],
|
||||
inbox_id: conversation.inbox_id,
|
||||
status: conversation.status_before_type_cast.to_i,
|
||||
status: conversation.status,
|
||||
timestamp: conversation.created_at.to_i,
|
||||
user_last_seen_at: conversation.user_last_seen_at.to_i,
|
||||
agent_last_seen_at: conversation.agent_last_seen_at.to_i,
|
||||
|
||||
@@ -20,7 +20,7 @@ RSpec.describe Conversations::EventDataPresenter do
|
||||
id: conversation.display_id,
|
||||
messages: [],
|
||||
inbox_id: conversation.inbox_id,
|
||||
status: conversation.status_before_type_cast.to_i,
|
||||
status: conversation.status,
|
||||
timestamp: conversation.created_at.to_i,
|
||||
user_last_seen_at: conversation.user_last_seen_at.to_i,
|
||||
agent_last_seen_at: conversation.agent_last_seen_at.to_i,
|
||||
|
||||
Reference in New Issue
Block a user