kono_utils 0.15.15 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +5 -5
  2. data/README.rdoc +17 -78
  3. data/app/assets/javascripts/kono_utils/core.coffee +477 -0
  4. data/app/assets/stylesheets/kono_utils/{_kono_styles.css.scss → core.css.scss} +1 -16
  5. data/app/policies/kono_utils/base_editing_policy_concern.rb +52 -3
  6. data/app/policies/kono_utils/base_search_form_policy_concern.rb +25 -0
  7. data/config/initializers/mysql.rb +2 -2
  8. data/config/locales/it.yml +3 -1
  9. data/lib/generators/kono_utils/install/install_generator.rb +44 -0
  10. data/lib/generators/templates/base_editing_controller.template +3 -0
  11. data/lib/generators/templates/base_editing_helper.template +3 -0
  12. data/lib/generators/templates/base_editing_policy.template +4 -0
  13. data/lib/generators/templates/initializer.rb +3 -1
  14. data/lib/kono_utils.rb +29 -18
  15. data/lib/kono_utils/application_core_helper.rb +524 -0
  16. data/lib/kono_utils/application_enum_helper.rb +53 -0
  17. data/lib/kono_utils/application_helper.rb +4 -578
  18. data/lib/kono_utils/base_editing_core_helper.rb +194 -0
  19. data/lib/kono_utils/base_editing_helper.rb +3 -186
  20. data/lib/kono_utils/base_search.rb +32 -19
  21. data/lib/kono_utils/concerns.rb +12 -10
  22. data/lib/kono_utils/concerns/active_record_translation.rb +8 -4
  23. data/lib/kono_utils/concerns/active_storage_remover_helper.rb +61 -0
  24. data/lib/kono_utils/concerns/base_editing.rb +199 -53
  25. data/lib/kono_utils/configuration.rb +18 -0
  26. data/lib/kono_utils/engine.rb +15 -6
  27. data/lib/kono_utils/paginate_proxer.rb +17 -0
  28. data/lib/kono_utils/search_form_builder.rb +24 -0
  29. data/lib/kono_utils/version.rb +1 -1
  30. data/spec/dummy/.gitignore +2 -0
  31. data/spec/dummy/app/assets/config/manifest.js +2 -0
  32. data/spec/dummy/app/assets/javascripts/application.js +2 -0
  33. data/spec/dummy/app/controllers/application_controller.rb +10 -0
  34. data/spec/dummy/app/controllers/base_editing_controller.rb +3 -0
  35. data/spec/dummy/app/controllers/users_controller.rb +2 -0
  36. data/spec/dummy/app/helpers/application_helper.rb +1 -0
  37. data/spec/dummy/app/helpers/base_editing_helper.rb +3 -0
  38. data/spec/dummy/app/models/application_record.rb +5 -0
  39. data/spec/dummy/app/models/user.rb +2 -0
  40. data/spec/dummy/app/policies/application_policy.rb +49 -0
  41. data/spec/dummy/app/policies/base_editing_policy.rb +4 -0
  42. data/spec/dummy/app/policies/user_policy.rb +23 -0
  43. data/spec/dummy/bin/rails +1 -1
  44. data/spec/dummy/bin/setup +20 -13
  45. data/spec/dummy/bin/update +31 -0
  46. data/spec/dummy/bin/yarn +11 -0
  47. data/spec/dummy/config/application.rb +15 -17
  48. data/spec/dummy/config/environment.rb +1 -1
  49. data/spec/dummy/config/environments/development.rb +31 -11
  50. data/spec/dummy/config/environments/production.rb +26 -16
  51. data/spec/dummy/config/environments/test.rb +10 -6
  52. data/spec/dummy/config/initializers/application_controller_renderer.rb +8 -0
  53. data/spec/dummy/config/initializers/assets.rb +6 -3
  54. data/spec/dummy/config/initializers/content_security_policy.rb +25 -0
  55. data/spec/dummy/config/initializers/cookies_serializer.rb +2 -0
  56. data/spec/dummy/config/initializers/kono_utils.rb +5 -0
  57. data/spec/dummy/config/initializers/new_framework_defaults_5_2.rb +38 -0
  58. data/spec/dummy/config/initializers/wrap_parameters.rb +2 -2
  59. data/spec/dummy/config/locales/en.yml +10 -0
  60. data/spec/dummy/config/routes.rb +3 -52
  61. data/spec/dummy/config/storage.yml +34 -0
  62. data/spec/dummy/db/migrate/20190716093114_create_users.rb +11 -0
  63. data/spec/dummy/db/schema.rb +23 -0
  64. data/spec/dummy/package.json +5 -0
  65. data/spec/dummy/spec/models/user_spec.rb +5 -0
  66. data/spec/dummy/yarn.lock +21 -0
  67. metadata +83 -144
  68. data/app/assets/javascripts/kono_utils/utilities.coffee +0 -481
  69. data/app/assets/stylesheets/kono_utils/utils.css.scss +0 -4
  70. data/app/input/bs_aceeditor_input.rb +0 -53
  71. data/app/input/bs_autocomplete_input.rb +0 -60
  72. data/app/input/bs_datepicker_input.rb +0 -16
  73. data/app/input/bs_datetimepicker_input.rb +0 -80
  74. data/app/input/bs_file_download_input.rb +0 -35
  75. data/app/input/bs_image_input.rb +0 -35
  76. data/app/input/bs_label_with_container_input.rb +0 -22
  77. data/app/input/bs_location_picker_input.rb +0 -95
  78. data/app/input/bs_readonly_input.rb +0 -52
  79. data/app/input/bs_timepicker_input.rb +0 -14
  80. data/app/views/kono_utils/application/_search_panel.html.erb +0 -36
  81. data/app/views/kono_utils/base_editing/_edit.html.erb +0 -3
  82. data/app/views/kono_utils/base_editing/_edit_page_side_title_header.html.erb +0 -3
  83. data/app/views/kono_utils/base_editing/_edit_page_title_header.html.erb +0 -3
  84. data/app/views/kono_utils/base_editing/_form.html.erb +0 -15
  85. data/app/views/kono_utils/base_editing/_index_buttons.html.erb +0 -2
  86. data/app/views/kono_utils/base_editing/_index_page_side_title_header.html.erb +0 -3
  87. data/app/views/kono_utils/base_editing/_index_page_title_header.html.erb +0 -3
  88. data/app/views/kono_utils/base_editing/_index_tfoot.html.erb +0 -0
  89. data/app/views/kono_utils/base_editing/_new.html.erb +0 -3
  90. data/app/views/kono_utils/base_editing/_new_page_side_title_header.html.erb +0 -3
  91. data/app/views/kono_utils/base_editing/_new_page_title_header.html.erb +0 -3
  92. data/app/views/kono_utils/base_editing/_search_form.html.erb +0 -1
  93. data/app/views/kono_utils/base_editing/application/_edit_page_side_title_header.html.erb +0 -1
  94. data/app/views/kono_utils/base_editing/application/_edit_page_title_header.html.erb +0 -1
  95. data/app/views/kono_utils/base_editing/application/_index_page_side_title_header.html.erb +0 -1
  96. data/app/views/kono_utils/base_editing/application/_index_page_title_header.html.erb +0 -1
  97. data/app/views/kono_utils/base_editing/application/_new_page_side_title_header.html.erb +0 -1
  98. data/app/views/kono_utils/base_editing/application/_new_page_title_header.html.erb +0 -1
  99. data/app/views/kono_utils/base_editing/application/edit.html.erb +0 -1
  100. data/app/views/kono_utils/base_editing/application/new.html.erb +0 -1
  101. data/app/views/kono_utils/base_editing/edit.html.erb +0 -1
  102. data/app/views/kono_utils/base_editing/index.html.erb +0 -36
  103. data/app/views/kono_utils/base_editing/new.html.erb +0 -1
  104. data/lib/kono_utils/encoder.rb +0 -47
  105. data/lib/kono_utils/fiscal_code.rb +0 -47
  106. data/lib/kono_utils/params_hash_array.rb +0 -37
  107. data/lib/kono_utils/percentage.rb +0 -60
  108. data/lib/kono_utils/tmp_file.rb +0 -81
  109. data/lib/kono_utils/virtual_model.rb +0 -22
  110. data/lib/tasks/kono_utils_tasks.rake +0 -4
  111. data/spec/lib/kono_utils/fiscal_code_spec.rb +0 -56
  112. data/vendor/assets/javascripts/EventEmitter.js +0 -473
@@ -14,15 +14,13 @@ Rails.application.configure do
14
14
  config.consider_all_requests_local = false
15
15
  config.action_controller.perform_caching = true
16
16
 
17
- # Enable Rack::Cache to put a simple HTTP cache in front of your application
18
- # Add `rack-cache` to your Gemfile before enabling this.
19
- # For large-scale production use, consider using a caching reverse proxy like
20
- # NGINX, varnish or squid.
21
- # config.action_dispatch.rack_cache = true
17
+ # Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
18
+ # or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
19
+ # config.require_master_key = true
22
20
 
23
21
  # Disable serving static files from the `/public` folder by default since
24
22
  # Apache or NGINX already handles this.
25
- config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
23
+ config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
26
24
 
27
25
  # Compress JavaScripts and CSS.
28
26
  config.assets.js_compressor = :uglifier
@@ -31,16 +29,18 @@ Rails.application.configure do
31
29
  # Do not fallback to assets pipeline if a precompiled asset is missed.
32
30
  config.assets.compile = false
33
31
 
34
- # Asset digests allow you to set far-future HTTP expiration dates on all assets,
35
- # yet still be able to expire them through the digest params.
36
- config.assets.digest = true
37
-
38
32
  # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
39
33
 
34
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
35
+ # config.action_controller.asset_host = 'http://assets.example.com'
36
+
40
37
  # Specifies the header that your server uses for sending files.
41
38
  # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
42
39
  # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
43
40
 
41
+ # Store uploaded files on the local file system (see config/storage.yml for options)
42
+ config.active_storage.service = :local
43
+
44
44
  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
45
45
  # config.force_ssl = true
46
46
 
@@ -49,16 +49,16 @@ Rails.application.configure do
49
49
  config.log_level = :debug
50
50
 
51
51
  # Prepend all log lines with the following tags.
52
- # config.log_tags = [ :subdomain, :uuid ]
53
-
54
- # Use a different logger for distributed setups.
55
- # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
52
+ config.log_tags = [ :request_id ]
56
53
 
57
54
  # Use a different cache store in production.
58
55
  # config.cache_store = :mem_cache_store
59
56
 
60
- # Enable serving of images, stylesheets, and JavaScripts from an asset server.
61
- # config.action_controller.asset_host = 'http://assets.example.com'
57
+ # Use a real queuing backend for Active Job (and separate queues per environment)
58
+ # config.active_job.queue_adapter = :resque
59
+ # config.active_job.queue_name_prefix = "dummy_#{Rails.env}"
60
+
61
+ config.action_mailer.perform_caching = false
62
62
 
63
63
  # Ignore bad email addresses and do not raise email delivery errors.
64
64
  # Set this to true and configure the email server for immediate delivery to raise delivery errors.
@@ -74,6 +74,16 @@ Rails.application.configure do
74
74
  # Use default logging formatter so that PID and timestamp are not suppressed.
75
75
  config.log_formatter = ::Logger::Formatter.new
76
76
 
77
+ # Use a different logger for distributed setups.
78
+ # require 'syslog/logger'
79
+ # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
80
+
81
+ if ENV["RAILS_LOG_TO_STDOUT"].present?
82
+ logger = ActiveSupport::Logger.new(STDOUT)
83
+ logger.formatter = config.log_formatter
84
+ config.logger = ActiveSupport::TaggedLogging.new(logger)
85
+ end
86
+
77
87
  # Do not dump schema after migrations.
78
88
  config.active_record.dump_schema_after_migration = false
79
89
  end
@@ -12,9 +12,11 @@ Rails.application.configure do
12
12
  # preloads Rails for running tests, you may have to set it to true.
13
13
  config.eager_load = false
14
14
 
15
- # Configure static file server for tests with Cache-Control for performance.
16
- config.serve_static_files = true
17
- config.static_cache_control = 'public, max-age=3600'
15
+ # Configure public file server for tests with Cache-Control for performance.
16
+ config.public_file_server.enabled = true
17
+ config.public_file_server.headers = {
18
+ 'Cache-Control' => "public, max-age=#{1.hour.to_i}"
19
+ }
18
20
 
19
21
  # Show full error reports and disable caching.
20
22
  config.consider_all_requests_local = true
@@ -26,14 +28,16 @@ Rails.application.configure do
26
28
  # Disable request forgery protection in test environment.
27
29
  config.action_controller.allow_forgery_protection = false
28
30
 
31
+ # Store uploaded files on the local file system in a temporary directory
32
+ config.active_storage.service = :test
33
+
34
+ config.action_mailer.perform_caching = false
35
+
29
36
  # Tell Action Mailer not to deliver emails to the real world.
30
37
  # The :test delivery method accumulates sent emails in the
31
38
  # ActionMailer::Base.deliveries array.
32
39
  config.action_mailer.delivery_method = :test
33
40
 
34
- # Randomize the order test cases are executed.
35
- config.active_support.test_order = :random
36
-
37
41
  # Print deprecation notices to the stderr.
38
42
  config.active_support.deprecation = :stderr
39
43
 
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # ActiveSupport::Reloader.to_prepare do
4
+ # ApplicationController.renderer.defaults.merge!(
5
+ # http_host: 'example.org',
6
+ # https: false
7
+ # )
8
+ # end
@@ -3,9 +3,12 @@
3
3
  # Version of your assets, change this if you want to expire all your assets.
4
4
  Rails.application.config.assets.version = '1.0'
5
5
 
6
- # Add additional assets to the asset load path
6
+ # Add additional assets to the asset load path.
7
7
  # Rails.application.config.assets.paths << Emoji.images_path
8
+ # Add Yarn node_modules folder to the asset load path.
9
+ Rails.application.config.assets.paths << Rails.root.join('node_modules')
8
10
 
9
11
  # Precompile additional assets.
10
- # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
11
- # Rails.application.config.assets.precompile += %w( search.js )
12
+ # application.js, application.css, and all non-JS/CSS in the app/assets
13
+ # folder are already added.
14
+ # Rails.application.config.assets.precompile += %w( admin.js admin.css )
@@ -0,0 +1,25 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Define an application-wide content security policy
4
+ # For further information see the following documentation
5
+ # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
6
+
7
+ # Rails.application.config.content_security_policy do |policy|
8
+ # policy.default_src :self, :https
9
+ # policy.font_src :self, :https, :data
10
+ # policy.img_src :self, :https, :data
11
+ # policy.object_src :none
12
+ # policy.script_src :self, :https
13
+ # policy.style_src :self, :https
14
+
15
+ # # Specify URI for violation reports
16
+ # # policy.report_uri "/csp-violation-report-endpoint"
17
+ # end
18
+
19
+ # If you are using UJS then enable automatic nonce generation
20
+ # Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) }
21
+
22
+ # Report CSP violations to a specified URI
23
+ # For further information see the following documentation:
24
+ # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only
25
+ # Rails.application.config.content_security_policy_report_only = true
@@ -1,3 +1,5 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
+ # Specify a serializer for the signed and encrypted cookie jars.
4
+ # Valid options are :json, :marshal, and :hybrid.
3
5
  Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -0,0 +1,5 @@
1
+ KonoUtils.configure do |config|
2
+ #config.google_api_key = '' #chiave API
3
+ end
4
+
5
+ Rails.application.config.action_controller.include_all_helpers=false
@@ -0,0 +1,38 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains migration options to ease your Rails 5.2 upgrade.
4
+ #
5
+ # Once upgraded flip defaults one by one to migrate to the new default.
6
+ #
7
+ # Read the Guide for Upgrading Ruby on Rails for more info on each option.
8
+
9
+ # Make Active Record use stable #cache_key alongside new #cache_version method.
10
+ # This is needed for recyclable cache keys.
11
+ # Rails.application.config.active_record.cache_versioning = true
12
+
13
+ # Use AES-256-GCM authenticated encryption for encrypted cookies.
14
+ # Also, embed cookie expiry in signed or encrypted cookies for increased security.
15
+ #
16
+ # This option is not backwards compatible with earlier Rails versions.
17
+ # It's best enabled when your entire app is migrated and stable on 5.2.
18
+ #
19
+ # Existing cookies will be converted on read then written with the new scheme.
20
+ # Rails.application.config.action_dispatch.use_authenticated_cookie_encryption = true
21
+
22
+ # Use AES-256-GCM authenticated encryption as default cipher for encrypting messages
23
+ # instead of AES-256-CBC, when use_authenticated_message_encryption is set to true.
24
+ # Rails.application.config.active_support.use_authenticated_message_encryption = true
25
+
26
+ # Add default protection from forgery to ActionController::Base instead of in
27
+ # ApplicationController.
28
+ # Rails.application.config.action_controller.default_protect_from_forgery = true
29
+
30
+ # Store boolean values are in sqlite3 databases as 1 and 0 instead of 't' and
31
+ # 'f' after migrating old data.
32
+ # Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true
33
+
34
+ # Use SHA-1 instead of MD5 to generate non-sensitive digests, such as the ETag header.
35
+ # Rails.application.config.active_support.use_sha1_digests = true
36
+
37
+ # Make `form_with` generate id attributes for any generated HTML tags.
38
+ # Rails.application.config.action_view.form_with_generates_ids = true
@@ -5,10 +5,10 @@
5
5
 
6
6
  # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
7
  ActiveSupport.on_load(:action_controller) do
8
- wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
8
+ wrap_parameters format: [:json]
9
9
  end
10
10
 
11
11
  # To enable root element in JSON for ActiveRecord objects.
12
12
  # ActiveSupport.on_load(:active_record) do
13
- # self.include_root_in_json = true
13
+ # self.include_root_in_json = true
14
14
  # end
@@ -16,6 +16,16 @@
16
16
  #
17
17
  # This would use the information in config/locales/es.yml.
18
18
  #
19
+ # The following keys must be escaped otherwise they will not be retrieved by
20
+ # the default I18n backend:
21
+ #
22
+ # true, false, on, off, yes, no
23
+ #
24
+ # Instead, surround them with single quotes.
25
+ #
26
+ # en:
27
+ # 'true': 'foo'
28
+ #
19
29
  # To learn more, please read the Rails Internationalization guide
20
30
  # available at http://guides.rubyonrails.org/i18n.html.
21
31
 
@@ -1,56 +1,7 @@
1
1
  Rails.application.routes.draw do
2
- # The priority is based upon order of creation: first created -> highest priority.
3
- # See how all your routes lay out with "rake routes".
2
+ # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
4
3
 
5
- # You can have the root of your site routed with "root"
6
- # root 'welcome#index'
4
+ resources :users
7
5
 
8
- # Example of regular route:
9
- # get 'products/:id' => 'catalog#view'
10
-
11
- # Example of named route that can be invoked with purchase_url(id: product.id)
12
- # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
13
-
14
- # Example resource route (maps HTTP verbs to controller actions automatically):
15
- # resources :products
16
-
17
- # Example resource route with options:
18
- # resources :products do
19
- # member do
20
- # get 'short'
21
- # post 'toggle'
22
- # end
23
- #
24
- # collection do
25
- # get 'sold'
26
- # end
27
- # end
28
-
29
- # Example resource route with sub-resources:
30
- # resources :products do
31
- # resources :comments, :sales
32
- # resource :seller
33
- # end
34
-
35
- # Example resource route with more complex sub-resources:
36
- # resources :products do
37
- # resources :comments
38
- # resources :sales do
39
- # get 'recent', on: :collection
40
- # end
41
- # end
42
-
43
- # Example resource route with concerns:
44
- # concern :toggleable do
45
- # post 'toggle'
46
- # end
47
- # resources :posts, concerns: :toggleable
48
- # resources :photos, concerns: :toggleable
49
-
50
- # Example resource route within a namespace:
51
- # namespace :admin do
52
- # # Directs /admin/products/* to Admin::ProductsController
53
- # # (app/controllers/admin/products_controller.rb)
54
- # resources :products
55
- # end
6
+ root to: "users#index"
56
7
  end
@@ -0,0 +1,34 @@
1
+ test:
2
+ service: Disk
3
+ root: <%= Rails.root.join("tmp/storage") %>
4
+
5
+ local:
6
+ service: Disk
7
+ root: <%= Rails.root.join("storage") %>
8
+
9
+ # Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
10
+ # amazon:
11
+ # service: S3
12
+ # access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
13
+ # secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
14
+ # region: us-east-1
15
+ # bucket: your_own_bucket
16
+
17
+ # Remember not to checkin your GCS keyfile to a repository
18
+ # google:
19
+ # service: GCS
20
+ # project: your_project
21
+ # credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
22
+ # bucket: your_own_bucket
23
+
24
+ # Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
25
+ # microsoft:
26
+ # service: AzureStorage
27
+ # storage_account_name: your_account_name
28
+ # storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
29
+ # container: your_container_name
30
+
31
+ # mirror:
32
+ # service: Mirror
33
+ # primary: local
34
+ # mirrors: [ amazon, google, microsoft ]
@@ -0,0 +1,11 @@
1
+ class CreateUsers < ActiveRecord::Migration[5.2]
2
+ def change
3
+ create_table :users do |t|
4
+ t.string :username
5
+ t.string :surname
6
+ t.string :email
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,23 @@
1
+ # This file is auto-generated from the current state of the database. Instead
2
+ # of editing this file, please use the migrations feature of Active Record to
3
+ # incrementally modify your database, and then regenerate this schema definition.
4
+ #
5
+ # Note that this schema.rb definition is the authoritative source for your
6
+ # database schema. If you need to create the application database on another
7
+ # system, you should be using db:schema:load, not running all the migrations
8
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
9
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
10
+ #
11
+ # It's strongly recommended that you check this file into your version control system.
12
+
13
+ ActiveRecord::Schema.define(version: 2019_07_16_093114) do
14
+
15
+ create_table "users", force: :cascade do |t|
16
+ t.string "username"
17
+ t.string "surname"
18
+ t.string "email"
19
+ t.datetime "created_at", null: false
20
+ t.datetime "updated_at", null: false
21
+ end
22
+
23
+ end
@@ -0,0 +1,5 @@
1
+ {
2
+ "dependencies": {
3
+ "patternfly-bootstrap-treeview": "^2.1.8"
4
+ }
5
+ }
@@ -0,0 +1,5 @@
1
+ require 'rails_helper'
2
+
3
+ RSpec.describe User, type: :model do
4
+ pending "add some examples to (or delete) #{__FILE__}"
5
+ end
@@ -0,0 +1,21 @@
1
+ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
+ # yarn lockfile v1
3
+
4
+
5
+ bootstrap@3.4.x:
6
+ version "3.4.1"
7
+ resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-3.4.1.tgz#c3a347d419e289ad11f4033e3c4132b87c081d72"
8
+ integrity sha512-yN5oZVmRCwe5aKwzRj6736nSmKDX7pLYwsXiCj/EYmo16hODaBiT4En5btW/jhBF/seV+XMx3aYwukYC3A49DA==
9
+
10
+ "jquery@>= 2.1.x":
11
+ version "3.4.1"
12
+ resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.4.1.tgz#714f1f8d9dde4bdfa55764ba37ef214630d80ef2"
13
+ integrity sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw==
14
+
15
+ patternfly-bootstrap-treeview@^2.1.8:
16
+ version "2.1.8"
17
+ resolved "https://registry.yarnpkg.com/patternfly-bootstrap-treeview/-/patternfly-bootstrap-treeview-2.1.8.tgz#4a79e245e8421578b6ce89a52c94596f523ae16f"
18
+ integrity sha512-Z3v+zJ0AEhMiySyj7qgUs4yGM8afJwjUUWgwSosWI9xpMsyJV+B+I+GzgRoGiukzh14EOl3EiX4qqMBC+nwqXQ==
19
+ dependencies:
20
+ bootstrap "3.4.x"
21
+ jquery ">= 2.1.x"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kono_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.15
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marino
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-13 00:00:00.000000000 Z
11
+ date: 2021-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview
@@ -25,21 +25,7 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: font-awesome-rails
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: underscore-rails
28
+ name: rdiscount
43
29
  requirement: !ruby/object:Gem::Requirement
44
30
  requirements:
45
31
  - - ">="
@@ -53,7 +39,7 @@ dependencies:
53
39
  - !ruby/object:Gem::Version
54
40
  version: '0'
55
41
  - !ruby/object:Gem::Dependency
56
- name: active_type
42
+ name: coffee-rails
57
43
  requirement: !ruby/object:Gem::Requirement
58
44
  requirements:
59
45
  - - ">="
@@ -67,7 +53,7 @@ dependencies:
67
53
  - !ruby/object:Gem::Version
68
54
  version: '0'
69
55
  - !ruby/object:Gem::Dependency
70
- name: codice-fiscale
56
+ name: sass-rails
71
57
  requirement: !ruby/object:Gem::Requirement
72
58
  requirements:
73
59
  - - ">="
@@ -81,91 +67,35 @@ dependencies:
81
67
  - !ruby/object:Gem::Version
82
68
  version: '0'
83
69
  - !ruby/object:Gem::Dependency
84
- name: rails-jquery-autocomplete
70
+ name: pundit
85
71
  requirement: !ruby/object:Gem::Requirement
86
72
  requirements:
87
73
  - - "~>"
88
74
  - !ruby/object:Gem::Version
89
- version: 1.0.3
75
+ version: '2.0'
90
76
  type: :runtime
91
77
  prerelease: false
92
78
  version_requirements: !ruby/object:Gem::Requirement
93
79
  requirements:
94
80
  - - "~>"
95
81
  - !ruby/object:Gem::Version
96
- version: 1.0.3
82
+ version: '2.0'
97
83
  - !ruby/object:Gem::Dependency
98
- name: formtastic-bootstrap
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "~>"
102
- - !ruby/object:Gem::Version
103
- version: 3.1.1
104
- type: :runtime
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
109
- - !ruby/object:Gem::Version
110
- version: 3.1.1
111
- - !ruby/object:Gem::Dependency
112
- name: momentjs-rails
84
+ name: kono_utils_helpers
113
85
  requirement: !ruby/object:Gem::Requirement
114
86
  requirements:
115
87
  - - ">="
116
88
  - !ruby/object:Gem::Version
117
- version: 2.9.0
89
+ version: '0'
118
90
  type: :runtime
119
91
  prerelease: false
120
92
  version_requirements: !ruby/object:Gem::Requirement
121
93
  requirements:
122
94
  - - ">="
123
95
  - !ruby/object:Gem::Version
124
- version: 2.9.0
125
- - !ruby/object:Gem::Dependency
126
- name: bootstrap3-datetimepicker-rails
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - "~>"
130
- - !ruby/object:Gem::Version
131
- version: 4.17.42
132
- type: :runtime
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - "~>"
137
- - !ruby/object:Gem::Version
138
- version: 4.17.42
139
- - !ruby/object:Gem::Dependency
140
- name: rails-assets-bootstrap-treeview
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - "~>"
144
- - !ruby/object:Gem::Version
145
- version: 1.2.0
146
- type: :runtime
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - "~>"
151
- - !ruby/object:Gem::Version
152
- version: 1.2.0
153
- - !ruby/object:Gem::Dependency
154
- name: will_paginate
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - "~>"
158
- - !ruby/object:Gem::Version
159
- version: 3.1.0
160
- type: :runtime
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - "~>"
165
- - !ruby/object:Gem::Version
166
- version: 3.1.0
96
+ version: '0'
167
97
  - !ruby/object:Gem::Dependency
168
- name: will_paginate-bootstrap
98
+ name: active_type
169
99
  requirement: !ruby/object:Gem::Requirement
170
100
  requirements:
171
101
  - - ">="
@@ -179,13 +109,13 @@ dependencies:
179
109
  - !ruby/object:Gem::Version
180
110
  version: '0'
181
111
  - !ruby/object:Gem::Dependency
182
- name: rdiscount
112
+ name: sqlite3
183
113
  requirement: !ruby/object:Gem::Requirement
184
114
  requirements:
185
115
  - - ">="
186
116
  - !ruby/object:Gem::Version
187
117
  version: '0'
188
- type: :runtime
118
+ type: :development
189
119
  prerelease: false
190
120
  version_requirements: !ruby/object:Gem::Requirement
191
121
  requirements:
@@ -193,35 +123,35 @@ dependencies:
193
123
  - !ruby/object:Gem::Version
194
124
  version: '0'
195
125
  - !ruby/object:Gem::Dependency
196
- name: sqlite3
126
+ name: rails
197
127
  requirement: !ruby/object:Gem::Requirement
198
128
  requirements:
199
- - - ">="
129
+ - - ">"
200
130
  - !ruby/object:Gem::Version
201
- version: '0'
131
+ version: 4.2.4
202
132
  type: :development
203
133
  prerelease: false
204
134
  version_requirements: !ruby/object:Gem::Requirement
205
135
  requirements:
206
- - - ">="
136
+ - - ">"
207
137
  - !ruby/object:Gem::Version
208
- version: '0'
138
+ version: 4.2.4
209
139
  - !ruby/object:Gem::Dependency
210
- name: rails
140
+ name: rspec-rails
211
141
  requirement: !ruby/object:Gem::Requirement
212
142
  requirements:
213
- - - "~>"
143
+ - - ">="
214
144
  - !ruby/object:Gem::Version
215
- version: 4.2.4
145
+ version: '0'
216
146
  type: :development
217
147
  prerelease: false
218
148
  version_requirements: !ruby/object:Gem::Requirement
219
149
  requirements:
220
- - - "~>"
150
+ - - ">="
221
151
  - !ruby/object:Gem::Version
222
- version: 4.2.4
152
+ version: '0'
223
153
  - !ruby/object:Gem::Dependency
224
- name: rspec-rails
154
+ name: listen
225
155
  requirement: !ruby/object:Gem::Requirement
226
156
  requirements:
227
157
  - - ">="
@@ -246,86 +176,67 @@ files:
246
176
  - MIT-LICENSE
247
177
  - README.rdoc
248
178
  - Rakefile
249
- - app/assets/javascripts/kono_utils/utilities.coffee
250
- - app/assets/stylesheets/kono_utils/_kono_styles.css.scss
251
- - app/assets/stylesheets/kono_utils/utils.css.scss
179
+ - app/assets/javascripts/kono_utils/core.coffee
180
+ - app/assets/stylesheets/kono_utils/core.css.scss
252
181
  - app/controllers/kono_utils/change_log_controller.rb
253
- - app/input/bs_aceeditor_input.rb
254
- - app/input/bs_autocomplete_input.rb
255
- - app/input/bs_datepicker_input.rb
256
- - app/input/bs_datetimepicker_input.rb
257
- - app/input/bs_file_download_input.rb
258
- - app/input/bs_image_input.rb
259
- - app/input/bs_label_with_container_input.rb
260
- - app/input/bs_location_picker_input.rb
261
- - app/input/bs_readonly_input.rb
262
- - app/input/bs_timepicker_input.rb
263
182
  - app/policies/kono_utils/base_editing_policy_concern.rb
264
- - app/views/kono_utils/application/_search_panel.html.erb
265
- - app/views/kono_utils/base_editing/_edit.html.erb
266
- - app/views/kono_utils/base_editing/_edit_page_side_title_header.html.erb
267
- - app/views/kono_utils/base_editing/_edit_page_title_header.html.erb
268
- - app/views/kono_utils/base_editing/_form.html.erb
269
- - app/views/kono_utils/base_editing/_index_buttons.html.erb
270
- - app/views/kono_utils/base_editing/_index_page_side_title_header.html.erb
271
- - app/views/kono_utils/base_editing/_index_page_title_header.html.erb
272
- - app/views/kono_utils/base_editing/_index_tfoot.html.erb
273
- - app/views/kono_utils/base_editing/_new.html.erb
274
- - app/views/kono_utils/base_editing/_new_page_side_title_header.html.erb
275
- - app/views/kono_utils/base_editing/_new_page_title_header.html.erb
276
- - app/views/kono_utils/base_editing/_search_form.html.erb
277
- - app/views/kono_utils/base_editing/application/_edit_page_side_title_header.html.erb
278
- - app/views/kono_utils/base_editing/application/_edit_page_title_header.html.erb
279
- - app/views/kono_utils/base_editing/application/_index_page_side_title_header.html.erb
280
- - app/views/kono_utils/base_editing/application/_index_page_title_header.html.erb
281
- - app/views/kono_utils/base_editing/application/_new_page_side_title_header.html.erb
282
- - app/views/kono_utils/base_editing/application/_new_page_title_header.html.erb
283
- - app/views/kono_utils/base_editing/application/edit.html.erb
284
- - app/views/kono_utils/base_editing/application/new.html.erb
285
- - app/views/kono_utils/base_editing/edit.html.erb
286
- - app/views/kono_utils/base_editing/index.html.erb
287
- - app/views/kono_utils/base_editing/new.html.erb
183
+ - app/policies/kono_utils/base_search_form_policy_concern.rb
288
184
  - app/views/kono_utils/change_log/index.html.erb
289
185
  - config/initializers/mysql.rb
290
186
  - config/initializers/time.rb
291
187
  - config/locales/it.yml
292
188
  - lib/generators/kono_utils/install/install_generator.rb
189
+ - lib/generators/templates/base_editing_controller.template
190
+ - lib/generators/templates/base_editing_helper.template
191
+ - lib/generators/templates/base_editing_policy.template
293
192
  - lib/generators/templates/initializer.rb
294
193
  - lib/kono_utils.rb
194
+ - lib/kono_utils/application_core_helper.rb
195
+ - lib/kono_utils/application_enum_helper.rb
295
196
  - lib/kono_utils/application_helper.rb
197
+ - lib/kono_utils/base_editing_core_helper.rb
296
198
  - lib/kono_utils/base_editing_helper.rb
297
199
  - lib/kono_utils/base_search.rb
298
200
  - lib/kono_utils/concerns.rb
299
201
  - lib/kono_utils/concerns/active_record_translation.rb
202
+ - lib/kono_utils/concerns/active_storage_remover_helper.rb
300
203
  - lib/kono_utils/concerns/base_editing.rb
301
204
  - lib/kono_utils/concerns/base_modals.rb
302
205
  - lib/kono_utils/concerns/success_message.rb
303
- - lib/kono_utils/encoder.rb
206
+ - lib/kono_utils/configuration.rb
304
207
  - lib/kono_utils/engine.rb
305
- - lib/kono_utils/fiscal_code.rb
306
- - lib/kono_utils/params_hash_array.rb
307
- - lib/kono_utils/percentage.rb
208
+ - lib/kono_utils/paginate_proxer.rb
308
209
  - lib/kono_utils/search_attribute.rb
309
- - lib/kono_utils/tmp_file.rb
210
+ - lib/kono_utils/search_form_builder.rb
310
211
  - lib/kono_utils/version.rb
311
- - lib/kono_utils/virtual_model.rb
312
- - lib/tasks/kono_utils_tasks.rake
212
+ - spec/dummy/.gitignore
313
213
  - spec/dummy/README.rdoc
314
214
  - spec/dummy/Rakefile
215
+ - spec/dummy/app/assets/config/manifest.js
315
216
  - spec/dummy/app/assets/images/.keep
316
217
  - spec/dummy/app/assets/javascripts/application.js
317
218
  - spec/dummy/app/assets/stylesheets/application.css
318
219
  - spec/dummy/app/controllers/application_controller.rb
220
+ - spec/dummy/app/controllers/base_editing_controller.rb
319
221
  - spec/dummy/app/controllers/concerns/.keep
222
+ - spec/dummy/app/controllers/users_controller.rb
320
223
  - spec/dummy/app/helpers/application_helper.rb
224
+ - spec/dummy/app/helpers/base_editing_helper.rb
321
225
  - spec/dummy/app/mailers/.keep
322
226
  - spec/dummy/app/models/.keep
227
+ - spec/dummy/app/models/application_record.rb
323
228
  - spec/dummy/app/models/concerns/.keep
229
+ - spec/dummy/app/models/user.rb
230
+ - spec/dummy/app/policies/application_policy.rb
231
+ - spec/dummy/app/policies/base_editing_policy.rb
232
+ - spec/dummy/app/policies/user_policy.rb
324
233
  - spec/dummy/app/views/layouts/application.html.erb
325
234
  - spec/dummy/bin/bundle
326
235
  - spec/dummy/bin/rails
327
236
  - spec/dummy/bin/rake
328
237
  - spec/dummy/bin/setup
238
+ - spec/dummy/bin/update
239
+ - spec/dummy/bin/yarn
329
240
  - spec/dummy/config.ru
330
241
  - spec/dummy/config/application.rb
331
242
  - spec/dummy/config/boot.rb
@@ -334,27 +245,35 @@ files:
334
245
  - spec/dummy/config/environments/development.rb
335
246
  - spec/dummy/config/environments/production.rb
336
247
  - spec/dummy/config/environments/test.rb
248
+ - spec/dummy/config/initializers/application_controller_renderer.rb
337
249
  - spec/dummy/config/initializers/assets.rb
338
250
  - spec/dummy/config/initializers/backtrace_silencers.rb
251
+ - spec/dummy/config/initializers/content_security_policy.rb
339
252
  - spec/dummy/config/initializers/cookies_serializer.rb
340
253
  - spec/dummy/config/initializers/filter_parameter_logging.rb
341
254
  - spec/dummy/config/initializers/inflections.rb
255
+ - spec/dummy/config/initializers/kono_utils.rb
342
256
  - spec/dummy/config/initializers/mime_types.rb
257
+ - spec/dummy/config/initializers/new_framework_defaults_5_2.rb
343
258
  - spec/dummy/config/initializers/session_store.rb
344
259
  - spec/dummy/config/initializers/wrap_parameters.rb
345
260
  - spec/dummy/config/locales/en.yml
346
261
  - spec/dummy/config/routes.rb
347
262
  - spec/dummy/config/secrets.yml
263
+ - spec/dummy/config/storage.yml
264
+ - spec/dummy/db/migrate/20190716093114_create_users.rb
265
+ - spec/dummy/db/schema.rb
348
266
  - spec/dummy/lib/assets/.keep
349
267
  - spec/dummy/log/.keep
268
+ - spec/dummy/package.json
350
269
  - spec/dummy/public/404.html
351
270
  - spec/dummy/public/422.html
352
271
  - spec/dummy/public/500.html
353
272
  - spec/dummy/public/favicon.ico
354
- - spec/lib/kono_utils/fiscal_code_spec.rb
273
+ - spec/dummy/spec/models/user_spec.rb
274
+ - spec/dummy/yarn.lock
355
275
  - spec/rails_helper.rb
356
276
  - spec/spec_helper.rb
357
- - vendor/assets/javascripts/EventEmitter.js
358
277
  homepage: https://github.com/ArchimediaZerogroup/KonoUtils
359
278
  licenses:
360
279
  - MIT
@@ -374,28 +293,39 @@ required_rubygems_version: !ruby/object:Gem::Requirement
374
293
  - !ruby/object:Gem::Version
375
294
  version: '0'
376
295
  requirements: []
377
- rubyforge_project:
378
- rubygems_version: 2.4.8
296
+ rubygems_version: 3.0.8
379
297
  signing_key:
380
298
  specification_version: 4
381
299
  summary: Kono Utilities
382
300
  test_files:
301
+ - spec/dummy/.gitignore
383
302
  - spec/dummy/README.rdoc
384
303
  - spec/dummy/Rakefile
304
+ - spec/dummy/app/assets/config/manifest.js
385
305
  - spec/dummy/app/assets/images/.keep
386
306
  - spec/dummy/app/assets/javascripts/application.js
387
307
  - spec/dummy/app/assets/stylesheets/application.css
388
308
  - spec/dummy/app/controllers/application_controller.rb
309
+ - spec/dummy/app/controllers/base_editing_controller.rb
389
310
  - spec/dummy/app/controllers/concerns/.keep
311
+ - spec/dummy/app/controllers/users_controller.rb
390
312
  - spec/dummy/app/helpers/application_helper.rb
313
+ - spec/dummy/app/helpers/base_editing_helper.rb
391
314
  - spec/dummy/app/mailers/.keep
392
315
  - spec/dummy/app/models/.keep
316
+ - spec/dummy/app/models/application_record.rb
393
317
  - spec/dummy/app/models/concerns/.keep
318
+ - spec/dummy/app/models/user.rb
319
+ - spec/dummy/app/policies/application_policy.rb
320
+ - spec/dummy/app/policies/base_editing_policy.rb
321
+ - spec/dummy/app/policies/user_policy.rb
394
322
  - spec/dummy/app/views/layouts/application.html.erb
395
323
  - spec/dummy/bin/bundle
396
324
  - spec/dummy/bin/rails
397
325
  - spec/dummy/bin/rake
398
326
  - spec/dummy/bin/setup
327
+ - spec/dummy/bin/update
328
+ - spec/dummy/bin/yarn
399
329
  - spec/dummy/config.ru
400
330
  - spec/dummy/config/application.rb
401
331
  - spec/dummy/config/boot.rb
@@ -404,23 +334,32 @@ test_files:
404
334
  - spec/dummy/config/environments/development.rb
405
335
  - spec/dummy/config/environments/production.rb
406
336
  - spec/dummy/config/environments/test.rb
337
+ - spec/dummy/config/initializers/application_controller_renderer.rb
407
338
  - spec/dummy/config/initializers/assets.rb
408
339
  - spec/dummy/config/initializers/backtrace_silencers.rb
340
+ - spec/dummy/config/initializers/content_security_policy.rb
409
341
  - spec/dummy/config/initializers/cookies_serializer.rb
410
342
  - spec/dummy/config/initializers/filter_parameter_logging.rb
411
343
  - spec/dummy/config/initializers/inflections.rb
344
+ - spec/dummy/config/initializers/kono_utils.rb
412
345
  - spec/dummy/config/initializers/mime_types.rb
346
+ - spec/dummy/config/initializers/new_framework_defaults_5_2.rb
413
347
  - spec/dummy/config/initializers/session_store.rb
414
348
  - spec/dummy/config/initializers/wrap_parameters.rb
415
349
  - spec/dummy/config/locales/en.yml
416
350
  - spec/dummy/config/routes.rb
417
351
  - spec/dummy/config/secrets.yml
352
+ - spec/dummy/config/storage.yml
353
+ - spec/dummy/db/migrate/20190716093114_create_users.rb
354
+ - spec/dummy/db/schema.rb
418
355
  - spec/dummy/lib/assets/.keep
419
356
  - spec/dummy/log/.keep
357
+ - spec/dummy/package.json
420
358
  - spec/dummy/public/404.html
421
359
  - spec/dummy/public/422.html
422
360
  - spec/dummy/public/500.html
423
361
  - spec/dummy/public/favicon.ico
424
- - spec/lib/kono_utils/fiscal_code_spec.rb
362
+ - spec/dummy/spec/models/user_spec.rb
363
+ - spec/dummy/yarn.lock
425
364
  - spec/rails_helper.rb
426
365
  - spec/spec_helper.rb