avo 0.5.0.beta5 → 0.5.0.beta6
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of avo might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Gemfile +0 -2
- data/Gemfile.lock +1 -5
- data/app/controllers/avo/actions_controller.rb +0 -1
- data/app/controllers/avo/base_controller.rb +1 -6
- data/avo.gemspec +0 -1
- data/lib/avo/base_action.rb +21 -13
- data/lib/avo/base_resource.rb +2 -0
- data/lib/avo/version.rb +1 -1
- metadata +1 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: feb0f2107251ad2cef1a10c6980d4ffecde53332b8c584697ebcefb2f341edb5
|
4
|
+
data.tar.gz: 49d8bedcfd86bfdb44e8426c393e485451020ca5825528948a199af78f722995
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5fc2c13d27849cc5c7b5456b9bbb1dea9798f8209746e38cc1d26cbd8f7cd158beab29c8407be0eca1cd0feedc4bfb03a8290941b9a5e66d55dc300cffada06
|
7
|
+
data.tar.gz: cd2c38578315087e25b5584de1145bba9bb0454c301f8587ad620f1799158dcddab644e6a8d73677a463b8d344f082cba93aaf53fd2e5a5d1cc9a0a2b0573ff4
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
avo (0.5.0.
|
4
|
+
avo (0.5.0.beta6)
|
5
5
|
active_link_to
|
6
6
|
countries
|
7
7
|
hotwire-rails
|
8
8
|
httparty
|
9
|
-
i18n-js
|
10
9
|
image_processing
|
11
10
|
inline_svg
|
12
11
|
pagy
|
@@ -144,8 +143,6 @@ GEM
|
|
144
143
|
multi_xml (>= 0.5.2)
|
145
144
|
i18n (1.8.9)
|
146
145
|
concurrent-ruby (~> 1.0)
|
147
|
-
i18n-js (3.8.0)
|
148
|
-
i18n (>= 0.6.6)
|
149
146
|
i18n_data (0.10.0)
|
150
147
|
image_processing (1.12.1)
|
151
148
|
mini_magick (>= 4.9.5, < 5)
|
@@ -368,7 +365,6 @@ DEPENDENCIES
|
|
368
365
|
gem-release
|
369
366
|
hotwire-rails
|
370
367
|
httparty
|
371
|
-
i18n-js
|
372
368
|
image_processing (~> 1.2)
|
373
369
|
inline_svg
|
374
370
|
iso
|
@@ -196,12 +196,7 @@ module Avo
|
|
196
196
|
end
|
197
197
|
|
198
198
|
@actions = @resource.get_actions.map do |action|
|
199
|
-
action
|
200
|
-
|
201
|
-
action.hydrate(model: model, resource: @resource)
|
202
|
-
action.boot_fields request
|
203
|
-
|
204
|
-
action
|
199
|
+
action.new.hydrate(model: model, resource: @resource)
|
205
200
|
end
|
206
201
|
end
|
207
202
|
|
data/avo.gemspec
CHANGED
@@ -39,7 +39,6 @@ Gem::Specification.new do |spec|
|
|
39
39
|
spec.add_dependency 'countries'
|
40
40
|
spec.add_dependency 'pundit'
|
41
41
|
spec.add_dependency 'httparty'
|
42
|
-
spec.add_dependency 'i18n-js'
|
43
42
|
spec.add_dependency 'active_link_to'
|
44
43
|
spec.add_dependency 'image_processing'
|
45
44
|
spec.add_dependency 'view_component'
|
data/lib/avo/base_action.rb
CHANGED
@@ -1,33 +1,39 @@
|
|
1
1
|
module Avo
|
2
2
|
class BaseAction
|
3
3
|
class_attribute :name, default: self.class.to_s.demodulize.underscore.humanize(keep_id_suffix: true)
|
4
|
-
class_attribute :message
|
5
|
-
class_attribute :confirm_text
|
6
|
-
class_attribute :cancel_text
|
4
|
+
class_attribute :message
|
5
|
+
class_attribute :confirm_text
|
6
|
+
class_attribute :cancel_text
|
7
7
|
class_attribute :no_confirmation, default: false
|
8
|
+
class_attribute :fields_loader
|
8
9
|
|
9
10
|
attr_accessor :response
|
10
11
|
attr_accessor :model
|
11
12
|
attr_accessor :resource
|
12
13
|
attr_accessor :user
|
13
14
|
|
14
|
-
|
15
|
+
class << self
|
16
|
+
def fields(&block)
|
17
|
+
self.fields_loader ||= Avo::Loaders::FieldsLoader.new
|
15
18
|
|
16
|
-
|
17
|
-
|
19
|
+
yield(fields_loader)
|
20
|
+
end
|
21
|
+
|
22
|
+
def context
|
23
|
+
App.context
|
24
|
+
end
|
25
|
+
end
|
18
26
|
|
19
27
|
def initialize
|
20
|
-
|
28
|
+
self.class.message ||= I18n.t('avo.are_you_sure_you_want_to_run_this_option')
|
29
|
+
self.class.confirm_text ||= I18n.t('avo.run')
|
30
|
+
self.class.cancel_text ||= I18n.t('avo.cancel')
|
31
|
+
|
21
32
|
@response ||= {}
|
22
33
|
@response[:message_type] ||= :notice
|
23
34
|
@response[:message] ||= I18n.t('avo.action_ran_successfully')
|
24
35
|
end
|
25
36
|
|
26
|
-
def boot_fields(request)
|
27
|
-
@field_loader = Avo::Loaders::FieldsLoader.new
|
28
|
-
fields request if self.respond_to? :fields
|
29
|
-
end
|
30
|
-
|
31
37
|
def get_fields(view_type: :table)
|
32
38
|
get_field_definitions.map do |field|
|
33
39
|
field.hydrate(action: self, model: @model)
|
@@ -38,7 +44,9 @@ module Avo
|
|
38
44
|
end
|
39
45
|
|
40
46
|
def get_field_definitions
|
41
|
-
|
47
|
+
return [] if self.class.fields_loader.blank?
|
48
|
+
|
49
|
+
self.class.fields_loader.bag.map do |field|
|
42
50
|
field.hydrate(action: self)
|
43
51
|
end
|
44
52
|
end
|
data/lib/avo/base_resource.rb
CHANGED
data/lib/avo/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.0.
|
4
|
+
version: 0.5.0.beta6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrian Marin
|
@@ -123,20 +123,6 @@ dependencies:
|
|
123
123
|
- - ">="
|
124
124
|
- !ruby/object:Gem::Version
|
125
125
|
version: '0'
|
126
|
-
- !ruby/object:Gem::Dependency
|
127
|
-
name: i18n-js
|
128
|
-
requirement: !ruby/object:Gem::Requirement
|
129
|
-
requirements:
|
130
|
-
- - ">="
|
131
|
-
- !ruby/object:Gem::Version
|
132
|
-
version: '0'
|
133
|
-
type: :runtime
|
134
|
-
prerelease: false
|
135
|
-
version_requirements: !ruby/object:Gem::Requirement
|
136
|
-
requirements:
|
137
|
-
- - ">="
|
138
|
-
- !ruby/object:Gem::Version
|
139
|
-
version: '0'
|
140
126
|
- !ruby/object:Gem::Dependency
|
141
127
|
name: active_link_to
|
142
128
|
requirement: !ruby/object:Gem::Requirement
|