labimotion 2.4.0.rc1 → 2.4.0.rc2
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/CHANGELOG.md +21 -0
- data/lib/labimotion/apis/element_variation_api.rb +58 -3
- data/lib/labimotion/apis/generic_klass_api.rb +25 -3
- data/lib/labimotion/apis/labimotion_api.rb +1 -0
- data/lib/labimotion/apis/user_klass_settings_api.rb +70 -0
- data/lib/labimotion/entities/generic_klass_entity.rb +1 -0
- data/lib/labimotion/entities/segment_entity.rb +8 -0
- data/lib/labimotion/entities/user_klass_setting_entity.rb +10 -0
- data/lib/labimotion/helpers/generic_helpers.rb +9 -0
- data/lib/labimotion/helpers/param_helpers.rb +14 -0
- data/lib/labimotion/libs/element_variation_column_set.rb +426 -0
- data/lib/labimotion/libs/element_variation_header.rb +119 -0
- data/lib/labimotion/libs/export_element_variations.rb +245 -0
- data/lib/labimotion/libs/import_element_variations.rb +411 -0
- data/lib/labimotion/libs/linked_element.rb +10 -3
- data/lib/labimotion/libs/sample_association.rb +5 -0
- data/lib/labimotion/models/cellline.rb +47 -0
- data/lib/labimotion/models/concerns/element_fetchable.rb +3 -2
- data/lib/labimotion/models/concerns/segmentable.rb +2 -0
- data/lib/labimotion/models/element.rb +3 -2
- data/lib/labimotion/models/user_klass_setting.rb +12 -0
- data/lib/labimotion/version.rb +1 -1
- data/lib/labimotion.rb +8 -0
- metadata +24 -2
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# This file extends the existing CelllineSample model in the consuming app
|
|
4
|
+
# and defines a Labimotion::CellLine wrapper for convenient access.
|
|
5
|
+
# NB: the ELN host model is ::CelllineSample, but the wrapper is named
|
|
6
|
+
# Labimotion::CellLine so that "cell_line".camelize == "CellLine" resolves
|
|
7
|
+
# to it in the search_basic_by_like endpoint.
|
|
8
|
+
|
|
9
|
+
# rubocop:disable Style/RedundantConstantBase
|
|
10
|
+
|
|
11
|
+
ActiveSupport.on_load(:active_record) do
|
|
12
|
+
if defined?(::CelllineSample)
|
|
13
|
+
::CelllineSample.class_eval do
|
|
14
|
+
include Labimotion::ElementFetchable
|
|
15
|
+
|
|
16
|
+
def self.element_klass_name
|
|
17
|
+
'cell_line'
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
else
|
|
21
|
+
warn '[Labimotion] CelllineSample is not defined when Labimotion extension was loaded.'
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Namespace wrapper to keep your preferred call style
|
|
26
|
+
module Labimotion
|
|
27
|
+
module CellLine
|
|
28
|
+
class << self
|
|
29
|
+
# Delegate class methods to ::CelllineSample.
|
|
30
|
+
# ruby2_keywords is required so keyword arguments survive the *args
|
|
31
|
+
# round-trip on Ruby >= 3.0 (e.g. fetch_for_user(id, name:, limit:)).
|
|
32
|
+
ruby2_keywords def method_missing(method, *args, &block)
|
|
33
|
+
if ::CelllineSample.respond_to?(method)
|
|
34
|
+
::CelllineSample.public_send(method, *args, &block)
|
|
35
|
+
else
|
|
36
|
+
super
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def respond_to_missing?(method, include_private = false)
|
|
41
|
+
::CelllineSample.respond_to?(method, include_private) || super
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# rubocop:enable Style/RedundantConstantBase
|
|
@@ -26,9 +26,10 @@ module Labimotion
|
|
|
26
26
|
joins(collections: :user).where(collections: { user_id: user_id })
|
|
27
27
|
)
|
|
28
28
|
|
|
29
|
-
# Shared records
|
|
29
|
+
# Shared records — collection_shares hangs off Collection, not off the
|
|
30
|
+
# element models themselves, so join through the collections association.
|
|
30
31
|
shared = apply_filters.call(
|
|
31
|
-
left_joins(:collection_shares).where(collection_shares: { shared_with_id: user_id })
|
|
32
|
+
left_joins(collections: :collection_shares).where(collection_shares: { shared_with_id: user_id })
|
|
32
33
|
)
|
|
33
34
|
|
|
34
35
|
# Combine (remove duplicates), order, and limit
|
|
@@ -141,9 +141,10 @@ module Labimotion
|
|
|
141
141
|
joins(collections: :user).where(collections: { user_id: user_id })
|
|
142
142
|
)
|
|
143
143
|
|
|
144
|
-
# Shared elements
|
|
144
|
+
# Shared elements — collection_shares hangs off Collection, not off
|
|
145
|
+
# Element itself, so join through the collections association.
|
|
145
146
|
shared = apply_filters.call(
|
|
146
|
-
left_joins(:collection_shares).where(collection_shares: { shared_with_id: user_id })
|
|
147
|
+
left_joins(collections: :collection_shares).where(collection_shares: { shared_with_id: user_id })
|
|
147
148
|
)
|
|
148
149
|
|
|
149
150
|
# Combine (remove duplicates), order, and limit
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Labimotion
|
|
4
|
+
# Per-user, per-klass UI settings (e.g. toolbar Overview/Arrange visibility).
|
|
5
|
+
# Scoped to the owning user via created_by; at most one row per
|
|
6
|
+
# (created_by, klass, klass_identifier) — see the unique index. Keyed on the
|
|
7
|
+
# stable klass identifier so it applies to every instance of that klass,
|
|
8
|
+
# across template versions.
|
|
9
|
+
class UserKlassSetting < ApplicationRecord
|
|
10
|
+
self.table_name = :user_klass_settings
|
|
11
|
+
end
|
|
12
|
+
end
|
data/lib/labimotion/version.rb
CHANGED
data/lib/labimotion.rb
CHANGED
|
@@ -28,6 +28,7 @@ module Labimotion
|
|
|
28
28
|
autoload :StandardLayerAPI, 'labimotion/apis/standard_layer_api'
|
|
29
29
|
autoload :VocabularyAPI, 'labimotion/apis/vocabulary_api'
|
|
30
30
|
autoload :UserAPI, 'labimotion/apis/user_api'
|
|
31
|
+
autoload :UserKlassSettingsAPI, 'labimotion/apis/user_klass_settings_api'
|
|
31
32
|
autoload :MttAPI, 'labimotion/apis/mtt_api'
|
|
32
33
|
autoload :ElementVariationAPI, 'labimotion/apis/element_variation_api'
|
|
33
34
|
autoload :LabimotionDoiAPI, 'labimotion/apis/labimotion_doi_api'
|
|
@@ -56,6 +57,7 @@ module Labimotion
|
|
|
56
57
|
## autoload :DatasetRevisionEntity, 'labimotion/entities/dataset_revision_entity'
|
|
57
58
|
autoload :VocabularyEntity, 'labimotion/entities/vocabulary_entity'
|
|
58
59
|
autoload :UserEntity, 'labimotion/entities/user_entity'
|
|
60
|
+
autoload :UserKlassSettingEntity, 'labimotion/entities/user_klass_setting_entity'
|
|
59
61
|
autoload :ElementVariationEntity, 'labimotion/entities/element_variation_entity'
|
|
60
62
|
autoload :LabimotionTemplateDoiEntity, 'labimotion/entities/labimotion_template_doi_entity'
|
|
61
63
|
|
|
@@ -93,6 +95,10 @@ module Labimotion
|
|
|
93
95
|
autoload :AttachmentHandler, 'labimotion/libs/attachment_handler'
|
|
94
96
|
autoload :VocabularyHandler, 'labimotion/libs/vocabulary_handler'
|
|
95
97
|
autoload :XlsxExporter, 'labimotion/libs/xlsx_exporter'
|
|
98
|
+
autoload :ElementVariationColumnSet, 'labimotion/libs/element_variation_column_set'
|
|
99
|
+
autoload :ElementVariationHeader, 'labimotion/libs/element_variation_header'
|
|
100
|
+
autoload :ExportElementVariations, 'labimotion/libs/export_element_variations'
|
|
101
|
+
autoload :ImportElementVariations, 'labimotion/libs/import_element_variations'
|
|
96
102
|
|
|
97
103
|
######## Utils
|
|
98
104
|
autoload :Prop, 'labimotion/utils/prop'
|
|
@@ -130,7 +136,9 @@ module Labimotion
|
|
|
130
136
|
|
|
131
137
|
autoload :StdLayer, 'labimotion/models/std_layer'
|
|
132
138
|
autoload :StdLayersRevision, 'labimotion/models/std_layers_revision'
|
|
139
|
+
autoload :UserKlassSetting, 'labimotion/models/user_klass_setting'
|
|
133
140
|
|
|
141
|
+
autoload :CellLine, 'labimotion/models/cellline'
|
|
134
142
|
autoload :DeviceDescription, 'labimotion/models/device_description'
|
|
135
143
|
autoload :DoseRespRequest, 'labimotion/models/dose_resp_request'
|
|
136
144
|
autoload :DoseRespOutput, 'labimotion/models/dose_resp_output'
|
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: 2.4.0.
|
|
4
|
+
version: 2.4.0.rc2
|
|
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: 2026-07-
|
|
12
|
+
date: 2026-07-10 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: caxlsx
|
|
@@ -45,6 +45,20 @@ dependencies:
|
|
|
45
45
|
- - "<"
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
47
|
version: '8.0'
|
|
48
|
+
- !ruby/object:Gem::Dependency
|
|
49
|
+
name: roo
|
|
50
|
+
requirement: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '2.10'
|
|
55
|
+
type: :runtime
|
|
56
|
+
prerelease: false
|
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - "~>"
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '2.10'
|
|
48
62
|
description:
|
|
49
63
|
email:
|
|
50
64
|
- chia-lin.lin@kit.edu
|
|
@@ -72,6 +86,7 @@ files:
|
|
|
72
86
|
- lib/labimotion/apis/standard_api.rb
|
|
73
87
|
- lib/labimotion/apis/standard_layer_api.rb
|
|
74
88
|
- lib/labimotion/apis/user_api.rb
|
|
89
|
+
- lib/labimotion/apis/user_klass_settings_api.rb
|
|
75
90
|
- lib/labimotion/apis/vocabulary_api.rb
|
|
76
91
|
- lib/labimotion/apis/wellplate_api.rb
|
|
77
92
|
- lib/labimotion/collection/export.rb
|
|
@@ -96,6 +111,7 @@ files:
|
|
|
96
111
|
- lib/labimotion/entities/segment_klass_entity.rb
|
|
97
112
|
- lib/labimotion/entities/segment_revision_entity.rb
|
|
98
113
|
- lib/labimotion/entities/user_entity.rb
|
|
114
|
+
- lib/labimotion/entities/user_klass_setting_entity.rb
|
|
99
115
|
- lib/labimotion/entities/vocabulary_entity.rb
|
|
100
116
|
- lib/labimotion/helpers/converter_helpers.rb
|
|
101
117
|
- lib/labimotion/helpers/dataset_helpers.rb
|
|
@@ -116,8 +132,12 @@ files:
|
|
|
116
132
|
- lib/labimotion/libs/data/vocab/Standard.json
|
|
117
133
|
- lib/labimotion/libs/data/vocab/System.json
|
|
118
134
|
- lib/labimotion/libs/dataset_builder.rb
|
|
135
|
+
- lib/labimotion/libs/element_variation_column_set.rb
|
|
136
|
+
- lib/labimotion/libs/element_variation_header.rb
|
|
119
137
|
- lib/labimotion/libs/export_dataset.rb
|
|
120
138
|
- lib/labimotion/libs/export_element.rb
|
|
139
|
+
- lib/labimotion/libs/export_element_variations.rb
|
|
140
|
+
- lib/labimotion/libs/import_element_variations.rb
|
|
121
141
|
- lib/labimotion/libs/linked_element.rb
|
|
122
142
|
- lib/labimotion/libs/nmr_mapper.rb
|
|
123
143
|
- lib/labimotion/libs/properties_handler.rb
|
|
@@ -126,6 +146,7 @@ files:
|
|
|
126
146
|
- lib/labimotion/libs/template_matcher.rb
|
|
127
147
|
- lib/labimotion/libs/vocabulary_handler.rb
|
|
128
148
|
- lib/labimotion/libs/xlsx_exporter.rb
|
|
149
|
+
- lib/labimotion/models/cellline.rb
|
|
129
150
|
- lib/labimotion/models/collections_element.rb
|
|
130
151
|
- lib/labimotion/models/concerns/attachment_converter.rb
|
|
131
152
|
- lib/labimotion/models/concerns/datasetable.rb
|
|
@@ -165,6 +186,7 @@ files:
|
|
|
165
186
|
- lib/labimotion/models/std_layer.rb
|
|
166
187
|
- lib/labimotion/models/std_layers_revision.rb
|
|
167
188
|
- lib/labimotion/models/template_submission.rb
|
|
189
|
+
- lib/labimotion/models/user_klass_setting.rb
|
|
168
190
|
- lib/labimotion/models/vocabulary.rb
|
|
169
191
|
- lib/labimotion/models/wellplate.rb
|
|
170
192
|
- lib/labimotion/usecases/build_template_doi_xml.rb
|