lato 0.1.10 → 0.1.12

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: 7ab1d90b203dab6864e4120b6b3dd3ff44bb42c5b42b54fba70e55f982bb260b
4
- data.tar.gz: 676844d4597c20a7cb64cbaba297ccb55c4c0421b85da981e0fa94919ac2525b
3
+ metadata.gz: b6df34962fde3948882b59ebc28b78f00a17296dc3d7a36ce5e38781406e7e82
4
+ data.tar.gz: 45f9c91d120c0ebc5c969b65955829edc06ed853bfd64dacfa4ca9b3e1ba964a
5
5
  SHA512:
6
- metadata.gz: 5b97a95b0b51722a8416083779d2fa6ee3f87445c36c366fb0ab25659d7d84c65db470c939884ea75755bcbe8cd26669d86919128908d507f24a1e7ed5f59800
7
- data.tar.gz: 90bedf8377b7d4ba09de99d9fd8653239efdf3d53e0b633c9cba3c0680df7b6d22356addbdcbe7845cebac81e8cf75506b97f76d3dfd00af5784a76b424b5cdb
6
+ metadata.gz: 92e26550cd33e53e7ab46e862a0397c77a0c8d91b0bedd9da10fc320b62b5bd6e5a4732a424495f6ef23b27c542ace1669a04c6ec64737a5d36764046d808c72
7
+ data.tar.gz: 033c58b1ca6a62c10290d66447ab43cce72101d6d1abbbc021faee33f98c899dbba0844feec2684a6fd29cd68647bacded8d204e94428b37e8e17e37dbc39e6f
@@ -3,6 +3,7 @@ import { Controller } from "@hotwired/stimulus"
3
3
  export default class extends Controller {
4
4
  static targets = [
5
5
  'trigger',
6
+ 'triggerSubmit',
6
7
  'modal',
7
8
  'modalBody',
8
9
  'modalTitle',
@@ -68,6 +69,10 @@ export default class extends Controller {
68
69
  element.addEventListener('click', (e) => this.openAction(this.loadOptionsFromTriggerElement(element)))
69
70
  }
70
71
 
72
+ triggerSubmitTargetConnected(element) {
73
+ element.addEventListener('submit', (e) => this.openAction(this.loadOptionsFromTriggerElement(element)))
74
+ }
75
+
71
76
  /**
72
77
  * Functions
73
78
  */
@@ -114,7 +119,7 @@ export default class extends Controller {
114
119
  * Actions
115
120
  */
116
121
 
117
- onTriggerClick(e) {
122
+ onTriggerRun(e) {
118
123
  this.openAction(this.loadOptionsFromTriggerElement(e.currentTarget))
119
124
  }
120
125
  }
@@ -75,7 +75,7 @@ module Lato
75
75
  # setup classes
76
76
  options[:class] ||= []
77
77
  options[:class].push(classes)
78
- options[:class].push('is-invalid') if form.object&.errors[key]&.any?
78
+ options[:class].push('is-invalid') if form.object && form.object.errors[key] && form.object.errors[key].any?
79
79
 
80
80
  # setup stimulus
81
81
  options[:data] ||= {}
@@ -9,6 +9,10 @@ module Lato
9
9
  !!@operation
10
10
  end
11
11
 
12
+ def operation_input_file_attachment
13
+ @operation.input_file.attached? ? @operation.input_file : nil
14
+ end
15
+
12
16
  def update_operation_percentage(percentage)
13
17
  return false unless operation?
14
18
 
@@ -85,12 +85,15 @@ module Lato
85
85
  # Class
86
86
  ##
87
87
 
88
- def self.generate(active_job_name, active_job_input = {}, user_id = nil)
89
- Operation.create(
88
+ def self.generate(active_job_name, active_job_input = {}, user_id = nil, file = nil)
89
+ operation_params = {
90
90
  active_job_name: active_job_name,
91
91
  active_job_input: active_job_input,
92
92
  lato_user_id: user_id
93
- )
93
+ }
94
+ operation_params[:input_file] = file unless file.nil?
95
+
96
+ Operation.create(operation_params)
94
97
  end
95
98
  end
96
99
  end
data/lib/lato/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lato
2
- VERSION = "0.1.10"
2
+ VERSION = "0.1.12"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lato
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregorio Galante
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-01 00:00:00.000000000 Z
11
+ date: 2022-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails