web47core 0.9.9 → 1.0.4

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: 6478bbaee535d0c5da28a2789ffa8b8ebe1e6615ab49c7c6e4160ac30c06c3d1
4
- data.tar.gz: 4f3a3d1bc035802f6d86f8b8a0b878ca53c1d100a523bb858c300f01b4dc4995
3
+ metadata.gz: 19ad57cb88f8e3915846ba74bfb5151c5ebc66be678b731e5b94dfc15e295b91
4
+ data.tar.gz: f01456dc0a54891dc091745a4a338e955f35b139d11a891ca553db36696ff897
5
5
  SHA512:
6
- metadata.gz: 60bef8e8f95ee1b37eadf532b8a8cc164e97aaea38656999940009b30f1336e5a59c79781c53f6fe4cb3932bcfd58870d06e69cda8615801f0a1ef50ebf9c9bb
7
- data.tar.gz: ae89618fb65cbabf97910e4b73c3064c9cc23d9411fd00c9f3348c6a125209b27bb860a058748a4c4073b18b32c610bc3b0393c5617eb411e0c6130e83dbe8aa
6
+ metadata.gz: 5898e05f8e14c6193dd0d67fe4708a73963080b35845a21523619fe91124b154168e768a6fed1fd4075dbc27dbb4a2a27553289d26aba359d3e975dc7cd6dda9
7
+ data.tar.gz: 2f3fb0df2af5f3c372b640b0074ed54f510ff4cc54638bb2bb07b440b752c3e1dc1324bbd569126ffb2edc0cdddd54adaabb12d8e12f2356fb22a879422bc073
data/README.md CHANGED
@@ -88,6 +88,7 @@ _Please do not ship to production code using the git repo, as the production ser
88
88
  17. `CronJobServer` and `CronJobServerTest`
89
89
  18. `JobCronTab` and `JobCronTabTest`
90
90
  19. `CronTab`
91
+ 20. `SecureFields`
91
92
 
92
93
  #### Models
93
94
  ##### Concerns
@@ -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
+ p.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(:p, 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
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ #
4
+ # A mixin for models with secure fields.
5
+ # Basically if the secure field is blank, nil or "", then delete it from the update.
6
+ #
7
+ module SecureFields
8
+ extend ActiveSupport::Concern
9
+ #
10
+ # Remove updates for secure fields
11
+ #
12
+ def update(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))
28
+ end
29
+
30
+ #
31
+ # List of secure fields
32
+ #
33
+ def secure_fields
34
+ []
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
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 = '0.9.9'
4
+ VERSION = '1.0.4'
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: 0.9.9
4
+ version: 1.0.4
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-03 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,6 +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
641
+ - lib/app/models/concerns/secure_fields.rb
639
642
  - lib/app/models/concerns/standard_model.rb
640
643
  - lib/app/models/concerns/switchboard_able.rb
641
644
  - lib/app/models/concerns/time_zone_able.rb