labimotion 1.3.2 → 1.4.0.rc1

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: 1618c815a5e643e1defe701789af1eb30a3e7e2a166bf65d0b0657893099cd38
4
- data.tar.gz: 66379371379950fb9666a7472954f9b54087b04095ce23444ce8c463c075e173
3
+ metadata.gz: 04e8244e35f9f07197148e331748e527451dae61be8352729f04b9e7be923e6f
4
+ data.tar.gz: 334b4f9d71132b30884e522a38cc11e770048d20d8ff4e34bc0f60ddaf45d3df
5
5
  SHA512:
6
- metadata.gz: f735c423f7975f6155be3d129b9b3918b8c64b019e45c146e148cefd66f5184f62d982d117b6f1c863822446776d6f9a91ba5b4be479ad79457aa9629e903286
7
- data.tar.gz: dbb7a6e448818ceceb32f885725167e99efa5bd2ef142e241c6c58f4a9dd74fa36713cf4e66434fed7cf74b3a64b1ef2830e5c2fc258cc8443216bb7e526baef
6
+ metadata.gz: faf260b294017c7b504aa9eef458736d1076cd5f7198ba15b073f593bc5649d7c6bf892bf9deb3be449ee51ffb3b44b4936719eb1134353fdf9a4535f1d1f9ad
7
+ data.tar.gz: 5ca488c82012a85bdf51b37c2210ce0a9171935b387a1e6cd31ac8008398be89539c43d1c5f42825834aa013f65b5ae31de14e25d745c505fc361f5e66b5e314
@@ -10,6 +10,7 @@ module Labimotion
10
10
  helpers ContainerHelpers
11
11
  helpers ParamsHelpers
12
12
  helpers CollectionHelpers
13
+ helpers UserLabelHelpers
13
14
  helpers Labimotion::SampleAssociationHelpers
14
15
  helpers Labimotion::GenericHelpers
15
16
  helpers Labimotion::ElementHelpers
@@ -327,7 +328,7 @@ module Labimotion
327
328
  Labimotion.log_exception(e, current_user)
328
329
  { error: e.message }
329
330
  end
330
- end
331
+ end
331
332
 
332
333
  desc 'Return serialized elements of current user'
333
334
  params do
@@ -336,6 +337,7 @@ module Labimotion
336
337
  optional :el_type, type: String, desc: 'element klass name'
337
338
  optional :from_date, type: Integer, desc: 'created_date from in ms'
338
339
  optional :to_date, type: Integer, desc: 'created_date to in ms'
340
+ optional :user_label, type: Integer, desc: 'user label'
339
341
  optional :filter_created_at, type: Boolean, desc: 'filter by created at or updated at'
340
342
  optional :sort_column, type: String, desc: 'sort by updated_at or selected layers property'
341
343
  end
@@ -426,7 +428,7 @@ module Labimotion
426
428
  raise e
427
429
  end
428
430
  end
429
- end
431
+ end
430
432
  end
431
433
  end
432
434
  end
@@ -95,6 +95,7 @@ module Labimotion
95
95
  element.properties = update_sample_association(params[:properties], current_user, element)
96
96
  element.container = update_datamodel(params[:container], current_user)
97
97
  element.save!
98
+ update_element_labels(element, params[:user_labels], current_user.id)
98
99
  element.save_segments(segments: params[:segments], current_user_id: current_user.id)
99
100
  element
100
101
  rescue StandardError => e
@@ -108,6 +109,9 @@ module Labimotion
108
109
  properties = update_sample_association(params[:properties], current_user, element)
109
110
  params.delete(:container)
110
111
  params.delete(:properties)
112
+ update_element_labels(element, params[:user_labels], current_user.id)
113
+ params.delete(:user_labels)
114
+
111
115
  attributes = declared(params.except(:segments), include_missing: false)
112
116
  properties['pkg'] = Labimotion::Utils.pkg(properties['pkg'])
113
117
  if element.klass_uuid != properties['klass_uuid'] || element.properties != properties || element.name != params[:name]
@@ -288,6 +292,7 @@ module Labimotion
288
292
  scope = scope.elements_created_time_to(Time.at(to) + 1.day) if to && by_created_at
289
293
  scope = scope.elements_updated_time_from(Time.at(from)) if from && !by_created_at
290
294
  scope = scope.elements_updated_time_to(Time.at(to) + 1.day) if to && !by_created_at
295
+ scope = scope.by_user_label(params[:user_label]) if params[:user_label]
291
296
  scope
292
297
  rescue StandardError => e
293
298
  Labimotion.log_exception(e, current_user)
@@ -315,7 +320,7 @@ module Labimotion
315
320
  return { status: 'success', message: "The element: #{attributes['name']} has been created using version: #{attributes['version']}!" }
316
321
  end
317
322
  end
318
-
323
+
319
324
  rescue StandardError => e
320
325
  Labimotion.log_exception(e, current_user)
321
326
  return { status: 'error', message: e.message }
@@ -22,7 +22,7 @@ module Labimotion
22
22
  optional :sync_time, type: DateTime, desc: 'Klass sync_time'
23
23
  optional :version, type: String, desc: 'Klass version'
24
24
  end
25
-
25
+
26
26
  params :create_element_klass_params do
27
27
  requires :name, type: String, desc: 'Element Klass Name'
28
28
  requires :label, type: String, desc: 'Element Klass Label'
@@ -40,7 +40,7 @@ module Labimotion
40
40
  optional :desc, type: String, desc: 'Element Klass Desc'
41
41
  optional :place, type: String, desc: 'Element Klass Place'
42
42
  end
43
-
43
+
44
44
  ## Element Params
45
45
  params :create_element_params do
46
46
  requires :element_klass, type: Hash
@@ -49,18 +49,20 @@ module Labimotion
49
49
  optional :properties_release, type: Hash
50
50
  optional :collection_id, type: Integer
51
51
  requires :container, type: Hash
52
+ optional :user_labels, type: Array
52
53
  optional :segments, type: Array, desc: 'Segments'
53
54
  end
54
-
55
+
55
56
  params :update_element_params do
56
57
  requires :id, type: Integer, desc: 'element id'
57
58
  optional :name, type: String
58
59
  requires :properties, type: Hash
59
60
  optional :properties_release, type: Hash
60
61
  requires :container, type: Hash
62
+ optional :user_labels, type: Array
61
63
  optional :segments, type: Array, desc: 'Segments'
62
64
  end
63
-
65
+
64
66
  ## Segment Klass Params
65
67
  params :upload_segment_klass_params do
66
68
  requires :label, type: String, desc: 'Klass label'
@@ -2,5 +2,5 @@
2
2
 
3
3
  ## Labimotion Version
4
4
  module Labimotion
5
- VERSION = '1.3.2'
5
+ VERSION = '1.4.0.rc1'
6
6
  end
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.3.2
4
+ version: 1.4.0.rc1
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-05-15 00:00:00.000000000 Z
12
+ date: 2024-05-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -122,9 +122,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
122
122
  version: '0'
123
123
  required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  requirements:
125
- - - ">="
125
+ - - ">"
126
126
  - !ruby/object:Gem::Version
127
- version: '0'
127
+ version: 1.3.1
128
128
  requirements: []
129
129
  rubygems_version: 3.1.6
130
130
  signing_key: