iron_admin 0.5.0 → 0.6.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.
- checksums.yaml +4 -4
- data/app/assets/config/iron_admin_manifest.js +12 -0
- data/app/components/iron_admin/dashboards/metric_card_component.html.haml +8 -3
- data/app/components/iron_admin/dashboards/metric_card_component.rb +21 -1
- data/app/components/iron_admin/form/belongs_to_component.rb +60 -6
- data/app/components/iron_admin/form/nested_form_component.html.haml +28 -0
- data/app/components/iron_admin/form/nested_form_component.rb +81 -0
- data/app/components/iron_admin/resources/data_table_component.html.haml +1 -1
- data/app/components/iron_admin/resources/data_table_component.rb +6 -0
- data/app/components/iron_admin/resources/show_field_component.rb +2 -0
- data/app/controllers/iron_admin/application_controller.rb +32 -1
- data/app/controllers/iron_admin/concerns/action_executable.rb +44 -0
- data/app/controllers/iron_admin/concerns/filterable.rb +84 -0
- data/app/controllers/iron_admin/concerns/json_params_coercion.rb +67 -0
- data/app/controllers/iron_admin/concerns/nested_permittable.rb +36 -0
- data/app/controllers/iron_admin/concerns/scopeable.rb +84 -0
- data/app/controllers/iron_admin/concerns/searchable.rb +13 -16
- data/app/controllers/iron_admin/exports_controller.rb +15 -11
- data/app/controllers/iron_admin/imports_controller.rb +83 -0
- data/app/controllers/iron_admin/live_controller.rb +12 -0
- data/app/controllers/iron_admin/resources_controller.rb +118 -117
- data/app/controllers/iron_admin/search_controller.rb +5 -5
- data/app/controllers/iron_admin/tools_controller.rb +63 -4
- data/app/helpers/iron_admin/application_helper.rb +33 -14
- data/app/helpers/iron_admin/field_display_helper.rb +160 -1
- data/app/javascript/iron_admin/controllers/cp_nested_form_controller.js +113 -0
- data/app/javascript/iron_admin/controllers/filter_operator_controller.js +10 -0
- data/app/javascript/iron_admin/index.js +4 -0
- data/app/views/iron_admin/dashboard/index.html.haml +7 -2
- data/app/views/iron_admin/form/_nested_row.html.haml +70 -0
- data/app/views/iron_admin/imports/new.html.haml +27 -0
- data/app/views/iron_admin/imports/preview.html.haml +31 -0
- data/app/views/iron_admin/resources/_form.html.haml +81 -5
- data/app/views/iron_admin/resources/action_form.html.haml +62 -0
- data/app/views/iron_admin/resources/bulk_action_form.html.haml +62 -0
- data/app/views/iron_admin/resources/index.html.haml +60 -18
- data/app/views/iron_admin/tools/action_form.html.haml +57 -0
- data/app/views/iron_admin/tools/show.html.haml +20 -1
- data/config/importmap.rb +2 -0
- data/config/locales/en.yml +36 -0
- data/config/routes.rb +7 -0
- data/docs/components/filter-components.md +60 -0
- data/docs/getting-started/quick-start.md +17 -1
- data/docs/guides/authentication.md +7 -6
- data/docs/guides/custom-adapters.md +628 -0
- data/docs/guides/extending.md +132 -3
- data/docs/guides/fields.md +1 -1
- data/docs/guides/resources.md +78 -2
- data/docs/guides/troubleshooting.md +29 -0
- data/docs/reference/routes.md +10 -0
- data/lib/generators/iron_admin/install/install_generator.rb +28 -4
- data/lib/generators/iron_admin/install_audit/install_audit_generator.rb +26 -10
- data/lib/iron_admin/action_field.rb +56 -0
- data/lib/iron_admin/adapters/active_record.rb +237 -0
- data/lib/iron_admin/adapters/base.rb +340 -0
- data/lib/iron_admin/adapters/http/column_descriptor.rb +10 -0
- data/lib/iron_admin/adapters/http/configuration.rb +27 -0
- data/lib/iron_admin/adapters/http/connection.rb +117 -0
- data/lib/iron_admin/adapters/http/model_proxy.rb +75 -0
- data/lib/iron_admin/adapters/http/query.rb +111 -0
- data/lib/iron_admin/adapters/http/record.rb +83 -0
- data/lib/iron_admin/adapters/http/type_inferrer.rb +51 -0
- data/lib/iron_admin/adapters/http.rb +241 -0
- data/lib/iron_admin/adapters/mongoid/association_wrapper.rb +74 -0
- data/lib/iron_admin/adapters/mongoid/column_descriptor.rb +10 -0
- data/lib/iron_admin/adapters/mongoid.rb +284 -0
- data/lib/iron_admin/adapters/registry.rb +44 -0
- data/lib/iron_admin/concerns/importable.rb +81 -0
- data/lib/iron_admin/concerns/live_updatable.rb +38 -0
- data/lib/iron_admin/concerns/nestable.rb +69 -0
- data/lib/iron_admin/concerns/soft_deletable.rb +61 -0
- data/lib/iron_admin/configuration.rb +20 -0
- data/lib/iron_admin/dashboard.rb +15 -20
- data/lib/iron_admin/engine.rb +28 -1
- data/lib/iron_admin/errors.rb +29 -0
- data/lib/iron_admin/field_inferrer.rb +61 -22
- data/lib/iron_admin/filters/active_record_query_builder.rb +63 -0
- data/lib/iron_admin/filters/base_query_builder.rb +55 -0
- data/lib/iron_admin/filters/http_query_builder.rb +39 -0
- data/lib/iron_admin/filters/mongoid_query_builder.rb +58 -0
- data/lib/iron_admin/filters/query_builder.rb +12 -0
- data/lib/iron_admin/import/column_mapper.rb +42 -0
- data/lib/iron_admin/import/import_preview.rb +10 -0
- data/lib/iron_admin/import/import_result.rb +10 -0
- data/lib/iron_admin/import/importer.rb +231 -0
- data/lib/iron_admin/import/parser/csv.rb +34 -0
- data/lib/iron_admin/import/parser/json.rb +36 -0
- data/lib/iron_admin/import/type_caster.rb +47 -0
- data/lib/iron_admin/live/broadcaster.rb +43 -0
- data/lib/iron_admin/live/poll_cache.rb +28 -0
- data/lib/iron_admin/live.rb +29 -0
- data/lib/iron_admin/nested_association.rb +15 -0
- data/lib/iron_admin/nested_attributes_validator.rb +25 -0
- data/lib/iron_admin/policy.rb +72 -13
- data/lib/iron_admin/resource.rb +148 -90
- data/lib/iron_admin/resource_registry.rb +77 -4
- data/lib/iron_admin/tool.rb +50 -0
- data/lib/iron_admin/tool_action.rb +73 -0
- data/lib/iron_admin/tool_context.rb +49 -0
- data/lib/iron_admin/version.rb +1 -1
- data/lib/iron_admin.rb +28 -0
- data/vendor/bundle/ruby/3.2.0/cache/addressable-2.9.0.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/crack-1.0.1.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/faraday-2.14.1.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/faraday-net_http-3.4.2.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/hashdiff-1.2.1.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/net-http-0.9.1.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/public_suffix-7.0.5.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/rexml-3.4.4.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/cache/webmock-3.26.2.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/bigdecimal-4.0.1/bigdecimal.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/bigdecimal-4.0.1/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/bigdecimal-4.0.1/mkmf.log +25 -25
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/date_core.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/mkmf.log +4 -4
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/erb-6.0.1/erb/escape.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/erb-6.0.1/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/erb-6.0.1/mkmf.log +2 -2
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.8.2/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.8.2/io/console.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.8.2/mkmf.log +22 -22
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/json-2.18.1/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/json-2.18.1/json/ext/generator.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/json-2.18.1/json/ext/parser.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/json-2.18.1/mkmf.log +9 -9
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/nio4r-2.7.5/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/nio4r-2.7.5/mkmf.log +12 -12
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/nio4r-2.7.5/nio4r_ext.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/prism-1.9.0/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/prism-1.9.0/mkmf.log +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/prism-1.9.0/prism/prism.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.3.1/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.3.1/mkmf.log +7 -7
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.3.1/psych.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/racc/cparse.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/redcarpet-3.6.1/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/redcarpet-3.6.1/redcarpet.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/mkmf.log +2 -2
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/stringio.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/websocket-driver-0.8.0/gem_make.out +6 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/websocket-driver-0.8.0/websocket_mask.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/CHANGELOG.md +326 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/LICENSE.txt +202 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/README.md +121 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable/idna/native.rb +66 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable/idna/pure.rb +4710 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable/idna.rb +26 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable/template.rb +1040 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable/uri.rb +2602 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable/version.rb +31 -0
- data/vendor/bundle/ruby/3.2.0/gems/addressable-2.9.0/lib/addressable.rb +4 -0
- data/vendor/bundle/ruby/3.2.0/gems/bigdecimal-4.0.1/ext/bigdecimal/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/bigdecimal-4.0.1/lib/bigdecimal.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/History +58 -0
- data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/LICENSE +20 -0
- data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/README.md +43 -0
- data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/lib/crack/json.rb +113 -0
- data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/lib/crack/util.rb +17 -0
- data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/lib/crack/version.rb +3 -0
- data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/lib/crack/xml.rb +240 -0
- data/vendor/bundle/ruby/3.2.0/gems/crack-1.0.1/lib/crack.rb +8 -0
- data/vendor/bundle/ruby/3.2.0/gems/date-3.5.1/ext/date/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/date-3.5.1/lib/date_core.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/erb-6.0.1/ext/erb/escape/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/erb-6.0.1/lib/erb/escape.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/CHANGELOG.md +574 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/LICENSE.md +20 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/README.md +67 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/Rakefile +12 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/examples/client_spec.rb +119 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/examples/client_test.rb +144 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/adapter/test.rb +311 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/adapter.rb +101 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/adapter_registry.rb +30 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/connection.rb +565 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/encoders/flat_params_encoder.rb +105 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/encoders/nested_params_encoder.rb +183 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/error.rb +202 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/logging/formatter.rb +118 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/methods.rb +6 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/middleware.rb +72 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/middleware_registry.rb +83 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/options/connection_options.rb +23 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/options/env.rb +204 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/options/proxy_options.rb +38 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/options/request_options.rb +23 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/options/ssl_options.rb +76 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/options.rb +219 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/parameters.rb +5 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/rack_builder.rb +248 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/request/authorization.rb +54 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/request/instrumentation.rb +58 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/request/json.rb +70 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/request/url_encoded.rb +60 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/request.rb +139 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/response/json.rb +74 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/response/logger.rb +39 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/response/raise_error.rb +83 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/response.rb +95 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/utils/headers.rb +150 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/utils/params_hash.rb +61 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/utils.rb +121 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday/version.rb +5 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/lib/faraday.rb +158 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/external_adapters/faraday_specs_setup.rb +14 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/adapter/test_spec.rb +442 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/adapter_registry_spec.rb +28 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/adapter_spec.rb +55 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/connection_spec.rb +841 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/error_spec.rb +175 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/middleware_registry_spec.rb +31 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/middleware_spec.rb +213 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/options/env_spec.rb +76 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/options/options_spec.rb +297 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/options/proxy_options_spec.rb +79 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/options/request_options_spec.rb +19 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/params_encoders/flat_spec.rb +42 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/params_encoders/nested_spec.rb +151 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/rack_builder_spec.rb +317 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/request/authorization_spec.rb +118 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/request/instrumentation_spec.rb +74 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/request/json_spec.rb +199 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/request/url_encoded_spec.rb +93 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/request_spec.rb +110 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/response/json_spec.rb +206 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/response/logger_spec.rb +299 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/response/raise_error_spec.rb +286 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/response_spec.rb +84 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/utils/headers_spec.rb +109 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday/utils_spec.rb +120 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/faraday_spec.rb +43 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/spec_helper.rb +133 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/disabling_stub.rb +14 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/fake_safe_buffer.rb +15 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/faraday_middleware_subclasses.rb +18 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/helper_methods.rb +96 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/shared_examples/adapter.rb +105 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/shared_examples/params_encoder.rb +18 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/shared_examples/request_method.rb +263 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-2.14.1/spec/support/streaming_response_checker.rb +35 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-net_http-3.4.2/LICENSE.md +21 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-net_http-3.4.2/README.md +57 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-net_http-3.4.2/lib/faraday/adapter/net_http.rb +206 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-net_http-3.4.2/lib/faraday/net_http/version.rb +7 -0
- data/vendor/bundle/ruby/3.2.0/gems/faraday-net_http-3.4.2/lib/faraday/net_http.rb +10 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/Gemfile +8 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/LICENSE +19 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/README.md +323 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/Rakefile +18 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/changelog.md +127 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/hashdiff.gemspec +39 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/compare_hashes.rb +101 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/diff.rb +185 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/lcs.rb +66 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/lcs_compare_arrays.rb +32 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/linear_compare_array.rb +159 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/patch.rb +88 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/util.rb +155 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff/version.rb +5 -0
- data/vendor/bundle/ruby/3.2.0/gems/hashdiff-1.2.1/lib/hashdiff.rb +10 -0
- data/vendor/bundle/ruby/3.2.0/gems/io-console-0.8.2/ext/io/console/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/io-console-0.8.2/lib/io/console.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/json-2.18.1/ext/json/ext/generator/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/json-2.18.1/ext/json/ext/parser/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/json-2.18.1/lib/json/ext/generator.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/json-2.18.1/lib/json/ext/parser.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/BSDL +22 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/COPYING +56 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/README.md +93 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/doc/net-http/examples.rdoc +31 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/doc/net-http/included_getters.rdoc +3 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/exceptions.rb +35 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/generic_request.rb +429 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/header.rb +985 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/proxy_delta.rb +17 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/request.rb +88 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/requests.rb +444 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/response.rb +739 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/responses.rb +1242 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http/status.rb +84 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/http.rb +2608 -0
- data/vendor/bundle/ruby/3.2.0/gems/net-http-0.9.1/lib/net/https.rb +23 -0
- data/vendor/bundle/ruby/3.2.0/gems/nio4r-2.7.5/ext/nio4r/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/nio4r-2.7.5/lib/nio4r_ext.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/prism-1.9.0/ext/prism/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/prism-1.9.0/lib/prism/prism.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/psych-5.3.1/ext/psych/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/psych-5.3.1/lib/psych.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/CHANGELOG.md +649 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/Gemfile +16 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/README.md +231 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/SECURITY.md +24 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/data/list.txt +16298 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/lib/public_suffix/domain.rb +235 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/lib/public_suffix/errors.rb +41 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/lib/public_suffix/list.rb +247 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/lib/public_suffix/rule.rb +350 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/lib/public_suffix/version.rb +14 -0
- data/vendor/bundle/ruby/3.2.0/gems/public_suffix-7.0.5/lib/public_suffix.rb +177 -0
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.8.1/ext/racc/cparse/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/racc-1.8.1/lib/racc/cparse.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/redcarpet-3.6.1/ext/redcarpet/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/redcarpet-3.6.1/lib/redcarpet.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/NEWS.md +843 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/README.md +57 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/context.rdoc +143 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/rdoc/child.rdoc +87 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/rdoc/document.rdoc +276 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/rdoc/element.rdoc +602 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/rdoc/node.rdoc +97 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/rdoc/parent.rdoc +267 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/child_toc.rdoc +12 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/document_toc.rdoc +30 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/element_toc.rdoc +55 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/master_toc.rdoc +135 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/node_toc.rdoc +16 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tasks/tocs/parent_toc.rdoc +25 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/doc/rexml/tutorial.rdoc +1358 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/attlistdecl.rb +63 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/attribute.rb +210 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/cdata.rb +68 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/child.rb +96 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/comment.rb +80 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/doctype.rb +306 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/document.rb +471 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/dtd/attlistdecl.rb +11 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/dtd/dtd.rb +47 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/dtd/elementdecl.rb +18 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/dtd/entitydecl.rb +57 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/dtd/notationdecl.rb +40 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/element.rb +2578 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/encoding.rb +48 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/entity.rb +142 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/formatters/default.rb +116 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/formatters/pretty.rb +142 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/formatters/transitive.rb +58 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/functions.rb +446 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/instruction.rb +79 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/light/node.rb +188 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/namespace.rb +63 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/node.rb +80 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/output.rb +30 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parent.rb +166 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parseexception.rb +53 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/baseparser.rb +949 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/lightparser.rb +59 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/pullparser.rb +213 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/sax2parser.rb +270 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/streamparser.rb +67 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/treeparser.rb +89 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/ultralightparser.rb +57 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/parsers/xpathparser.rb +739 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/quickpath.rb +267 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/rexml.rb +39 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/sax2listener.rb +98 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/security.rb +28 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/source.rb +388 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/streamlistener.rb +93 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/text.rb +420 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/undefinednamespaceexception.rb +9 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/validation/relaxng.rb +540 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/validation/validation.rb +144 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/validation/validationexception.rb +10 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/xmldecl.rb +130 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/xmltokens.rb +85 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/xpath.rb +70 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml/xpath_parser.rb +980 -0
- data/vendor/bundle/ruby/3.2.0/gems/rexml-3.4.4/lib/rexml.rb +3 -0
- data/vendor/bundle/ruby/3.2.0/gems/stringio-3.2.0/ext/stringio/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/stringio-3.2.0/lib/stringio.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/CHANGELOG.md +2148 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/LICENSE +20 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/README.md +1229 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/api.rb +111 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/assertion_failure.rb +13 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/callback_registry.rb +37 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/config.rb +20 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/cucumber.rb +12 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/deprecation.rb +11 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/errors.rb +19 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/async_http_client_adapter.rb +228 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/curb_adapter.rb +354 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/em_http_request_adapter.rb +239 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/excon_adapter.rb +167 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_lib_adapter.rb +9 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_lib_adapter_registry.rb +21 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_rb/client.rb +17 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_rb/request.rb +28 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_rb/response.rb +95 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_rb/streamer.rb +44 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_rb/webmock.rb +77 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/http_rb_adapter.rb +39 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/httpclient_adapter.rb +260 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/manticore_adapter.rb +147 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/net_http.rb +310 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/net_http_response.rb +36 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/patron_adapter.rb +132 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/http_lib_adapters/typhoeus_hydra_adapter.rb +190 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/matchers/any_arg_matcher.rb +15 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/matchers/hash_argument_matcher.rb +23 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/matchers/hash_excluding_matcher.rb +17 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/matchers/hash_including_matcher.rb +19 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/minitest.rb +43 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/rack_response.rb +73 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_body_diff.rb +66 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_execution_verifier.rb +79 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_pattern.rb +428 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_registry.rb +37 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_signature.rb +56 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_signature_snippet.rb +63 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/request_stub.rb +134 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/response.rb +161 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/responses_sequence.rb +42 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/rspec/matchers/request_pattern_matcher.rb +80 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/rspec/matchers/webmock_matcher.rb +69 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/rspec/matchers.rb +29 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/rspec.rb +44 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/stub_registry.rb +84 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/stub_request_snippet.rb +40 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/test_unit.rb +22 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/hash_counter.rb +45 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/hash_keys_stringifier.rb +27 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/hash_validator.rb +19 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/headers.rb +77 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/parsers/json.rb +72 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/parsers/parse_error.rb +7 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/parsers/xml.rb +16 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/query_mapper.rb +283 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/uri.rb +113 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/values_stringifier.rb +22 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/util/version_checker.rb +113 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/version.rb +5 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock/webmock.rb +175 -0
- data/vendor/bundle/ruby/3.2.0/gems/webmock-3.26.2/lib/webmock.rb +61 -0
- data/vendor/bundle/ruby/3.2.0/gems/websocket-driver-0.8.0/ext/websocket-driver/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/websocket-driver-0.8.0/lib/websocket_mask.so +0 -0
- data/vendor/bundle/ruby/3.2.0/specifications/addressable-2.9.0.gemspec +29 -0
- data/vendor/bundle/ruby/3.2.0/specifications/crack-1.0.1.gemspec +27 -0
- data/vendor/bundle/ruby/3.2.0/specifications/faraday-2.14.1.gemspec +0 -0
- data/vendor/bundle/ruby/3.2.0/specifications/faraday-net_http-3.4.2.gemspec +26 -0
- data/vendor/bundle/ruby/3.2.0/specifications/hashdiff-1.2.1.gemspec +30 -0
- data/vendor/bundle/ruby/3.2.0/specifications/net-http-0.9.1.gemspec +27 -0
- data/vendor/bundle/ruby/3.2.0/specifications/public_suffix-7.0.5.gemspec +24 -0
- data/vendor/bundle/ruby/3.2.0/specifications/rexml-3.4.4.gemspec +25 -0
- data/vendor/bundle/ruby/3.2.0/specifications/webmock-3.26.2.gemspec +44 -0
- metadata +377 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cd7c68ca4e035fc4fe1b47d4c3415e76dcbb9ba77a53e9a574abe55a7e3bd6c9
|
|
4
|
+
data.tar.gz: 95ef292dd61db7778af10963a749cc63a9f67e9ecda2a8f115207522ffb28caf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 056e8a6cf97e585a4d979e303aa2a9ca10618b50e6fb75a5f61d5c52070adb7d8d4ae65498eefad9346700eb8ad629a11203a8fc940bd0f96cf44065e2b02b3e
|
|
7
|
+
data.tar.gz: 419a9faf097e0a4f0beab00624eb7e79876cb1b6fbce0d61703dd13f3d879b102586d1271bb58073e7da1dd7cb0709776b625f9cfefaaac41881ecb9be79c259
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Sprockets manifest for IronAdmin engine assets.
|
|
2
|
+
// Engine initializer adds this manifest to the host's precompile list,
|
|
3
|
+
// recursively pulling these assets into Sprockets' precompile set.
|
|
4
|
+
|
|
5
|
+
// Stimulus / importmap entry point + controllers.
|
|
6
|
+
//= link_tree ../../javascript/iron_admin .js
|
|
7
|
+
|
|
8
|
+
// Chart.js (vendored) — loaded by the dashboard layout via
|
|
9
|
+
// `javascript_include_tag "chart.min"`. Without this link, hosts on
|
|
10
|
+
// sprockets-rails 500 on `/admin` with
|
|
11
|
+
// `Asset 'chart.min.js' was not declared to be precompiled`.
|
|
12
|
+
//= link chart.min.js
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
.bg-white.rounded-lg.shadow.p-6
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
.bg-white.rounded-lg.shadow.p-6{ id: (live_target_id if live?) }
|
|
2
|
+
.flex.items-center.justify-between
|
|
3
|
+
%div
|
|
4
|
+
%p.text-sm.font-medium.text-gray-500= label
|
|
5
|
+
%p.mt-2.text-3xl.font-bold.text-gray-900= formatted_value
|
|
6
|
+
- if icon
|
|
7
|
+
.flex-shrink-0.p-3.bg-indigo-50.rounded-lg
|
|
8
|
+
= heroicon icon, variant: :outline, options: { class: "h-6 w-6 text-indigo-600" }
|
|
@@ -7,10 +7,14 @@ module IronAdmin
|
|
|
7
7
|
# @param name [String, Symbol] Metric name
|
|
8
8
|
# @param value [Numeric] Metric value
|
|
9
9
|
# @param format [Symbol] Format (:number, :currency, :percentage)
|
|
10
|
-
|
|
10
|
+
# @param icon [String, nil] Optional Heroicon name (e.g., "users", "currency-dollar")
|
|
11
|
+
# @param live [Boolean] Whether to render a stable Turbo Stream target id
|
|
12
|
+
def initialize(name:, value:, format: :number, icon: nil, live: false)
|
|
11
13
|
@name = name
|
|
12
14
|
@value = value
|
|
13
15
|
@format = format
|
|
16
|
+
@icon = icon
|
|
17
|
+
@live = live
|
|
14
18
|
end
|
|
15
19
|
|
|
16
20
|
# @api private
|
|
@@ -28,6 +32,22 @@ module IronAdmin
|
|
|
28
32
|
def label
|
|
29
33
|
@name.to_s.humanize
|
|
30
34
|
end
|
|
35
|
+
|
|
36
|
+
# @api private
|
|
37
|
+
# @return [Boolean] True when the metric should expose a live target
|
|
38
|
+
def live?
|
|
39
|
+
@live
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# @api private
|
|
43
|
+
# @return [String] Stable Turbo Stream target id
|
|
44
|
+
def live_target_id
|
|
45
|
+
"metric_#{@name.to_s.parameterize(separator: "_")}"
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# @api private
|
|
49
|
+
# @return [String, nil] Heroicon name
|
|
50
|
+
attr_reader :icon
|
|
31
51
|
end
|
|
32
52
|
end
|
|
33
53
|
end
|
|
@@ -15,6 +15,12 @@ module IronAdmin
|
|
|
15
15
|
# @return [Integer]
|
|
16
16
|
DEFAULT_OPTIONS_LIMIT = 100
|
|
17
17
|
|
|
18
|
+
# Methods tried (in order) when no explicit `display_method:` is
|
|
19
|
+
# passed, or when the explicit method returns a blank value.
|
|
20
|
+
# Single source of truth lives on `IronAdmin::ApplicationHelper`
|
|
21
|
+
# so forms and show/index pages can never silently drift apart.
|
|
22
|
+
DISPLAY_METHOD_FALLBACKS = IronAdmin::ApplicationHelper::DISPLAY_METHODS
|
|
23
|
+
|
|
18
24
|
# @return [String] Select name attribute
|
|
19
25
|
attr_reader :name
|
|
20
26
|
|
|
@@ -45,13 +51,17 @@ module IronAdmin
|
|
|
45
51
|
# @param name [String] Select name
|
|
46
52
|
# @param association_class [Class] Associated model class
|
|
47
53
|
# @param selected [Integer, nil] Selected ID
|
|
48
|
-
# @param display_method [Symbol]
|
|
54
|
+
# @param display_method [Symbol, Proc, nil] Custom display method.
|
|
55
|
+
# Pass `nil` (the default) to let the component auto-detect a
|
|
56
|
+
# sensible label from `IronAdmin::ApplicationHelper::DISPLAY_METHODS`
|
|
57
|
+
# (`:name`, `:title`, `:email`, `:label`, `:slug`), falling back
|
|
58
|
+
# to `"<Model> #<id>"` if none of those exist.
|
|
49
59
|
# @param include_blank [Boolean] Include blank option
|
|
50
60
|
# @param disabled [Boolean] Disabled state
|
|
51
61
|
# @param has_error [Boolean] Error state
|
|
52
62
|
# @param options_limit [Integer] Max options
|
|
53
63
|
# @param options_scope [Proc, nil] Custom scope
|
|
54
|
-
def initialize(name:, association_class:, selected: nil, display_method:
|
|
64
|
+
def initialize(name:, association_class:, selected: nil, display_method: nil,
|
|
55
65
|
include_blank: true, disabled: false, has_error: false,
|
|
56
66
|
options_limit: DEFAULT_OPTIONS_LIMIT, options_scope: nil)
|
|
57
67
|
@name = name
|
|
@@ -74,16 +84,43 @@ module IronAdmin
|
|
|
74
84
|
# @api private
|
|
75
85
|
# @return [Array<Array(String, Integer)>] Options array for select tag
|
|
76
86
|
def options
|
|
77
|
-
scope = options_scope ? association_class.instance_exec(&options_scope) :
|
|
78
|
-
|
|
79
|
-
[record
|
|
87
|
+
scope = options_scope ? association_class.instance_exec(&options_scope) : association_adapter.all
|
|
88
|
+
association_adapter.limit(scope, options_limit).map do |record|
|
|
89
|
+
[option_label_for(record), record.id]
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# @api private
|
|
94
|
+
# Resolves the option label for a single record. Mirrors
|
|
95
|
+
# `IronAdmin::ApplicationHelper#display_record_label` so callers
|
|
96
|
+
# who construct the component directly (or test it without
|
|
97
|
+
# rendering) get the same fallback behavior:
|
|
98
|
+
#
|
|
99
|
+
# 1. Try the explicit `display_method:` (`Proc` or `Symbol`/
|
|
100
|
+
# `String`) and return it if it produces a non-blank value.
|
|
101
|
+
# 2. If the explicit method is absent or returns blank/nil, walk
|
|
102
|
+
# `DISPLAY_METHOD_FALLBACKS` and return the first non-blank one.
|
|
103
|
+
# 3. Otherwise return `"<Model> #<id>"` so the option is at least
|
|
104
|
+
# identifiable.
|
|
105
|
+
#
|
|
106
|
+
# @param record [Object] The associated record
|
|
107
|
+
# @return [String] The label
|
|
108
|
+
def option_label_for(record)
|
|
109
|
+
explicit = explicit_display_value(record)
|
|
110
|
+
return explicit if explicit.present?
|
|
111
|
+
|
|
112
|
+
DISPLAY_METHOD_FALLBACKS.each do |method|
|
|
113
|
+
value = record.public_send(method) if record.respond_to?(method)
|
|
114
|
+
return value if value.present?
|
|
80
115
|
end
|
|
116
|
+
|
|
117
|
+
"#{record.class.model_name.human} ##{record.id}"
|
|
81
118
|
end
|
|
82
119
|
|
|
83
120
|
# @api private
|
|
84
121
|
# @return [Boolean] Whether to show hint about more records available
|
|
85
122
|
def show_search_hint?
|
|
86
|
-
|
|
123
|
+
association_adapter.count > options_limit
|
|
87
124
|
end
|
|
88
125
|
|
|
89
126
|
# @api private
|
|
@@ -105,6 +142,23 @@ module IronAdmin
|
|
|
105
142
|
"stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e\"); background-position: right 0.5rem center; " \
|
|
106
143
|
"background-repeat: no-repeat; background-size: 1.5em 1.5em; padding-right: 2.5rem;"
|
|
107
144
|
end
|
|
145
|
+
|
|
146
|
+
private
|
|
147
|
+
|
|
148
|
+
# Calls the explicit `display_method:` (if any) and returns its
|
|
149
|
+
# result. Returns `nil` when no explicit method is set, so callers
|
|
150
|
+
# can `present?`-check and fall through to the auto-detect chain.
|
|
151
|
+
def explicit_display_value(record)
|
|
152
|
+
case display_method
|
|
153
|
+
when Proc then display_method.call(record)
|
|
154
|
+
when Symbol, String then record.public_send(display_method)
|
|
155
|
+
end
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# @return [IronAdmin::Adapters::Base] Adapter for the associated model
|
|
159
|
+
def association_adapter
|
|
160
|
+
@association_adapter ||= IronAdmin::Adapters::ActiveRecord.new(association_class)
|
|
161
|
+
end
|
|
108
162
|
end
|
|
109
163
|
end
|
|
110
164
|
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
%div{ data: { controller: "cp-nested-form",
|
|
2
|
+
"cp-nested-form-association-name-value": name,
|
|
3
|
+
"cp-nested-form-allow-destroy-value": allow_destroy,
|
|
4
|
+
"cp-nested-form-sortable-value": sortable? } }
|
|
5
|
+
|
|
6
|
+
.flex.items-center.justify-between.mb-4
|
|
7
|
+
%h3.text-base.font-semibold{ class: "#{theme.heading_weight} #{theme.body_text}" }= title
|
|
8
|
+
- if show_add_button?
|
|
9
|
+
%button.inline-flex.items-center.gap-1.px-3.py-1.text-sm.font-medium.rounded-lg.border.border-dashed.cursor-pointer{ type: "button",
|
|
10
|
+
class: "#{theme.link} border-current hover:bg-gray-50",
|
|
11
|
+
data: { action: "cp-nested-form#addRow" } }
|
|
12
|
+
= I18n.t("iron_admin.nested_form.add_button", default: "Add row")
|
|
13
|
+
|
|
14
|
+
-# Hidden template for JS cloning of new rows
|
|
15
|
+
%template{ id: "#{name}-nested-template" }
|
|
16
|
+
- if form
|
|
17
|
+
- new_child = nested_association.reflection.klass.new
|
|
18
|
+
= form.fields_for name, new_child, child_index: template_index do |child_f|
|
|
19
|
+
= render "iron_admin/form/nested_row", child_f: child_f, nested_association: nested_association,
|
|
20
|
+
child: new_child, current_user: current_user
|
|
21
|
+
|
|
22
|
+
-# Existing rows container
|
|
23
|
+
%div{ data: { "cp-nested-form-target": "rowsContainer" } }
|
|
24
|
+
- child_records.each do |child|
|
|
25
|
+
- if form
|
|
26
|
+
= form.fields_for name, child do |child_f|
|
|
27
|
+
= render "iron_admin/form/nested_row", child_f: child_f, nested_association: nested_association,
|
|
28
|
+
child: child, current_user: current_user
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module IronAdmin
|
|
4
|
+
module Form
|
|
5
|
+
# ViewComponent for rendering nested association forms inline within a parent form.
|
|
6
|
+
#
|
|
7
|
+
# Renders existing child records as editable rows and provides a hidden <template>
|
|
8
|
+
# element that JavaScript clones to add new rows dynamically.
|
|
9
|
+
class NestedFormComponent < ViewComponent::Base
|
|
10
|
+
# @return [ActionView::Helpers::FormBuilder] The parent form builder
|
|
11
|
+
attr_reader :form
|
|
12
|
+
|
|
13
|
+
# @return [IronAdmin::NestedAssociation] The nested association configuration
|
|
14
|
+
attr_reader :nested_association
|
|
15
|
+
|
|
16
|
+
# @return [ActiveRecord::Base] The parent record
|
|
17
|
+
attr_reader :record
|
|
18
|
+
|
|
19
|
+
# @return [Object, nil] The current authenticated user
|
|
20
|
+
attr_reader :current_user
|
|
21
|
+
|
|
22
|
+
delegate :name, :kind, :fields, :allow_destroy, :position_field, to: :nested_association
|
|
23
|
+
|
|
24
|
+
# @param form [ActionView::Helpers::FormBuilder] The parent form builder
|
|
25
|
+
# @param nested_association [IronAdmin::NestedAssociation] Nested config
|
|
26
|
+
# @param record [ActiveRecord::Base] The parent record
|
|
27
|
+
# @param current_user [Object, nil] Current user for permission checks
|
|
28
|
+
def initialize(form:, nested_association:, record:, current_user: nil)
|
|
29
|
+
super()
|
|
30
|
+
@form = form
|
|
31
|
+
@nested_association = nested_association
|
|
32
|
+
@record = record
|
|
33
|
+
@current_user = current_user
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# @return [IronAdmin::Configuration::Theme] Theme configuration
|
|
37
|
+
def theme
|
|
38
|
+
IronAdmin.configuration.theme
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# @return [String] Human-readable title for the section header
|
|
42
|
+
def title
|
|
43
|
+
name.to_s.humanize
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# @return [Boolean] Whether to show the "Add" button (has_many only)
|
|
47
|
+
def show_add_button?
|
|
48
|
+
kind == :has_many
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# @return [Boolean] Whether drag-and-drop sorting is enabled
|
|
52
|
+
def sortable?
|
|
53
|
+
position_field.present?
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# @return [String] The placeholder index used in template rows
|
|
57
|
+
def template_index
|
|
58
|
+
"NEW_RECORD_INDEX"
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Returns the child records for the nested association.
|
|
62
|
+
#
|
|
63
|
+
# For has_one, wraps the record in an array or builds a new instance.
|
|
64
|
+
# For has_many with a position_field, sorts by that field ascending.
|
|
65
|
+
# Returns in-memory objects so validation errors are preserved.
|
|
66
|
+
#
|
|
67
|
+
# @return [Array<ActiveRecord::Base>] Child records
|
|
68
|
+
def child_records
|
|
69
|
+
children = record.public_send(name)
|
|
70
|
+
|
|
71
|
+
if kind == :has_one
|
|
72
|
+
[children || nested_association.reflection.klass.new]
|
|
73
|
+
elsif position_field
|
|
74
|
+
children.to_a.sort_by { |c| c.public_send(position_field) || Float::INFINITY }
|
|
75
|
+
else
|
|
76
|
+
children.to_a
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
No records found.
|
|
24
24
|
- else
|
|
25
25
|
- records.each do |record|
|
|
26
|
-
%tr{ class: theme.table_row_hover }
|
|
26
|
+
%tr{ id: row_dom_id(record), class: theme.table_row_hover }
|
|
27
27
|
- visible_fields.each do |field|
|
|
28
28
|
%td.px-6.py-4.whitespace-nowrap.text-sm{ class: theme.body_text }
|
|
29
29
|
= helpers.display_index_field_value(record, field)
|
|
@@ -89,6 +89,12 @@ module IronAdmin
|
|
|
89
89
|
def sort_direction
|
|
90
90
|
current_direction
|
|
91
91
|
end
|
|
92
|
+
|
|
93
|
+
# @api private
|
|
94
|
+
# @return [String] Stable Turbo Stream target id for a record row
|
|
95
|
+
def row_dom_id(record)
|
|
96
|
+
"iron_admin_#{resource_class.resource_name}_row_#{record.id}"
|
|
97
|
+
end
|
|
92
98
|
end
|
|
93
99
|
end
|
|
94
100
|
end
|
|
@@ -13,7 +13,10 @@ module IronAdmin
|
|
|
13
13
|
|
|
14
14
|
before_action :authenticate_iron_admin_user!
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
rescue_from IronAdmin::RecordNotFound, with: :render_not_found
|
|
17
|
+
rescue_from ActionController::ParameterMissing, with: :render_bad_request
|
|
18
|
+
|
|
19
|
+
helper_method :iron_admin_current_user, :iron_admin_filter_param, :iron_admin_active_filter?
|
|
17
20
|
|
|
18
21
|
private
|
|
19
22
|
|
|
@@ -30,5 +33,33 @@ module IronAdmin
|
|
|
30
33
|
|
|
31
34
|
@iron_admin_current_user ||= instance_exec(self, &IronAdmin.configuration.current_user_block)
|
|
32
35
|
end
|
|
36
|
+
|
|
37
|
+
def iron_admin_filter_param(*keys)
|
|
38
|
+
iron_admin_param_dig(params[:filters], *keys)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def iron_admin_active_filter?(filter)
|
|
42
|
+
iron_admin_filter_param(filter[:name]).present? ||
|
|
43
|
+
iron_admin_filter_param("#{filter[:name]}_from").present? ||
|
|
44
|
+
iron_admin_filter_param("#{filter[:name]}_to").present? ||
|
|
45
|
+
(iron_admin_filter_param(filter[:name].to_s).is_a?(ActionController::Parameters) &&
|
|
46
|
+
iron_admin_filter_param(filter[:name].to_s, "value").present?)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def iron_admin_param_dig(value, *keys)
|
|
50
|
+
keys.reduce(value) do |current, key|
|
|
51
|
+
return nil unless current.is_a?(ActionController::Parameters) || current.is_a?(Hash)
|
|
52
|
+
|
|
53
|
+
current[key]
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def render_not_found
|
|
58
|
+
head(:not_found)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def render_bad_request
|
|
62
|
+
head(:bad_request)
|
|
63
|
+
end
|
|
33
64
|
end
|
|
34
65
|
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module IronAdmin
|
|
4
|
+
module Concerns
|
|
5
|
+
# Provides action execution with arity-based dispatch for form params.
|
|
6
|
+
#
|
|
7
|
+
# Supports both legacy 1-arg blocks (backward compat) and 2-arg blocks
|
|
8
|
+
# that receive collected action_form params as the second argument.
|
|
9
|
+
module ActionExecutable
|
|
10
|
+
extend ActiveSupport::Concern
|
|
11
|
+
|
|
12
|
+
private
|
|
13
|
+
|
|
14
|
+
# Dispatches an action block with the correct number of arguments.
|
|
15
|
+
#
|
|
16
|
+
# 1-arg blocks receive only the subject (record or records).
|
|
17
|
+
# 2-arg blocks receive the subject and collected form params.
|
|
18
|
+
#
|
|
19
|
+
# @param block [Proc] The action block
|
|
20
|
+
# @param subject [Object] The record or records
|
|
21
|
+
# @param collected_params [Hash] Collected form params
|
|
22
|
+
# @return [Object] The block's return value
|
|
23
|
+
def call_action_block(block, subject, collected_params)
|
|
24
|
+
if block.arity.in?([1, -1])
|
|
25
|
+
block.call(subject)
|
|
26
|
+
else
|
|
27
|
+
block.call(subject, collected_params)
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Extracts and permits action form params based on declared form_fields.
|
|
32
|
+
#
|
|
33
|
+
# @param action [Hash] The action definition with :form_fields key
|
|
34
|
+
# @return [Hash] Permitted params with symbolized keys, or empty hash
|
|
35
|
+
def action_form_params(action)
|
|
36
|
+
fields = action[:form_fields] || []
|
|
37
|
+
return {} if fields.empty?
|
|
38
|
+
|
|
39
|
+
permitted_keys = fields.map(&:name)
|
|
40
|
+
params.fetch(:action_form, {}).permit(*permitted_keys).to_h.symbolize_keys
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module IronAdmin
|
|
4
|
+
module Concerns
|
|
5
|
+
# Provides filter functionality for resource controllers.
|
|
6
|
+
#
|
|
7
|
+
# Supports flat filters (:select, :boolean), date range filters,
|
|
8
|
+
# and operator-based filters (:string, :number) via QueryBuilder.
|
|
9
|
+
module Filterable
|
|
10
|
+
extend ActiveSupport::Concern
|
|
11
|
+
|
|
12
|
+
included do
|
|
13
|
+
helper_method :iron_admin_visible_filters if respond_to?(:helper_method)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
private
|
|
17
|
+
|
|
18
|
+
# Applies all configured filters to the scope.
|
|
19
|
+
#
|
|
20
|
+
# @param scope [Object] Base query scope (ActiveRecord::Relation or Mongoid::Criteria)
|
|
21
|
+
# @return [Object] Filtered scope
|
|
22
|
+
def apply_filters(scope)
|
|
23
|
+
iron_admin_visible_filters.each do |filter|
|
|
24
|
+
scope = case filter[:type]
|
|
25
|
+
when :string, :number then apply_operator_filter(scope, filter)
|
|
26
|
+
when :date_range then apply_date_range_filter(scope, filter)
|
|
27
|
+
else apply_flat_filter(scope, filter)
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
scope
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def iron_admin_visible_filters
|
|
34
|
+
@iron_admin_visible_filters ||= begin
|
|
35
|
+
resolved_fields = @resource_class.resolved_fields
|
|
36
|
+
resolved_names = resolved_fields.map(&:name)
|
|
37
|
+
visible_names = resolved_fields.select { |field| field.visible?(iron_admin_current_user) }.map(&:name)
|
|
38
|
+
|
|
39
|
+
@resource_class.all_filters.select do |filter|
|
|
40
|
+
filter_name = filter[:name].to_sym
|
|
41
|
+
resolved_names.exclude?(filter_name) || visible_names.include?(filter_name)
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def apply_operator_filter(scope, filter)
|
|
47
|
+
sub = iron_admin_filter_param(filter[:name].to_s)
|
|
48
|
+
return scope unless sub.is_a?(ActionController::Parameters) && sub["value"].present?
|
|
49
|
+
|
|
50
|
+
adapter.query_builder_class.call(scope, filter, sub.to_unsafe_h)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def apply_date_range_filter(scope, filter)
|
|
54
|
+
from = iron_admin_filter_param("#{filter[:name]}_from")
|
|
55
|
+
to = iron_admin_filter_param("#{filter[:name]}_to")
|
|
56
|
+
scope = adapter.filter(scope, filter[:name], parse_date(from)..) if from.present? && parse_date(from)
|
|
57
|
+
scope = adapter.filter(scope, filter[:name], ..parse_date(to)&.end_of_day) if to.present? && parse_date(to)
|
|
58
|
+
scope
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def apply_flat_filter(scope, filter)
|
|
62
|
+
value = iron_admin_filter_param(filter[:name])
|
|
63
|
+
return scope if value.blank?
|
|
64
|
+
return scope unless value.is_a?(String)
|
|
65
|
+
|
|
66
|
+
value = adapter.cast_boolean(value) if filter[:type] == :boolean
|
|
67
|
+
|
|
68
|
+
if filter[:scope]
|
|
69
|
+
filter[:scope].call(value, scope)
|
|
70
|
+
else
|
|
71
|
+
adapter.filter(scope, filter[:name], value)
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def parse_date(value)
|
|
76
|
+
return nil if value.blank?
|
|
77
|
+
|
|
78
|
+
Date.parse(value)
|
|
79
|
+
rescue ArgumentError, TypeError
|
|
80
|
+
nil
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module IronAdmin
|
|
4
|
+
module Concerns
|
|
5
|
+
# Coerces incoming `:json` form params from JSON strings (the textarea
|
|
6
|
+
# content rendered by `_form.html.haml`'s `when :json` branch) back into
|
|
7
|
+
# Ruby `Hash`/`Array`. Without this, the controller would assign the raw
|
|
8
|
+
# textarea string to the model's jsonb/json column, replacing the
|
|
9
|
+
# structured value with a string and silently losing data.
|
|
10
|
+
#
|
|
11
|
+
# Invalid JSON is left as-is so model-side validation can surface the
|
|
12
|
+
# error to the user instead of being swallowed.
|
|
13
|
+
module JsonParamsCoercion
|
|
14
|
+
extend ActiveSupport::Concern
|
|
15
|
+
|
|
16
|
+
private
|
|
17
|
+
|
|
18
|
+
def coerce_json_field_params!(parsed)
|
|
19
|
+
coerce_json_fields!(parsed, form_fields)
|
|
20
|
+
coerce_nested_json_field_params!(parsed)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def coerce_json_fields!(parsed, fields)
|
|
24
|
+
fields.each do |field|
|
|
25
|
+
next unless field.type == :json
|
|
26
|
+
|
|
27
|
+
value = parsed[field.name]
|
|
28
|
+
next unless value.is_a?(String)
|
|
29
|
+
|
|
30
|
+
# An empty textarea means "clear this field". Storing the empty
|
|
31
|
+
# string would serialize to a JSON string scalar (`""`) instead
|
|
32
|
+
# of clearing the column.
|
|
33
|
+
if value.empty?
|
|
34
|
+
parsed[field.name] = nil
|
|
35
|
+
next
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
parsed[field.name] = JSON.parse(value)
|
|
39
|
+
rescue JSON::ParserError
|
|
40
|
+
# Drop the key so the existing column value is preserved instead
|
|
41
|
+
# of being overwritten with the raw string (which AR would then
|
|
42
|
+
# store as a JSON string scalar, silently destroying the prior
|
|
43
|
+
# Hash/Array). The user keeps the form open via model-side
|
|
44
|
+
# validation in the typical case; full inline-error UX is tracked
|
|
45
|
+
# as a follow-up.
|
|
46
|
+
parsed.delete(field.name)
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def coerce_nested_json_field_params!(parsed)
|
|
51
|
+
@resource_class.nested_associations.each do |nested|
|
|
52
|
+
nested_params = parsed[:"#{nested.name}_attributes"]
|
|
53
|
+
next unless nested_params.respond_to?(:each_value)
|
|
54
|
+
|
|
55
|
+
json_fields = nested.fields.select { |field| field.type == :json }
|
|
56
|
+
next if json_fields.empty?
|
|
57
|
+
|
|
58
|
+
child_params_collection = nested.kind == :has_many ? nested_params.each_value : [nested_params]
|
|
59
|
+
|
|
60
|
+
child_params_collection.each do |child_params|
|
|
61
|
+
coerce_json_fields!(child_params, json_fields)
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module IronAdmin
|
|
4
|
+
module Concerns
|
|
5
|
+
# Provides nested attribute strong parameter building for resource controllers.
|
|
6
|
+
module NestedPermittable
|
|
7
|
+
extend ActiveSupport::Concern
|
|
8
|
+
|
|
9
|
+
private
|
|
10
|
+
|
|
11
|
+
# Builds the permit list for a nested association's attributes.
|
|
12
|
+
#
|
|
13
|
+
# Includes all non-readonly field names, :id for matching existing records,
|
|
14
|
+
# :_destroy when allow_destroy is true, and the position_field when present.
|
|
15
|
+
#
|
|
16
|
+
# @param nested [IronAdmin::NestedAssociation]
|
|
17
|
+
# @return [Array] Permit list for strong params
|
|
18
|
+
def build_nested_permit_list(nested)
|
|
19
|
+
nested_fields = nested.fields.reject { |f| f.readonly?(iron_admin_current_user) }
|
|
20
|
+
permit_list = nested_fields.flat_map { |f| nested_field_permit(f) }
|
|
21
|
+
permit_list << :id
|
|
22
|
+
permit_list << :_destroy if nested.allow_destroy
|
|
23
|
+
permit_list << nested.position_field if nested.position_field
|
|
24
|
+
permit_list
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def nested_field_permit(field)
|
|
28
|
+
case field.type
|
|
29
|
+
when :belongs_to then field.options[:foreign_key]
|
|
30
|
+
when :files then { field.name => [] }
|
|
31
|
+
else field.name
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|