forest_admin_datasource_customizer 1.38.2 → 1.39.0
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/lib/forest_admin_datasource_customizer/collection_customizer.rb +4 -2
- data/lib/forest_admin_datasource_customizer/decorators/hook/hook_collection_decorator.rb +2 -2
- data/lib/forest_admin_datasource_customizer/decorators/hook/hooks.rb +7 -2
- data/lib/forest_admin_datasource_customizer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c5f2259e1f95031dd3c51234bee68d9f06f0062bbc695f774af69fbda8e6300a
|
|
4
|
+
data.tar.gz: 50d3a4a7acda8cad6ce1aedb315b4dcc48c4a6643ff4d02aa6b9e6969ab75933
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8f3b8168feb067ecf658411090300b71e5f08dd75b6599a9b4ce8d8abb230d6e297c7f0c01ad858ffea7a83778006456ee1cf7fded95d217375ff630351a3994
|
|
7
|
+
data.tar.gz: 6e7db791839ed390bf985b21166cc18b980947f7932e6f4d8875a9b52e343f010b9787c503df171e6c4505b5c590594d20e1966e837bdd5e80c4850a66d1632e
|
|
@@ -263,8 +263,10 @@ module ForestAdminDatasourceCustomizer
|
|
|
263
263
|
# .add_hook('before', 'list') do |context|
|
|
264
264
|
# # Do something before the list action
|
|
265
265
|
# end
|
|
266
|
-
def add_hook(position, type, &handler)
|
|
267
|
-
push_customization
|
|
266
|
+
def add_hook(position, type, prepend: false, &handler)
|
|
267
|
+
push_customization do
|
|
268
|
+
@stack.hook.get_collection(@name).add_hook(position, type, handler, prepend: prepend)
|
|
269
|
+
end
|
|
268
270
|
end
|
|
269
271
|
|
|
270
272
|
# Add a new segment on the collection.
|
|
@@ -18,8 +18,8 @@ module ForestAdminDatasourceCustomizer
|
|
|
18
18
|
}
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
-
def add_hook(position, type, hook)
|
|
22
|
-
@hooks[type].add_handler(position, hook)
|
|
21
|
+
def add_hook(position, type, hook, prepend: false)
|
|
22
|
+
@hooks[type].add_handler(position, hook, prepend: prepend)
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
def create(caller, data)
|
|
@@ -17,8 +17,13 @@ module ForestAdminDatasourceCustomizer
|
|
|
17
17
|
@after.each { |hook| hook.call(context) }
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
# `prepend` puts the handler ahead of the ones already registered. `execute_after` stops at the
|
|
21
|
+
# first exception, so a handler that must run whatever a sibling does (the audit trail recording a
|
|
22
|
+
# write that already happened) cannot afford to be last.
|
|
23
|
+
def add_handler(position, hook, prepend: false)
|
|
24
|
+
handlers = position == 'After' ? @after : @before
|
|
25
|
+
|
|
26
|
+
prepend ? handlers.unshift(hook) : handlers.push(hook)
|
|
22
27
|
end
|
|
23
28
|
end
|
|
24
29
|
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.
|
|
4
|
+
version: 1.39.0
|
|
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: 2026-08-
|
|
12
|
+
date: 2026-08-19 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: activesupport
|