forest_admin_datasource_customizer 1.0.0.pre.beta.21 → 1.0.0.pre.beta.57

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/forest_admin_datasource_customizer.gemspec +3 -2
  3. data/lib/forest_admin_datasource_customizer/collection_customizer.rb +292 -5
  4. data/lib/forest_admin_datasource_customizer/context/agent_customization_context.rb +18 -0
  5. data/lib/forest_admin_datasource_customizer/context/collection_customization_context.rb +15 -0
  6. data/lib/forest_admin_datasource_customizer/context/relaxed_wrappers/relaxed_collection.rb +50 -0
  7. data/lib/forest_admin_datasource_customizer/context/relaxed_wrappers/relaxed_data_source.rb +18 -0
  8. data/lib/forest_admin_datasource_customizer/datasource_customizer.rb +43 -13
  9. data/lib/forest_admin_datasource_customizer/decorators/action/action_collection_decorator.rb +137 -0
  10. data/lib/forest_admin_datasource_customizer/decorators/action/base_action.rb +67 -0
  11. data/lib/forest_admin_datasource_customizer/decorators/action/context/action_context.rb +56 -0
  12. data/lib/forest_admin_datasource_customizer/decorators/action/context/action_context_single.rb +26 -0
  13. data/lib/forest_admin_datasource_customizer/decorators/action/dynamic_field.rb +50 -0
  14. data/lib/forest_admin_datasource_customizer/decorators/action/result_builder.rb +68 -0
  15. data/lib/forest_admin_datasource_customizer/decorators/action/types/action_scope.rb +15 -0
  16. data/lib/forest_admin_datasource_customizer/decorators/action/types/field_type.rb +35 -0
  17. data/lib/forest_admin_datasource_customizer/decorators/action/widget_field.rb +357 -0
  18. data/lib/forest_admin_datasource_customizer/decorators/binary/binary_collection_decorator.rb +215 -0
  19. data/lib/forest_admin_datasource_customizer/decorators/binary/binary_helper.rb +17 -0
  20. data/lib/forest_admin_datasource_customizer/decorators/chart/chart_collection_decorator.rb +41 -0
  21. data/lib/forest_admin_datasource_customizer/decorators/chart/chart_context.rb +33 -0
  22. data/lib/forest_admin_datasource_customizer/decorators/chart/chart_datasource_decorator.rb +46 -0
  23. data/lib/forest_admin_datasource_customizer/decorators/chart/result_builder.rb +148 -0
  24. data/lib/forest_admin_datasource_customizer/decorators/computed/compute_collection_decorator.rb +115 -0
  25. data/lib/forest_admin_datasource_customizer/decorators/computed/computed_definition.rb +21 -0
  26. data/lib/forest_admin_datasource_customizer/decorators/computed/utils/computed_field.rb +74 -0
  27. data/lib/forest_admin_datasource_customizer/decorators/computed/utils/flattener.rb +49 -0
  28. data/lib/forest_admin_datasource_customizer/decorators/decorators_stack.rb +33 -4
  29. data/lib/forest_admin_datasource_customizer/decorators/hook/context/after/hook_after_aggregate_context.rb +18 -0
  30. data/lib/forest_admin_datasource_customizer/decorators/hook/context/after/hook_after_create_context.rb +18 -0
  31. data/lib/forest_admin_datasource_customizer/decorators/hook/context/after/hook_after_delete_context.rb +12 -0
  32. data/lib/forest_admin_datasource_customizer/decorators/hook/context/after/hook_after_list_context.rb +18 -0
  33. data/lib/forest_admin_datasource_customizer/decorators/hook/context/after/hook_after_update_context.rb +12 -0
  34. data/lib/forest_admin_datasource_customizer/decorators/hook/context/before/hook_before_aggregate_context.rb +20 -0
  35. data/lib/forest_admin_datasource_customizer/decorators/hook/context/before/hook_before_create_context.rb +18 -0
  36. data/lib/forest_admin_datasource_customizer/decorators/hook/context/before/hook_before_delete_context.rb +18 -0
  37. data/lib/forest_admin_datasource_customizer/decorators/hook/context/before/hook_before_list_context.rb +19 -0
  38. data/lib/forest_admin_datasource_customizer/decorators/hook/context/before/hook_before_update_context.rb +19 -0
  39. data/lib/forest_admin_datasource_customizer/decorators/hook/context/hook_context.rb +22 -0
  40. data/lib/forest_admin_datasource_customizer/decorators/hook/hook_collection_decorator.rb +95 -0
  41. data/lib/forest_admin_datasource_customizer/decorators/hook/hooks.rb +26 -0
  42. data/lib/forest_admin_datasource_customizer/decorators/operators_emulate/operators_emulate_collection_decorator.rb +118 -0
  43. data/lib/forest_admin_datasource_customizer/decorators/operators_equivalence/operators_equivalence_collection_decorator.rb +50 -0
  44. data/lib/forest_admin_datasource_customizer/decorators/override/context/create_override_customization_context.rb +16 -0
  45. data/lib/forest_admin_datasource_customizer/decorators/override/context/delete_override_customization_context.rb +16 -0
  46. data/lib/forest_admin_datasource_customizer/decorators/override/context/update_override_customization_context.rb +17 -0
  47. data/lib/forest_admin_datasource_customizer/decorators/override/override_collection_decorator.rb +49 -0
  48. data/lib/forest_admin_datasource_customizer/decorators/publication/publication_collection_decorator.rb +95 -0
  49. data/lib/forest_admin_datasource_customizer/decorators/publication/publication_datasource_decorator.rb +57 -0
  50. data/lib/forest_admin_datasource_customizer/decorators/relation/relation_collection_decorator.rb +268 -0
  51. data/lib/forest_admin_datasource_customizer/decorators/rename_collection/rename_collection_datasource_decorator.rb +70 -0
  52. data/lib/forest_admin_datasource_customizer/decorators/rename_collection/rename_collection_decorator.rb +37 -0
  53. data/lib/forest_admin_datasource_customizer/decorators/rename_field/rename_field_collection_decorator.rb +190 -0
  54. data/lib/forest_admin_datasource_customizer/decorators/schema/schema_collection_decorator.rb +21 -0
  55. data/lib/forest_admin_datasource_customizer/decorators/search/search_collection_decorator.rb +135 -0
  56. data/lib/forest_admin_datasource_customizer/decorators/segment/segment_collection_decorator.rb +60 -0
  57. data/lib/forest_admin_datasource_customizer/decorators/sort/sort_collection_decorator.rb +127 -0
  58. data/lib/forest_admin_datasource_customizer/decorators/validation/validation_collection_decorator.rb +82 -0
  59. data/lib/forest_admin_datasource_customizer/decorators/write/create_relations/create_relations_collection_decorator.rb +75 -0
  60. data/lib/forest_admin_datasource_customizer/decorators/write/update_relations/update_relations_collection_decorator.rb +96 -0
  61. data/lib/forest_admin_datasource_customizer/decorators/write/write_datasource_decorator.rb +14 -0
  62. data/lib/forest_admin_datasource_customizer/decorators/write/write_replace/write_customization_context.rb +18 -0
  63. data/lib/forest_admin_datasource_customizer/decorators/write/write_replace/write_replace_collection_decorator.rb +125 -0
  64. data/lib/forest_admin_datasource_customizer/plugins/add_external_relation.rb +27 -0
  65. data/lib/forest_admin_datasource_customizer/plugins/import_field.rb +74 -0
  66. data/lib/forest_admin_datasource_customizer/version.rb +1 -1
  67. metadata +84 -5
  68. data/README.md +0 -31
@@ -0,0 +1,96 @@
1
+ module ForestAdminDatasourceCustomizer
2
+ module Decorators
3
+ module Write
4
+ module UpdateRelations
5
+ class UpdateRelationsCollectionDecorator < ForestAdminDatasourceToolkit::Decorators::CollectionDecorator
6
+ include ForestAdminDatasourceToolkit::Components::Query
7
+
8
+ def update(caller, filter, patch)
9
+ # Step 1: Perform the normal update
10
+ if patch.keys.any? { |key| schema[:fields][key].type == 'Column' }
11
+ patch_without_relations = patch.reduce({}) do |carry, (key, value)|
12
+ schema[:fields][key].type == 'Column' ? carry.merge(key => value) : carry
13
+ end
14
+
15
+ child_collection.update(caller, filter, patch_without_relations)
16
+ end
17
+
18
+ # Step 2: Perform additional updates for relations
19
+ return unless patch.keys.any? { |key| schema[:fields][key].type != 'Column' }
20
+
21
+ # Fetch the records that will be updated, to know which relations need to be created/updated
22
+ projection = build_projection(patch)
23
+ records = list(caller, filter, projection)
24
+
25
+ # Perform the updates for each relation
26
+ patch.keys
27
+ .filter { |key| schema[:fields][key].type != 'Column' }
28
+ .map { |key| create_or_update_relation(caller, records, key, patch[key]) }
29
+ end
30
+
31
+ private
32
+
33
+ # Build a projection that has enough information to know
34
+ # - which relations need to be created/updated
35
+ # - the values that will be used to build filters to target records
36
+ # - the values that will be used to create/update the relations
37
+ def build_projection(patch)
38
+ projection = Projection.new.with_pks(self)
39
+
40
+ patch.each_key do |key|
41
+ field_schema = schema[:fields][key]
42
+
43
+ next unless field_schema.type != 'Column'
44
+
45
+ relation = datasource.get_collection(field_schema.foreign_collection)
46
+
47
+ projection = projection.union(Projection.new.with_pks(relation).nest(prefix: key))
48
+ if field_schema.type == 'ManyToOne'
49
+ projection = projection.union(Projection.new([field_schema.foreign_key_target]).nest(prefix: key))
50
+ end
51
+ if field_schema.type == 'OneToOne'
52
+ projection = projection.union(Projection.new([field_schema.origin_key_target]).nest(prefix: key))
53
+ end
54
+ end
55
+
56
+ projection
57
+ end
58
+
59
+ def create_or_update_relation(caller, records, key, patch)
60
+ field_schema = schema[:fields][key]
61
+ relation = datasource.get_collection(field_schema.foreign_collection)
62
+ creates = records.filter { |r| !r[key] || r[key].nil? }
63
+ updates = records.filter { |r| r[key] && !r[key].nil? }
64
+
65
+ unless creates.empty?
66
+ if field_schema.type == 'ManyToOne'
67
+ # Create many-to-one relations
68
+ sub_record = relation.create(caller, patch)
69
+
70
+ # Set foreign key on the parent records
71
+ condition_tree = ConditionTree::ConditionTreeFactory.match_records(self, creates)
72
+ parent_patch = { field_schema.foreign_key => sub_record[field_schema.foreign_key_target] }
73
+
74
+ update(caller, Filter.new(condition_tree: condition_tree), parent_patch)
75
+ else
76
+ # Create the one-to-one relations that don't already exist
77
+ relation.create(
78
+ caller,
79
+ patch.merge(field_schema.origin_key => creates.first[field_schema.origin_key_target])
80
+ )
81
+ end
82
+ end
83
+
84
+ # Update the relations that already exist
85
+ return if updates.empty?
86
+
87
+ sub_records = updates.map { |record| record[key] }
88
+ condition_tree = ConditionTree::ConditionTreeFactory.match_records(relation, sub_records)
89
+
90
+ relation.update(caller, Filter.new(condition_tree: condition_tree), patch)
91
+ end
92
+ end
93
+ end
94
+ end
95
+ end
96
+ end
@@ -0,0 +1,14 @@
1
+ module ForestAdminDatasourceCustomizer
2
+ module Decorators
3
+ module Write
4
+ class WriteDatasourceDecorator < ForestAdminDatasourceToolkit::Decorators::DatasourceDecorator
5
+ include ForestAdminDatasourceToolkit::Decorators
6
+ def initialize(child_datasource)
7
+ create = DatasourceDecorator.new(child_datasource, CreateRelations::CreateRelationsCollectionDecorator)
8
+ update = DatasourceDecorator.new(create, UpdateRelations::UpdateRelationsCollectionDecorator)
9
+ super(update, WriteReplace::WriteReplaceCollectionDecorator)
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,18 @@
1
+ module ForestAdminDatasourceCustomizer
2
+ module Decorators
3
+ module Write
4
+ module WriteReplace
5
+ class WriteCustomizationContext < ForestAdminDatasourceCustomizer::Context::CollectionCustomizationContext
6
+ attr_reader :action, :record, :filter
7
+
8
+ def initialize(collection, caller, action, record, filter = nil)
9
+ super(collection, caller)
10
+ @action = action
11
+ @record = record
12
+ @filter = filter
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,125 @@
1
+ module ForestAdminDatasourceCustomizer
2
+ module Decorators
3
+ module Write
4
+ module WriteReplace
5
+ class WriteReplaceCollectionDecorator < ForestAdminDatasourceToolkit::Decorators::CollectionDecorator
6
+ include ForestAdminDatasourceToolkit::Exceptions
7
+ include ForestAdminDatasourceToolkit::Validations
8
+ attr_reader :handlers
9
+
10
+ def initialize(child_collection, datasource)
11
+ super
12
+ @handlers = {}
13
+ end
14
+
15
+ def replace_field_writing(field_name, &definition)
16
+ raise ForestException, 'A new writing method should be provided to replace field writing' unless definition
17
+
18
+ ForestAdminDatasourceToolkit::Validations::FieldValidator.validate(self, field_name)
19
+
20
+ @handlers[field_name] = definition
21
+ mark_schema_as_dirty
22
+ end
23
+
24
+ def refine_schema(child_schema)
25
+ schema = child_schema.dup
26
+ schema[:fields] = child_schema[:fields].dup
27
+
28
+ @handlers.each do |field_name, handler|
29
+ schema[:fields][field_name].is_read_only = handler.nil?
30
+ end
31
+
32
+ schema
33
+ end
34
+
35
+ def create(caller, record)
36
+ new_record = rewrite_patch(caller, 'create', record)
37
+
38
+ child_collection.create(caller, new_record)
39
+ end
40
+
41
+ def update(caller, filter, patch)
42
+ new_patch = rewrite_patch(caller, 'update', patch, [], filter)
43
+
44
+ child_collection.update(caller, filter, new_patch)
45
+ end
46
+
47
+ # Takes a patch and recursively applies all rewriting rules to it.
48
+ def rewrite_patch(caller, action, patch, used_handlers = [], filter = nil)
49
+ # We rewrite the patch by applying all handlers on each field.
50
+ context = WriteCustomizationContext.new(self, caller, action, patch, filter)
51
+
52
+ patches = patch.map { |key, _| rewrite_key(context, key, used_handlers) }
53
+
54
+ # We now have a list of patches (one per field) that we can merge.
55
+ new_patch = deep_merge(*patches)
56
+
57
+ # Check that the customer handlers did not introduce invalid data.
58
+ RecordValidator.validate(self, new_patch) if new_patch.length.positive?
59
+
60
+ new_patch
61
+ end
62
+
63
+ private
64
+
65
+ def rewrite_key(context, key, used)
66
+ if used.include?(key)
67
+ raise ForestException, "Conflict value on the field #{key}. It received several values."
68
+ end
69
+
70
+ field_schema = schema.nil? ? nil : schema[:fields][key]
71
+
72
+ if field_schema&.type == 'Column'
73
+ # We either call the customer handler or a default one that does nothing.
74
+ handler = @handlers[key] || proc { |v| { key => v } }
75
+ field_patch = if context.record[key] && handler.call(context.record[key], context)
76
+ handler.call(context.record[key], context)
77
+ else
78
+ []
79
+ end
80
+
81
+ if field_patch && !field_patch.is_a?(Hash)
82
+ raise ForestException, "The write handler of #{key} should return an Hash or nothing."
83
+ end
84
+
85
+ # Isolate change to our own value (which should not recurse) and the rest which should
86
+ # trigger the other handlers.
87
+ value = field_patch[key] || nil
88
+ new_patch = rewrite_patch(context.caller, context.action, field_patch.except(key), used + [key])
89
+
90
+ value ? deep_merge({ key => value }, new_patch) : new_patch
91
+ elsif field_schema&.type == 'ManyToOne' || field_schema&.type == 'OneToOne'
92
+ # Delegate relations to the appropriate collection.
93
+ relation = datasource.get_collection(field_schema.foreign_collection)
94
+
95
+ { key => relation.rewrite_patch(context.caller, context.action, context.record[key]) }
96
+ else
97
+ raise ForestException, "Unknown field: '#{key}'"
98
+ end
99
+ end
100
+
101
+ # Recursively merge patches into a single one ensuring that there is no conflict.
102
+ def deep_merge(*patches)
103
+ acc = {}
104
+
105
+ patches.each do |patch|
106
+ patch = { patch => patch } unless patch.is_a?(Hash)
107
+
108
+ patch.each do |sub_key, sub_value|
109
+ if !acc.key?(sub_key)
110
+ acc[sub_key] = sub_value
111
+ elsif sub_value.is_a?(Hash)
112
+ acc[sub_key] = deep_merge(acc[sub_key], sub_value)
113
+ else
114
+ raise ForestException, "Conflict value on the field #{sub_key}. It received several values."
115
+ end
116
+ end
117
+ end
118
+
119
+ acc
120
+ end
121
+ end
122
+ end
123
+ end
124
+ end
125
+ end
@@ -0,0 +1,27 @@
1
+ module ForestAdminDatasourceCustomizer
2
+ module Plugins
3
+ class AddExternalRelation < Plugin
4
+ include ForestAdminDatasourceToolkit::Exceptions
5
+ include ForestAdminDatasourceCustomizer::Decorators::Computed
6
+
7
+ def run(_datasource_customizer, collection_customizer = nil, options = {})
8
+ primary_keys = ForestAdminDatasourceToolkit::Utils::Schema.primary_keys(collection_customizer.collection)
9
+
10
+ unless options.key?(:name) && options.key?(:schema) && options.key?(:listRecords)
11
+ raise ForestException, 'The options parameter must contains the following keys: `name, schema, listRecords`'
12
+ end
13
+
14
+ collection_customizer.add_field(
15
+ options[:name],
16
+ ComputedDefinition.new(
17
+ column_type: [options[:schema]],
18
+ dependencies: options[:dependencies] || primary_keys,
19
+ values: proc { |records, context|
20
+ records.map { |record| options[:listRecords].call(record, context) }
21
+ }
22
+ )
23
+ )
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,74 @@
1
+ module ForestAdminDatasourceCustomizer
2
+ module Plugins
3
+ class ImportField < Plugin
4
+ include ForestAdminDatasourceToolkit::Exceptions
5
+ include ForestAdminDatasourceCustomizer::Decorators::Computed
6
+
7
+ def run(datasource_customizer, collection_customizer = nil, options = {})
8
+ if options[:name].nil? || options[:path].nil?
9
+ raise ForestException, 'The options parameter must contains the following keys: `name, path`'
10
+ end
11
+
12
+ options[:readonly] = false unless options.key?(:readonly)
13
+ name = options[:name]
14
+ result = options[:path].split(':').reduce({ collection: collection_customizer.name }) do |memo, field|
15
+ collection = datasource_customizer.get_collection(memo[:collection])
16
+ unless collection.schema[:fields].key?(field)
17
+ raise ForestException, "Field #{field} not found in collection #{collection.name}"
18
+ end
19
+
20
+ field_schema = collection.schema[:fields][field]
21
+ if field_schema.type == 'Column'
22
+ { schema: field_schema }
23
+ elsif field_schema.type == 'ManyToOne' || field_schema.type == 'OneToOne'
24
+ { collection: field_schema.foreign_collection }
25
+ end
26
+ end
27
+
28
+ schema = result[:schema]
29
+ collection_customizer.add_field(
30
+ name,
31
+ ComputedDefinition.new(
32
+ column_type: schema.column_type,
33
+ dependencies: [options[:path]],
34
+ values: proc { |records|
35
+ records.map { |record| ForestAdminDatasourceToolkit::Utils::Record.field_value(record, options[:path]) }
36
+ },
37
+ default_value: schema.default_value,
38
+ enum_values: schema.enum_values
39
+ )
40
+ )
41
+
42
+ unless options[:readonly] || schema.is_read_only
43
+ collection_customizer.replace_field_writing(name) do |value|
44
+ path = options[:path].split(':')
45
+ writing_path = path.reduce({}) do |nested_path, current_path|
46
+ nested_path[current_path] = path.index(current_path) == path.size - 1 ? value : {}
47
+ nested_path[current_path]
48
+ end
49
+
50
+ writing_path
51
+ end
52
+ end
53
+
54
+ if !options[:readonly] && schema.is_read_only
55
+ raise ForestException,
56
+ "Readonly option should not be false because the field #{options[:path]} is not writable"
57
+ end
58
+
59
+ schema.filter_operators.each do |operator|
60
+ collection_customizer.replace_field_operator(name, operator) do |value|
61
+ { field: options[:path], operator: operator, value: value }
62
+ end
63
+ end
64
+
65
+ return unless schema.is_sortable
66
+
67
+ collection_customizer.replace_field_sorting(
68
+ name,
69
+ [{ field: options[:path], ascending: true }]
70
+ )
71
+ end
72
+ end
73
+ end
74
+ end
@@ -1,3 +1,3 @@
1
1
  module ForestAdminDatasourceCustomizer
2
- VERSION = "1.0.0-beta.21"
2
+ VERSION = "1.0.0-beta.57"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_admin_datasource_customizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.beta.21
4
+ version: 1.0.0.pre.beta.57
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: 2023-12-18 00:00:00.000000000 Z
12
+ date: 2024-06-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -25,6 +25,26 @@ dependencies:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  version: '6.1'
28
+ - !ruby/object:Gem::Dependency
29
+ name: marcel
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - "~>"
33
+ - !ruby/object:Gem::Version
34
+ version: '1.0'
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: 1.0.4
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - "~>"
43
+ - !ruby/object:Gem::Version
44
+ version: '1.0'
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 1.0.4
28
48
  - !ruby/object:Gem::Dependency
29
49
  name: zeitwerk
30
50
  requirement: !ruby/object:Gem::Requirement
@@ -50,24 +70,83 @@ extensions: []
50
70
  extra_rdoc_files: []
51
71
  files:
52
72
  - ".rspec"
53
- - README.md
54
73
  - Rakefile
55
74
  - forest_admin_datasource_customizer.gemspec
56
75
  - lib/forest_admin_datasource_customizer.rb
57
76
  - lib/forest_admin_datasource_customizer/collection_customizer.rb
77
+ - lib/forest_admin_datasource_customizer/context/agent_customization_context.rb
78
+ - lib/forest_admin_datasource_customizer/context/collection_customization_context.rb
79
+ - lib/forest_admin_datasource_customizer/context/relaxed_wrappers/relaxed_collection.rb
80
+ - lib/forest_admin_datasource_customizer/context/relaxed_wrappers/relaxed_data_source.rb
58
81
  - lib/forest_admin_datasource_customizer/datasource_customizer.rb
82
+ - lib/forest_admin_datasource_customizer/decorators/action/action_collection_decorator.rb
83
+ - lib/forest_admin_datasource_customizer/decorators/action/base_action.rb
84
+ - lib/forest_admin_datasource_customizer/decorators/action/context/action_context.rb
85
+ - lib/forest_admin_datasource_customizer/decorators/action/context/action_context_single.rb
86
+ - lib/forest_admin_datasource_customizer/decorators/action/dynamic_field.rb
87
+ - lib/forest_admin_datasource_customizer/decorators/action/result_builder.rb
88
+ - lib/forest_admin_datasource_customizer/decorators/action/types/action_scope.rb
89
+ - lib/forest_admin_datasource_customizer/decorators/action/types/field_type.rb
90
+ - lib/forest_admin_datasource_customizer/decorators/action/widget_field.rb
91
+ - lib/forest_admin_datasource_customizer/decorators/binary/binary_collection_decorator.rb
92
+ - lib/forest_admin_datasource_customizer/decorators/binary/binary_helper.rb
93
+ - lib/forest_admin_datasource_customizer/decorators/chart/chart_collection_decorator.rb
94
+ - lib/forest_admin_datasource_customizer/decorators/chart/chart_context.rb
95
+ - lib/forest_admin_datasource_customizer/decorators/chart/chart_datasource_decorator.rb
96
+ - lib/forest_admin_datasource_customizer/decorators/chart/result_builder.rb
97
+ - lib/forest_admin_datasource_customizer/decorators/computed/compute_collection_decorator.rb
98
+ - lib/forest_admin_datasource_customizer/decorators/computed/computed_definition.rb
99
+ - lib/forest_admin_datasource_customizer/decorators/computed/utils/computed_field.rb
100
+ - lib/forest_admin_datasource_customizer/decorators/computed/utils/flattener.rb
59
101
  - lib/forest_admin_datasource_customizer/decorators/decorators_stack.rb
60
102
  - lib/forest_admin_datasource_customizer/decorators/empty/empty_collection_decorator.rb
103
+ - lib/forest_admin_datasource_customizer/decorators/hook/context/after/hook_after_aggregate_context.rb
104
+ - lib/forest_admin_datasource_customizer/decorators/hook/context/after/hook_after_create_context.rb
105
+ - lib/forest_admin_datasource_customizer/decorators/hook/context/after/hook_after_delete_context.rb
106
+ - lib/forest_admin_datasource_customizer/decorators/hook/context/after/hook_after_list_context.rb
107
+ - lib/forest_admin_datasource_customizer/decorators/hook/context/after/hook_after_update_context.rb
108
+ - lib/forest_admin_datasource_customizer/decorators/hook/context/before/hook_before_aggregate_context.rb
109
+ - lib/forest_admin_datasource_customizer/decorators/hook/context/before/hook_before_create_context.rb
110
+ - lib/forest_admin_datasource_customizer/decorators/hook/context/before/hook_before_delete_context.rb
111
+ - lib/forest_admin_datasource_customizer/decorators/hook/context/before/hook_before_list_context.rb
112
+ - lib/forest_admin_datasource_customizer/decorators/hook/context/before/hook_before_update_context.rb
113
+ - lib/forest_admin_datasource_customizer/decorators/hook/context/hook_context.rb
114
+ - lib/forest_admin_datasource_customizer/decorators/hook/hook_collection_decorator.rb
115
+ - lib/forest_admin_datasource_customizer/decorators/hook/hooks.rb
116
+ - lib/forest_admin_datasource_customizer/decorators/operators_emulate/operators_emulate_collection_decorator.rb
117
+ - lib/forest_admin_datasource_customizer/decorators/operators_equivalence/operators_equivalence_collection_decorator.rb
118
+ - lib/forest_admin_datasource_customizer/decorators/override/context/create_override_customization_context.rb
119
+ - lib/forest_admin_datasource_customizer/decorators/override/context/delete_override_customization_context.rb
120
+ - lib/forest_admin_datasource_customizer/decorators/override/context/update_override_customization_context.rb
121
+ - lib/forest_admin_datasource_customizer/decorators/override/override_collection_decorator.rb
122
+ - lib/forest_admin_datasource_customizer/decorators/publication/publication_collection_decorator.rb
123
+ - lib/forest_admin_datasource_customizer/decorators/publication/publication_datasource_decorator.rb
124
+ - lib/forest_admin_datasource_customizer/decorators/relation/relation_collection_decorator.rb
125
+ - lib/forest_admin_datasource_customizer/decorators/rename_collection/rename_collection_datasource_decorator.rb
126
+ - lib/forest_admin_datasource_customizer/decorators/rename_collection/rename_collection_decorator.rb
127
+ - lib/forest_admin_datasource_customizer/decorators/rename_field/rename_field_collection_decorator.rb
128
+ - lib/forest_admin_datasource_customizer/decorators/schema/schema_collection_decorator.rb
129
+ - lib/forest_admin_datasource_customizer/decorators/search/search_collection_decorator.rb
130
+ - lib/forest_admin_datasource_customizer/decorators/segment/segment_collection_decorator.rb
131
+ - lib/forest_admin_datasource_customizer/decorators/sort/sort_collection_decorator.rb
132
+ - lib/forest_admin_datasource_customizer/decorators/validation/validation_collection_decorator.rb
133
+ - lib/forest_admin_datasource_customizer/decorators/write/create_relations/create_relations_collection_decorator.rb
134
+ - lib/forest_admin_datasource_customizer/decorators/write/update_relations/update_relations_collection_decorator.rb
135
+ - lib/forest_admin_datasource_customizer/decorators/write/write_datasource_decorator.rb
136
+ - lib/forest_admin_datasource_customizer/decorators/write/write_replace/write_customization_context.rb
137
+ - lib/forest_admin_datasource_customizer/decorators/write/write_replace/write_replace_collection_decorator.rb
138
+ - lib/forest_admin_datasource_customizer/plugins/add_external_relation.rb
139
+ - lib/forest_admin_datasource_customizer/plugins/import_field.rb
61
140
  - lib/forest_admin_datasource_customizer/plugins/plugin.rb
62
141
  - lib/forest_admin_datasource_customizer/version.rb
63
142
  - sig/forest_admin_datasource_customizer.rbs
64
143
  homepage: https://www.forestadmin.com
65
144
  licenses:
66
- - MIT
145
+ - GPL-3.0
67
146
  metadata:
68
147
  homepage_uri: https://www.forestadmin.com
69
148
  source_code_uri: https://github.com/ForestAdmin/agent-ruby
70
- changelog_uri: https://github.com/ForestAdmin/agent-ruby/CHANGELOG.md
149
+ changelog_uri: https://github.com/ForestAdmin/agent-ruby/blob/main/CHANGELOG.md
71
150
  rubygems_mfa_required: 'false'
72
151
  post_install_message:
73
152
  rdoc_options: []
data/README.md DELETED
@@ -1,31 +0,0 @@
1
- # ForestAdminDatasourceCustomizer
2
-
3
- TODO: Delete this and the text below, and describe your gem
4
-
5
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/forest_admin_datasource_customizer`. To experiment with that code, run `bin/console` for an interactive prompt.
6
-
7
- ## Installation
8
-
9
- TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
10
-
11
- Install the gem and add to the application's Gemfile by executing:
12
-
13
- $ bundle add UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
14
-
15
- If bundler is not being used to manage dependencies, install the gem by executing:
16
-
17
- $ gem install UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
18
-
19
- ## Usage
20
-
21
- TODO: Write usage instructions here
22
-
23
- ## Development
24
-
25
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
26
-
27
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
28
-
29
- ## Contributing
30
-
31
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/forest_admin_datasource_customizer.