web47core 1.0.0 → 1.0.5

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: 70bf5b32aa6d77005704da9da81ad262c3ae29c616f0fe1534f3aab345787788
4
- data.tar.gz: 23d93a745ac6455c5839e31dea6c8fdf7b309b20a5788d6d5cd9481796b44b58
3
+ metadata.gz: 5a04d24fd691cb32029738a49005457f80c38043f6ffc8718ce6be6f369fdbc7
4
+ data.tar.gz: 113ee737740d6c85fec57c8c799d01804ea8dd689ea5837933469c2abc2236fc
5
5
  SHA512:
6
- metadata.gz: 69e34643867f8a073e28f031aeda323d6f6bcd61f93d38b8748b38f61f82109772ffbc0df984cd4e2fd6e7e1eff228addba62714ba6f96f314d42dc6dd1c4580
7
- data.tar.gz: 61b2c9ec0213d473be51951b8d5a999ad584d153a92a7dd869a37bc61a679352e8c810f33375d10bbdd2c9058b48a037e1cfcedad684aec08d7feab3adf152a6
6
+ metadata.gz: e69873bd07d0b85fab0ddea56caf9198ccedd97d09365d683be0ddb5dd98f371b7c2466e71356bfaf8a654254a33fba847d66c5060860b1726b08458cdd160f9
7
+ data.tar.gz: e4885a8a85209f77f13d0f103fd9e8f1d61742e3cb7fbf0b3101d6c671afda4eaf0ca5f7ae358e3c7573fd65753015a1fb9744767d8ee5ceff9ecb9449cd7ee7
@@ -0,0 +1,34 @@
1
+ #
2
+ # Enable copy capability to the machines copy/paste buffer
3
+ #
4
+ $(document).ready ->
5
+ if clipboardEnabled()
6
+ $('a.copy').on 'click', (e) ->
7
+ node = e.target
8
+ textField = document.createElement('textarea')
9
+ node.parentNode.insertBefore(textField, node)
10
+ try
11
+ textField.innerText = $(this).data('clipboard-text')
12
+ textField.select()
13
+ textField.focus()
14
+ if document.execCommand('copy')
15
+ M.toast({html: 'Copied!'}, 3000);
16
+ else
17
+ M.toast({html: 'Unable to copy text'}, 3000);
18
+ catch error
19
+ M.toast({html: 'Unable to copy text'}, 3000);
20
+ finally
21
+ textField.parentNode.removeChild(textField)
22
+
23
+ else
24
+ $('.copy').hide()
25
+
26
+ #
27
+ # Test that we can issue the execCommand for copy and that it returns
28
+ #
29
+ clipboardEnabled = ->
30
+ try
31
+ document.execCommand('copy')
32
+ true
33
+ catch error
34
+ false
@@ -0,0 +1,13 @@
1
+ .clipboard {
2
+ margin: 0 0 0 2px;
3
+ padding: 0;
4
+ span {
5
+ font-size: 1rem;
6
+ }
7
+ a.copy {
8
+ i.material-icons {
9
+ i.material-icons;
10
+ font-size: 1rem;
11
+ }
12
+ }
13
+ }
@@ -17,7 +17,7 @@ module CoreLinkHelper
17
17
  # Setup the text as copy text
18
18
  #
19
19
  def copy_tag(copy_text, options = {})
20
- content_tag(:p, class: 'stack-tight') do
20
+ content_tag(:div, class: 'clipboard') do
21
21
  concat(content_tag(:span) { copy_text })
22
22
  concat(copy_text_tag(copy_text, options))
23
23
  concat(download_tag(options[:download_url], options)) if options[:download_url].present?
@@ -38,7 +38,7 @@ module Cron
38
38
  def job_names
39
39
  @job_names ||= all_jobs.collect do |job|
40
40
  job_name = job.to_s
41
- next if FRAMEWORK_CLASSES.include?(job_name) || job_name.end_with?('Test') || job_name.start_with?('Base')
41
+ next if FRAMEWORK_CLASSES.include?(job_name) || job_name.end_with?('_test') || job_name.start_with?('base_')
42
42
 
43
43
  job_name.underscore
44
44
  end.compact
@@ -10,8 +10,21 @@ module SecureFields
10
10
  # Remove updates for secure fields
11
11
  #
12
12
  def update(params)
13
- secure_fields.each { |field| params.delete(field) if params[field].blank? }
14
- super(params)
13
+ super(filter_secure_fields(params))
14
+ end
15
+
16
+ #
17
+ # Remove updates for secure fields
18
+ #
19
+ def update!(params)
20
+ super(filter_secure_fields(params))
21
+ end
22
+
23
+ #
24
+ # Remove updates for secure fields
25
+ #
26
+ def assign_attributes(params)
27
+ super(filter_secure_fields(params))
15
28
  end
16
29
 
17
30
  #
@@ -20,4 +33,9 @@ module SecureFields
20
33
  def secure_fields
21
34
  []
22
35
  end
36
+
37
+ def filter_secure_fields(params)
38
+ secure_fields.each { |field| params.delete(field) if params[field].blank? }
39
+ params
40
+ end
23
41
  end
@@ -9,6 +9,7 @@ require 'app/models/concerns/standard_model'
9
9
  require 'app/models/concerns/switchboard_able'
10
10
  require 'app/models/concerns/core_system_configuration'
11
11
  require 'app/models/concerns/core_account'
12
+ require 'app/models/concerns/secure_fields'
12
13
  require 'app/models/delayed_job'
13
14
  require 'app/models/redis_configuration'
14
15
  require 'app/models/notification'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Web47core
4
- VERSION = '1.0.0'
4
+ VERSION = '1.0.5'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: web47core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Schroeder
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-17 00:00:00.000000000 Z
11
+ date: 2020-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -570,7 +570,9 @@ files:
570
570
  - LICENSE
571
571
  - README.md
572
572
  - app/assets/images/1x1.png
573
+ - app/assets/javascript/clipboard.coffee
573
574
  - app/assets/javascript/flash.coffee
575
+ - app/assets/stylesheets/clipboard.scss
574
576
  - app/controllers/exceptions_controller.rb
575
577
  - app/controllers/notifications_controller.rb
576
578
  - app/controllers/status_controller.rb
@@ -636,7 +638,7 @@ files:
636
638
  - lib/app/models/concerns/email_able.rb
637
639
  - lib/app/models/concerns/role_able.rb
638
640
  - lib/app/models/concerns/search_able.rb
639
- - lib/app/models/concerns/seucre_fields.rb
641
+ - lib/app/models/concerns/secure_fields.rb
640
642
  - lib/app/models/concerns/standard_model.rb
641
643
  - lib/app/models/concerns/switchboard_able.rb
642
644
  - lib/app/models/concerns/time_zone_able.rb