forest_admin_agent 1.0.0.pre.beta.101 → 1.0.0.pre.beta.102

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6223d99c746540623b7ce715791870700e07b11f92e8c57187ed909fdf6a2c42
4
- data.tar.gz: 470859889d2954c638705fd2d7420764120209a2d7b7686ae1dde39f2070264a
3
+ metadata.gz: dc4f4cb666cf9cf3dd97b7ded958dc8e0afffa2f4957671d7529503983c5dd7c
4
+ data.tar.gz: 7f21be29ff46c7a5c8b29a6842764dd6b106b7a0faec78440941d61c0f9e5c3a
5
5
  SHA512:
6
- metadata.gz: 4d3cb85a498f0d9093a1897d34c0b980351c64e4b98364528c8cc377a5539210f25cb0dec262e4be6a87a75a9c1eea45d75c07a9f413992d783bbaadb8edac3d
7
- data.tar.gz: 4945d071abb09becb8d5fb5290c31aaee0637acc5c34bfade0294b511d6efc8c60797b897f5e321de7b9f06d1c67be59e10a654594f866f77cac02688c4ad157
6
+ metadata.gz: faf5838b0440a91228ab6875f301ea24935a2dcd427e8c54640c68957fe2e7158a3e06c4891669716022a34e7d0a6a166fac9b7b93ad4fbd813d85e4e9f834c8
7
+ data.tar.gz: 2594871196756957ad2724519d46f6dbe5ffe23ff1966a4a1a59074bd61cadcf74498221a51d42d1cc39502adeb6b3138c57bcebf1922b872f7c63d09818e9e2
@@ -47,6 +47,18 @@ module ForestAdminAgent
47
47
  send_schema
48
48
  end
49
49
 
50
+ def reload!
51
+ begin
52
+ @customizer.reload!(logger: @logger)
53
+ rescue StandardError => e
54
+ @logger.log('Error', "Error reloading agent: #{e.message}")
55
+ return
56
+ end
57
+
58
+ @container.register(:datasource, @customizer.datasource(@logger), replace: true)
59
+ send_schema
60
+ end
61
+
50
62
  def send_schema(force: false)
51
63
  return unless @has_env_secret
52
64
 
@@ -102,7 +102,7 @@ module ForestAdminAgent
102
102
 
103
103
  {
104
104
  content: {
105
- fields: Schema::GeneratorAction.build_fields(@collection, form_elements[:fields]),
105
+ fields: form_elements[:fields].map { |f| Schema::GeneratorAction.build_field_schema(@collection, f) },
106
106
  layout: Schema::GeneratorAction.build_layout(form_elements[:layout])
107
107
  }
108
108
  }
@@ -44,6 +44,7 @@ module ForestAdminAgent
44
44
  end
45
45
 
46
46
  def handle_api_chart(args)
47
+ build(args)
47
48
  {
48
49
  content: Serializer::ForestChartSerializer.serialize(
49
50
  @collection.render_chart(
@@ -56,6 +57,7 @@ module ForestAdminAgent
56
57
  end
57
58
 
58
59
  def handle_smart_chart(args)
60
+ build(args)
59
61
  {
60
62
  content: @collection.render_chart(
61
63
  @caller,
@@ -100,6 +100,9 @@ module ForestAdminAgent
100
100
  def self.make_data_uri(file)
101
101
  return if file.nil?
102
102
 
103
+ # file is already a data_uri
104
+ return file if file.is_a?(String) && file.start_with?('data:')
105
+
103
106
  mime_type = `file --b --mime-type #{file.path}`.strip
104
107
  value = Base64.strict_encode64(File.read(file.path))
105
108
 
@@ -30,7 +30,7 @@ module ForestAdminAgent
30
30
  action_index = collection.schema[:actions].keys.index(name)
31
31
  slug = get_action_slug(name)
32
32
  form_elements = extract_fields_and_layout(collection.get_form(nil, name))
33
- if action.static_form?
33
+ if action.static_form
34
34
  fields = build_fields(collection, form_elements[:fields])
35
35
  layout = form_elements[:layout]
36
36
  else
@@ -51,7 +51,7 @@ module ForestAdminAgent
51
51
  download: action.is_generate_file,
52
52
  fields: fields,
53
53
  hooks: {
54
- load: !action.static_form?,
54
+ load: !action.static_form,
55
55
  # Always registering the change hook has no consequences, even if we don't use it.
56
56
  change: ['changeHook']
57
57
  }
@@ -7,7 +7,7 @@ module ForestAdminAgent
7
7
  class SchemaEmitter
8
8
  LIANA_NAME = "agent-ruby"
9
9
 
10
- LIANA_VERSION = "1.0.0-beta.101"
10
+ LIANA_VERSION = "1.0.0-beta.102"
11
11
 
12
12
  def self.get_serialized_schema(datasource)
13
13
  schema_path = Facades::Container.cache(:schema_path)
@@ -1,3 +1,3 @@
1
1
  module ForestAdminAgent
2
- VERSION = "1.0.0-beta.101"
2
+ VERSION = "1.0.0-beta.102"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_admin_agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.beta.101
4
+ version: 1.0.0.pre.beta.102
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthieu
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2025-05-21 00:00:00.000000000 Z
12
+ date: 2025-05-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport