activeadmin_mitosis_editor 0.1.0

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.
Files changed (165) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +17 -0
  3. data/CLAUDE.md +118 -0
  4. data/Gemfile +3 -0
  5. data/LICENSE +21 -0
  6. data/README.md +126 -0
  7. data/RELEASE.md +80 -0
  8. data/Rakefile +2 -0
  9. data/activeadmin_mitosis_editor.gemspec +17 -0
  10. data/app/views/inputs/mitosis_editor_input/_dependencies.html.erb +9 -0
  11. data/app/views/inputs/mitosis_editor_input/_form.html.erb +52 -0
  12. data/bin/console +5 -0
  13. data/bin/setup +14 -0
  14. data/demo/.dockerignore +51 -0
  15. data/demo/.gitattributes +9 -0
  16. data/demo/.gitignore +37 -0
  17. data/demo/.kamal/hooks/docker-setup.sample +3 -0
  18. data/demo/.kamal/hooks/post-app-boot.sample +3 -0
  19. data/demo/.kamal/hooks/post-deploy.sample +14 -0
  20. data/demo/.kamal/hooks/post-proxy-reboot.sample +3 -0
  21. data/demo/.kamal/hooks/pre-app-boot.sample +3 -0
  22. data/demo/.kamal/hooks/pre-build.sample +51 -0
  23. data/demo/.kamal/hooks/pre-connect.sample +47 -0
  24. data/demo/.kamal/hooks/pre-deploy.sample +122 -0
  25. data/demo/.kamal/hooks/pre-proxy-reboot.sample +3 -0
  26. data/demo/.kamal/secrets +20 -0
  27. data/demo/.rubocop.yml +8 -0
  28. data/demo/.ruby-version +1 -0
  29. data/demo/Dockerfile +76 -0
  30. data/demo/Gemfile +78 -0
  31. data/demo/Procfile.dev +2 -0
  32. data/demo/README.md +24 -0
  33. data/demo/Rakefile +6 -0
  34. data/demo/app/admin/articles.rb +12 -0
  35. data/demo/app/admin/dashboard.rb +17 -0
  36. data/demo/app/admin/pages.rb +12 -0
  37. data/demo/app/admin/posts.rb +12 -0
  38. data/demo/app/assets/builds/.keep +0 -0
  39. data/demo/app/assets/builds/active_admin.css +3852 -0
  40. data/demo/app/assets/images/.keep +0 -0
  41. data/demo/app/assets/stylesheets/active_admin.css +3 -0
  42. data/demo/app/assets/stylesheets/application.css +1 -0
  43. data/demo/app/assets/stylesheets/mitosis-editor.css +1 -0
  44. data/demo/app/assets/stylesheets/theme-dark.css +1 -0
  45. data/demo/app/assets/stylesheets/theme-light.css +1 -0
  46. data/demo/app/controllers/application_controller.rb +7 -0
  47. data/demo/app/controllers/articles_controller.rb +7 -0
  48. data/demo/app/controllers/concerns/.keep +0 -0
  49. data/demo/app/helpers/application_helper.rb +2 -0
  50. data/demo/app/helpers/articles_helper.rb +2 -0
  51. data/demo/app/javascript/application.js +3 -0
  52. data/demo/app/javascript/controllers/application.js +9 -0
  53. data/demo/app/javascript/controllers/hello_controller.js +7 -0
  54. data/demo/app/javascript/controllers/index.js +4 -0
  55. data/demo/app/jobs/application_job.rb +7 -0
  56. data/demo/app/mailers/application_mailer.rb +4 -0
  57. data/demo/app/models/application_record.rb +3 -0
  58. data/demo/app/models/article.rb +5 -0
  59. data/demo/app/models/concerns/.keep +0 -0
  60. data/demo/app/models/page.rb +5 -0
  61. data/demo/app/models/post.rb +5 -0
  62. data/demo/app/views/articles/_article.html.erb +12 -0
  63. data/demo/app/views/articles/_article.json.jbuilder +2 -0
  64. data/demo/app/views/articles/_form.html.erb +27 -0
  65. data/demo/app/views/articles/edit.html.erb +12 -0
  66. data/demo/app/views/articles/index.html.erb +16 -0
  67. data/demo/app/views/articles/index.json.jbuilder +1 -0
  68. data/demo/app/views/articles/new.html.erb +11 -0
  69. data/demo/app/views/articles/show.html.erb +10 -0
  70. data/demo/app/views/articles/show.json.jbuilder +1 -0
  71. data/demo/app/views/inputs/mitosis_editor_input/_dependencies.html.erb +17 -0
  72. data/demo/app/views/layouts/application.html.erb +29 -0
  73. data/demo/app/views/layouts/mailer.html.erb +13 -0
  74. data/demo/app/views/layouts/mailer.text.erb +1 -0
  75. data/demo/app/views/pwa/manifest.json.erb +22 -0
  76. data/demo/app/views/pwa/service-worker.js +26 -0
  77. data/demo/bin/brakeman +7 -0
  78. data/demo/bin/bundler-audit +6 -0
  79. data/demo/bin/ci +6 -0
  80. data/demo/bin/dev +8 -0
  81. data/demo/bin/docker-entrypoint +8 -0
  82. data/demo/bin/importmap +4 -0
  83. data/demo/bin/jobs +6 -0
  84. data/demo/bin/kamal +27 -0
  85. data/demo/bin/rails +4 -0
  86. data/demo/bin/rake +4 -0
  87. data/demo/bin/rubocop +8 -0
  88. data/demo/bin/setup +35 -0
  89. data/demo/bin/thrust +5 -0
  90. data/demo/config/application.rb +27 -0
  91. data/demo/config/boot.rb +4 -0
  92. data/demo/config/bundler-audit.yml +5 -0
  93. data/demo/config/cable.yml +17 -0
  94. data/demo/config/cache.yml +16 -0
  95. data/demo/config/ci.rb +23 -0
  96. data/demo/config/credentials.yml.enc +1 -0
  97. data/demo/config/database.yml +41 -0
  98. data/demo/config/deploy.yml +120 -0
  99. data/demo/config/environment.rb +21 -0
  100. data/demo/config/environments/development.rb +78 -0
  101. data/demo/config/environments/production.rb +90 -0
  102. data/demo/config/environments/test.rb +53 -0
  103. data/demo/config/importmap.rb +7 -0
  104. data/demo/config/initializers/active_admin.rb +275 -0
  105. data/demo/config/initializers/activeadmin_mitosis_editor.rb +19 -0
  106. data/demo/config/initializers/assets.rb +7 -0
  107. data/demo/config/initializers/content_security_policy.rb +29 -0
  108. data/demo/config/initializers/filter_parameter_logging.rb +8 -0
  109. data/demo/config/initializers/inflections.rb +16 -0
  110. data/demo/config/locales/en.yml +31 -0
  111. data/demo/config/puma.rb +42 -0
  112. data/demo/config/queue.yml +18 -0
  113. data/demo/config/recurring.yml +15 -0
  114. data/demo/config/routes.rb +16 -0
  115. data/demo/config/storage.yml +27 -0
  116. data/demo/config.ru +6 -0
  117. data/demo/db/cable_schema.rb +11 -0
  118. data/demo/db/cache_schema.rb +12 -0
  119. data/demo/db/migrate/20260215110410_create_active_admin_comments.rb +16 -0
  120. data/demo/db/migrate/20260215110416_create_articles.rb +10 -0
  121. data/demo/db/migrate/20260216124916_create_posts.rb +10 -0
  122. data/demo/db/migrate/20260216124919_create_pages.rb +10 -0
  123. data/demo/db/queue_schema.rb +129 -0
  124. data/demo/db/schema.rb +48 -0
  125. data/demo/db/seeds.rb +9 -0
  126. data/demo/lib/tasks/.keep +0 -0
  127. data/demo/log/.keep +0 -0
  128. data/demo/package-lock.json +1260 -0
  129. data/demo/package.json +13 -0
  130. data/demo/public/400.html +135 -0
  131. data/demo/public/404.html +135 -0
  132. data/demo/public/406-unsupported-browser.html +135 -0
  133. data/demo/public/422.html +135 -0
  134. data/demo/public/500.html +135 -0
  135. data/demo/public/icon.png +0 -0
  136. data/demo/public/icon.svg +3 -0
  137. data/demo/public/robots.txt +1 -0
  138. data/demo/script/.keep +0 -0
  139. data/demo/spec/rails_helper.rb +72 -0
  140. data/demo/spec/spec_helper.rb +94 -0
  141. data/demo/spec/system/admin_articles_spec.rb +22 -0
  142. data/demo/spec/system/mitosis_editor_prism_spec.rb +34 -0
  143. data/demo/spec/system/mitosis_editor_theme_spec.rb +63 -0
  144. data/demo/storage/.keep +0 -0
  145. data/demo/tailwind-active_admin.config.js +17 -0
  146. data/demo/tmp/.keep +0 -0
  147. data/demo/tmp/storage/.keep +0 -0
  148. data/demo/vendor/.keep +0 -0
  149. data/demo/vendor/javascript/.keep +0 -0
  150. data/docs/plans/2026-02-15-mitosis-editor-gem-design.md +70 -0
  151. data/docs/plans/2026-02-15-mitosis-editor-gem-implementation.md +407 -0
  152. data/lib/activeadmin_mitosis_editor/inputs/mitosis_editor_input.rb +29 -0
  153. data/lib/activeadmin_mitosis_editor/railtie.rb +7 -0
  154. data/lib/activeadmin_mitosis_editor/version.rb +3 -0
  155. data/lib/activeadmin_mitosis_editor.rb +13 -0
  156. data/lib/generators/mitosis_editor/styles_generator.rb +23 -0
  157. data/lib/generators/mitosis_editor/templates/_dependencies.html.erb +17 -0
  158. data/lib/generators/mitosis_editor/views_generator.rb +14 -0
  159. data/preview.png +0 -0
  160. data/script/bump-version +78 -0
  161. data/vendor/assets/javascripts/mitosis-editor.js +61 -0
  162. data/vendor/assets/stylesheets/mitosis-editor.css +1 -0
  163. data/vendor/assets/stylesheets/theme-dark.min.css +1 -0
  164. data/vendor/assets/stylesheets/theme-light.min.css +1 -0
  165. metadata +248 -0
@@ -0,0 +1,41 @@
1
+ # SQLite. Versions 3.8.0 and up are supported.
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem "sqlite3"
6
+ #
7
+ default: &default
8
+ adapter: sqlite3
9
+ max_connections: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
10
+ timeout: 5000
11
+
12
+ development:
13
+ <<: *default
14
+ database: storage/development.sqlite3
15
+
16
+ # Warning: The database defined as "test" will be erased and
17
+ # re-generated from your development database when you run "rake".
18
+ # Do not set this db to the same as development or production.
19
+ test:
20
+ <<: *default
21
+ database: storage/test.sqlite3
22
+
23
+
24
+ # Store production database in the storage/ directory, which by default
25
+ # is mounted as a persistent Docker volume in config/deploy.yml.
26
+ production:
27
+ primary:
28
+ <<: *default
29
+ database: storage/production.sqlite3
30
+ cache:
31
+ <<: *default
32
+ database: storage/production_cache.sqlite3
33
+ migrations_paths: db/cache_migrate
34
+ queue:
35
+ <<: *default
36
+ database: storage/production_queue.sqlite3
37
+ migrations_paths: db/queue_migrate
38
+ cable:
39
+ <<: *default
40
+ database: storage/production_cable.sqlite3
41
+ migrations_paths: db/cable_migrate
@@ -0,0 +1,120 @@
1
+ # Name of your application. Used to uniquely configure containers.
2
+ service: demo
3
+
4
+ # Name of the container image (use your-user/app-name on external registries).
5
+ image: demo
6
+
7
+ # Deploy to these servers.
8
+ servers:
9
+ web:
10
+ - 192.168.0.1
11
+ # job:
12
+ # hosts:
13
+ # - 192.168.0.1
14
+ # cmd: bin/jobs
15
+
16
+ # Enable SSL auto certification via Let's Encrypt and allow for multiple apps on a single web server.
17
+ # If used with Cloudflare, set encryption mode in SSL/TLS setting to "Full" to enable CF-to-app encryption.
18
+ #
19
+ # Using an SSL proxy like this requires turning on config.assume_ssl and config.force_ssl in production.rb!
20
+ #
21
+ # Don't use this when deploying to multiple web servers (then you have to terminate SSL at your load balancer).
22
+ #
23
+ # proxy:
24
+ # ssl: true
25
+ # host: app.example.com
26
+
27
+ # Where you keep your container images.
28
+ registry:
29
+ # Alternatives: hub.docker.com / registry.digitalocean.com / ghcr.io / ...
30
+ server: localhost:5555
31
+
32
+ # Needed for authenticated registries.
33
+ # username: your-user
34
+
35
+ # Always use an access token rather than real password when possible.
36
+ # password:
37
+ # - KAMAL_REGISTRY_PASSWORD
38
+
39
+ # Inject ENV variables into containers (secrets come from .kamal/secrets).
40
+ env:
41
+ secret:
42
+ - RAILS_MASTER_KEY
43
+ clear:
44
+ # Run the Solid Queue Supervisor inside the web server's Puma process to do jobs.
45
+ # When you start using multiple servers, you should split out job processing to a dedicated machine.
46
+ SOLID_QUEUE_IN_PUMA: true
47
+
48
+ # Set number of processes dedicated to Solid Queue (default: 1)
49
+ # JOB_CONCURRENCY: 3
50
+
51
+ # Set number of cores available to the application on each server (default: 1).
52
+ # WEB_CONCURRENCY: 2
53
+
54
+ # Match this to any external database server to configure Active Record correctly
55
+ # Use demo-db for a db accessory server on same machine via local kamal docker network.
56
+ # DB_HOST: 192.168.0.2
57
+
58
+ # Log everything from Rails
59
+ # RAILS_LOG_LEVEL: debug
60
+
61
+ # Aliases are triggered with "bin/kamal <alias>". You can overwrite arguments on invocation:
62
+ # "bin/kamal logs -r job" will tail logs from the first server in the job section.
63
+ aliases:
64
+ console: app exec --interactive --reuse "bin/rails console"
65
+ shell: app exec --interactive --reuse "bash"
66
+ logs: app logs -f
67
+ dbc: app exec --interactive --reuse "bin/rails dbconsole --include-password"
68
+
69
+ # Use a persistent storage volume for sqlite database files and local Active Storage files.
70
+ # Recommended to change this to a mounted volume path that is backed up off server.
71
+ volumes:
72
+ - "demo_storage:/rails/storage"
73
+
74
+ # Bridge fingerprinted assets, like JS and CSS, between versions to avoid
75
+ # hitting 404 on in-flight requests. Combines all files from new and old
76
+ # version inside the asset_path.
77
+ asset_path: /rails/public/assets
78
+
79
+
80
+ # Configure the image builder.
81
+ builder:
82
+ arch: amd64
83
+
84
+ # # Build image via remote server (useful for faster amd64 builds on arm64 computers)
85
+ # remote: ssh://docker@docker-builder-server
86
+ #
87
+ # # Pass arguments and secrets to the Docker build process
88
+ # args:
89
+ # RUBY_VERSION: ruby-3.3.5
90
+ # secrets:
91
+ # - GITHUB_TOKEN
92
+ # - RAILS_MASTER_KEY
93
+
94
+ # Use a different ssh user than root
95
+ # ssh:
96
+ # user: app
97
+
98
+ # Use accessory services (secrets come from .kamal/secrets).
99
+ # accessories:
100
+ # db:
101
+ # image: mysql:8.0
102
+ # host: 192.168.0.2
103
+ # # Change to 3306 to expose port to the world instead of just local network.
104
+ # port: "127.0.0.1:3306:3306"
105
+ # env:
106
+ # clear:
107
+ # MYSQL_ROOT_HOST: '%'
108
+ # secret:
109
+ # - MYSQL_ROOT_PASSWORD
110
+ # files:
111
+ # - config/mysql/production.cnf:/etc/mysql/my.cnf
112
+ # - db/production.sql:/docker-entrypoint-initdb.d/setup.sql
113
+ # directories:
114
+ # - data:/var/lib/mysql
115
+ # redis:
116
+ # image: valkey/valkey:8
117
+ # host: 192.168.0.2
118
+ # port: 6379
119
+ # directories:
120
+ # - data:/data
@@ -0,0 +1,21 @@
1
+ # Load the Rails application.
2
+ require_relative "application"
3
+
4
+ # Monkey patch for Rails 8 compatibility with ActiveAdmin 4.x
5
+ unless ActiveSupport::Deprecation.respond_to?(:silence)
6
+ class ActiveSupport::Deprecation
7
+ def self.silence
8
+ @silenced = true
9
+ yield
10
+ ensure
11
+ @silenced = false
12
+ end
13
+
14
+ def silenced?
15
+ @silenced
16
+ end
17
+ end
18
+ end
19
+
20
+ # Initialize the Rails application.
21
+ Rails.application.initialize!
@@ -0,0 +1,78 @@
1
+ require "active_support/core_ext/integer/time"
2
+
3
+ Rails.application.configure do
4
+ # Settings specified here will take precedence over those in config/application.rb.
5
+
6
+ # Make code changes take effect immediately without server restart.
7
+ config.enable_reloading = true
8
+
9
+ # Do not eager load code on boot.
10
+ config.eager_load = false
11
+
12
+ # Show full error reports.
13
+ config.consider_all_requests_local = true
14
+
15
+ # Enable server timing.
16
+ config.server_timing = true
17
+
18
+ # Enable/disable Action Controller caching. By default Action Controller caching is disabled.
19
+ # Run rails dev:cache to toggle Action Controller caching.
20
+ if Rails.root.join("tmp/caching-dev.txt").exist?
21
+ config.action_controller.perform_caching = true
22
+ config.action_controller.enable_fragment_cache_logging = true
23
+ config.public_file_server.headers = { "cache-control" => "public, max-age=#{2.days.to_i}" }
24
+ else
25
+ config.action_controller.perform_caching = false
26
+ end
27
+
28
+ # Change to :null_store to avoid any caching.
29
+ config.cache_store = :memory_store
30
+
31
+ # Store uploaded files on the local file system (see config/storage.yml for options).
32
+ config.active_storage.service = :local
33
+
34
+ # Don't care if the mailer can't send.
35
+ config.action_mailer.raise_delivery_errors = false
36
+
37
+ # Make template changes take effect immediately.
38
+ config.action_mailer.perform_caching = false
39
+
40
+ # Set localhost to be used by links generated in mailer templates.
41
+ config.action_mailer.default_url_options = { host: "localhost", port: 3000 }
42
+
43
+ # Print deprecation notices to the Rails logger.
44
+ config.active_support.deprecation = :log
45
+
46
+ # Raise an error on page load if there are pending migrations.
47
+ config.active_record.migration_error = :page_load
48
+
49
+ # Highlight code that triggered database queries in logs.
50
+ config.active_record.verbose_query_logs = true
51
+
52
+ # Append comments with runtime information tags to SQL queries in logs.
53
+ config.active_record.query_log_tags_enabled = true
54
+
55
+ # Highlight code that enqueued background job in logs.
56
+ config.active_job.verbose_enqueue_logs = true
57
+
58
+ # Highlight code that triggered redirect in logs.
59
+ config.action_dispatch.verbose_redirect_logs = true
60
+
61
+ # Suppress logger output for asset requests.
62
+ config.assets.quiet = true
63
+
64
+ # Raises error for missing translations.
65
+ # config.i18n.raise_on_missing_translations = true
66
+
67
+ # Annotate rendered view with file names.
68
+ config.action_view.annotate_rendered_view_with_filenames = true
69
+
70
+ # Uncomment if you wish to allow Action Cable access from any origin.
71
+ # config.action_cable.disable_request_forgery_protection = true
72
+
73
+ # Raise error when a before_action's only/except options reference missing actions.
74
+ config.action_controller.raise_on_missing_callback_actions = true
75
+
76
+ # Apply autocorrection by RuboCop to files generated by `bin/rails generate`.
77
+ # config.generators.apply_rubocop_autocorrect_after_generate!
78
+ end
@@ -0,0 +1,90 @@
1
+ require "active_support/core_ext/integer/time"
2
+
3
+ Rails.application.configure do
4
+ # Settings specified here will take precedence over those in config/application.rb.
5
+
6
+ # Code is not reloaded between requests.
7
+ config.enable_reloading = false
8
+
9
+ # Eager load code on boot for better performance and memory savings (ignored by Rake tasks).
10
+ config.eager_load = true
11
+
12
+ # Full error reports are disabled.
13
+ config.consider_all_requests_local = false
14
+
15
+ # Turn on fragment caching in view templates.
16
+ config.action_controller.perform_caching = true
17
+
18
+ # Cache assets for far-future expiry since they are all digest stamped.
19
+ config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" }
20
+
21
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
22
+ # config.asset_host = "http://assets.example.com"
23
+
24
+ # Store uploaded files on the local file system (see config/storage.yml for options).
25
+ config.active_storage.service = :local
26
+
27
+ # Assume all access to the app is happening through a SSL-terminating reverse proxy.
28
+ # config.assume_ssl = true
29
+
30
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
31
+ # config.force_ssl = true
32
+
33
+ # Skip http-to-https redirect for the default health check endpoint.
34
+ # config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
35
+
36
+ # Log to STDOUT with the current request id as a default log tag.
37
+ config.log_tags = [ :request_id ]
38
+ config.logger = ActiveSupport::TaggedLogging.logger(STDOUT)
39
+
40
+ # Change to "debug" to log everything (including potentially personally-identifiable information!).
41
+ config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
42
+
43
+ # Prevent health checks from clogging up the logs.
44
+ config.silence_healthcheck_path = "/up"
45
+
46
+ # Don't log any deprecations.
47
+ config.active_support.report_deprecations = false
48
+
49
+ # Replace the default in-process memory cache store with a durable alternative.
50
+ config.cache_store = :solid_cache_store
51
+
52
+ # Replace the default in-process and non-durable queuing backend for Active Job.
53
+ config.active_job.queue_adapter = :solid_queue
54
+ config.solid_queue.connects_to = { database: { writing: :queue } }
55
+
56
+ # Ignore bad email addresses and do not raise email delivery errors.
57
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
58
+ # config.action_mailer.raise_delivery_errors = false
59
+
60
+ # Set host to be used by links generated in mailer templates.
61
+ config.action_mailer.default_url_options = { host: "example.com" }
62
+
63
+ # Specify outgoing SMTP server. Remember to add smtp/* credentials via bin/rails credentials:edit.
64
+ # config.action_mailer.smtp_settings = {
65
+ # user_name: Rails.application.credentials.dig(:smtp, :user_name),
66
+ # password: Rails.application.credentials.dig(:smtp, :password),
67
+ # address: "smtp.example.com",
68
+ # port: 587,
69
+ # authentication: :plain
70
+ # }
71
+
72
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
73
+ # the I18n.default_locale when a translation cannot be found).
74
+ config.i18n.fallbacks = true
75
+
76
+ # Do not dump schema after migrations.
77
+ config.active_record.dump_schema_after_migration = false
78
+
79
+ # Only use :id for inspections in production.
80
+ config.active_record.attributes_for_inspect = [ :id ]
81
+
82
+ # Enable DNS rebinding protection and other `Host` header attacks.
83
+ # config.hosts = [
84
+ # "example.com", # Allow requests from example.com
85
+ # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
86
+ # ]
87
+ #
88
+ # Skip DNS rebinding protection for the default health check endpoint.
89
+ # config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
90
+ end
@@ -0,0 +1,53 @@
1
+ # The test environment is used exclusively to run your application's
2
+ # test suite. You never need to work with it otherwise. Remember that
3
+ # your test database is "scratch space" for the test suite and is wiped
4
+ # and recreated between test runs. Don't rely on the data there!
5
+
6
+ Rails.application.configure do
7
+ # Settings specified here will take precedence over those in config/application.rb.
8
+
9
+ # While tests run files are not watched, reloading is not necessary.
10
+ config.enable_reloading = false
11
+
12
+ # Eager loading loads your entire application. When running a single test locally,
13
+ # this is usually not necessary, and can slow down your test suite. However, it's
14
+ # recommended that you enable it in continuous integration systems to ensure eager
15
+ # loading is working properly before deploying your code.
16
+ config.eager_load = ENV["CI"].present?
17
+
18
+ # Configure public file server for tests with cache-control for performance.
19
+ config.public_file_server.headers = { "cache-control" => "public, max-age=3600" }
20
+
21
+ # Show full error reports.
22
+ config.consider_all_requests_local = true
23
+ config.cache_store = :null_store
24
+
25
+ # Render exception templates for rescuable exceptions and raise for other exceptions.
26
+ config.action_dispatch.show_exceptions = :rescuable
27
+
28
+ # Disable request forgery protection in test environment.
29
+ config.action_controller.allow_forgery_protection = false
30
+
31
+ # Store uploaded files on the local file system in a temporary directory.
32
+ config.active_storage.service = :test
33
+
34
+ # Tell Action Mailer not to deliver emails to the real world.
35
+ # The :test delivery method accumulates sent emails in the
36
+ # ActionMailer::Base.deliveries array.
37
+ config.action_mailer.delivery_method = :test
38
+
39
+ # Set host to be used by links generated in mailer templates.
40
+ config.action_mailer.default_url_options = { host: "example.com" }
41
+
42
+ # Print deprecation notices to the stderr.
43
+ config.active_support.deprecation = :stderr
44
+
45
+ # Raises error for missing translations.
46
+ # config.i18n.raise_on_missing_translations = true
47
+
48
+ # Annotate rendered view with file names.
49
+ # config.action_view.annotate_rendered_view_with_filenames = true
50
+
51
+ # Raise error when a before_action's only/except options reference missing actions.
52
+ config.action_controller.raise_on_missing_callback_actions = true
53
+ end
@@ -0,0 +1,7 @@
1
+ # Pin npm packages by running ./bin/importmap
2
+
3
+ pin "application"
4
+ pin "@hotwired/turbo-rails", to: "turbo.min.js"
5
+ pin "@hotwired/stimulus", to: "stimulus.min.js"
6
+ pin "@hotwired/stimulus-loading", to: "stimulus-loading.js"
7
+ pin_all_from "app/javascript/controllers", under: "controllers"
@@ -0,0 +1,275 @@
1
+ ActiveAdmin.setup do |config|
2
+ # == Site Title
3
+ #
4
+ # Set the title that is displayed on the main layout
5
+ # for each of the active admin pages. Can also be customized
6
+ # by extracting the _site_header partial into your project
7
+ # to use your own logo, styles, etc.
8
+ #
9
+ config.site_title = "Demo"
10
+
11
+ # == Load Paths
12
+ #
13
+ # By default Active Admin files go inside app/admin/.
14
+ # You can change this directory.
15
+ #
16
+ # eg:
17
+ # config.load_paths = [File.join(Rails.root, 'app', 'ui')]
18
+ #
19
+ # Or, you can also load more directories.
20
+ # Useful when setting namespaces with users that are not your main AdminUser entity.
21
+ #
22
+ # eg:
23
+ # config.load_paths = [
24
+ # File.join(Rails.root, 'app', 'admin'),
25
+ # File.join(Rails.root, 'app', 'cashier')
26
+ # ]
27
+
28
+ # == Default Namespace
29
+ #
30
+ # Set the default namespace each administration resource
31
+ # will be added to.
32
+ #
33
+ # eg:
34
+ # config.default_namespace = :hello_world
35
+ #
36
+ # This will create resources in the HelloWorld module and
37
+ # will namespace routes to /hello_world/*
38
+ #
39
+ # To set no namespace by default, use:
40
+ # config.default_namespace = false
41
+ #
42
+ # Default:
43
+ # config.default_namespace = :admin
44
+ #
45
+ # You can customize the settings for each namespace by using
46
+ # a namespace block. For example, to change the site title
47
+ # within a namespace:
48
+ #
49
+ # config.namespace :admin do |admin|
50
+ # admin.site_title = "Custom Admin Title"
51
+ # end
52
+ #
53
+ # This will ONLY change the title for the admin section. Other
54
+ # namespaces will continue to use the main "site_title" configuration.
55
+
56
+ # == User Authentication
57
+ #
58
+ # Active Admin will automatically call an authentication
59
+ # method in a before filter of all controller actions to
60
+ # ensure that there is a currently logged in admin user.
61
+ #
62
+ # This setting changes the method which Active Admin calls
63
+ # within the application controller.
64
+ # config.authentication_method = :authenticate_admin_user!
65
+
66
+ # == User Authorization
67
+ #
68
+ # Active Admin will automatically call an authorization
69
+ # method in a before filter of all controller actions to
70
+ # ensure that there is a user with proper rights. You can use
71
+ # CanCanAdapter, PunditAdapter, or make your own. Please
72
+ # refer to the documentation.
73
+ # config.authorization_adapter = ActiveAdmin::CanCanAdapter
74
+ # config.authorization_adapter = ActiveAdmin::PunditAdapter
75
+
76
+ # In case you prefer Pundit over other solutions you can here pass
77
+ # the name of default policy class. This policy will be used in every
78
+ # case when Pundit is unable to find suitable policy.
79
+ # config.pundit_default_policy = "MyDefaultPunditPolicy"
80
+
81
+ # If you wish to maintain a separate set of Pundit policies for admin
82
+ # resources, you may set a namespace here that Pundit will search
83
+ # within when looking for a resource's policy.
84
+ # config.pundit_policy_namespace = :admin
85
+
86
+ # You can customize your CanCan Ability class name here.
87
+ # config.cancan_ability_class = "Ability"
88
+
89
+ # You can specify a method to be called on unauthorized access.
90
+ # This is necessary in order to prevent a redirect loop which happens
91
+ # because, by default, user gets redirected to Dashboard. If user
92
+ # doesn't have access to Dashboard, he'll end up in a redirect loop.
93
+ # Method provided here should be defined in application_controller.rb.
94
+ # config.on_unauthorized_access = :access_denied
95
+
96
+ # == Current User
97
+ #
98
+ # Active Admin will associate actions with the current
99
+ # user performing them.
100
+ #
101
+ # This setting changes the method which Active Admin calls
102
+ # (within the application controller) to return the currently logged in user.
103
+ # config.current_user_method = :current_admin_user
104
+
105
+ # == Logging Out
106
+ #
107
+ # Active Admin displays a logout link on each screen. These
108
+ # settings configure the location and method used for the link.
109
+ #
110
+ # This setting changes the path where the link points to. If it's
111
+ # a string, the string is used as the path. If it's a Symbol, we
112
+ # will call the method to return the path.
113
+ #
114
+ # Default:
115
+ config.logout_link_path = :destroy_admin_user_session_path
116
+
117
+ # == Root
118
+ #
119
+ # Set the action to call for the root path. You can set different
120
+ # roots for each namespace.
121
+ #
122
+ # Default:
123
+ # config.root_to = 'dashboard#index'
124
+
125
+ # == Admin Comments
126
+ #
127
+ # This allows your users to comment on any resource registered with Active Admin.
128
+ #
129
+ # You can completely disable comments:
130
+ # config.comments = false
131
+ #
132
+ # You can change the name under which comments are registered:
133
+ # config.comments_registration_name = 'AdminComment'
134
+ #
135
+ # You can change the order for the comments and you can change the column
136
+ # to be used for ordering:
137
+ # config.comments_order = 'created_at ASC'
138
+ #
139
+ # You can disable the menu item for the comments index page:
140
+ # config.comments_menu = false
141
+ #
142
+ # You can customize the comment menu:
143
+ # config.comments_menu = { parent: 'Admin', priority: 1 }
144
+
145
+ # == Batch Actions
146
+ #
147
+ # Enable and disable Batch Actions
148
+ #
149
+ config.batch_actions = true
150
+
151
+ # == Controller Filters
152
+ #
153
+ # You can add before, after and around filters to all of your
154
+ # Active Admin resources and pages from here.
155
+ #
156
+ # config.before_action :do_something_awesome
157
+
158
+ # == Attribute Filters
159
+ #
160
+ # You can exclude possibly sensitive model attributes from being displayed,
161
+ # added to forms, or exported by default by ActiveAdmin
162
+ #
163
+ config.filter_attributes = [ :encrypted_password, :password, :password_confirmation ]
164
+
165
+ # == Localize Date/Time Format
166
+ #
167
+ # Set the localize format to display dates and times.
168
+ # To understand how to localize your app with I18n, read more at
169
+ # https://guides.rubyonrails.org/i18n.html
170
+ #
171
+ # You can run `bin/rails runner 'puts I18n.t("date.formats")'` to see the
172
+ # available formats in your application.
173
+ #
174
+ config.localize_format = :long
175
+
176
+ # == Removing Breadcrumbs
177
+ #
178
+ # Breadcrumbs are enabled by default. You can customize them for individual
179
+ # resources or you can disable them globally from here.
180
+ #
181
+ # config.breadcrumb = false
182
+
183
+ # == Create Another Checkbox
184
+ #
185
+ # Create another checkbox is disabled by default. You can customize it for individual
186
+ # resources or you can enable them globally from here.
187
+ #
188
+ # config.create_another = true
189
+
190
+ # == CSV options
191
+ #
192
+ # Set the CSV builder separator
193
+ # config.csv_options = { col_sep: ';' }
194
+ #
195
+ # Force the use of quotes
196
+ # config.csv_options = { force_quotes: true }
197
+
198
+ # == Menu System
199
+ #
200
+ # You can add a navigation menu to be used in your application, or configure a provided menu
201
+ #
202
+ # If you wanted to add a static menu item to the default menu provided:
203
+ #
204
+ # config.namespace :admin do |admin|
205
+ # admin.build_menu :default do |menu|
206
+ # menu.add label: "My Great Website", url: "https://mygreatwebsite.example.com", html_options: { target: "_blank" }
207
+ # end
208
+ # end
209
+
210
+ # == Download Links
211
+ #
212
+ # You can disable download links on resource listing pages,
213
+ # or customize the formats shown per namespace/globally
214
+ #
215
+ # To disable/customize for the :admin namespace:
216
+ #
217
+ # config.namespace :admin do |admin|
218
+ #
219
+ # # Disable the links entirely
220
+ # admin.download_links = false
221
+ #
222
+ # # Only show XML & PDF options. You must register the format mime type with `Mime::Type.register`.
223
+ # admin.download_links = [:xml, :pdf]
224
+ #
225
+ # # Enable/disable the links based on block (for example, with cancan)
226
+ # admin.download_links = proc { can?(:view_download_links) }
227
+ #
228
+ # end
229
+
230
+ # == Pagination
231
+ #
232
+ # Pagination is enabled by default for all resources.
233
+ # You can control the default per page count for all resources here.
234
+ #
235
+ # config.default_per_page = 30
236
+ #
237
+ # You can control the max per page count too.
238
+ #
239
+ # config.max_per_page = 10_000
240
+
241
+ # == Filters
242
+ #
243
+ # By default the index screen includes a "Filters" sidebar on the right
244
+ # hand side with a filter for each attribute of the registered model.
245
+ # You can enable or disable them for all resources here.
246
+ #
247
+ # config.filters = true
248
+ #
249
+ # By default the filters include associations in a select, which means
250
+ # that every record will be loaded for each association (up
251
+ # to the value of config.maximum_association_filter_arity).
252
+ # You can enabled or disable the inclusion
253
+ # of those filters by default here.
254
+ #
255
+ # config.include_default_association_filters = true
256
+
257
+ # config.maximum_association_filter_arity = 256 # default value of :unlimited will change to 256 in a future version
258
+ # config.filter_columns_for_large_association = [
259
+ # :display_name,
260
+ # :full_name,
261
+ # :name,
262
+ # :username,
263
+ # :login,
264
+ # :title,
265
+ # :email,
266
+ # ]
267
+ # config.filter_method_for_large_association = '_start'
268
+
269
+ # == Sorting
270
+ #
271
+ # By default ActiveAdmin::OrderClause is used for sorting logic
272
+ # You can inherit it with own class and inject it for all resources
273
+ #
274
+ # config.order_clause = MyOrderClause
275
+ end