avo 3.0.1.beta19 → 3.0.1.beta20
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.lock +1 -1
- data/README.md +1 -1
- data/app/assets/builds/avo.base.css +8 -31
- data/app/components/avo/fields/common/badge_viewer_component.rb +1 -1
- data/app/components/avo/fields/common/files/list_viewer_component.rb +3 -3
- data/app/components/avo/fields/common/files/view_type/{grid_component.html.erb → grid_item_component.html.erb} +2 -2
- data/app/components/avo/fields/common/files/view_type/{grid_component.rb → grid_item_component.rb} +3 -2
- data/app/components/avo/fields/common/files/view_type/{list_component.rb → list_item_component.rb} +1 -1
- data/app/components/avo/fields/file_field/edit_component.html.erb +1 -1
- data/app/components/avo/fields/file_field/show_component.html.erb +1 -1
- data/app/components/avo/index/resource_table_component.rb +1 -4
- data/app/components/avo/modal_component.html.erb +2 -2
- data/app/components/avo/views/resource_index_component.rb +2 -1
- data/app/controllers/avo/actions_controller.rb +1 -1
- data/app/controllers/avo/application_controller.rb +6 -2
- data/app/controllers/avo/base_controller.rb +1 -0
- data/app/controllers/avo/search_controller.rb +12 -2
- data/app/javascript/js/controllers/search_controller.js +2 -0
- data/app/views/avo/actions/show.html.erb +1 -1
- data/app/views/avo/partials/_resource_search.html.erb +1 -0
- data/lib/avo/base_resource.rb +19 -3
- data/lib/avo/fields/has_base_field.rb +8 -1
- data/lib/avo/fields/has_one_field.rb +1 -1
- data/lib/avo/services/encryption_service.rb +8 -12
- data/lib/avo/version.rb +1 -1
- data/lib/avo/view_inquirer.rb +2 -5
- data/lib/avo.rb +1 -1
- data/public/avo-assets/avo.base.js +1 -1
- data/public/avo-assets/avo.base.js.map +2 -2
- metadata +6 -6
- /data/app/components/avo/fields/common/files/view_type/{list_component.html.erb → list_item_component.html.erb} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 024a9e280e4e0a908ebcbb16244dfd1bfc4e659c5d11378799acddd7306f82ab
|
4
|
+
data.tar.gz: cf20e9467319e4cd70f6a007f6297b56be3b7b3d54ce7b6d464ec5c6d0a2057f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 504136d6d7357d717453565826a18117a6fc5b806f35e6633ad70e8521e7aa7fb0b6b4ef5df0433c0b7457abe0621102f4f4a144af0969d2803d0e9c9df84d81
|
7
|
+
data.tar.gz: 9c413b093b021377c6a9113470fec070f563696f8d66bcbc7305a0639af2326ae12e2d848f15f792958c2d2a1ea18168af5c632d04327588671caab102d0b556
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -17,7 +17,7 @@ Avo is a beautiful next-generation framework that empowers you, the developer, t
|
|
17
17
|
✨ **Website**: [avohq.io](https://avohq.io)\
|
18
18
|
📚 **Documentation**: [docs.avohq.io](https://docs.avohq.io)\
|
19
19
|
🗺 **Roadmap**: [GitHub Roadmap](https://github.com/orgs/avo-hq/projects/3)\
|
20
|
-
🎸 **Demo app**: [Avodemo](https://avodemo.
|
20
|
+
🎸 **Demo app**: [Avodemo](https://main.avodemo.com/)\
|
21
21
|
🐤 **Twitter**: [avo_hq](https://twitter.com/avo_hq)\
|
22
22
|
💬 **Community chat**: [discord](https://discord.gg/pkTF6y8)\
|
23
23
|
🔧 **Issue tracker**: [GitHub issues](http://github.com/avo-hq/avo/issues)\
|
@@ -3393,7 +3393,7 @@ body.dark,body[data-theme=dark]{
|
|
3393
3393
|
transition:inherit
|
3394
3394
|
}
|
3395
3395
|
|
3396
|
-
/*! tailwindcss v3.3.
|
3396
|
+
/*! tailwindcss v3.3.2 | MIT License | https://tailwindcss.com
|
3397
3397
|
*/
|
3398
3398
|
|
3399
3399
|
/*
|
@@ -3583,10 +3583,6 @@ select,
|
|
3583
3583
|
textarea {
|
3584
3584
|
font-family: inherit;
|
3585
3585
|
/* 1 */
|
3586
|
-
font-feature-settings: inherit;
|
3587
|
-
/* 1 */
|
3588
|
-
font-variation-settings: inherit;
|
3589
|
-
/* 1 */
|
3590
3586
|
font-size: 100%;
|
3591
3587
|
/* 1 */
|
3592
3588
|
font-weight: inherit;
|
@@ -3737,14 +3733,6 @@ menu {
|
|
3737
3733
|
padding: 0;
|
3738
3734
|
}
|
3739
3735
|
|
3740
|
-
/*
|
3741
|
-
Reset default styling for dialogs.
|
3742
|
-
*/
|
3743
|
-
|
3744
|
-
dialog {
|
3745
|
-
padding: 0;
|
3746
|
-
}
|
3747
|
-
|
3748
3736
|
/*
|
3749
3737
|
Prevent resizing textareas horizontally by default.
|
3750
3738
|
*/
|
@@ -3819,7 +3807,7 @@ video {
|
|
3819
3807
|
display: none;
|
3820
3808
|
}
|
3821
3809
|
|
3822
|
-
[type='text'],
|
3810
|
+
[type='text'],[type='email'],[type='url'],[type='password'],[type='number'],[type='date'],[type='datetime-local'],[type='month'],[type='search'],[type='tel'],[type='time'],[type='week'],[multiple],textarea,select{
|
3823
3811
|
appearance:none;
|
3824
3812
|
background-color:#fff;
|
3825
3813
|
border-color:#757D8A;
|
@@ -3834,7 +3822,7 @@ video {
|
|
3834
3822
|
--tw-shadow:0 0 #0000;
|
3835
3823
|
}
|
3836
3824
|
|
3837
|
-
[type='text']:focus,
|
3825
|
+
[type='text']:focus, [type='email']:focus, [type='url']:focus, [type='password']:focus, [type='number']:focus, [type='date']:focus, [type='datetime-local']:focus, [type='month']:focus, [type='search']:focus, [type='tel']:focus, [type='time']:focus, [type='week']:focus, [multiple]:focus, textarea:focus, select:focus{
|
3838
3826
|
outline:2px solid transparent;
|
3839
3827
|
outline-offset:2px;
|
3840
3828
|
--tw-ring-inset:var(--tw-empty,/*!*/ /*!*/);
|
@@ -3857,17 +3845,7 @@ input::placeholder,textarea::placeholder{
|
|
3857
3845
|
}
|
3858
3846
|
|
3859
3847
|
::-webkit-date-and-time-value{
|
3860
|
-
min-height:1.5em
|
3861
|
-
text-align:inherit
|
3862
|
-
}
|
3863
|
-
|
3864
|
-
::-webkit-datetime-edit{
|
3865
|
-
display:inline-flex
|
3866
|
-
}
|
3867
|
-
|
3868
|
-
::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{
|
3869
|
-
padding-top:0;
|
3870
|
-
padding-bottom:0
|
3848
|
+
min-height:1.5em
|
3871
3849
|
}
|
3872
3850
|
|
3873
3851
|
select{
|
@@ -3877,24 +3855,24 @@ select{
|
|
3877
3855
|
background-size:1.5em 1.5em;
|
3878
3856
|
padding-right:2.5rem;
|
3879
3857
|
-webkit-print-color-adjust:exact;
|
3880
|
-
|
3858
|
+
color-adjust:exact
|
3881
3859
|
}
|
3882
3860
|
|
3883
|
-
[multiple]
|
3861
|
+
[multiple]{
|
3884
3862
|
background-image:initial;
|
3885
3863
|
background-position:initial;
|
3886
3864
|
background-repeat:unset;
|
3887
3865
|
background-size:initial;
|
3888
3866
|
padding-right:0.75rem;
|
3889
3867
|
-webkit-print-color-adjust:unset;
|
3890
|
-
|
3868
|
+
color-adjust:unset
|
3891
3869
|
}
|
3892
3870
|
|
3893
3871
|
[type='checkbox'],[type='radio']{
|
3894
3872
|
appearance:none;
|
3895
3873
|
padding:0;
|
3896
3874
|
-webkit-print-color-adjust:exact;
|
3897
|
-
|
3875
|
+
color-adjust:exact;
|
3898
3876
|
display:inline-block;
|
3899
3877
|
vertical-align:middle;
|
3900
3878
|
background-origin:border-box;
|
@@ -3976,7 +3954,6 @@ select{
|
|
3976
3954
|
}
|
3977
3955
|
|
3978
3956
|
[type='file']:focus{
|
3979
|
-
outline:1px solid ButtonText;
|
3980
3957
|
outline:1px auto -webkit-focus-ring-color
|
3981
3958
|
}
|
3982
3959
|
|
@@ -17,7 +17,7 @@ class Avo::Fields::Common::BadgeViewerComponent < ViewComponent::Base
|
|
17
17
|
background = :info
|
18
18
|
|
19
19
|
@options.invert.each do |values, type|
|
20
|
-
if [values].flatten.map { |value| value }.include? @value
|
20
|
+
if [values].flatten.map { |value| value.to_s }.include? @value.to_s
|
21
21
|
background = type.to_sym
|
22
22
|
next
|
23
23
|
end
|
@@ -31,11 +31,11 @@ class Avo::Fields::Common::Files::ListViewerComponent < ViewComponent::Base
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def view_type_component(file)
|
34
|
-
component = "Avo::Fields::Common::Files::ViewType::#{view_type.to_s.capitalize}
|
35
|
-
component.new(field: field, resource: resource, file: file)
|
34
|
+
component = "Avo::Fields::Common::Files::ViewType::#{view_type.to_s.capitalize}ItemComponent".constantize
|
35
|
+
component.new(field: field, resource: resource, file: file, extra_classes: "aspect-video")
|
36
36
|
end
|
37
37
|
|
38
38
|
def view_type
|
39
|
-
(resource.params.dig(:view_type) || field.view_type).to_sym
|
39
|
+
@view_type ||= (resource.params.dig(:view_type) || field.view_type).to_sym
|
40
40
|
end
|
41
41
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<div id="<%= dom_id file %>" class="relative min-h-full max-w-full flex-1 flex flex-col justify-between space-y-2">
|
2
2
|
<% if file.present? %>
|
3
|
-
<div class="flex
|
3
|
+
<div class="flex h-full">
|
4
4
|
<% if file.representable? && is_image? %>
|
5
|
-
<%= image_tag helpers.main_app.url_for(file), class:
|
5
|
+
<%= image_tag helpers.main_app.url_for(file), class: "rounded-lg max-w-full #{@extra_classes}" %>
|
6
6
|
<% elsif is_audio? %>
|
7
7
|
<%= audio_tag(helpers.main_app.url_for(file), controls: true, preload: false, class: 'w-full') %>
|
8
8
|
<% elsif is_video? %>
|
data/app/components/avo/fields/common/files/view_type/{grid_component.rb → grid_item_component.rb}
RENAMED
@@ -1,12 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
class Avo::Fields::Common::Files::ViewType::
|
3
|
+
class Avo::Fields::Common::Files::ViewType::GridItemComponent < ViewComponent::Base
|
4
4
|
attr_reader :field, :resource
|
5
5
|
|
6
|
-
def initialize(field:, resource:, file: nil)
|
6
|
+
def initialize(field:, resource:, file: nil, extra_classes: nil)
|
7
7
|
@file = file
|
8
8
|
@field = field
|
9
9
|
@resource = resource
|
10
|
+
@extra_classes = extra_classes
|
10
11
|
end
|
11
12
|
|
12
13
|
def id
|
data/app/components/avo/fields/common/files/view_type/{list_component.rb → list_item_component.rb}
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
class Avo::Fields::Common::Files::ViewType::
|
3
|
+
class Avo::Fields::Common::Files::ViewType::ListItemComponent < Avo::Fields::Common::Files::ViewType::GridItemComponent
|
4
4
|
def icon_for_file
|
5
5
|
if is_image?
|
6
6
|
"photo"
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<%= field_wrapper **field_wrapper_args do %>
|
2
2
|
<% if @field.value.present? %>
|
3
3
|
<div class="mb-2">
|
4
|
-
<%= render Avo::Fields::Common::Files::ViewType::
|
4
|
+
<%= render Avo::Fields::Common::Files::ViewType::GridItemComponent.new resource: @resource, field: @field %>
|
5
5
|
</div>
|
6
6
|
<% end %>
|
7
7
|
|
@@ -1,3 +1,3 @@
|
|
1
1
|
<%= field_wrapper **field_wrapper_args do %>
|
2
|
-
<%= render Avo::Fields::Common::Files::ViewType::
|
2
|
+
<%= render Avo::Fields::Common::Files::ViewType::GridItemComponent.new resource: @resource, field: @field %>
|
3
3
|
<% end %>
|
@@ -21,9 +21,6 @@ class Avo::Index::ResourceTableComponent < ViewComponent::Base
|
|
21
21
|
@query = @query.result
|
22
22
|
end
|
23
23
|
|
24
|
-
Avo::Services::EncryptionService.encrypt(
|
25
|
-
message: Marshal.dump(@query),
|
26
|
-
purpose: :select_all
|
27
|
-
)
|
24
|
+
Avo::Services::EncryptionService.encrypt(message: @query, purpose: :select_all, serializer: Marshal)
|
28
25
|
end
|
29
26
|
end
|
@@ -6,10 +6,10 @@
|
|
6
6
|
<div aria-expanded="true" role="dialog" aria-modal="true" class="modal-body rounded-lg inset-auto w-11/12 lg:w-1/2 sm:max-w-168 min-h-1/4 bg-white flex z-50 relative shadow-modal overflow-auto max-h-full">
|
7
7
|
<div class="flex-1 flex flex-col justify-between">
|
8
8
|
<div>
|
9
|
-
<div class="p-6 text-2xl tracking-normal font-semibold text-black">
|
9
|
+
<div class="p-6 pb-0 text-2xl tracking-normal font-semibold text-black">
|
10
10
|
<%= heading %>
|
11
11
|
</div>
|
12
|
-
<div class="
|
12
|
+
<div class="p-6 text-base text-gray-500">
|
13
13
|
<%= content %>
|
14
14
|
</div>
|
15
15
|
</div>
|
@@ -186,7 +186,8 @@ class Avo::Views::ResourceIndexComponent < Avo::ResourceComponent
|
|
186
186
|
association: "has_many",
|
187
187
|
association_id: @reflection.name,
|
188
188
|
class: reflection_model_class,
|
189
|
-
id: @parent_record.to_param
|
189
|
+
id: @parent_record.to_param,
|
190
|
+
view: @parent_resource.view
|
190
191
|
}
|
191
192
|
end
|
192
193
|
|
@@ -98,7 +98,7 @@ module Avo
|
|
98
98
|
def decrypted_query
|
99
99
|
return if (encrypted_query = action_params[:fields][:avo_selected_query]).blank?
|
100
100
|
|
101
|
-
|
101
|
+
Avo::Services::EncryptionService.decrypt(message: encrypted_query, purpose: :select_all, serializer: Marshal)
|
102
102
|
end
|
103
103
|
|
104
104
|
def decrypted_arguments
|
@@ -116,13 +116,17 @@ module Avo
|
|
116
116
|
def set_resource
|
117
117
|
raise ActionController::RoutingError.new "No route matches" if resource.nil?
|
118
118
|
|
119
|
-
@resource = resource.new(view: action_name.to_s, user: _current_user, params: params)
|
119
|
+
@resource = resource.new(view: params[:view] || action_name.to_s, user: _current_user, params: params)
|
120
120
|
|
121
121
|
set_authorization
|
122
122
|
end
|
123
123
|
|
124
|
+
def detect_fields
|
125
|
+
@resource.detect_fields
|
126
|
+
end
|
127
|
+
|
124
128
|
def set_related_resource
|
125
|
-
@related_resource = related_resource.new(params: params, view: action_name.to_sym, user: _current_user, record: @related_record)
|
129
|
+
@related_resource = related_resource.new(params: params, view: action_name.to_sym, user: _current_user, record: @related_record).detect_fields
|
126
130
|
end
|
127
131
|
|
128
132
|
def set_record
|
@@ -8,6 +8,7 @@ module Avo
|
|
8
8
|
before_action :set_resource
|
9
9
|
before_action :set_applied_filters, only: :index
|
10
10
|
before_action :set_record, only: [:show, :edit, :destroy, :update, :preview]
|
11
|
+
before_action :detect_fields
|
11
12
|
before_action :set_record_to_fill
|
12
13
|
before_action :set_edit_title_and_breadcrumbs, only: [:edit, :update]
|
13
14
|
before_action :fill_record, only: [:create, :update]
|
@@ -156,8 +156,18 @@ module Avo
|
|
156
156
|
end
|
157
157
|
|
158
158
|
def fetch_field
|
159
|
-
|
160
|
-
|
159
|
+
return if params[:via_association_id].nil?
|
160
|
+
|
161
|
+
reflection_resource = Avo.resource_manager.get_resource_by_model_class(params[:via_reflection_class]).new(
|
162
|
+
view: Avo::ViewInquirer.new(params[:via_reflection_view]),
|
163
|
+
record: parent,
|
164
|
+
params: params,
|
165
|
+
user: current_user
|
166
|
+
)
|
167
|
+
|
168
|
+
reflection_resource.detect_fields.get_field_definitions.find do |field|
|
169
|
+
field.id.to_s == params[:via_association_id]
|
170
|
+
end
|
161
171
|
end
|
162
172
|
|
163
173
|
def fetch_parent
|
@@ -279,6 +279,8 @@ export default class extends Controller {
|
|
279
279
|
via_reflection_class: this.dataset.viaReflectionClass,
|
280
280
|
// eslint-disable-next-line camelcase
|
281
281
|
via_reflection_id: this.dataset.viaReflectionId,
|
282
|
+
// eslint-disable-next-line camelcase
|
283
|
+
via_reflection_view: this.dataset.viaReflectionView,
|
282
284
|
}
|
283
285
|
|
284
286
|
return params
|
@@ -25,7 +25,7 @@
|
|
25
25
|
<%= form.hidden_field :avo_selected_query, 'data-action-target': 'selectedAllQuery' %>
|
26
26
|
<%= form.hidden_field :arguments, value: params[:arguments] %>
|
27
27
|
<% if @action.get_fields.present? %>
|
28
|
-
<div class="
|
28
|
+
<div class="mt-4 -mx-6">
|
29
29
|
<% @action.get_fields.each_with_index do |field, index| %>
|
30
30
|
<%= render field
|
31
31
|
.hydrate(resource: @resource, record: @resource.record, user: @resource.user, view: @view)
|
@@ -8,6 +8,7 @@
|
|
8
8
|
data-via-association-id="<%= via_reflection[:association_id] %>"
|
9
9
|
data-via-reflection-class="<%= via_reflection[:class] %>"
|
10
10
|
data-via-reflection-id="<%= via_reflection[:id] %>"
|
11
|
+
data-via-reflection-view="<%= via_reflection[:view] %>"
|
11
12
|
<% end %>
|
12
13
|
>
|
13
14
|
</div>
|
data/lib/avo/base_resource.rb
CHANGED
@@ -244,8 +244,6 @@ module Avo
|
|
244
244
|
hydrate_model_with_default_values if @view&.new?
|
245
245
|
end
|
246
246
|
|
247
|
-
detect_fields
|
248
|
-
|
249
247
|
unless self.class.model_class.present?
|
250
248
|
if model_class.present? && model_class.respond_to?(:base_class)
|
251
249
|
self.class.model_class = model_class.base_class
|
@@ -260,12 +258,30 @@ module Avo
|
|
260
258
|
if temporary_items.present?
|
261
259
|
instance_eval(&temporary_items)
|
262
260
|
else
|
263
|
-
|
261
|
+
fetch_fields
|
264
262
|
end
|
265
263
|
|
266
264
|
self
|
267
265
|
end
|
268
266
|
|
267
|
+
def fetch_fields
|
268
|
+
possible_methods_for_view = {
|
269
|
+
index: [:index_fields, :display_fields],
|
270
|
+
show: [:show_fields, :display_fields],
|
271
|
+
edit: [:edit_fields, :form_fields],
|
272
|
+
update: [:edit_fields, :form_fields],
|
273
|
+
new: [:new_fields, :form_fields],
|
274
|
+
create: [:new_fields, :form_fields]
|
275
|
+
}[view.to_sym]
|
276
|
+
|
277
|
+
# Safe navigation operator is used because the view can be "destroy" or "preview"
|
278
|
+
possible_methods_for_view&.each do |method_for_view|
|
279
|
+
return send(method_for_view) if respond_to?(method_for_view)
|
280
|
+
end
|
281
|
+
|
282
|
+
fields
|
283
|
+
end
|
284
|
+
|
269
285
|
def fields
|
270
286
|
# blank fields method
|
271
287
|
end
|
@@ -37,7 +37,7 @@ module Avo
|
|
37
37
|
def frame_url
|
38
38
|
Avo::Services::URIService.parse(field_resource.record_path)
|
39
39
|
.append_path(id.to_s)
|
40
|
-
.append_query(
|
40
|
+
.append_query(query_params)
|
41
41
|
.to_s
|
42
42
|
end
|
43
43
|
|
@@ -100,6 +100,13 @@ module Avo
|
|
100
100
|
use_resource&.name || super
|
101
101
|
end
|
102
102
|
|
103
|
+
def query_params
|
104
|
+
{
|
105
|
+
turbo_frame: turbo_frame,
|
106
|
+
view: view
|
107
|
+
}
|
108
|
+
end
|
109
|
+
|
103
110
|
private
|
104
111
|
|
105
112
|
def frame_id
|
@@ -1,32 +1,28 @@
|
|
1
1
|
module Avo
|
2
2
|
module Services
|
3
3
|
class EncryptionService
|
4
|
-
attr_reader :message
|
5
|
-
attr_reader :purpose
|
6
|
-
attr_reader :crypt
|
7
|
-
|
8
4
|
class << self
|
9
|
-
def encrypt(
|
10
|
-
new(
|
5
|
+
def encrypt(...)
|
6
|
+
new(...).encrypt
|
11
7
|
end
|
12
8
|
|
13
|
-
def decrypt(
|
14
|
-
new(
|
9
|
+
def decrypt(...)
|
10
|
+
new(...).decrypt
|
15
11
|
end
|
16
12
|
end
|
17
13
|
|
18
|
-
def initialize(message:, purpose
|
14
|
+
def initialize(message:, purpose:, **kwargs)
|
19
15
|
@message = message
|
20
16
|
@purpose = purpose
|
21
|
-
@crypt = ActiveSupport::MessageEncryptor.new(encryption_key)
|
17
|
+
@crypt = ActiveSupport::MessageEncryptor.new(encryption_key, **kwargs)
|
22
18
|
end
|
23
19
|
|
24
20
|
def encrypt
|
25
|
-
crypt.encrypt_and_sign(message, purpose: purpose)
|
21
|
+
@crypt.encrypt_and_sign(@message, purpose: @purpose)
|
26
22
|
end
|
27
23
|
|
28
24
|
def decrypt
|
29
|
-
crypt.decrypt_and_verify(message, purpose: purpose)
|
25
|
+
@crypt.decrypt_and_verify(@message, purpose: @purpose)
|
30
26
|
end
|
31
27
|
|
32
28
|
private
|
data/lib/avo/version.rb
CHANGED
data/lib/avo/view_inquirer.rb
CHANGED
@@ -2,14 +2,11 @@
|
|
2
2
|
# It also allows to check if the view is a form or a display view by using `view.form?` or `view.display?`
|
3
3
|
module Avo
|
4
4
|
class ViewInquirer < ActiveSupport::StringInquirer
|
5
|
-
DISPLAY_VIEWS = %w[index show]
|
6
|
-
FORM_VIEWS = %w[new edit]
|
7
|
-
|
8
5
|
def initialize(view)
|
9
6
|
super(view.to_s)
|
10
7
|
|
11
|
-
@display = in?
|
12
|
-
@form = in?
|
8
|
+
@display = in? %w[index show]
|
9
|
+
@form = in? %w[new edit]
|
13
10
|
end
|
14
11
|
|
15
12
|
def display?
|
data/lib/avo.rb
CHANGED
@@ -64,7 +64,7 @@ module Avo
|
|
64
64
|
Avo.run_load_hooks(:init, self)
|
65
65
|
end
|
66
66
|
|
67
|
-
#
|
67
|
+
# Generate a dynamic root path using the URIService
|
68
68
|
def root_path(paths: [], query: {}, **args)
|
69
69
|
Avo::Services::URIService.parse(Avo::Current.view_context.avo.root_url.to_s)
|
70
70
|
.append_paths(paths)
|