forest_admin_datasource_toolkit 1.0.0.pre.beta.40 → 1.0.0.pre.beta.41

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: 2d1644c6dbd5c74ceeaf4b1fad0f885380d2c064e8e27052c4051215c54d1ec6
4
- data.tar.gz: 8620984de80b2ca0c452495bf84a389813932e23e3f9446925f8cd9c90fe25b7
3
+ metadata.gz: 1035a539d283d780ed5f275c2201cd90151f5fda9b411c962f04bce55f8d5635
4
+ data.tar.gz: 605fc837c85f9adb4599902dc34f2a2c9c8cbe490415ecea5bd6a088cdeec794
5
5
  SHA512:
6
- metadata.gz: 231b56aa6f848a9c06c7dfe8b7d5ba5d3ac22150a8ce4a60d310270cff7d4058add55ec6b7cc0c0f77c11001bc038d3c7e42f9bf781b0efc5b9cc9e45ddf7b43
7
- data.tar.gz: ca841388695d9c61c97c381429e710e723c39c57fdec4dda3662e6db95acb4361dab286f2268e3ca01be50de9cd576c54d21376b353527df97aafa5b484d87ae
6
+ metadata.gz: 6030038abe0c9539e36cac0552935e23783f4edd5293063c88cb07a41b829636b0d29cade972264c471318a61527bcbfd093bcdeb5cb3580adc6d5bae2a1ebc5
7
+ data.tar.gz: 967c956a40ebb8d304e989eb3f6c66b95c4a22f9fb023db2a84e5e7c02c620d35a477663336425a0f9996d18f656d95da38e824b86bb4b5af9a5f9f18ccd0b13
@@ -3,7 +3,6 @@ module ForestAdminDatasourceToolkit
3
3
  attr_accessor :segments
4
4
 
5
5
  attr_reader :actions,
6
- :charts,
7
6
  :datasource,
8
7
  :name,
9
8
  :schema,
@@ -17,11 +16,11 @@ module ForestAdminDatasourceToolkit
17
16
  @schema = {
18
17
  fields: {},
19
18
  countable: false,
20
- searchable: false
19
+ searchable: false,
20
+ charts: []
21
21
  }
22
22
  @actions = {}
23
23
  @segments = {}
24
- @charts = {}
25
24
  end
26
25
 
27
26
  def enable_count
@@ -57,5 +56,9 @@ module ForestAdminDatasourceToolkit
57
56
 
58
57
  @actions[name] = action
59
58
  end
59
+
60
+ def render_chart(_caller, name, _record_id)
61
+ raise Exceptions::ForestException, "Chart #{name} is not implemented."
62
+ end
60
63
  end
61
64
  end
@@ -6,10 +6,6 @@ module ForestAdminDatasourceToolkit
6
6
  raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'"
7
7
  end
8
8
 
9
- def charts
10
- raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'"
11
- end
12
-
13
9
  def get_collection(name)
14
10
  raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'"
15
11
  end
@@ -1,10 +1,10 @@
1
1
  module ForestAdminDatasourceToolkit
2
2
  class Datasource < Components::Contracts::DatasourceContract
3
- attr_reader :collections, :charts
3
+ attr_reader :collections, :schema
4
4
 
5
5
  def initialize
6
6
  super
7
- @charts = {}
7
+ @schema = { charts: [] }
8
8
  @collections = {}
9
9
  end
10
10
 
@@ -7,6 +7,10 @@ module ForestAdminDatasourceToolkit
7
7
  @decorators = {}
8
8
  end
9
9
 
10
+ def schema
11
+ @child_datasource.schema
12
+ end
13
+
10
14
  def collections
11
15
  @child_datasource.collections.transform_values { |c| get_collection(c.name) }
12
16
  end
@@ -1,3 +1,3 @@
1
1
  module ForestAdminDatasourceToolkit
2
- VERSION = "1.0.0-beta.40"
2
+ VERSION = "1.0.0-beta.41"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_admin_datasource_toolkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.beta.40
4
+ version: 1.0.0.pre.beta.41
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: 2024-04-05 00:00:00.000000000 Z
12
+ date: 2024-04-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport