wco_email 0.1.1.77 → 0.1.1.78

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: 52038e34d498579e3f5dd95657b60505e36bf3837c89a252b1ba37550a101a59
4
- data.tar.gz: 0b4625fb6079e260b8bb5adf6a834ea9fecb3505092c9b4ce1114830a60b380a
3
+ metadata.gz: 598c923ca2af9d6d4b66479f643b5d0c261e5883bd1378e09bb9e8d207bf8d94
4
+ data.tar.gz: d80c9501a2636c8c9163ad8f7ef91aa991062d95083aa398dee5d23e5139cd3c
5
5
  SHA512:
6
- metadata.gz: 1a702be39b4ce58cf3794353505689f54b3bf1a64772f1c492d284d72982caf951a0ea4cc76485083c3ae1e30b4bce385ef0775c15ae00fe0fed419f48325495
7
- data.tar.gz: 0a594716aaa81794af5c06424b28218946b2146a4c4e2048e7a0737fe497cfdaa4b67c329c4565ddbc485e17dce1b4759ad0506a11a6b6e89a194abcd5ba8652
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
@@ -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.77
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-07 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