labimotion 1.5.0.rc1 → 1.5.0.rc3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4bf785dda2ca949138e3d5f9b5047c3a8696c6171af31b54ee02072f98aa9d58
|
4
|
+
data.tar.gz: c90714bacc5941ca475ec8e75f2355ba4e2f5b347f14d49e649e0496799b1ba5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbfb288dc3f358efe920ea49f135208024443e09512f122e7adac44defeafcc3391b4948f9cfea9bfc78fc6597134426bcbc6237733a9101ca69acc264c675f4
|
7
|
+
data.tar.gz: 9badebc9b2f3040b1d9c52d4a19bed4a05b7ba03677a044a1451dbf11c647b659a2875b054a2e20412cbcc6d049d568f208148a5312b7996194f74b2f76b89ed
|
@@ -55,8 +55,8 @@ module Labimotion
|
|
55
55
|
|
56
56
|
# list = Labimotion::Vocabulary.all.sort_by { |e| e.name }
|
57
57
|
# present list, with: Labimotion::StdLayer, root: 'klass'
|
58
|
-
|
59
|
-
combined_data = Labimotion::VocabularyEntity.represent(vocabularies, serializable: true)
|
58
|
+
combined_data = Labimotion::VocabularyHandler.load_all_vocabularies
|
59
|
+
# combined_data = Labimotion::VocabularyEntity.represent(vocabularies, serializable: true)
|
60
60
|
return { mc: 'ss00', data: combined_data }
|
61
61
|
rescue StandardError => e
|
62
62
|
Labimotion.log_exception(e, current_user)
|
@@ -9,7 +9,7 @@ module Labimotion
|
|
9
9
|
(object&.properties.is_a?(Hash) && object.properties[Labimotion::Prop::LAYERS]&.keys || []).each do |key|
|
10
10
|
# layer = object.properties[key]
|
11
11
|
|
12
|
-
# field_vocabularies = object.properties[Labimotion::Prop::LAYERS][key][Labimotion::Prop::FIELDS].select { |ss| ss['
|
12
|
+
# field_vocabularies = object.properties[Labimotion::Prop::LAYERS][key][Labimotion::Prop::FIELDS].select { |ss| ss['is_voc'] == true}
|
13
13
|
# field_vocabularies.each do |field|
|
14
14
|
# idx = object.properties[Labimotion::Prop::LAYERS][key][Labimotion::Prop::FIELDS].index(field)
|
15
15
|
# if field['identifier'] == '7c30cd4f-aef4-433a-946e-d0f81f8918f1'
|
@@ -6,7 +6,7 @@ module Labimotion
|
|
6
6
|
def self.update_vocabularies(properties, current_user, element)
|
7
7
|
properties[Labimotion::Prop::LAYERS].keys.each do |key|
|
8
8
|
layer = properties[Labimotion::Prop::LAYERS][key]
|
9
|
-
field_vocabularies = layer[Labimotion::Prop::FIELDS].select { |ss| ss['
|
9
|
+
field_vocabularies = layer[Labimotion::Prop::FIELDS].select { |ss| ss['is_voc'] == true && ss['opid'] == 9}
|
10
10
|
field_vocabularies.each do |field|
|
11
11
|
idx = properties[Labimotion::Prop::LAYERS][key][Labimotion::Prop::FIELDS].index(field)
|
12
12
|
val = ''
|
@@ -72,18 +72,23 @@ module Labimotion
|
|
72
72
|
|
73
73
|
def self.load_from_files
|
74
74
|
merged_data = []
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
75
|
+
# byebug
|
76
|
+
sys_json = File.join(__dir__, 'data', 'vocab', 'System.json')
|
77
|
+
# byebug
|
78
|
+
file_content = File.read(sys_json)
|
79
|
+
json_data = JSON.parse(file_content)
|
80
|
+
merged_data.concat(json_data)
|
81
|
+
|
82
|
+
std_json = File.join(__dir__, 'data', 'vocab', 'Standard.json')
|
83
|
+
file_content = File.read(std_json)
|
84
|
+
json_data = JSON.parse(file_content)
|
85
|
+
merged_data.concat(json_data)
|
81
86
|
merged_data
|
82
87
|
end
|
83
88
|
|
84
89
|
def self.load_from_database
|
85
|
-
Labimotion::Vocabulary.all.sort_by(&:name)
|
86
|
-
|
90
|
+
vocabularies = Labimotion::Vocabulary.all.sort_by(&:name)
|
91
|
+
Labimotion::VocabularyEntity.represent(vocabularies, serializable: true)
|
87
92
|
end
|
88
93
|
|
89
94
|
private_class_method :load_from_files, :load_from_database
|
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.5.0.
|
4
|
+
version: 1.5.0.rc3
|
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-10-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|