wco_models 3.1.0.175 → 3.1.0.177
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4eaa4ae791b0efb894e267ee640a2559d8cf3a0aec9e9c2b46ef28d19610d069
|
4
|
+
data.tar.gz: aba7e8635f3edc53fdaea60ce8739e9488215bd702309a23b8f3cc69708e9dda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e242a74a1154595834d349d86f4b0475219439ee17e9762a257c7f40fa8761fb61cc3ef73e164045d6b2b7a7525756ac67a1d0f266943eb4ed27292b489aecef
|
7
|
+
data.tar.gz: 665b22dbd49c9fa79d24e0f349a6a30f639bfd7dec0db48a3e69758ae0e0984e14ceada8d33c39c6fe5ec98156f9884bd336472e2163828b001d8e0731bf24a4
|
@@ -33,6 +33,48 @@ class WcoEmail::Conversation
|
|
33
33
|
|
34
34
|
belongs_to :filter, class_name: 'WcoEmail::EmailFilter', inverse_of: :conversations, optional: true
|
35
35
|
|
36
|
+
def self.load_conversations_messages_tag_by_params_and_profile params, current_profile
|
37
|
+
@conversations = WcoEmail::Conversation.all
|
38
|
+
|
39
|
+
if params[:tagname]
|
40
|
+
@tag = Wco::Tag.find_by slug: params[:tagname]
|
41
|
+
@conversations = @conversations.where( :tag_ids.in => [ @tag.id ] )
|
42
|
+
end
|
43
|
+
if params[:tagname_not]
|
44
|
+
@tag_not = Wco::Tag.find_by slug: params[:tagname_not]
|
45
|
+
@conversations = @conversations.where( :tag_ids.nin => [ @tag_not.id ] )
|
46
|
+
end
|
47
|
+
|
48
|
+
if params[:subject].present?
|
49
|
+
@conversations = @conversations.where({ subject: /.*#{params[:subject]}.*/i })
|
50
|
+
end
|
51
|
+
|
52
|
+
if params[:from_email].present?
|
53
|
+
@conversations = @conversations.where({ from_emails: /.*#{params[:from_email]}.*/i })
|
54
|
+
end
|
55
|
+
|
56
|
+
if params[:lead_id].present?
|
57
|
+
@conversations = @conversations.where( lead_ids: params[:lead_id] )
|
58
|
+
end
|
59
|
+
|
60
|
+
@conversations = @conversations.where(
|
61
|
+
).includes( :leads, :messages, :tags
|
62
|
+
).order_by( latest_at: :desc
|
63
|
+
).page( params[:conv_page] ).per( current_profile.per_page )
|
64
|
+
|
65
|
+
conversation_ids = @conversations.map &:id
|
66
|
+
messages = WcoEmail::Message.where(
|
67
|
+
:conversation_id.in => conversation_ids,
|
68
|
+
read_at: nil,
|
69
|
+
)
|
70
|
+
@messages_hash = {}
|
71
|
+
messages.map do |msg|
|
72
|
+
@messages_hash[msg.id.to_s] = msg
|
73
|
+
end
|
74
|
+
|
75
|
+
return [ @conversations, @messages_hash, @tag ]
|
76
|
+
end
|
77
|
+
|
36
78
|
def cache_key
|
37
79
|
"#{self.class.name} #{id.to_s} #{updated_at}"
|
38
80
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wco_models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.0.
|
4
|
+
version: 3.1.0.177
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Pudeyev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ahoy_matey
|
@@ -421,11 +421,11 @@ files:
|
|
421
421
|
- app/assets/stylesheets/wco/conversations.scss
|
422
422
|
- app/assets/stylesheets/wco/galleries.scss
|
423
423
|
- app/assets/stylesheets/wco/leads_leadsets.scss
|
424
|
+
- app/assets/stylesheets/wco/main.scss
|
424
425
|
- app/assets/stylesheets/wco/office_action_templates.scss
|
425
426
|
- app/assets/stylesheets/wco/pagination.scss
|
426
427
|
- app/assets/stylesheets/wco/photos.scss
|
427
428
|
- app/assets/stylesheets/wco/sitemaps.scss
|
428
|
-
- app/assets/stylesheets/wco/utils.scss
|
429
429
|
- app/assets/stylesheets/wco/videos.scss
|
430
430
|
- app/controllers/wco/api/leads_controller.rb
|
431
431
|
- app/controllers/wco/api/obfuscated_redirects_controller.rb
|