habarico 7.3.0.pre.beta.3 → 7.3.0.pre.beta.5
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/VERSION +1 -1
- data/lib/habarico/contrib/preferences/schemas.rb +3 -0
- data/lib/habarico/definition/actions/action.rb +1 -1
- data/lib/habarico/definition/actions/{upload_images_action.rb → upload_files_action.rb} +2 -2
- data/lib/habarico/definition/definition.rb +2 -2
- data/lib/habarico/generators/action/action_schema_generator.rb +6 -6
- data/lib/habarico/generators/action/{upload_images_action_parameters_generator.rb → upload_files_action_parameters_generator.rb} +10 -10
- data/lib/habarico/schema/action/action_schema.rb +2 -2
- data/lib/habarico/schema/action/{upload_images_action_parameters.rb → upload_files_action_parameters.rb} +9 -8
- data/lib/habarico/schema/types.rb +2 -2
- data/lib/habarico.rb +3 -3
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e0e4009da1ab0b2accec7fe69c471bc03059b732a75d3b0583cdb62a4a8bb156
|
|
4
|
+
data.tar.gz: d78befb975f15a7bb523dcc3a791036cae5423ef10bcf2ad140db8ec4ba23d5a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2b4442204bc85d0b1af7026cb5fb57bc7f18c47d56ab97a7f198243eb322cd62b709a2c9a1321ffed0ac53bf848ca3e3ed3dde6df20b4f6b9642fa96751b292b
|
|
7
|
+
data.tar.gz: dc5078034531a5dc6c95e96da8a595a3f4d5ec62123213a9518beae62c8f9ef91dd2a129234017fa81b2c12b6857228af3353f04e991c79ddc0faeb9bf83f704
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
7.3.0-beta.
|
|
1
|
+
7.3.0-beta.5
|
|
@@ -55,6 +55,9 @@ module Habarico
|
|
|
55
55
|
"y" => { "type" => "integer", "minimum" => 0 },
|
|
56
56
|
"w" => { "type" => "integer", "minimum" => 1 },
|
|
57
57
|
"h" => { "type" => "integer", "minimum" => 1 },
|
|
58
|
+
"stackedH" => { "type" => "integer", "minimum" => 1 },
|
|
59
|
+
"minW" => { "type" => "integer", "minimum" => 1 },
|
|
60
|
+
"minH" => { "type" => "integer", "minimum" => 1 },
|
|
58
61
|
},
|
|
59
62
|
}.freeze
|
|
60
63
|
|
|
@@ -13,7 +13,7 @@ module Habarico
|
|
|
13
13
|
attr_accessor :is_background, :data # attributes for type = :resource
|
|
14
14
|
attr_accessor :after_save # attributes for type = :save
|
|
15
15
|
attr_accessor :link_url, :link_target, :if # attributes for type = :link
|
|
16
|
-
attr_accessor :
|
|
16
|
+
attr_accessor :upload_files_reference, :upload_files_target, :upload_files_accept, :upload_files_file_field, :upload_files_data # attributes for type = :"upload-files"
|
|
17
17
|
|
|
18
18
|
end
|
|
19
19
|
end
|
|
@@ -37,7 +37,7 @@ module Habarico
|
|
|
37
37
|
:resource_action_parameters_generator, :save_action_parameters_generator, :action_schema_generator,
|
|
38
38
|
:view_action_endpoint_parameters_generator, :view_action_parameters_generator,
|
|
39
39
|
:confirm_dialog_properties_generator, :global_resource_action_schema_generator,
|
|
40
|
-
:resource_action_schema_generator, :
|
|
40
|
+
:resource_action_schema_generator, :upload_files_action_parameters_generator,
|
|
41
41
|
:trigger_action_schema_generator,
|
|
42
42
|
|
|
43
43
|
# Generator classes - endpoint
|
|
@@ -119,7 +119,7 @@ module Habarico
|
|
|
119
119
|
@confirm_dialog_properties_generator = Habarico::ConfirmDialogPropertiesGenerator
|
|
120
120
|
@global_resource_action_schema_generator = Habarico::GlobalResourceActionSchemaGenerator
|
|
121
121
|
@resource_action_schema_generator = Habarico::ResourceActionSchemaGenerator
|
|
122
|
-
@
|
|
122
|
+
@upload_files_action_parameters_generator = Habarico::UploadFilesActionParametersGenerator
|
|
123
123
|
@trigger_action_schema_generator = Habarico::TriggerActionSchemaGenerator
|
|
124
124
|
|
|
125
125
|
# Endpoint
|
|
@@ -17,7 +17,7 @@ module Habarico
|
|
|
17
17
|
resource: generate_resource(action, context),
|
|
18
18
|
link: generate_link(action, context),
|
|
19
19
|
save: generate_save(action, context),
|
|
20
|
-
|
|
20
|
+
upload_files: generate_upload_files(action, context)
|
|
21
21
|
)
|
|
22
22
|
end
|
|
23
23
|
|
|
@@ -39,8 +39,8 @@ module Habarico
|
|
|
39
39
|
@link_action_parameters_generator ||= definition.link_action_parameters_generator.new(definition, resource_path)
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
-
def
|
|
43
|
-
@
|
|
42
|
+
def upload_files_action_parameters_generator
|
|
43
|
+
@upload_files_action_parameters_generator ||= definition.upload_files_action_parameters_generator.new(definition, resource_path)
|
|
44
44
|
end
|
|
45
45
|
|
|
46
46
|
def confirm_dialog_properties_generator
|
|
@@ -104,9 +104,9 @@ module Habarico
|
|
|
104
104
|
end
|
|
105
105
|
end
|
|
106
106
|
|
|
107
|
-
def
|
|
108
|
-
if action.type.to_sym == :'upload-
|
|
109
|
-
|
|
107
|
+
def generate_upload_files(action, context)
|
|
108
|
+
if action.type.to_sym == :'upload-files'
|
|
109
|
+
upload_files_action_parameters_generator.generate(action, context)
|
|
110
110
|
end
|
|
111
111
|
end
|
|
112
112
|
end
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
module Habarico
|
|
2
|
-
class
|
|
2
|
+
class UploadFilesActionParametersGenerator < AbstractGenerator
|
|
3
3
|
|
|
4
4
|
def generate(action, context)
|
|
5
5
|
# Validate arguments
|
|
6
6
|
raise Eluvia::Errors::StandardError.new('Argument `action` must be a Habarico::Action') unless action.is_a?(Habarico::Action)
|
|
7
|
-
raise Eluvia::Errors::StandardError.new('Argument `action` must be of :"upload-
|
|
7
|
+
raise Eluvia::Errors::StandardError.new('Argument `action` must be of :"upload-files" type') unless action.type.to_sym == :"upload-files"
|
|
8
8
|
|
|
9
9
|
# Create model
|
|
10
|
-
Habarico::
|
|
10
|
+
Habarico::UploadFilesActionParameters.new(
|
|
11
11
|
reference: generate_reference(action, context),
|
|
12
12
|
target: generate_target(action, context),
|
|
13
13
|
accept: generate_accept(action, context),
|
|
14
|
-
|
|
14
|
+
file_field: generate_file_field(action, context),
|
|
15
15
|
data: generate_data(action, context)
|
|
16
16
|
)
|
|
17
17
|
end
|
|
@@ -23,23 +23,23 @@ module Habarico
|
|
|
23
23
|
# ***********************************************************************
|
|
24
24
|
|
|
25
25
|
def generate_reference(action, _context)
|
|
26
|
-
action.
|
|
26
|
+
action.upload_files_reference
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
def generate_target(action, _context)
|
|
30
|
-
action.
|
|
30
|
+
action.upload_files_target
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
def generate_accept(action, _context)
|
|
34
|
-
action.
|
|
34
|
+
action.upload_files_accept
|
|
35
35
|
end
|
|
36
36
|
|
|
37
|
-
def
|
|
38
|
-
action.
|
|
37
|
+
def generate_file_field(action, _context)
|
|
38
|
+
action.upload_files_file_field
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
def generate_data(action, context)
|
|
42
|
-
Habarico::CallableHelper.resolve(action.
|
|
42
|
+
Habarico::CallableHelper.resolve(action.upload_files_data, context)
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
end
|
|
@@ -40,7 +40,7 @@ module Habarico
|
|
|
40
40
|
# Parameters specific to action type 'save'
|
|
41
41
|
has_one_attr :save, 'Habarico::SaveActionParameters'
|
|
42
42
|
|
|
43
|
-
# Parameters specific to action type 'upload-
|
|
44
|
-
has_one_attr :
|
|
43
|
+
# Parameters specific to action type 'upload-files'
|
|
44
|
+
has_one_attr :upload_files, 'Habarico::UploadFilesActionParameters'
|
|
45
45
|
end
|
|
46
46
|
end
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
module Habarico
|
|
2
|
-
class
|
|
2
|
+
class UploadFilesActionParameters
|
|
3
3
|
include ::ActiveModel::Model
|
|
4
4
|
include Eluvia::ActiveModel::Attributes
|
|
5
5
|
|
|
6
|
-
# Resource where
|
|
7
|
-
# instead of the current resource context.
|
|
6
|
+
# Resource where a record is created for each uploaded file. When set, uploads to this
|
|
7
|
+
# resource instead of the current resource context.
|
|
8
8
|
string_attr :reference
|
|
9
9
|
|
|
10
|
-
# Field name on the
|
|
10
|
+
# Field name on the file model linking to the parent record.
|
|
11
11
|
# When set together with reference, the current record's ID is used as the target value.
|
|
12
12
|
string_attr :target
|
|
13
13
|
|
|
14
|
-
# Array of accepted file extensions (e.g. [".
|
|
15
|
-
# When not set, the frontend uses its own default (.png,.jpg,.jpeg,.bmp,.gif)
|
|
14
|
+
# Array of accepted file extensions (e.g. [".pdf", ".docx"]).
|
|
15
|
+
# When not set, the frontend uses its own default (.png,.jpg,.jpeg,.bmp,.gif), which accepts
|
|
16
|
+
# images only - set it whenever the action uploads other files.
|
|
16
17
|
any_attr :accept
|
|
17
18
|
|
|
18
19
|
# Field name on the target model that holds the uploaded file. Required by the
|
|
19
20
|
# frontend to know which attribute to set on the record it creates for each upload.
|
|
20
|
-
string_attr :
|
|
21
|
+
string_attr :file_field
|
|
21
22
|
|
|
22
|
-
# Additional data added to every
|
|
23
|
+
# Additional data added to every file record the frontend creates for an upload
|
|
23
24
|
any_attr :data
|
|
24
25
|
|
|
25
26
|
end
|
|
@@ -38,7 +38,7 @@ module Habarico
|
|
|
38
38
|
VIEW_MODE_TYPE = %i[redirect dialog sidepanel].freeze
|
|
39
39
|
|
|
40
40
|
# ActionType - kind of the action
|
|
41
|
-
ACTION_TYPE = %i[view link resource save upload-
|
|
41
|
+
ACTION_TYPE = %i[view link resource save upload-files] # rubocop:disable Style/MutableConstant
|
|
42
42
|
|
|
43
43
|
# MenuType - kind of the menu item
|
|
44
44
|
MENU_TYPE = %i[link view text].freeze
|
|
@@ -66,7 +66,7 @@ module Habarico
|
|
|
66
66
|
# the OpenAPI contract (`doc/openapi.yaml`) that no gem may widen on its own.
|
|
67
67
|
#
|
|
68
68
|
# The whole vocabulary stays in the free core - including values with no Ruby implementation
|
|
69
|
-
# yet (`upload-
|
|
69
|
+
# yet (`upload-files`, `ai`, `ai-text`). The names are a contract shared with the frontend;
|
|
70
70
|
# what is paid is the implementation behind them, not the name.
|
|
71
71
|
EXTENSIBLE = %i[FIELD_TYPE FIELD_FORMAT_TYPE BOX_TYPE ACTION_TYPE].freeze
|
|
72
72
|
|
data/lib/habarico.rb
CHANGED
|
@@ -59,7 +59,7 @@ require "habarico/schema/action/view_action_parameters"
|
|
|
59
59
|
require "habarico/schema/action/confirm_dialog_properties"
|
|
60
60
|
require "habarico/schema/action/global_resource_action_schema"
|
|
61
61
|
require "habarico/schema/action/resource_action_schema"
|
|
62
|
-
require "habarico/schema/action/
|
|
62
|
+
require "habarico/schema/action/upload_files_action_parameters"
|
|
63
63
|
|
|
64
64
|
# Aggregate schema models
|
|
65
65
|
|
|
@@ -132,7 +132,7 @@ require "habarico/generators/action/confirm_dialog_properties_generator"
|
|
|
132
132
|
require "habarico/generators/action/global_resource_action_schema_generator"
|
|
133
133
|
require "habarico/generators/action/resource_action_schema_generator"
|
|
134
134
|
require "habarico/generators/action/save_action_parameters_generator"
|
|
135
|
-
require "habarico/generators/action/
|
|
135
|
+
require "habarico/generators/action/upload_files_action_parameters_generator"
|
|
136
136
|
require "habarico/generators/action/trigger_action_schema_generator"
|
|
137
137
|
|
|
138
138
|
# Endpoint generators
|
|
@@ -201,7 +201,7 @@ require "habarico/definition/actions/delete_action"
|
|
|
201
201
|
require "habarico/definition/actions/edit_action"
|
|
202
202
|
require "habarico/definition/actions/save_action"
|
|
203
203
|
require "habarico/definition/actions/show_action"
|
|
204
|
-
require "habarico/definition/actions/
|
|
204
|
+
require "habarico/definition/actions/upload_files_action"
|
|
205
205
|
|
|
206
206
|
# Menu
|
|
207
207
|
require "habarico/definition/menu/menu_item"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: habarico
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 7.3.0.pre.beta.
|
|
4
|
+
version: 7.3.0.pre.beta.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matěj Outlý
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -139,7 +139,7 @@ files:
|
|
|
139
139
|
- lib/habarico/definition/actions/resource_action.rb
|
|
140
140
|
- lib/habarico/definition/actions/save_action.rb
|
|
141
141
|
- lib/habarico/definition/actions/show_action.rb
|
|
142
|
-
- lib/habarico/definition/actions/
|
|
142
|
+
- lib/habarico/definition/actions/upload_files_action.rb
|
|
143
143
|
- lib/habarico/definition/actions/view_action.rb
|
|
144
144
|
- lib/habarico/definition/boxes/array_box.rb
|
|
145
145
|
- lib/habarico/definition/boxes/box.rb
|
|
@@ -178,7 +178,7 @@ files:
|
|
|
178
178
|
- lib/habarico/generators/action/resource_action_schema_generator.rb
|
|
179
179
|
- lib/habarico/generators/action/save_action_parameters_generator.rb
|
|
180
180
|
- lib/habarico/generators/action/trigger_action_schema_generator.rb
|
|
181
|
-
- lib/habarico/generators/action/
|
|
181
|
+
- lib/habarico/generators/action/upload_files_action_parameters_generator.rb
|
|
182
182
|
- lib/habarico/generators/action/view_action_endpoint_parameters_generator.rb
|
|
183
183
|
- lib/habarico/generators/action/view_action_parameters_generator.rb
|
|
184
184
|
- lib/habarico/generators/endpoint/dynamic_render_options_generator.rb
|
|
@@ -238,7 +238,7 @@ files:
|
|
|
238
238
|
- lib/habarico/schema/action/resource_action_parameters.rb
|
|
239
239
|
- lib/habarico/schema/action/resource_action_schema.rb
|
|
240
240
|
- lib/habarico/schema/action/save_action_parameters.rb
|
|
241
|
-
- lib/habarico/schema/action/
|
|
241
|
+
- lib/habarico/schema/action/upload_files_action_parameters.rb
|
|
242
242
|
- lib/habarico/schema/action/view_action_endpoint_parameters.rb
|
|
243
243
|
- lib/habarico/schema/action/view_action_parameters.rb
|
|
244
244
|
- lib/habarico/schema/endpoint/ai_field_options.rb
|