wco_email 0.1.1.76 → 0.1.1.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5020bf6b347667ed27584fb369875c2f767f8cd623b713b10a2c20de7904b8ca
4
- data.tar.gz: 8dfaa34af1c86637f08df5eaa79d8c7c22ce348fc4c0a6e8779aaa4452628fed
3
+ metadata.gz: 598c923ca2af9d6d4b66479f643b5d0c261e5883bd1378e09bb9e8d207bf8d94
4
+ data.tar.gz: d80c9501a2636c8c9163ad8f7ef91aa991062d95083aa398dee5d23e5139cd3c
5
5
  SHA512:
6
- metadata.gz: '0905199d8188ca35b6323dad6ee02484a75c2b49e41fe5f08c32393e2ea820bf34bb59098f412ba2dfb456a558398c90831efee61c1ecea415403fac23c79c4f'
7
- data.tar.gz: 4f0b75eb2cd293c009e99a474db98d47d9ed27bbc5176ef643d40ad20797d551f52ccf2e7e15a415f0cdf7e53cb284998a986f5c5fc7b9cadbf6415a247e5bf3
6
+ metadata.gz: 52edcfe51e90ee55651fc2ab47641e6e2f80be5ee621ec08c391e1a94945cfc65186604782e422eeb79d522b8b454e854b29920c1e652ee618966009b35425ec
7
+ data.tar.gz: d2d817c9a1b8d9ca8655a9035b46e4f20d3a4ac0f70341333818edcacc637a05d440e6ee1582e832a5dcacc2053a556913997bf77e7a8e21c644ff9506c54963
@@ -0,0 +1,27 @@
1
+
2
+ class WcoEmail::Api::ContextsController < WcoEmail::ApiController
3
+
4
+ # before_action :set_lists
5
+
6
+
7
+ def summary
8
+ authorize! :summary, WcoEmail::Context
9
+ @results = WcoEmail::Context.summary
10
+ end
11
+
12
+
13
+ ##
14
+ ## Private
15
+ ##
16
+ private
17
+
18
+ # def set_lists
19
+ # @email_layouts_list = WcoEmail::EmailTemplate::LAYOUTS
20
+ # @email_templates_list = [ [nil, nil] ] + WcoEmail::EmailTemplate.all.map { |tmpl| [ tmpl.slug, tmpl.id ] }
21
+ # @leads_list = Wco::Lead.list
22
+ # end
23
+
24
+
25
+
26
+ end
27
+
@@ -1,8 +1,10 @@
1
1
 
2
2
  class WcoEmail::ApiController < ActionController::Base
3
3
 
4
- before_action :check_credentials
4
+ before_action :check_credentials, only: [ :create_email_message ]
5
+ before_action :decode_jwt, except: [ :create_email_message ]
5
6
  skip_before_action :verify_authenticity_token
7
+ layout false
6
8
 
7
9
  def create_email_message
8
10
  # puts! params, 'params'
@@ -28,4 +30,18 @@ class WcoEmail::ApiController < ActionController::Base
28
30
  end
29
31
  end
30
32
 
33
+ def decode_jwt
34
+ if Rails.env.test?
35
+ sign_in User.find_by({ email: 'victor@wasya.co' })
36
+ return
37
+ end
38
+
39
+ out = JWT.decode params[:jwt_token], nil, false
40
+ email = out[0]['email']
41
+ user = User.find_by({ email: email })
42
+ puts! user, 'user'
43
+
44
+ sign_in user
45
+ end
46
+
31
47
  end
@@ -11,7 +11,7 @@ class WcoEmail::EmailFiltersController < WcoEmail::ApplicationController
11
11
  else
12
12
  flash[:alert] = "No luck: #{@email_filter.errors.full_messages.join(', ')}."
13
13
  end
14
- redirect_to action: 'index'
14
+ redirect_to action: 'new'
15
15
  end
16
16
 
17
17
  def destroy
@@ -0,0 +1,7 @@
1
+
2
+ json.datapoints @results do |pt|
3
+ next if !pt['_id']
4
+ json.date pt['_id']
5
+ json.value pt['total']
6
+ end
7
+
data/config/routes.rb CHANGED
@@ -6,6 +6,8 @@ WcoEmail::Engine.routes.draw do
6
6
  get 'analytics', to: 'application#analytics'
7
7
  get 'tinymce', to: 'application#tinymce', as: :application_tinymce
8
8
 
9
+ get 'api/contexts/summary', to: '/wco_email/api/contexts#summary'
10
+
9
11
  get 'conversations/in/:tagname', to: '/wco_email/conversations#index', as: :conversations_in
10
12
  get 'conversations/not-in/:tagname_not', to: '/wco_email/conversations#index', as: :conversations_not_in
11
13
  get 'conversations/:id', to: '/wco_email/conversations#show', as: :conversation
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.76
4
+ version: 0.1.1.78
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-08-01 00:00:00.000000000 Z
11
+ date: 2024-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-s3
@@ -309,6 +309,7 @@ files:
309
309
  - app/assets/stylesheets/wco_email/logs.scss
310
310
  - app/assets/stylesheets/wco_email/messages.scss
311
311
  - app/assets/stylesheets/wco_email/tags.scss
312
+ - app/controllers/wco_email/api/contexts_controller.rb
312
313
  - app/controllers/wco_email/api_controller.rb
313
314
  - app/controllers/wco_email/application_controller.rb
314
315
  - app/controllers/wco_email/contexts_controller.rb
@@ -366,6 +367,7 @@ files:
366
367
  - app/views/wco_email/_analytics.erb
367
368
  - app/views/wco_email/_main_header.haml
368
369
  - app/views/wco_email/_sidebar.haml
370
+ - app/views/wco_email/api/contexts/summary.json.jbuilder
369
371
  - app/views/wco_email/contexts/_form.haml
370
372
  - app/views/wco_email/contexts/_form_reply.haml
371
373
  - app/views/wco_email/contexts/_header.haml