labimotion 1.4.0.rc3 → 1.4.0.rc5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 587b32cc2f374e118a3570bbe34a69a497ec9e6d2134757d9241ad6c90b416ec
|
4
|
+
data.tar.gz: 4a778699fb7c40c7aa3383cc2cabfb910218a616f122d0b748d092262d2ee370
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c20c57d746b3c6d0f771781fb3bf44eda10062f0ca577cb06e6c4aed1bcceb8f8f0be7556d2cb3e310010aa38c9de14ef791309fe829ef1d591b8782ac5c29a
|
7
|
+
data.tar.gz: 760ae347f5842287bdf7d04074d55d38cdac15cf61fa540c87295f049c1547fea20fba669997172db08fcbb2f570abd3bf1b4fdbb5774e41d163645e41512e15
|
@@ -47,8 +47,12 @@ module Labimotion
|
|
47
47
|
begin
|
48
48
|
data.fetch('Labimotion::Dataset', {}).each do |uuid, fields|
|
49
49
|
klass_id = fields['dataset_klass_id']
|
50
|
-
|
51
|
-
|
50
|
+
next if data.fetch('Labimotion::DatasetKlass', {}).empty?
|
51
|
+
|
52
|
+
dk_obj = data.fetch('Labimotion::DatasetKlass', {}) && data.fetch('Labimotion::DatasetKlass', {})[klass_id]
|
53
|
+
next if dk_obj.nil?
|
54
|
+
|
55
|
+
dk_id = dk_obj && dk_obj['identifier']
|
52
56
|
element_uuid = fields.fetch('element_id')
|
53
57
|
element_type = fields.fetch('element_type')
|
54
58
|
element = instances.fetch(element_type).fetch(element_uuid)
|
@@ -78,7 +82,7 @@ module Labimotion
|
|
78
82
|
end
|
79
83
|
rescue StandardError => e
|
80
84
|
Labimotion.log_exception(e)
|
81
|
-
raise
|
85
|
+
# raise
|
82
86
|
end
|
83
87
|
end
|
84
88
|
|
@@ -23,7 +23,7 @@ module Labimotion
|
|
23
23
|
def deactivate_klass(params)
|
24
24
|
klz = fetch_klass(params[:klass], params[:id])
|
25
25
|
klz&.update!(is_active: params[:is_active])
|
26
|
-
generate_klass_file unless klz.class.name != 'ElementKlass'
|
26
|
+
generate_klass_file unless klz.class.name != 'Labimotion::ElementKlass'
|
27
27
|
klz
|
28
28
|
rescue StandardError => e
|
29
29
|
Labimotion.log_exception(e, current_user)
|
@@ -34,7 +34,7 @@ module Labimotion
|
|
34
34
|
authenticate_admin!(params[:klass].gsub(/(Klass)/, 's').downcase)
|
35
35
|
klz = fetch_klass(params[:klass], params[:id])
|
36
36
|
klz&.destroy!
|
37
|
-
generate_klass_file unless klz.class.name != 'ElementKlass'
|
37
|
+
generate_klass_file unless klz.class.name != 'Labimotion::ElementKlass'
|
38
38
|
status 201
|
39
39
|
rescue StandardError => e
|
40
40
|
Labimotion.log_exception(e, current_user)
|
@@ -107,9 +107,9 @@ module Labimotion
|
|
107
107
|
attributes['updated_by'] = current_user.id
|
108
108
|
attributes['sync_by'] = current_user.id
|
109
109
|
attributes['sync_time'] = DateTime.now
|
110
|
-
attr_klass = response.dig('element_klass', {}) # response['element_klass']
|
110
|
+
attr_klass = response['element_klass'] ## response.dig('element_klass', {}) # response['element_klass']
|
111
111
|
validate_klass(attributes, attr_klass)
|
112
|
-
|
112
|
+
|
113
113
|
rescue StandardError => e
|
114
114
|
Labimotion.log_exception(e, current_user)
|
115
115
|
raise e
|
@@ -97,7 +97,10 @@ module Labimotion
|
|
97
97
|
type = "#{field['type']}-#{field['option_layers']}" if field['type'] == Labimotion::FieldType::SELECT || field['type'] == Labimotion::FieldType::SYSTEM_DEFINED
|
98
98
|
|
99
99
|
show_value = field['value'] =~ /\A\d+,\d+\z/ ? field['value']&.gsub(',', '.') : field['value']
|
100
|
-
|
100
|
+
ols_short_form = (field['ontology'] && field['ontology']['short_form']) || ''
|
101
|
+
ols_label = (field['ontology'] && field['ontology']['label']) || ''
|
102
|
+
ols_iri = (field['ontology'] && field['ontology']['iri']) || ''
|
103
|
+
sheet.add_row([' ', field['label'], nil, field['value_system'], field['field'], type, from_device, field['dkey'], nil, ols_short_form, ols_label, ols_iri].freeze)
|
101
104
|
|
102
105
|
case field['type']
|
103
106
|
when Labimotion::FieldType::SELECT
|
@@ -166,7 +169,7 @@ module Labimotion
|
|
166
169
|
end
|
167
170
|
|
168
171
|
def header
|
169
|
-
['Layer Label', 'Field Label', 'Value', 'Unit', 'Name', 'Type', 'Source?', 'Source identifier', 'Source data'].freeze
|
172
|
+
['Layer Label', 'Field Label', 'Value', 'Unit', 'Name', 'Type', 'Source?', 'Source identifier', 'Source data', 'Ontology', 'Ontology Label', 'iri'].freeze
|
170
173
|
end
|
171
174
|
|
172
175
|
def read
|
data/lib/labimotion/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: labimotion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.0.
|
4
|
+
version: 1.4.0.rc5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chia-Lin Lin
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-07-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|