wco_models 3.1.0.212 → 3.1.0.214
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 +4 -4
- data/README.txt +13 -1
- data/app/controllers/wco/office_action_templates_controller.rb +7 -2
- data/app/controllers/wco/office_actions_controller.rb +11 -0
- data/app/models/wco/office_action_template.rb +1 -0
- data/app/models/wco/price.rb +5 -1
- data/app/views/wco/leadsets/_form.haml +1 -1
- data/app/views/wco/office_action_templates/_form.haml +4 -1
- data/app/views/wco/office_action_templates/index.haml +9 -4
- data/app/views/wco/office_action_templates/show.haml +1 -1
- data/app/views/wco/office_actions/_actions.haml +1 -1
- data/app/views/wco/office_actions/_index.haml +2 -0
- data/config/routes.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cdeac595a719fd8ca76e389973edd35dcebde79b128db8b2b0336ce5b90138d2
|
4
|
+
data.tar.gz: 012f0b8ba7459279cd2781260aab2549d7aac5dc4b1c2543813bc9537fbd2b07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b2269ccb090f1d833206ae2ff0da27ef239ca28133bc31c269897a6a892614f40ea0128807c488e2ef829f6d27ef33d732feb3a3fc7f678f71042770052c9b7
|
7
|
+
data.tar.gz: 2f12f75f8feca3fde8a3b5599e3ff8d92ed6330e7aa57e8af959e832c24aec083b6df67befa01ffef45379fe20f99502216ee37e4efa226bb329094c96784309
|
data/README.txt
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
|
2
|
-
|
2
|
+
WasyaCo Models. The functionality shared across all (most) projects, including:
|
3
|
+
* The ActiveRecord models
|
4
|
+
* some stylesheets,
|
5
|
+
* some javascript.
|
6
|
+
|
7
|
+
== Setup ==
|
8
|
+
|
9
|
+
Docker is reqiured for development. It is used for mongo, and localstack.
|
10
|
+
|
11
|
+
Some infrastructure is driven by ansible - therefore, local python is required:
|
12
|
+
|
13
|
+
python3 -m venv zenv
|
14
|
+
. zenv/bin/activate
|
3
15
|
|
4
16
|
== Test ==
|
5
17
|
|
@@ -25,9 +25,14 @@ class Wco::OfficeActionTemplatesController < Wco::ApplicationController
|
|
25
25
|
def perform
|
26
26
|
@oat = OAT.find params[:id]
|
27
27
|
authorize! :run, @oat
|
28
|
-
@conversations = WcoEmail::Conversation.find( params[:conversation_ids] )
|
29
|
-
|
28
|
+
@conversations = WcoEmail::Conversation.find( params[:conversation_ids] ) if params[:conversation_ids].present?
|
29
|
+
if 'rb' == @oat.action_type
|
30
|
+
out = eval( @oat.action_exe )
|
31
|
+
elsif 'sh' == @oat.action_type
|
32
|
+
out = `#{@oat.action_exe}`
|
33
|
+
end
|
30
34
|
flash_notice out
|
35
|
+
redirect_to action: :index
|
31
36
|
end
|
32
37
|
|
33
38
|
def show
|
@@ -15,6 +15,17 @@ class Wco::OfficeActionsController < Wco::ApplicationController
|
|
15
15
|
redirect_to action: :index
|
16
16
|
end
|
17
17
|
|
18
|
+
def destroy
|
19
|
+
@oa = OA.find params[:id]
|
20
|
+
authorize! :destroy, @oa
|
21
|
+
if @oa.delete
|
22
|
+
flash_notice @oa
|
23
|
+
else
|
24
|
+
flash_alert @oa
|
25
|
+
end
|
26
|
+
redirect_to action: :index
|
27
|
+
end
|
28
|
+
|
18
29
|
def edit
|
19
30
|
@oa = OA.find params[:id]
|
20
31
|
authorize! :edit, @oa
|
@@ -16,6 +16,7 @@ class Wco::OfficeActionTemplate
|
|
16
16
|
belongs_to :from, polymorphic: true, optional: true
|
17
17
|
belongs_to :publisher, class_name: 'Wco::Publisher', optional: true
|
18
18
|
|
19
|
+
field :action_type, type: :string, default: 'rb' # 'js', 'rb', 'sh'
|
19
20
|
field :action_exe, type: :string
|
20
21
|
validates :action_exe, presence: true
|
21
22
|
def do_run
|
data/app/models/wco/price.rb
CHANGED
@@ -8,7 +8,11 @@ class Wco::Price
|
|
8
8
|
## Wco::Product, WcoHosting::ApplianceTmpl
|
9
9
|
belongs_to :product, polymorphic: true
|
10
10
|
|
11
|
-
|
11
|
+
## 2025-09-12 This used to be required - but I think it's unreasonable...
|
12
|
+
## all leadsets can have the same price.
|
13
|
+
## but I'll keep this around - to be able to override per-leadset.
|
14
|
+
## something else may be broken b/c I made this optional.
|
15
|
+
belongs_to :leadset, class_name: 'Wco::Leadset', optional: true
|
12
16
|
|
13
17
|
has_many :subscriptions, class_name: 'Wco::Subscription', inverse_of: :price, foreign_key: :wco_price_id
|
14
18
|
|
@@ -9,8 +9,11 @@
|
|
9
9
|
%label Slug
|
10
10
|
= f.text_field :slug, class: 'w-100'
|
11
11
|
|
12
|
+
.field
|
13
|
+
%label action_type
|
14
|
+
= f.select :action_type, options_for_select( [ nil, 'js', 'rb', 'sh' ], selected: oat.action_type )
|
12
15
|
.descr
|
13
|
-
available vars: @conversations , @oat ,
|
16
|
+
rb available vars: @conversations , @oat ,
|
14
17
|
.field
|
15
18
|
%label action_exe
|
16
19
|
= f.text_area :action_exe, class: :monospace
|
@@ -6,10 +6,15 @@
|
|
6
6
|
%ul
|
7
7
|
- @oats.each do |oat|
|
8
8
|
%li
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
.d-flex
|
10
|
+
= link_to '[~]', edit_office_action_template_path(oat)
|
11
|
+
|
12
|
+
= button_to 'x', office_action_template_path(oat), method: :delete, data: { confirm: 'Are you sure?' }
|
13
|
+
|
14
|
+
= link_to oat.slug, office_action_template_path(oat)
|
15
|
+
|
16
|
+
= button_to 'Run', office_action_templates_perform_path(oat), data: { confirm: 'Are you sure?' }
|
17
|
+
|
13
18
|
= render '/wco/office_action_templates/ties', ties: oat.ties, oat: oat
|
14
19
|
-# = oat.inspect
|
15
20
|
|
@@ -3,5 +3,5 @@
|
|
3
3
|
%h5 Office Action
|
4
4
|
.d-inline-block
|
5
5
|
= select_tag :office_action_template, options_for_select(@office_action_templates_list), class: 'select2'
|
6
|
-
%a.btn.office-action-templates-perform-btn{ href: "javascript: void(0)", data: { url: wco.
|
6
|
+
%a.btn.office-action-templates-perform-btn{ href: "javascript: void(0)", data: { url: wco.oat_perform_with_conversations_path } }
|
7
7
|
Perform
|
data/config/routes.rb
CHANGED
@@ -44,7 +44,9 @@ Wco::Engine.routes.draw do
|
|
44
44
|
resources :obfuscated_redirects
|
45
45
|
|
46
46
|
post 'office_action_templates', to: 'office_action_templates#update'
|
47
|
-
post 'office_action_templates/perform', to: 'office_action_templates#perform', as: :
|
47
|
+
post 'office_action_templates/perform', to: 'office_action_templates#perform', as: :oat_perform_with_conversations ## from the mailbox, the oat_id is passed as a body param.
|
48
|
+
post 'office_action_templates/:id/perform', to: 'office_action_templates#perform', as: :oat_perform
|
49
|
+
get 'office_action_templates/:id/perform', to: 'office_action_templates#perform'
|
48
50
|
resources :office_action_templates
|
49
51
|
resources :office_actions
|
50
52
|
|
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.214
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Pudeyev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ahoy_matey
|