thecore_dataentry_commons 2.1.3 → 3.0.1

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: 72d3846ee6b5e964c9fa544196f1f2c3edc3c697f28f81ecad5ffbcb268bab49
4
- data.tar.gz: f640dcbdfc40d8b3b41f83a3c60ec2a91a8734d1f1af98324197aaf17cce7822
3
+ metadata.gz: 9fd8a36a3d518668c5c6bd0fb3644a89cc23d4a99390ca7d7bfbb8816e312b57
4
+ data.tar.gz: dd8153fb6d322f312530fd0680e22a7eeab671f3566b30886023dac93fcc0417
5
5
  SHA512:
6
- metadata.gz: 3ef264ca99d2370203ae46c83ff272ead5297f168b59ffe91b1a64d7da3dc5eb0d895dd8f5dc9d36cdd191ec7493c116e010b97dff5265ca228005ee8953a22f
7
- data.tar.gz: 1e1e14596cb0f24258e8a0ca0632236e2b7ba7614b8ec2f8b363033797093690574387fb9dbfbe019d537b5e7994cae3ad7c885045f7149fcb10afcb4aadffce
6
+ metadata.gz: 470c25c72f726c99effad1af626bfe4d94be23f72214cbdb646af9aadf7612f2bccfde82d0fe56d94dbabbcded03553ea92b4d08dfa8af9a300aba0162b90b3f
7
+ data.tar.gz: 1b82305c464e98d6dd92dc9507d1dc039d4ec836560faa97bbbc38fffa9836cdde370ad1c4c2aa193b3bf605e479029b6aac674cd4bb22240d8a017e56f2c2f6
@@ -71,10 +71,6 @@
71
71
  if(!primary && !secondary)
72
72
  resetAll();
73
73
  }
74
-
75
- <%-unless (hide_action rescue true)%>
76
- dataAction.init();
77
- <%-end%>
78
74
  // END of overridable functions
79
75
 
80
76
  // Operation on barcode scan
@@ -88,14 +84,20 @@
88
84
  }).then(barcodeScannedSuccess).done(barcodeScannedThen).fail(barcodeScannedFailure);
89
85
  }
90
86
 
91
- <%-if (start_disabled rescue false)%>
92
- $('#send').off('click', sendFunction);
93
- <%-else%>
94
- $('#send').on('click', sendFunction);
95
- <%-end%>
87
+ document.addEventListener("turbo:load", function (event) {
88
+ console.log("Inside Barcode Simple Scan Debug");
89
+ <%-unless (hide_action rescue true)%>
90
+ dataAction.init();
91
+ <%-end%>
92
+ <%-if (start_disabled rescue false)%>
93
+ $('#send').off('click', sendFunction);
94
+ <%-else%>
95
+ $('#send').on('click', sendFunction);
96
+ <%-end%>
96
97
 
97
- // Starting with a clean interface
98
- resetInfo();
98
+ // Starting with a clean interface
99
+ resetInfo();
100
+ });
99
101
  </script>
100
102
 
101
103
  <%= render "dataentry_commons_input_group_logic", start_disabled: (start_disabled rescue false) %>
@@ -1,45 +1,15 @@
1
- <%-if @type == "ws" %>
2
- <style type="text/css">
3
- .input-group-addon.primary {
4
- color: rgb(255, 255, 255);
5
- background-color: rgb(50, 118, 177);
6
- border-color: rgb(40, 94, 142);
7
- }
8
- .input-group-addon.success {
9
- color: rgb(255, 255, 255);
10
- background-color: rgb(92, 184, 92);
11
- border-color: rgb(76, 174, 76);
12
- }
13
- .input-group-addon.info {
14
- color: rgb(255, 255, 255);
15
- background-color: rgb(57, 179, 215);
16
- border-color: rgb(38, 154, 188);
17
- }
18
- .input-group-addon.warning {
19
- color: rgb(255, 255, 255);
20
- background-color: rgb(240, 173, 78);
21
- border-color: rgb(238, 162, 54);
22
- }
23
- .input-group-addon.danger {
24
- color: rgb(255, 255, 255);
25
- background-color: rgb(217, 83, 79);
26
- border-color: rgb(212, 63, 58);
27
- }
28
- </style>
29
- <%-end%>
30
-
31
- <div class="row" id="barcode-container">
32
- <div class="col-lg-12">
33
- <div class="input-group input-group-lg">
1
+ <div class="card mb-3" id="barcode-container">
2
+ <div class="card-body">
3
+ <div class="input-group">
34
4
  <%-if @type == "ws" %>
35
- <span id="connection" class="input-group-addon danger">
5
+ <div id="connection" class="input-group-prepend bg-danger">
36
6
  <i class='fa fa-plug'></i>
37
- </span>
7
+ </div>
38
8
  <%-end%>
39
- <input type="text" name="barcode" class="form-control input-lg" id="barcode" placeholder="<%= I18n.t :manual_barcode %>"/>
40
- <span class="input-group-btn">
41
- <button id="send" type="button" class="btn btn-default btn-lg" data-loading-text="<i class='fa fa-spinner fa-spin '></i> <%=t :loading %>"><%= I18n.t :send %></button>
42
- </span>
9
+ <input type="text" name="barcode" class="form-control" id="barcode" placeholder="<%= I18n.t :manual_barcode %>"/>
10
+ <div class="input-group-append">
11
+ <button id="send" type="button" class="btn btn-outline-secondary" data-loading-text="<i class='fa fa-spinner fa-spin '></i> <%=t :loading %>"><%= I18n.t :send %></button>
12
+ </div>
43
13
  </div>
44
14
  </div>
45
15
  </div>
@@ -75,15 +75,18 @@
75
75
  // $("#send").focus();
76
76
  // Init
77
77
  // Disabling any previously defined keypress event
78
- $(window).off('keydown');
79
- $(document).off(kpMode);
80
- $("#barcode").off(kpMode);
81
- $("#barcode").focus();
82
- // Enabling keypress event only for this page
83
- <%-if (start_disabled rescue false)%>
84
- // disableKSCapture();
85
- <%-else%>
86
- $(window).on('keydown', manageScannedKeystrokes);
87
- // startKSCapture();
88
- <%-end%>
78
+ document.addEventListener("turbo:load", function (event) {
79
+ console.log("Inside KP Debug");
80
+ $(window).off('keydown');
81
+ $(document).off(kpMode);
82
+ $("#barcode").off(kpMode);
83
+ $("#barcode").focus();
84
+ // Enabling keypress event only for this page
85
+ <%-if (start_disabled rescue false)%>
86
+ // disableKSCapture();
87
+ <%-else%>
88
+ $(window).on('keydown', manageScannedKeystrokes);
89
+ // startKSCapture();
90
+ <%-end%>
91
+ });
89
92
  </script>
@@ -0,0 +1,51 @@
1
+ <div id="modal-interaction" class="modal fade" tabindex="-1" role="dialog">
2
+ <div class="modal-dialog" role="document">
3
+ <div class="modal-content">
4
+ <div class="modal-header">
5
+ <h4 class="modal-title" id="modal-interaction-label">&nbsp;</h4>
6
+ <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
7
+ </div>
8
+ <div class="modal-body" id="modal-interaction-body">
9
+ &nbsp;
10
+ </div>
11
+ <div class="modal-footer" id="modal-interaction-footer">
12
+ <button type="button" class="btn btn-default" data-bs-dismiss="modal" id="modal-interaction-secondary">&nbsp;</button>
13
+ <button type="button" class="btn btn-primary" id="modal-interaction-primary">&nbsp;</button>
14
+ </div>
15
+ </div>
16
+ <!-- /.modal-content -->
17
+ </div>
18
+ <!-- /.modal-dialog -->
19
+ </div>
20
+ <!-- /.modal -->
21
+
22
+ <script>
23
+ function openModal(title, message, buttonPrimary, buttonSecondary) {
24
+ $('#modal-interaction-label').html(title);
25
+ $('#modal-interaction-body').html(message);
26
+ if (buttonPrimary != null) {
27
+ $('#modal-interaction-primary').html(buttonPrimary.lbl);
28
+ $('#modal-interaction-primary').on('click', buttonPrimary.func);
29
+ $('#modal-interaction-primary').show();
30
+ }
31
+ if (buttonSecondary != null) {
32
+ $('#modal-interaction-secondary').html(buttonSecondary.lbl);
33
+ $('#modal-interaction-secondary').on('click', buttonSecondary.func);
34
+ $('#modal-interaction-secondary').show();
35
+ }
36
+ (buttonPrimary != null || buttonSecondary != null) ? $("#modal-interaction-footer").show() : $("#modal-interaction-footer").hide();
37
+ $('#modal-interaction').modal('show');
38
+ }
39
+ function closeModal() {
40
+ $('#modal-interaction').modal('hide');
41
+ $('#modal-interaction-label').html("&nbsp;");
42
+ $('#modal-interaction-body').html("&nbsp;");
43
+ $('#modal-interaction-primary').html("&nbsp;");
44
+ $('#modal-interaction-secondary').html("&nbsp;");
45
+ $('#modal-interaction-primary').hide();
46
+ $('#modal-interaction-secondary').hide();
47
+ $("#modal-interaction-footer").hide();
48
+ $('#modal-interaction-primary').off();
49
+ $('#modal-interaction-secondary').off();
50
+ }
51
+ </script>
@@ -41,11 +41,11 @@
41
41
  };
42
42
  // In production you would want this to be resiliant against the server being killed by Android, by the user navigating between pages or any other unexpected error related to connection.
43
43
  ws.onclose = function () {
44
- setSocketStatus("success", "danger");
44
+ setSocketStatus("bg-success", "bg-danger");
45
45
  socketClosed = true;
46
46
  };
47
47
  ws.onopen = function () {
48
- setSocketStatus("danger", "success");
48
+ setSocketStatus("bg-danger", "bg-success");
49
49
  socketClosed = false;
50
50
  };
51
51
  ws.onerror = function (event) {
@@ -81,10 +81,13 @@
81
81
  }
82
82
  }
83
83
 
84
- <%-if (start_disabled rescue false)%>
85
- // Do nothing, if start is disabled is true, don't print anything.
86
- // If it's not defined, it must default to starting websocket()
87
- <%-else%>
88
- startWS();
89
- <%-end%>
84
+ document.addEventListener("turbo:load", function (event) {
85
+ console.log("Inside WS Debug");
86
+ <%-if (start_disabled rescue false)%>
87
+ // Do nothing, if start is disabled is true, don't print anything.
88
+ // If it's not defined, it must default to starting websocket()
89
+ <%-else%>
90
+ startWS();
91
+ <%-end%>
92
+ });
90
93
  </script>
@@ -0,0 +1,5 @@
1
+ # This method defines the migrations paths for the engine and adds them to the migrations paths of
2
+ # the parent Rails app by using ActiveRecord::Migrator.migrations_paths.concat.
3
+ # migrations_paths = [File.expand_path("../../db/migrate", __dir__)]
4
+ # ActiveRecord::Migrator.migrations_paths.concat(migrations_paths)
5
+ Rails.application.config.paths['db/migrate'] << File.expand_path("../../db/migrate", __dir__)
@@ -1,24 +1,4 @@
1
1
  module ThecoreDataentryCommons
2
2
  class Engine < ::Rails::Engine
3
- # This code makes the static assets present in this
4
- # engine available to main app, even if this gem is
5
- # just a dependency of another engine
6
- # initializer 'thecore_dataentry_commons.load_static_assets' do |app|
7
- # # puts "Loading static assets for #{root}"
8
- # app.middleware.use ::ActionDispatch::Static, "#{root}/app"
9
- # end
10
- initializer 'thecore_dataentry_commons.add_to_migrations' do |app|
11
- # Adds the list of Thecore Engines, so to manage seeds loading, i.e.:
12
- # Thecore::Base.thecore_engines.each { |engine| engine.load_seed }
13
- Thecore::Base.thecore_engines << self.class
14
- unless app.root.to_s.match root.to_s
15
- # APPEND TO MAIN APP MIGRATIONS FROM THIS GEM
16
- config.paths['db/migrate'].expanded.each do |expanded_path|
17
- app.config.paths['db/migrate'] << expanded_path
18
- end
19
- # = app.config.paths['db/migrate'].uniq
20
- # puts app.config.paths['db/migrate'].map(:path).inspect
21
- end
22
- end
23
3
  end
24
4
  end
@@ -1,3 +1,4 @@
1
1
  module ThecoreDataentryCommons
2
- VERSION = "#{`git describe --tags $(git rev-list --tags --max-count=1)`.chomp}"
2
+ VERSION = "3.0.1".freeze
3
+ # "#{`git describe --tags $(git rev-list --tags --max-count=1)`.chomp}"
3
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thecore_dataentry_commons
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.3
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-23 00:00:00.000000000 Z
11
+ date: 2023-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thecore_ui_rails_admin
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.7'
19
+ version: '3.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.7'
26
+ version: '3.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: browser
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -54,8 +54,10 @@ files:
54
54
  - app/views/rails_admin/main/_dataentry_commons_input_group.html.erb
55
55
  - app/views/rails_admin/main/_dataentry_commons_input_group_logic.html.erb
56
56
  - app/views/rails_admin/main/_kp.html.erb
57
+ - app/views/rails_admin/main/_modal_interaction.html.erb
57
58
  - app/views/rails_admin/main/_ws.html.erb
58
59
  - app/views/thecore_utils/_html_helpers.html.erb
60
+ - config/initializers/add_to_db_migrations.rb
59
61
  - config/locales/en.thecore_datawedge_websocket_helpers.yml
60
62
  - config/locales/it.thecore_datawedge_websocket_helpers.yml
61
63
  - db/seeds.rb
@@ -81,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
83
  - !ruby/object:Gem::Version
82
84
  version: '0'
83
85
  requirements: []
84
- rubygems_version: 3.0.3.1
86
+ rubygems_version: 3.4.10
85
87
  signing_key:
86
88
  specification_version: 4
87
89
  summary: Some javascripts and partials to handle DW WS.