thecore_print_commons 2.2.0 → 2.3.1

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: 670b8b4f153ad70642a153811f71d2ce797e697ddc7e5af3cbc915739954abb4
4
- data.tar.gz: daed3ca480be8480a89d93f4f6b494ace07a93224cee549d33c0941ec00a6431
3
+ metadata.gz: 3f0b1b571fa094d8b1b266d24f6ea7ae229c57c2364952dff65355d744da507e
4
+ data.tar.gz: f96a79855b594b66e390cdfceef995faba318fd47e1975cfbdcc12074efd7005
5
5
  SHA512:
6
- metadata.gz: dd44e8214bddfa87012ec35e728b623eb70c8b21478670175c2f25a627a5cc246d38d5f3bb43b1e2ad5cd5252cdd1bcfdf4564d609d5241778416f479efe4b49
7
- data.tar.gz: 21d5bc33596daeef921285ea6828a5f660f50df7389c105ffc011ed4c61bc8375351277759e1811c420c1178e4b8955a25d202c99f8e8c330dd3614fd49d40d5
6
+ metadata.gz: fc9fd513300b2dab275b0702bc6c01ac87edf5a04616f2afc03ecb591e7b3cfddc9a7b93300d9a9445e46e11ef11d2a97cab4763a59ef0a59a7b57deb0e3ced8
7
+ data.tar.gz: ffdd5c9dd4ac4ca21ee5b25b6fb1278295d451e1c0e2ce51a4091fdb6a99555beb54d67ce29d2a817e9f4ce63a461f6687cbbf7472009306049d77fc1a5e6368
@@ -2,7 +2,7 @@ module Api::PrintTemplate
2
2
  extend ActiveSupport::Concern
3
3
 
4
4
  included do
5
- # Use @@json_attrs to drive json rendering for
5
+ # Use self.json_attrs to drive json rendering for
6
6
  # API model responses (index, show and update ones).
7
7
  # For reference:
8
8
  # https://api.rubyonrails.org/classes/ActiveModel/Serializers/JSON.html
@@ -12,7 +12,7 @@ module Api::PrintTemplate
12
12
  # - methods: include the result of some method defined in the model
13
13
  # - include: include associated models, it's an object {} which also accepts the keys described here
14
14
  cattr_accessor :json_attrs
15
- @@json_attrs = ::ModelDrivenApi.smart_merge (json_attrs || {}), {}
15
+ self.json_attrs = ::ModelDrivenApi.smart_merge (json_attrs || {}), {}
16
16
 
17
17
  # Here you can add custom actions to be called from the API
18
18
  # The action must return an serializable (JSON) object.
@@ -2,7 +2,7 @@ module Api::Printer
2
2
  extend ActiveSupport::Concern
3
3
 
4
4
  included do
5
- # Use @@json_attrs to drive json rendering for
5
+ # Use self.json_attrs to drive json rendering for
6
6
  # API model responses (index, show and update ones).
7
7
  # For reference:
8
8
  # https://api.rubyonrails.org/classes/ActiveModel/Serializers/JSON.html
@@ -12,7 +12,9 @@ module Api::Printer
12
12
  # - methods: include the result of some method defined in the model
13
13
  # - include: include associated models, it's an object {} which also accepts the keys described here
14
14
  cattr_accessor :json_attrs
15
- @@json_attrs = ::ModelDrivenApi.smart_merge (json_attrs || {}), {}
15
+ self.json_attrs = ::ModelDrivenApi.smart_merge (json_attrs || {}), {
16
+ methods: [ :is_online ]
17
+ }
16
18
 
17
19
  # Here you can add custom actions to be called from the API
18
20
  # The action must return an serializable (JSON) object.
@@ -6,8 +6,8 @@ module RailsAdmin::Printer
6
6
  navigation_label I18n.t("admin.settings.label")
7
7
  navigation_icon 'fa fa-print'
8
8
 
9
- field :print_template
10
9
  field :name
10
+ field :print_template
11
11
  field :ip
12
12
  field :port do
13
13
  default_value do
@@ -15,8 +15,17 @@ module RailsAdmin::Printer
15
15
  end
16
16
  end
17
17
  field :default, :toggle
18
- field :temperature
19
- field :description
18
+
19
+ show do
20
+ field :temperature
21
+ field :description
22
+ end
23
+
24
+ edit do
25
+ field :temperature
26
+ field :description
27
+ end
28
+
20
29
  field :is_online do
21
30
  read_only true
22
31
  formatted_value do # used in form views
@@ -31,15 +40,6 @@ module RailsAdmin::Printer
31
40
  value ? "OK" : "KO" # used in exports, where no html/data is allowed
32
41
  end
33
42
  end
34
-
35
- list do
36
- configure :description do
37
- visible false
38
- end
39
- configure :temperature do
40
- visible false
41
- end
42
- end
43
43
  end
44
44
  end
45
45
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thecore_print_commons
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-15 00:00:00.000000000 Z
11
+ date: 2022-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thecore_background_jobs
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.0'
19
+ version: '2.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.0'
26
+ version: '2.2'
27
27
  description: Thecorized thecore_print_commons full description.
28
28
  email:
29
29
  - gabriele.tassoni@gmail.com