forest_admin_datasource_customizer 1.13.1 → 1.13.2

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: b1531ca79b0ec98a190c973d34bca7e775a65e2a18f60f1b591f63e3817d2b3f
4
- data.tar.gz: e8e524bf87067bb60960a31211764b976925485be60f9230d466d8e579ebeb76
3
+ metadata.gz: a506e245343e6bede97932de2086844c4e0cc0350c4d0a7534a15156c7599997
4
+ data.tar.gz: 0a44724088ff4ee539ae64b9f7b082c167af0fbce8c16a85d0fb36c2422899cb
5
5
  SHA512:
6
- metadata.gz: d603a54ab12baa8431bfdd6d9c96ce48767de15fecb1186e634e6a62a32f7bede47c620bb7fc272b611dfae823deec239be56bc6079cbafe68b04b5d12de543b
7
- data.tar.gz: 345fba1e020c78633b45c54889e33628fc8dee2914abfe189a9ffb3eafc8d0cee43214731ba42582993ec9099ad4fd0154248e6cf2e7084b2d9ddbeb4cd2ee85
6
+ metadata.gz: 36cd54ee3503d1542e1033f86e4e0dedc1e5b261cb3e83bc3f373e79e42bcbe3c09f9366dfa761999d488defd44ca7b3be53d92aa62de97a31bf1174e6cee20b
7
+ data.tar.gz: e48603a5fb00043bce6ac92202f7376ecec3fbc2e8b5dcd0bfc60ac58769d3830a429b129b3ac96f00fcb1c60e045448c38c6eb124c3e2dfbb026a8a252a5568
@@ -14,40 +14,37 @@ module ForestAdminDatasourceCustomizer
14
14
 
15
15
  def success(message: 'Success', options: {})
16
16
  {
17
- headers: @headers,
17
+ response_headers: @headers,
18
18
  type: 'Success',
19
- success: message,
20
- refresh: { relationships: options.key?(:invalidated) ? options[:invalidated] : [] },
19
+ message: message,
20
+ invalidated: options.key?(:invalidated) ? options[:invalidated] : [],
21
21
  html: options.key?(:html) ? options[:html] : nil
22
22
  }
23
23
  end
24
24
 
25
25
  def error(message: 'Error', options: {})
26
26
  {
27
- headers: @headers,
27
+ response_headers: @headers,
28
28
  type: 'Error',
29
- status: 400,
30
- error: message,
29
+ message: message,
31
30
  html: options.key?(:html) ? options[:html] : nil
32
31
  }
33
32
  end
34
33
 
35
34
  def webhook(url:, method: 'POST', headers: {}, body: {})
36
35
  {
37
- headers: @headers,
36
+ response_headers: @headers,
38
37
  type: 'Webhook',
39
- webhook: {
40
- body: body,
41
- headers: headers,
42
- method: method,
43
- url: url
44
- }
38
+ body: body,
39
+ headers: headers,
40
+ method: method,
41
+ url: url
45
42
  }
46
43
  end
47
44
 
48
45
  def file(content:, name: 'file', mime_type: 'application/octet-stream')
49
46
  {
50
- headers: @headers,
47
+ response_headers: @headers,
51
48
  type: 'File',
52
49
  name: name,
53
50
  mime_type: mime_type,
@@ -57,9 +54,9 @@ module ForestAdminDatasourceCustomizer
57
54
 
58
55
  def redirect_to(path:)
59
56
  {
60
- headers: @headers,
57
+ response_headers: @headers,
61
58
  type: 'Redirect',
62
- redirect_to: path
59
+ path: path
63
60
  }
64
61
  end
65
62
  end
@@ -40,7 +40,7 @@ module ForestAdminDatasourceCustomizer
40
40
  if schema.type == 'Column'
41
41
  new_schema = schema.dup
42
42
  new_schema.column_type = replace_column_type(schema.column_type)
43
- new_schema.validations = replace_validation(name, schema)
43
+ new_schema.validation = replace_validation(name, schema)
44
44
  fields[name] = new_schema
45
45
  else
46
46
  fields[name] = schema
@@ -203,8 +203,8 @@ module ForestAdminDatasourceCustomizer
203
203
  def replace_validation(name, column_schema)
204
204
  if column_schema.column_type == 'Binary'
205
205
  validations = []
206
- min_length = (column_schema.validations.find { |v| v[:operator] == Operators::LONGER_THAN } || {})[:value]
207
- max_length = (column_schema.validations.find { |v| v[:operator] == Operators::SHORTER_THAN } || {})[:value]
206
+ min_length = (column_schema.validation.find { |v| v[:operator] == Operators::LONGER_THAN } || {})[:value]
207
+ max_length = (column_schema.validation.find { |v| v[:operator] == Operators::SHORTER_THAN } || {})[:value]
208
208
 
209
209
  if should_use_hex(name)
210
210
  validations << { operator: Operators::MATCH, value: '/^[0-9a-f]+$/' }
@@ -214,14 +214,14 @@ module ForestAdminDatasourceCustomizer
214
214
  validations << { operator: Operators::MATCH, value: '/^data:.*;base64,.*/' }
215
215
  end
216
216
 
217
- if column_schema.validations.find { |v| v[:operator] == Operators::PRESENT }
217
+ if column_schema.validation.find { |v| v[:operator] == Operators::PRESENT }
218
218
  validations << { operator: Operators::PRESENT }
219
219
  end
220
220
 
221
221
  return validations
222
222
  end
223
223
 
224
- column_schema.validations
224
+ column_schema.validation
225
225
  end
226
226
  end
227
227
  end
@@ -40,7 +40,7 @@ module ForestAdminDatasourceCustomizer
40
40
  def refine_schema(child_schema)
41
41
  @validation.each do |name, rules|
42
42
  field = child_schema[:fields][name]
43
- field.validations = (field.validations || []).concat(rules)
43
+ field.validation = (field.validation || []).concat(rules)
44
44
  child_schema[:fields][name] = field
45
45
  end
46
46
 
@@ -1,3 +1,3 @@
1
1
  module ForestAdminDatasourceCustomizer
2
- VERSION = "1.13.1"
2
+ VERSION = "1.13.2"
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.13.1
4
+ version: 1.13.2
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-11-03 00:00:00.000000000 Z
12
+ date: 2025-11-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport