wco_email 0.1.1.74 → 0.1.1.76

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: eadb96571c35fc50347f3428795c5d34627b9b8475411a3854b5d06d5558e27e
4
- data.tar.gz: 05eece40857e365fdc985dc2a4e58cd8eb736ec7cb955d8967567446ac13c910
3
+ metadata.gz: 5020bf6b347667ed27584fb369875c2f767f8cd623b713b10a2c20de7904b8ca
4
+ data.tar.gz: 8dfaa34af1c86637f08df5eaa79d8c7c22ce348fc4c0a6e8779aaa4452628fed
5
5
  SHA512:
6
- metadata.gz: 187a5b65817946e8cf779ef9e286529913fc96fefe6b9a97d51d49cba77e4f8a645201321bd38732fd7cdf2dc574a1dc5e1bfc00bbbad1c99fca5a76f1ebc227
7
- data.tar.gz: 8e12a1b02d952a9c0a86781c3e0ba91a5e9d8a15f43c9ed7b816c3b3c2522346777031835fc81cb1dccf891455a4644d1360e5284d0fd57a66371ba5fd754d4e
6
+ metadata.gz: '0905199d8188ca35b6323dad6ee02484a75c2b49e41fe5f08c32393e2ea820bf34bb59098f412ba2dfb456a558398c90831efee61c1ecea415403fac23c79c4f'
7
+ data.tar.gz: 4f0b75eb2cd293c009e99a474db98d47d9ed27bbc5176ef643d40ad20797d551f52ccf2e7e15a415f0cdf7e53cb284998a986f5c5fc7b9cadbf6415a247e5bf3
@@ -68,6 +68,42 @@ $(".add-tag-btn").click(function(e) {
68
68
 
69
69
  })
70
70
 
71
+
72
+ $(".office-action-templates-perform-btn").click(function(e) {
73
+ if ( !confirm('Are you sure?') ) { return; }
74
+
75
+ const jwt_token = $("#Config").data('jwt-token')
76
+ const action_path = $(this).data('url')
77
+ const oat_id = $("select[name='office_action_template']").val()
78
+ const out = []
79
+
80
+ $( $("input[type='checkbox'].i-sel:checked") ).each( idx => {
81
+ let val = $($("input[type='checkbox'].i-sel:checked")[idx]).val()
82
+ out.push(val)
83
+ })
84
+
85
+ let data = {
86
+ conversation_ids: out,
87
+ jwt_token: jwt_token,
88
+ id: oat_id,
89
+ }
90
+ $.ajax({
91
+ url: action_path,
92
+ type: 'POST',
93
+ data: data,
94
+ success: e => {
95
+ logg((e||{}).responseText, 'Ok')
96
+ location.reload()
97
+ },
98
+ error: e => {
99
+ logg((e||{}).responseText, 'Err')
100
+ location.reload()
101
+ },
102
+ })
103
+
104
+ })
105
+
106
+
71
107
  $(".remove-tag-btn").click(function(e) {
72
108
  if ( !confirm('Are you sure?') ) { return; }
73
109
 
@@ -4,8 +4,13 @@
4
4
  **/
5
5
 
6
6
  .application--sidebar {
7
+ // border-right: 1px solid red;
7
8
  min-width: 200px;
8
- border-right: 1px solid red;
9
+
10
+ }
11
+
12
+ .btn {
13
+ border: 2px solid gray;
9
14
  }
10
15
 
11
16
  iframe.email-template-iframe {
@@ -18,3 +18,13 @@ th.select-all {
18
18
  th.tags {
19
19
  width: 200px;
20
20
  }
21
+
22
+ .conversations--tags-actions {
23
+ display: flex;
24
+ align-items: baseline;
25
+
26
+ h5 {
27
+ font-size: 1em;
28
+ padding-right: 0.5em;
29
+ }
30
+ }
@@ -0,0 +1,6 @@
1
+
2
+ ul.Logs {
3
+ > li {
4
+ margin-left: 0.4em;
5
+ }
6
+ }
@@ -6,16 +6,21 @@
6
6
  }
7
7
 
8
8
  .Meta {
9
+ > ul {
10
+ list-style-type: none;
11
+ }
9
12
  ul {
10
13
  margin: 0;
11
14
  padding: 0;
12
- list-style-type: none;
15
+ }
16
+ }
13
17
 
14
- li {
18
+ .messages--meta {
19
+ > ul {
20
+ > li {
15
21
  border-left: 3px solid var(--wco-color-2);
16
22
  padding-left: 0.5em;
17
23
  margin-bottom: 0.5em;
18
24
  }
19
-
20
25
  }
21
26
  }
@@ -152,9 +152,10 @@ class WcoEmail::ConversationsController < WcoEmail::ApplicationController
152
152
  end
153
153
 
154
154
  def set_lists
155
- @tags = Wco::Tag.all
156
155
  @email_templates_list = [ [nil, nil] ] + WcoEmail::EmailTemplate.all.map { |tmpl| [ tmpl.slug, tmpl.id ] }
157
156
  @leads_list = Wco::Lead.list
157
+ @office_action_templates_list = Wco::OfficeActionTemplate.list
158
+ @tags = Wco::Tag.all
158
159
  @tags_list = Wco::Tag.list
159
160
  end
160
161
 
@@ -4,8 +4,20 @@ class WcoEmail::MessageStubsController < WcoEmail::ApplicationController
4
4
  def churn
5
5
  @stub = WcoEmail::MessageStub.find params[:id]
6
6
  authorize! :churn, @stub
7
- WcoEmail::MessageIntakeJob.perform_async( @stub.id.to_s )
8
- flash_notice "Schedueld to churn 1 stub."
7
+
8
+ # WcoEmail::MessageIntakeJob.perform_async( @stub.id.to_s )
9
+ begin
10
+ @stub.do_process
11
+ rescue => err
12
+ @stub.update({ status: WcoEmail::MessageStub::STATUS_FAILED })
13
+ puts! err, "WcoEmail::MessageIntakeJob error"
14
+ ::ExceptionNotifier.notify_exception(
15
+ err,
16
+ data: { stub: @stub }
17
+ )
18
+ end
19
+
20
+ flash_notice "Churned 1 stub."
9
21
  redirect_to request.referrer
10
22
  end
11
23
 
@@ -5,6 +5,17 @@ class WcoEmail::MessagesController < WcoEmail::ApplicationController
5
5
 
6
6
  def show
7
7
  @message = WcoEmail::Message.find params[:id]
8
+
9
+ @client ||= Aws::S3::Client.new({
10
+ region: ::S3_CREDENTIALS[:region_ses],
11
+ access_key_id: ::S3_CREDENTIALS[:access_key_id_ses],
12
+ secret_access_key: ::S3_CREDENTIALS[:secret_access_key_ses],
13
+ })
14
+ stub = @message.stub
15
+ raw = @client.get_object( bucket: stub.bucket, key: stub.object_key ).body.read
16
+ raw = raw.encode('utf-8', invalid: :replace, undef: :replace, replace: '_' )
17
+ @the_mail = Mail.new( raw )
18
+
8
19
  authorize! :show, @message
9
20
  end
10
21
 
@@ -1,6 +1,7 @@
1
1
 
2
2
 
3
- .bordered.inline-block.mb-2
3
+ .conversations--tags-actions.bordered.inline-block.mb-2
4
+ %h5 Add/Remove Tag
4
5
  .d-inline-block
5
6
  = select_tag :emailtag, options_for_select(@tags_list), class: 'select2'
6
7
  = check_box_tag :is_move
@@ -3,6 +3,8 @@
3
3
  = render 'wco_email/sidebar'
4
4
 
5
5
  .conversations-index
6
+ = render '/wco_email/conversations/search'
7
+
6
8
  .header
7
9
  %h5.title
8
10
  - if @tag
@@ -10,8 +12,9 @@
10
12
  - if @tag_not
11
13
  Tag-not `#{@tag_not}`
12
14
  (#{@conversations.length})
13
- = render '/wco_email/conversations/search'
14
- = render '/wco_email/conversations/actions'
15
+
16
+ = render '/wco_email/conversations/tags_actions'
17
+ = render '/wco/office_actions/actions'
15
18
 
16
19
  = render '/wco/paginate', resource: @conversations, param_name: :conv_page
17
20
  = render '/wco_email/conversations/table', convs: @conversations
@@ -12,15 +12,12 @@
12
12
  %span.gray.mini= @conversation.id
13
13
 
14
14
  = render '/wco/tags/index_chips', tags: @conversation.tags
15
-
16
- = render '/wco_email/conversations/actions'
17
-
18
- .Leads.mb-2
19
- .d-inline <b>Leads:</b>
20
- - @conversation.leads.each do |lead|
21
- .Chip= link_to lead.email, wco.lead_path( lead )
15
+ = render '/wco_email/conversations/tags_actions'
16
+ = render '/wco/leads/index_chips', leads: @conversation.leads
17
+ = render '/wco/leadsets/index_chips', leadsets: @conversation.leadsets
22
18
 
23
19
  - if @other_convs.present?
20
+ %h5 Other convs:
24
21
  - @other_convs.each do |conv|
25
22
  .d-flex
26
23
  = button_to "Merge", merge_conversations_path( @conversation, conv ), data: { confirm: 'Are you sure?' }
@@ -1,15 +1,19 @@
1
1
 
2
- .d-inline-block.Meta
3
- %i.fa.fa-compress.collapse-expand
2
+ .d-inline-block
3
+ %i.fa.fa-compress.collapse-expand#messageMeta
4
4
  Meta
5
- .messages--meta.flex-row{ style: 'display: none' }
5
+ .Meta.messages--meta.flex-row
6
6
 
7
7
  %ul
8
8
  %li <b>froms:</b> #{message.froms}
9
9
  %li <b>tos:</b> #{message.tos}
10
10
  %li <b>ccs:</b> #{message.ccs}
11
11
  %li <b>bccs:</b> #{message.bccs}
12
- %li <b>logs:</b> #{message.logs}
12
+ %li
13
+ <b>logs:</b>
14
+ %ul.Logs
15
+ - message.logs.each do |log|
16
+ %li= log
13
17
  %ul
14
18
  %li
15
19
  <b>date:</b> #{message.date}
@@ -19,6 +23,10 @@
19
23
  <b>message_id:</b> #{message.message_id}
20
24
  %li
21
25
  <b>object_key:</b> #{message.object_key}
26
+ %li
27
+ <b>Stub:</b>
28
+ #{message.stub.id}
29
+ .d-inline-block= button_to 'reprocess', churn_message_stub_path(message.stub)
22
30
  %li <b>in_reply_to_id:</b> #{message.in_reply_to_id}
23
31
  %li
24
32
  <b>n_images:</b> #{message.photos.length}
@@ -1,5 +1,5 @@
1
1
 
2
- .messages-show
2
+ .messages-show.maxwidth
3
3
  %h5
4
4
  Message
5
5
  <b>Subject:</b>
@@ -10,4 +10,8 @@
10
10
  %iframe.message-iframe{ src: message_iframe_path(@message) }
11
11
  = render '/wco_email/contexts/form_reply', lead_id: @message.lead_id, message: @message, ctx: WcoEmail::Context.new({ from_email: @message.to&.downcase, subject: @message.subject, email_template_id: ET.find_by( slug: 'blank').id })
12
12
 
13
+ = @message.inspect
14
+ %hr
15
+ %pre
16
+ = raw @the_mail.body.decoded
13
17
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wco_email
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1.74
4
+ version: 0.1.1.76
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-05-15 00:00:00.000000000 Z
11
+ date: 2024-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-s3
@@ -306,6 +306,7 @@ files:
306
306
  - app/assets/stylesheets/wco_email/application.scss
307
307
  - app/assets/stylesheets/wco_email/contexts.scss
308
308
  - app/assets/stylesheets/wco_email/conversations.scss
309
+ - app/assets/stylesheets/wco_email/logs.scss
309
310
  - app/assets/stylesheets/wco_email/messages.scss
310
311
  - app/assets/stylesheets/wco_email/tags.scss
311
312
  - app/controllers/wco_email/api_controller.rb
@@ -376,9 +377,9 @@ files:
376
377
  - app/views/wco_email/contexts/show_iframe.haml
377
378
  - app/views/wco_email/contexts/summary.csv.erb
378
379
  - app/views/wco_email/contexts/summary.haml
379
- - app/views/wco_email/conversations/_actions.haml
380
380
  - app/views/wco_email/conversations/_form.haml
381
381
  - app/views/wco_email/conversations/_search.haml
382
+ - app/views/wco_email/conversations/_tags_actions.haml
382
383
  - app/views/wco_email/conversations/edit.haml
383
384
  - app/views/wco_email/conversations/index.haml
384
385
  - app/views/wco_email/conversations/show.haml