wco_email 0.1.1.58 → 0.1.1.60

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ee69de6a781e7d30ee9a55bffd62814ec869211f0b97c4430fc49d45e138cfc9
4
- data.tar.gz: 24123409b3c7261e75db576ce5c95839dcffd36583b25541246114143cdac0ba
3
+ metadata.gz: 2b52075c51de58e22a4d47f2b4ad35beda41d4859a1bde66ef9e96c9073978bc
4
+ data.tar.gz: 72a95d19d834e11df8e7667c66c8d482faaf10940310009dad3769f225686721
5
5
  SHA512:
6
- metadata.gz: 1786bc6c59b990a140dfae0209f1a2ab2bb6fa88986d59e16be31d699ef11227905aad42a90591c7376033637d953a7958ec8fe920d3e9044b79f14264d64f15
7
- data.tar.gz: dfc0322f896a37e3ec10a45d8f85cbb3394b1152d846f480bb1494cfad78200410b919b67d8f4bfebae6bc7642a024cd4707ef26f380ada0ac2845fc50ebb90f
6
+ metadata.gz: 1d12e1104206b6eed807a73da00f4840b6de120caea9221f8e92d6a6119e0df7581930f8b1a36f787371e981024c93e962ecb5b1704b256965c778a4bdf105fd
7
+ data.tar.gz: 8538366595cb58699e57fdcbf65db246a765b8de7f70be8badbf7f9ab922976f3e136b66e6d717888bca43c246b65aeae28449a71cf26624fdce42ab5bf3aa44
@@ -52,9 +52,21 @@ class WcoEmail::ConversationsController < WcoEmail::ApplicationController
52
52
  @conversations = @conversations.where( lead_ids: params[:lead_id] )
53
53
  end
54
54
 
55
- @conversations = @conversations.includes( :leads, :messages, :tags
55
+ @conversations = @conversations.where(
56
+ # ).includes( :leads, :messages, :tags
56
57
  ).order_by( latest_at: :desc
57
58
  ).page( params[:conv_page] ).per( current_profile.per_page )
59
+
60
+ conversation_ids = @conversations.map &:id
61
+
62
+ @messages_hash = {}
63
+ messages = WcoEmail::Message.where(
64
+ :conversation_id.in => conversation_ids,
65
+ read_at: nil,
66
+ )
67
+ messages.map do |msg|
68
+ @messages_hash[msg.id.to_s] = msg
69
+ end
58
70
  end
59
71
 
60
72
  ## merge conv1 into conv2, and delete conv1
@@ -100,15 +112,15 @@ class WcoEmail::ConversationsController < WcoEmail::ApplicationController
100
112
 
101
113
  @conversation.messages.unread.update_all({ read_at: Time.now })
102
114
 
103
- @other_convs = WcoEmail::Message.where( :message_id.in => @messages.map( &:in_reply_to_id )
104
- ).where( :conversation_id.ne => @conversation.id
105
- ).map( &:conversation_id ).uniq
106
- other_convs_by_subj = WcoEmail::Conversation.where( subject: @conversation.subject
107
- ).where( :conversation_id.ne => @conversation.id
108
- ).map( &:id )
109
- if @other_convs.present?
110
- @other_convs = WcoEmail::Conversation.find( @other_convs + other_convs_by_subj )
111
- end
115
+ # @other_convs = WcoEmail::Message.where( :message_id.in => @messages.map( &:in_reply_to_id )
116
+ # ).where( :conversation_id.ne => @conversation.id
117
+ # ).map( &:conversation_id ).uniq
118
+ # other_convs_by_subj = WcoEmail::Conversation.where( subject: @conversation.subject
119
+ # ).where( :conversation_id.ne => @conversation.id
120
+ # ).map( &:id )
121
+ # if @other_convs.present? || other_convs_by_subj.present?
122
+ # @other_convs = WcoEmail::Conversation.find( @other_convs + other_convs_by_subj )
123
+ # end
112
124
  end
113
125
 
114
126
  def update
@@ -4,7 +4,7 @@
4
4
  - @tags.each do |tag|
5
5
  %li
6
6
  = link_to tag.slug, conversations_in_path( tag.slug )
7
- -# (#{tag.conversations.unread.length})
7
+ -# <b>#{tag.conversations.unread.length}</b>
8
8
  -# (#{tag.conversations.length})
9
9
  = link_to "not", conversations_not_in_path( tag.slug )
10
10
 
@@ -15,5 +15,4 @@
15
15
 
16
16
  = render '/wco/paginate', resource: @conversations, param_name: :conv_page
17
17
  = render '/wco_email/conversations/table', convs: @conversations
18
-
19
18
  = render '/wco/paginate', resource: @conversations, param_name: :conv_page
@@ -13,14 +13,13 @@
13
13
  - @conversation.leads.each do |lead|
14
14
  .Chip= link_to lead.email, wco.lead_path( lead )
15
15
 
16
-
17
- - if @other_convs.present?
18
- - @other_convs.each do |conv|
19
- .d-flex
20
- = button_to "Merge", merge_conversations_path( @conversation, conv ), data: { confirm: 'Are you sure?' }
21
- = conv.subject
22
- (#{conv.messages.length})
23
- %span.gray.mini= conv.id
16
+ -# - if @other_convs.present?
17
+ -# - @other_convs.each do |conv|
18
+ -# .d-flex
19
+ -# = button_to "Merge", merge_conversations_path( @conversation, conv ), data: { confirm: 'Are you sure?' }
20
+ -# = conv.subject
21
+ -# (#{conv.messages.length})
22
+ -# %span.gray.mini= conv.id
24
23
 
25
24
 
26
25
  %ul.m-0.p-0
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wco_email
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1.58
4
+ version: 0.1.1.60
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Pudeyev