workarea-core 3.4.45 → 3.5.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +52 -0
- data/app/assets/javascripts/workarea/core/modules/duplicate_id.js +1 -5
- data/app/assets/javascripts/workarea/core/modules/style_guide_autocomplete_fields.js +9 -42
- data/app/assets/javascripts/workarea/core/modules/url.js +14 -0
- data/app/controllers/workarea/application_controller.rb +5 -1
- data/app/controllers/workarea/authentication.rb +15 -26
- data/app/controllers/workarea/authorization.rb +3 -3
- data/app/controllers/workarea/current_referrer.rb +1 -2
- data/app/controllers/workarea/current_release.rb +1 -1
- data/app/controllers/workarea/current_segments.rb +52 -0
- data/app/controllers/workarea/current_tracking.rb +45 -0
- data/app/controllers/workarea/http_caching.rb +30 -0
- data/app/controllers/workarea/impersonation.rb +18 -44
- data/app/helpers/workarea/schema_org_helper.rb +21 -0
- data/app/mailers/workarea/application_mailer.rb +2 -4
- data/app/middleware/workarea/application_middleware.rb +44 -0
- data/app/middleware/workarea/query_cache_middleware.rb +55 -0
- data/app/middleware/workarea/release_server_middleware.rb +1 -1
- data/app/models/workarea/application_document.rb +1 -1
- data/app/models/workarea/bulk_action/product_edit.rb +6 -6
- data/app/models/workarea/calculate_percent_change.rb +1 -1
- data/app/models/workarea/catalog/category.rb +0 -2
- data/app/models/workarea/catalog/product.rb +19 -2
- data/app/models/workarea/checkout/collect_payment.rb +10 -1
- data/app/models/workarea/checkout/fraud/analyzer.rb +44 -0
- data/app/models/workarea/checkout/fraud/no_decision_analyzer.rb +14 -0
- data/app/models/workarea/checkout/fraud/test_analyzer.rb +26 -0
- data/app/models/workarea/checkout.rb +18 -6
- data/app/models/workarea/configuration/admin.rb +25 -0
- data/app/models/workarea/configuration/params.rb +45 -0
- data/app/models/workarea/content/asset.rb +5 -18
- data/app/models/workarea/content/block.rb +8 -2
- data/app/models/workarea/content/block_draft.rb +7 -2
- data/app/models/workarea/content/block_type.rb +2 -2
- data/app/models/workarea/content/block_type_definition.rb +4 -0
- data/app/models/workarea/content/preset.rb +1 -1
- data/app/models/workarea/content.rb +12 -82
- data/app/models/workarea/data_file/csv.rb +6 -8
- data/app/models/workarea/data_file/import.rb +9 -1
- data/app/models/workarea/data_file/json.rb +1 -20
- data/app/models/workarea/data_file/operation.rb +0 -4
- data/app/models/workarea/data_file/tax_rates.rb +3 -0
- data/app/models/workarea/featured_products.rb +8 -0
- data/app/models/workarea/fulfillment/policies/base.rb +21 -0
- data/app/models/workarea/fulfillment/policies/download.rb +21 -0
- data/app/models/workarea/fulfillment/policies/ignore.rb +11 -0
- data/app/models/workarea/fulfillment/policies/ship.rb +15 -0
- data/app/models/workarea/fulfillment/sku.rb +72 -0
- data/app/models/workarea/fulfillment/token.rb +36 -0
- data/app/models/workarea/inquiry.rb +1 -2
- data/app/models/workarea/insights/customer_acquisition.rb +5 -9
- data/app/models/workarea/insights/trending_products.rb +2 -2
- data/app/models/workarea/insights/trending_searches.rb +2 -2
- data/app/models/workarea/inventory/collection.rb +30 -0
- data/app/models/workarea/inventory/collection_status.rb +40 -0
- data/app/models/workarea/metrics/affinity.rb +33 -0
- data/app/models/workarea/metrics/country_by_day.rb +4 -0
- data/app/models/workarea/metrics/product_by_day.rb +3 -0
- data/app/models/workarea/metrics/product_by_week.rb +2 -0
- data/app/models/workarea/metrics/product_for_last_week.rb +8 -12
- data/app/models/workarea/metrics/sales_by_day.rb +5 -0
- data/app/models/workarea/metrics/search_by_day.rb +1 -3
- data/app/models/workarea/metrics/search_for_last_week.rb +5 -11
- data/app/models/workarea/metrics/segment_by_day.rb +31 -0
- data/app/models/workarea/metrics/sku_by_day.rb +3 -0
- data/app/models/workarea/metrics/tender_by_day.rb +11 -0
- data/app/models/workarea/metrics/update_user_aggregations.rb +77 -0
- data/app/models/workarea/metrics/user.rb +73 -87
- data/app/models/workarea/navigation/breadcrumbs.rb +10 -1
- data/app/models/workarea/order/fraud_decision.rb +18 -0
- data/app/models/workarea/order/item.rb +5 -0
- data/app/models/workarea/order/queries.rb +1 -0
- data/app/models/workarea/order/status.rb +10 -1
- data/app/models/workarea/order.rb +47 -4
- data/app/models/workarea/payment/credit_card.rb +12 -0
- data/app/models/workarea/payment.rb +7 -2
- data/app/models/workarea/pricing/cache_key.rb +9 -3
- data/app/models/workarea/pricing/calculator.rb +5 -1
- data/app/models/workarea/pricing/calculators/tax_calculator.rb +32 -5
- data/app/models/workarea/pricing/discount/application_group.rb +8 -3
- data/app/models/workarea/pricing/discount/free_gift.rb +2 -1
- data/app/models/workarea/pricing/discount/redemption.rb +1 -1
- data/app/models/workarea/pricing/discount.rb +2 -3
- data/app/models/workarea/pricing/item_tax_applier.rb +41 -0
- data/app/models/workarea/pricing/price.rb +1 -0
- data/app/models/workarea/pricing/request.rb +11 -0
- data/app/models/workarea/pricing/sku.rb +1 -0
- data/app/models/workarea/pricing/tax_application.rb +21 -0
- data/app/models/workarea/pricing/tax_applier.rb +12 -15
- data/app/models/workarea/pricing/unsupported_segmentation.rb +22 -0
- data/app/models/workarea/product_rule.rb +5 -0
- data/app/models/workarea/releasable.rb +83 -89
- data/app/models/workarea/release/activation.rb +45 -0
- data/app/models/workarea/release/changes.rb +45 -0
- data/app/models/workarea/release/changeset.rb +42 -52
- data/app/models/workarea/release/preview.rb +28 -0
- data/app/models/workarea/release/status.rb +2 -24
- data/app/models/workarea/release.rb +72 -99
- data/app/models/workarea/release_session.rb +11 -11
- data/app/models/workarea/search/admin/catalog_product.rb +1 -2
- data/app/models/workarea/search/admin/fulfillment_sku.rb +27 -0
- data/app/models/workarea/search/admin/order.rb +1 -1
- data/app/models/workarea/search/admin/pricing_discount.rb +1 -1
- data/app/models/workarea/search/admin/release.rb +1 -4
- data/app/models/workarea/search/admin/segment.rb +19 -0
- data/app/models/workarea/search/admin.rb +17 -39
- data/app/models/workarea/search/order_text.rb +23 -6
- data/app/models/workarea/search/storefront/category_query.rb +152 -0
- data/app/models/workarea/search/storefront/product/categories.rb +11 -45
- data/app/models/workarea/search/storefront.rb +33 -29
- data/app/models/workarea/segment/first_time_customer.rb +8 -0
- data/app/models/workarea/segment/first_time_visitor.rb +12 -0
- data/app/models/workarea/segment/life_cycle.rb +44 -0
- data/app/models/workarea/segment/loyal_customer.rb +12 -0
- data/app/models/workarea/segment/returning_customer.rb +14 -0
- data/app/models/workarea/segment/returning_visitor.rb +12 -0
- data/app/models/workarea/segment/rules/base.rb +16 -0
- data/app/models/workarea/segment/rules/browser_info.rb +29 -0
- data/app/models/workarea/segment/rules/geolocation.rb +29 -0
- data/app/models/workarea/segment/rules/geolocation_option.rb +53 -0
- data/app/models/workarea/segment/rules/last_order.rb +14 -0
- data/app/models/workarea/segment/rules/logged_in.rb +13 -0
- data/app/models/workarea/segment/rules/orders.rb +17 -0
- data/app/models/workarea/segment/rules/revenue.rb +17 -0
- data/app/models/workarea/segment/rules/sessions.rb +17 -0
- data/app/models/workarea/segment/rules/tags.rb +14 -0
- data/app/models/workarea/segment/rules/traffic_referrer.rb +18 -0
- data/app/models/workarea/segment.rb +54 -0
- data/app/models/workarea/segmentable.rb +66 -0
- data/app/models/workarea/sort.rb +14 -2
- data/app/models/workarea/tax/rate.rb +35 -1
- data/app/models/workarea/user/authorization.rb +19 -13
- data/app/models/workarea/user/login.rb +4 -0
- data/app/models/workarea/user/password_reset.rb +1 -3
- data/app/queries/workarea/categorization.rb +3 -3
- data/app/queries/workarea/featured_categorization.rb +53 -0
- data/app/queries/workarea/order_cancellation_metrics.rb +155 -0
- data/app/queries/workarea/order_item_details.rb +16 -3
- data/app/queries/workarea/order_metrics.rb +32 -3
- data/app/queries/workarea/product_primary_navigation.rb +13 -2
- data/app/queries/workarea/product_releases.rb +38 -0
- data/app/queries/workarea/recommendation/user_activity_based.rb +14 -6
- data/app/queries/workarea/reports/average_order_value.rb +1 -1
- data/app/queries/workarea/reports/customers.rb +14 -11
- data/app/queries/workarea/reports/first_time_vs_returning_sales.rb +1 -1
- data/app/queries/workarea/reports/group_by_time.rb +13 -17
- data/app/queries/workarea/reports/sales_by_category.rb +1 -1
- data/app/queries/workarea/reports/sales_by_country.rb +10 -3
- data/app/queries/workarea/reports/sales_by_discount.rb +1 -1
- data/app/queries/workarea/reports/sales_by_menu.rb +1 -1
- data/app/queries/workarea/reports/sales_by_product.rb +39 -4
- data/app/queries/workarea/reports/sales_by_sku.rb +39 -4
- data/app/queries/workarea/reports/sales_by_tender.rb +42 -0
- data/app/queries/workarea/reports/sales_by_traffic_referrer.rb +1 -1
- data/app/queries/workarea/reports/sales_over_time.rb +10 -3
- data/app/queries/workarea/reports/searches.rb +1 -1
- data/app/queries/workarea/reports/searches_over_time.rb +1 -1
- data/app/queries/workarea/reports/searches_without_results_over_time.rb +1 -1
- data/app/queries/workarea/search/admin_fulfillment_skus.rb +20 -0
- data/app/queries/workarea/search/admin_releases.rb +1 -4
- data/app/queries/workarea/search/admin_search.rb +0 -4
- data/app/queries/workarea/search/admin_segments.rb +16 -0
- data/app/queries/workarea/search/admin_sorting.rb +1 -1
- data/app/queries/workarea/search/pagination.rb +1 -4
- data/app/queries/workarea/search/product_display_rules.rb +40 -8
- data/app/queries/workarea/search/product_entries.rb +15 -1
- data/app/queries/workarea/search/product_search.rb +4 -1
- data/app/queries/workarea/search/storefront_search/exact_matches.rb +1 -1
- data/app/queries/workarea/search/storefront_search/response.rb +6 -4
- data/app/queries/workarea/search/storefront_search.rb +5 -4
- data/app/seeds/workarea/assets_seeds.rb +2 -1
- data/app/seeds/workarea/insights_seeds.rb +0 -23
- data/app/seeds/workarea/orders_seeds.rb +7 -6
- data/app/seeds/workarea/products_seeds.rb +2 -0
- data/app/seeds/workarea/segments_seeds.rb +8 -0
- data/app/seeds/workarea/tax_seeds.rb +3 -3
- data/app/services/workarea/cancel_order.rb +8 -3
- data/app/services/workarea/copy_order.rb +6 -0
- data/app/services/workarea/create_fulfillment.rb +5 -3
- data/app/services/workarea/direct_upload.rb +11 -19
- data/app/services/workarea/hash_update.rb +1 -18
- data/app/services/workarea/packaging.rb +1 -1
- data/app/services/workarea/save_publishing.rb +5 -1
- data/app/workers/sidekiq/callbacks.rb +4 -52
- data/app/workers/sidekiq/callbacks_worker.rb +4 -6
- data/app/workers/workarea/bulk_index_admin.rb +2 -2
- data/app/workers/workarea/bulk_index_products.rb +6 -5
- data/app/workers/workarea/bulk_index_searches.rb +5 -5
- data/app/workers/workarea/deactivate_stale_discounts.rb +3 -3
- data/app/workers/workarea/generate_insights.rb +1 -1
- data/app/workers/workarea/index_admin_search.rb +1 -0
- data/app/workers/workarea/index_categorization.rb +4 -7
- data/app/workers/workarea/index_category.rb +2 -1
- data/app/workers/workarea/index_category_changes.rb +11 -6
- data/app/workers/workarea/index_fulfillment_changes.rb +2 -1
- data/app/workers/workarea/index_help.rb +2 -1
- data/app/workers/workarea/index_page.rb +2 -1
- data/app/workers/workarea/index_payment_transactions.rb +2 -1
- data/app/workers/workarea/index_product.rb +4 -4
- data/app/workers/workarea/index_product_children.rb +4 -3
- data/app/workers/workarea/index_product_rule.rb +3 -2
- data/app/workers/workarea/index_search_customizations.rb +3 -2
- data/app/workers/workarea/index_skus.rb +5 -6
- data/app/workers/workarea/keep_product_index_fresh.rb +3 -5
- data/app/workers/workarea/process_import.rb +3 -3
- data/app/workers/workarea/process_search_recommendations.rb +5 -9
- data/app/workers/workarea/publish_release.rb +1 -0
- data/app/workers/workarea/save_metrics.rb +116 -0
- data/app/workers/workarea/save_order_cancellation_metrics.rb +35 -0
- data/app/workers/workarea/save_order_metrics.rb +10 -74
- data/app/workers/workarea/status_reporter.rb +2 -4
- data/app/workers/workarea/synchronize_user_metrics.rb +17 -0
- data/app/workers/workarea/update_payment_profile_email.rb +22 -0
- data/app/workers/workarea/verify_scheduled_releases.rb +4 -11
- data/config/initializers/00_configuration.rb +185 -0
- data/config/initializers/02_assets.rb +1 -0
- data/config/initializers/05_scheduled_jobs.rb +0 -7
- data/config/initializers/10_rack_middleware.rb +2 -5
- data/config/initializers/11_payment.rb +4 -0
- data/config/initializers/13_rack_attack.rb +2 -4
- data/config/initializers/14_content_block_types.rb +16 -16
- data/config/initializers/15_endpoint_monitoring.rb +3 -6
- data/config/initializers/{21_premailer.rb → 24_premailer.rb} +1 -0
- data/config/initializers/{20_i18n_js.rb → 25_i18n_js.rb} +0 -0
- data/config/locales/en.yml +13 -24
- data/lib/generators/workarea/content_block_type/templates/initializer.rb +1 -1
- data/lib/generators/workarea/install/USAGE +0 -1
- data/lib/generators/workarea/install/install_generator.rb +0 -21
- data/lib/generators/workarea/install/templates/initializer.rb.erb +1 -1
- data/lib/tasks/insights.rake +1 -0
- data/lib/tasks/migrate.rake +106 -0
- data/lib/tasks/search.rake +17 -19
- data/lib/tasks/tests.rake +1 -1
- data/lib/workarea/cache.rb +6 -35
- data/lib/workarea/changelog.rake +2 -2
- data/lib/workarea/configuration/administrable/definition.rb +42 -0
- data/lib/workarea/configuration/administrable/field.rb +79 -0
- data/lib/workarea/configuration/administrable/fieldset.rb +44 -0
- data/lib/workarea/configuration/administrable_options.rb +24 -0
- data/lib/workarea/configuration/cache_store.rb +3 -1
- data/lib/workarea/configuration/content_blocks.rb +17 -0
- data/lib/workarea/configuration/mongoid.rb +1 -4
- data/lib/workarea/configuration/session.rb +36 -0
- data/lib/workarea/configuration/sidekiq.rb +3 -1
- data/lib/workarea/configuration.rb +121 -148
- data/lib/workarea/core/engine.rb +3 -58
- data/lib/workarea/core.rb +15 -11
- data/lib/workarea/elasticsearch/document.rb +8 -15
- data/lib/workarea/ext/freedom_patches/action_view_cache_helper.rb +4 -6
- data/lib/workarea/ext/freedom_patches/active_support_duration.rb +14 -0
- data/lib/workarea/ext/freedom_patches/money.rb +11 -0
- data/lib/workarea/ext/freedom_patches/premailer.rb +6 -0
- data/lib/workarea/ext/freedom_patches/string.rb +19 -4
- data/lib/workarea/ext/mongoid/find_ordered.rb +2 -2
- data/lib/workarea/ext/mongoid/lookup_hash.rb +30 -0
- data/lib/workarea/geolocation.rb +24 -6
- data/lib/workarea/routes_constraints/super_admin.rb +1 -1
- data/lib/workarea/version.rb +3 -4
- data/lib/workarea/visit.rb +92 -0
- data/lib/workarea/warnings.rb +95 -0
- data/lib/workarea.rb +102 -3
- data/test/dummy/config/initializers/session_store.rb +1 -1
- data/test/fixtures/tax_rates.csv +3 -3
- data/test/generators/workarea/content_block_type_generator_test.rb +1 -1
- data/test/generators/workarea/install_generator_test.rb +0 -13
- data/test/integration/workarea/authentication_test.rb +27 -4
- data/test/integration/workarea/authorization_test.rb +5 -0
- data/test/integration/workarea/cache_varies_integration_test.rb +21 -23
- data/test/integration/workarea/monitoring_integration_test.rb +5 -10
- data/test/javascripts/duplicate_id_spec.js +1 -7
- data/test/javascripts/fixtures/{duplicate_id_fail.html.haml → duplicate_id.html.haml} +0 -1
- data/test/javascripts/form_submitting_controls_spec.js +0 -1
- data/test/lib/workarea/asset_endpoints/favicons_test.rb +11 -13
- data/test/lib/workarea/configuration/administrable/definition_test.rb +71 -0
- data/test/lib/workarea/configuration/administrable/field_test.rb +128 -0
- data/test/lib/workarea/configuration/administrable/fieldset_test.rb +78 -0
- data/test/lib/workarea/configuration/configuration_test.rb +20 -0
- data/test/lib/workarea/elasticsearch/document_test.rb +0 -20
- data/test/lib/workarea/elasticsearch/query_cache_test.rb +7 -7
- data/test/lib/workarea/ext/freedom_patches/money_test.rb +11 -0
- data/test/lib/workarea/ext/mongoid/lookup_hash_test.rb +86 -0
- data/test/lib/workarea/geolocation_test.rb +20 -0
- data/test/mailers/workarea/application_mailer_test.rb +1 -11
- data/test/middleware/workarea/query_cache_middleware_test.rb +55 -0
- data/test/models/workarea/checkout/collect_payment_test.rb +14 -6
- data/test/models/workarea/checkout_test.rb +31 -57
- data/test/models/workarea/configuration/params_test.rb +37 -0
- data/test/models/workarea/data_file/csv_test.rb +8 -73
- data/test/models/workarea/data_file/import_test.rb +31 -0
- data/test/models/workarea/data_file/json_test.rb +6 -48
- data/test/models/workarea/data_file/tax_test.rb +3 -0
- data/test/models/workarea/fulfillment/policies/download_test.rb +39 -0
- data/test/models/workarea/fulfillment/sku_test.rb +54 -0
- data/test/models/workarea/insights/best_customers_test.rb +5 -2
- data/test/models/workarea/insights/best_full_price_customers_test.rb +5 -2
- data/test/models/workarea/insights/customer_acquisition_test.rb +1 -1
- data/test/models/workarea/insights/customers_at_risk_test.rb +1 -1
- data/test/models/workarea/insights/low_aov_customers_test.rb +1 -1
- data/test/models/workarea/inventory/collection_test.rb +75 -0
- data/test/models/workarea/metrics/affinity_test.rb +85 -0
- data/test/models/workarea/metrics/product_by_week_test.rb +27 -31
- data/test/models/workarea/metrics/search_by_day_test.rb +3 -0
- data/test/models/workarea/metrics/search_by_week_test.rb +27 -31
- data/test/models/workarea/metrics/update_user_aggregations_test.rb +62 -0
- data/test/models/workarea/metrics/user_test.rb +146 -63
- data/test/models/workarea/navigation/breadcrumbs_test.rb +12 -2
- data/test/models/workarea/order/queries_test.rb +2 -0
- data/test/models/workarea/order_test.rb +44 -0
- data/test/models/workarea/payment/address_test.rb +109 -111
- data/test/models/workarea/payment/credit_card_integration_test.rb +0 -52
- data/test/models/workarea/payment/credit_card_test.rb +5 -0
- data/test/models/workarea/pricing/cache_key_test.rb +7 -1
- data/test/models/workarea/pricing/calculators/tax_calculator_test.rb +41 -1
- data/test/models/workarea/pricing/discount/collection_test.rb +27 -29
- data/test/models/workarea/pricing/discount_test.rb +22 -24
- data/test/models/workarea/pricing/item_tax_applier_test.rb +83 -0
- data/test/models/workarea/pricing/price_test.rb +9 -0
- data/test/models/workarea/pricing/request_test.rb +13 -0
- data/test/models/workarea/pricing/sku_test.rb +9 -0
- data/test/models/workarea/releasable_active_test.rb +113 -0
- data/test/models/workarea/releasable_test.rb +69 -120
- data/test/models/workarea/release/changeset_test.rb +41 -0
- data/test/models/workarea/release_jobs_test.rb +52 -0
- data/test/models/workarea/release_previewing_test.rb +43 -0
- data/test/models/workarea/release_test.rb +59 -153
- data/test/models/workarea/search/admin/content_asset_test.rb +26 -28
- data/test/models/workarea/search/order_text_test.rb +35 -0
- data/test/models/workarea/search/storefront/category_query_test.rb +81 -0
- data/test/models/workarea/search/storefront/product/categories_test.rb +10 -70
- data/test/models/workarea/search/storefront/product_test.rb +10 -11
- data/test/models/workarea/search/storefront_test.rb +1 -13
- data/test/models/workarea/segment/life_cycle_test.rb +24 -0
- data/test/models/workarea/segment/rules/browser_info_test.rb +33 -0
- data/test/models/workarea/segment/rules/geolocation_option_test.rb +16 -0
- data/test/models/workarea/segment/rules/geolocation_test.rb +49 -0
- data/test/models/workarea/segment/rules/last_order_test.rb +32 -0
- data/test/models/workarea/segment/rules/logged_in_test.rb +25 -0
- data/test/models/workarea/segment/rules/orders_test.rb +59 -0
- data/test/models/workarea/segment/rules/revenue_test.rb +59 -0
- data/test/models/workarea/segment/rules/sessions_test.rb +26 -0
- data/test/models/workarea/segment/rules/tags_test.rb +27 -0
- data/test/models/workarea/segment/rules/traffic_referrer_test.rb +31 -0
- data/test/models/workarea/segment_test.rb +80 -0
- data/test/models/workarea/segmentable_test.rb +74 -0
- data/test/models/workarea/shipping/address_test.rb +109 -111
- data/test/models/workarea/shipping/sku_test.rb +8 -12
- data/test/models/workarea/user/password_reset_test.rb +4 -12
- data/test/models/workarea/user_test.rb +13 -10
- data/test/queries/workarea/admin_search_query_wrapper_test.rb +21 -25
- data/test/queries/workarea/categorization_test.rb +49 -0
- data/test/queries/workarea/featured_categorization_test.rb +66 -0
- data/test/queries/workarea/order_cancellation_metrics_test.rb +203 -0
- data/test/queries/workarea/order_item_details_test.rb +17 -0
- data/test/queries/workarea/order_metrics_test.rb +12 -0
- data/test/queries/workarea/product_releases_test.rb +56 -0
- data/test/queries/workarea/recommendation/searches_test.rb +3 -3
- data/test/queries/workarea/recommendation/user_activity_based_test.rb +4 -4
- data/test/queries/workarea/reports/customers_test.rb +12 -8
- data/test/queries/workarea/reports/report_test.rb +4 -6
- data/test/queries/workarea/reports/sales_by_country_test.rb +18 -3
- data/test/queries/workarea/reports/sales_by_product_test.rb +28 -8
- data/test/queries/workarea/reports/sales_by_sku_test.rb +28 -8
- data/test/queries/workarea/reports/sales_by_tender_test.rb +100 -0
- data/test/queries/workarea/reports/sales_by_traffic_referrer_test.rb +6 -6
- data/test/queries/workarea/search/admin_releases_test.rb +1 -26
- data/test/queries/workarea/search/admin_search_test.rb +0 -10
- data/test/queries/workarea/search/admin_users_test.rb +2 -2
- data/test/queries/workarea/search/category_browse_test.rb +53 -0
- data/test/queries/workarea/search/facet_sorting/size_test.rb +11 -13
- data/test/queries/workarea/search/pagination_test.rb +9 -26
- data/test/queries/workarea/search/product_entries_test.rb +27 -0
- data/test/queries/workarea/search/product_search_test.rb +0 -16
- data/test/queries/workarea/search/storefront_search/response_test.rb +26 -0
- data/test/queries/workarea/search/storefront_search_test.rb +34 -36
- data/test/services/workarea/cancel_order_test.rb +27 -13
- data/test/services/workarea/copy_order_test.rb +17 -0
- data/test/services/workarea/direct_upload_test.rb +1 -46
- data/test/services/workarea/export_report_test.rb +41 -45
- data/test/services/workarea/hash_update_test.rb +12 -12
- data/test/services/workarea/packaging_test.rb +9 -11
- data/test/services/workarea/save_publishing_test.rb +23 -0
- data/test/workers/sidekiq/callbacks_test.rb +0 -22
- data/test/workers/workarea/deactivate_stale_discounts_test.rb +2 -2
- data/test/workers/workarea/index_category_changes_test.rb +5 -7
- data/test/workers/workarea/keep_product_index_fresh_test.rb +1 -1
- data/test/workers/workarea/process_import_test.rb +0 -6
- data/test/workers/workarea/process_search_recommendations_test.rb +4 -5
- data/test/workers/workarea/status_reporter_test.rb +2 -1
- data/test/workers/workarea/synchronize_user_metrics_test.rb +57 -0
- data/test/workers/workarea/update_payment_profile_email_test.rb +27 -0
- data/test/workers/workarea/verify_scheduled_releases_test.rb +0 -26
- data/workarea-core.gemspec +13 -11
- metadata +196 -92
- data/app/assets/javascripts/workarea/core/templates/ui_menu_item.jst.ejs +0 -10
- data/app/controllers/workarea/admin_guest_browsing.rb +0 -54
- data/app/middleware/workarea/rack_cache_config_middleware.rb +0 -19
- data/app/queries/workarea/search/search_suggestions.rb +0 -43
- data/app/workers/workarea/bust_discount_cache.rb +0 -16
- data/app/workers/workarea/clean_user_activity.rb +0 -11
- data/app/workers/workarea/undo_release.rb +0 -15
- data/app/workers/workarea/update_email.rb +0 -33
- data/lib/generators/workarea/docker/USAGE +0 -16
- data/lib/generators/workarea/docker/docker_generator.rb +0 -61
- data/lib/generators/workarea/docker/templates/.env.erb +0 -6
- data/lib/generators/workarea/docker/templates/Dockerfile.erb +0 -48
- data/lib/generators/workarea/docker/templates/docker-compose.yml.erb +0 -72
- data/lib/generators/workarea/docker/templates/docker-entrypoint.sh.erb +0 -6
- data/lib/generators/workarea/docker/templates/docker-sync.yml.erb +0 -8
- data/lib/generators/workarea/docker/templates/docker-wait.sh +0 -11
- data/lib/generators/workarea/docker/templates/docker.env +0 -16
- data/lib/generators/workarea/docker/templates/docker_init.rb.erb +0 -29
- data/lib/workarea/configuration/headless_chrome.rb +0 -42
- data/lib/workarea/configuration/puma.rb +0 -37
- data/lib/workarea/ext/freedom_patches/i18n_js.rb +0 -27
- data/lib/workarea/ext/freedom_patches/mongoid_localized_defaults.rb +0 -25
- data/lib/workarea/ext/jbuilder/jbuilder_cache.rb +0 -29
- data/lib/workarea/ext/referer_parser/parser.decorator +0 -43
- data/lib/workarea/queues_pauser.rb +0 -26
- data/lib/workarea/robots.rb +0 -9
- data/test/generators/workarea/docker_generator_test.rb +0 -156
- data/test/javascripts/fixtures/duplicate_id_pass.html.haml +0 -2
- data/test/lib/workarea/ext/freedom_patches/mongoid_localized_defaults_test.rb +0 -25
- data/test/lib/workarea/ext/referer_parser/parser_test.rb +0 -20
- data/test/queries/workarea/search/search_suggestions_test.rb +0 -29
- data/test/workers/workarea/undo_release_test.rb +0 -23
- data/test/workers/workarea/update_email_test.rb +0 -39
@@ -4,8 +4,25 @@ module Workarea
|
|
4
4
|
Rails.configuration.workarea
|
5
5
|
end
|
6
6
|
|
7
|
+
def self.define_fields(&block)
|
8
|
+
config.admin_definition.instance_eval(&block)
|
9
|
+
end
|
10
|
+
|
7
11
|
def self.setup_defaults
|
8
|
-
Rails.configuration.workarea =
|
12
|
+
Rails.configuration.workarea = AdministrableOptions.new(
|
13
|
+
admin_definition: Administrable::Definition.new
|
14
|
+
)
|
15
|
+
|
16
|
+
config.configurable_field_types = {
|
17
|
+
string: 'String',
|
18
|
+
symbol: 'Symbol',
|
19
|
+
integer: 'Integer',
|
20
|
+
float: 'Float',
|
21
|
+
boolean: 'Boolean',
|
22
|
+
array: 'Array',
|
23
|
+
hash: 'HashWithIndifferentAccess',
|
24
|
+
duration: 'ActiveSupport::Duration'
|
25
|
+
}
|
9
26
|
|
10
27
|
config.site_name = 'Workarea'
|
11
28
|
config.host = 'www.example.com'
|
@@ -25,30 +42,21 @@ module Workarea
|
|
25
42
|
config.gateways = ActiveSupport::Configurable::Configuration.new
|
26
43
|
config.gateways.shipping = ActiveShipping::Workarea.new
|
27
44
|
|
28
|
-
# Whether or not to allow po box addresses for shipping/payment
|
29
|
-
config.allow_shipping_address_po_box = false
|
30
|
-
config.allow_payment_address_po_box = true
|
31
|
-
|
32
45
|
# How to validate whether an address is a PO Box
|
33
46
|
config.po_box_regex = /(?:P(?:ost(?:al)?)?[\.\-\s]*(?:(?:O(?:ffice)?[\.\-\s]*)?B(?:ox|in|\b|\d)|o(?:ffice|\b)(?:[-\s]*\d)|code)|box[-\s\b]*\d)/i
|
34
47
|
|
35
|
-
# How long a user stays logged in
|
36
|
-
config.admin_session_timeout = 1.hour
|
37
|
-
config.customer_session_timeout = 10.minutes
|
38
|
-
|
39
48
|
# How long the completed order cookie lasts, i.e. how long they have to
|
40
49
|
# sign up for an account after placing the order and have the order
|
41
50
|
# details copied to the account. Be careful changing this.
|
51
|
+
#
|
52
|
+
# TODO deprecated, remove in 3.6
|
42
53
|
config.completed_order_timeout = 10.minutes
|
43
54
|
|
44
|
-
# How long a password reset stays valid
|
45
|
-
config.password_reset_timeout = 2.hours
|
46
|
-
|
47
55
|
# How long the built-in HTTP cache lasts TODO remove in v4
|
48
56
|
config.page_cache_ttl = 15.minutes
|
49
57
|
|
50
58
|
# Where to store Dragonfly asset files
|
51
|
-
config.asset_store =
|
59
|
+
config.asset_store = :file_system
|
52
60
|
|
53
61
|
# Different types of available Content::Assets
|
54
62
|
config.asset_types = %w(image pdf flash video audio text)
|
@@ -62,29 +70,14 @@ module Workarea
|
|
62
70
|
# How many times to retry image importing on failure
|
63
71
|
config.images_import_retries = 2
|
64
72
|
|
65
|
-
# How long an order is considered active before considering it abandoned
|
66
|
-
config.order_active_period = 2.hours
|
67
|
-
|
68
73
|
# How long to lock an order when an attempt to place it is being made
|
69
74
|
# @deprecated as of v3.2 locking is handled via Workarea::Lock
|
70
75
|
config.order_lock_period = 10.seconds
|
71
76
|
|
72
|
-
# How long a checkout can be idle before the user is forced to restart
|
73
|
-
config.checkout_expiration = 15.minutes
|
74
|
-
|
75
|
-
# How long to wait until abandoned orders are deleted from the database
|
76
|
-
config.order_expiration_period = 6.months
|
77
|
-
|
78
|
-
# Number of orders to display on the user order history page
|
79
|
-
config.storefront_user_order_display_count = 50
|
80
|
-
|
81
77
|
# The available tender types for purchase/refund, used in order to
|
82
78
|
# determine purchase precedence and in reverse for refund precedence.
|
83
79
|
config.tender_types = [:store_credit, :credit_card]
|
84
80
|
|
85
|
-
# How many failed login attempts before marking the user locked out
|
86
|
-
config.allowed_login_attempts = 6
|
87
|
-
|
88
81
|
# How long an account is locked out after making too many
|
89
82
|
# failed login attempts
|
90
83
|
config.lockout_period = 30.minutes
|
@@ -95,9 +88,6 @@ module Workarea
|
|
95
88
|
# How many passwords to keep and validate against
|
96
89
|
config.password_history_length = 4
|
97
90
|
|
98
|
-
# Password requirement level: :weak, :medium, or :strong
|
99
|
-
config.password_strength = :weak
|
100
|
-
|
101
91
|
# Default page size for products
|
102
92
|
config.per_page = 20
|
103
93
|
|
@@ -105,15 +95,6 @@ module Workarea
|
|
105
95
|
# This decay is applied weekly.
|
106
96
|
config.score_decay = 0.9
|
107
97
|
|
108
|
-
# How many search suggestions should be shown in the
|
109
|
-
# autocomplete searches
|
110
|
-
config.search_suggestions = 5
|
111
|
-
|
112
|
-
# The minimum number of search results required to consider the results
|
113
|
-
# sufficient. If a search result set is not sufficient, the search will
|
114
|
-
# try another pass with looser options to bring in more matches.
|
115
|
-
config.search_sufficient_results = 2
|
116
|
-
|
117
98
|
# Default values for search boosts
|
118
99
|
config.default_search_boosts = {
|
119
100
|
name: 3,
|
@@ -123,24 +104,9 @@ module Workarea
|
|
123
104
|
facets: 2
|
124
105
|
}
|
125
106
|
|
126
|
-
# How long logged search queries are stored
|
127
|
-
config.search_query_expiration = 30.days
|
128
|
-
|
129
107
|
# How many products to consider stale in a reindexing batch for freshness.
|
130
108
|
config.stale_products_size = 100
|
131
109
|
|
132
|
-
# Minimum number of words for content to be searchable on the storefront
|
133
|
-
config.minimum_content_search_words = 5
|
134
|
-
|
135
|
-
# Subjects list for the contact form { 'slug' => 'description' }
|
136
|
-
config.inquiry_subjects = {
|
137
|
-
'orders' => 'Orders',
|
138
|
-
'returns' => 'Returns and Exchanges',
|
139
|
-
'products' => 'Product Information',
|
140
|
-
'feedback' => 'Feedback',
|
141
|
-
'general' => 'General Inquiry'
|
142
|
-
}
|
143
|
-
|
144
110
|
# Attributes used when copying addresses or comparing them
|
145
111
|
config.address_attributes = [
|
146
112
|
:first_name,
|
@@ -174,11 +140,6 @@ module Workarea
|
|
174
140
|
|
175
141
|
config.credit_card_issuers['bogus'] = 'Test Card' unless Rails.env.production?
|
176
142
|
|
177
|
-
# Most credit card processors won't let a capture/purchase be refunded until
|
178
|
-
# the transaction settles. (Most processors settle once a day). If your processor
|
179
|
-
# allows immediate refuding you can include extra tests around refund operations.
|
180
|
-
config.run_credit_card_refund_tests = false
|
181
|
-
|
182
143
|
# Determines the order in which discounts are calculated.
|
183
144
|
config.discount_application_order = %w(
|
184
145
|
Workarea::Pricing::Discount::Product
|
@@ -196,19 +157,19 @@ module Workarea
|
|
196
157
|
# admin.
|
197
158
|
config.discount_staleness_ttl = 30.days
|
198
159
|
|
199
|
-
# Number of orders to show in account summary dashboard
|
200
|
-
config.recent_order_count = 3
|
201
|
-
|
202
160
|
# How many products show in a category summary content block
|
203
161
|
config.category_summary_product_count = 6
|
204
162
|
|
205
163
|
# How many products show in product insights content block
|
206
164
|
config.product_insights_count = 6
|
207
165
|
|
166
|
+
# Email Widths
|
167
|
+
config.admin_email_width = 600
|
168
|
+
config.storefront_email_width = 600
|
169
|
+
|
208
170
|
# Colors and theming for customer-facing emails
|
209
171
|
# TODO: v4 remove
|
210
172
|
config.email_theme = ActiveSupport::OrderedOptions.new
|
211
|
-
config.email_theme.width = 600
|
212
173
|
config.email_theme.background_color = '#ffffff'
|
213
174
|
config.email_theme.layout_link_color = '#000000'
|
214
175
|
config.email_theme.layout_separator_color = '#dddddd'
|
@@ -251,27 +212,11 @@ module Workarea
|
|
251
212
|
# Can be configured independantly of all site breakpoints
|
252
213
|
config.content_preview_breakpoints = ['small', 'medium', 'wide']
|
253
214
|
|
254
|
-
# Origin location for calculating shipping costs
|
255
|
-
config.shipping_origin = {
|
256
|
-
country: 'US',
|
257
|
-
state: 'PA',
|
258
|
-
city: 'Philadelphia',
|
259
|
-
zip: '19106'
|
260
|
-
}
|
261
|
-
|
262
215
|
# Global options for calculating shipping costs
|
263
216
|
config.shipping_options = { units: :imperial }
|
264
217
|
|
265
|
-
# Default package dimensions to use for calculating shipping costs.
|
266
|
-
# It's recommended to set these to your average or standard box size when
|
267
|
-
# using shipping rates from a carrier.
|
268
|
-
#
|
269
|
-
# Dimensions on a specific Shipping::Sku will override these.
|
270
|
-
#
|
271
|
-
config.shipping_dimensions = [1, 1, 1]
|
272
|
-
|
273
218
|
# The content block types currently available. Most easily customized by
|
274
|
-
# calling Workarea
|
219
|
+
# calling Workarea.define_content_block_types
|
275
220
|
config.content_block_types = SwappableList.new
|
276
221
|
|
277
222
|
# Field mappings for category rules
|
@@ -319,6 +264,7 @@ module Workarea
|
|
319
264
|
'Taxonomy' => :navigation_taxons_path,
|
320
265
|
'Navigation' => :navigation_menus_path,
|
321
266
|
'Pricing' => :pricing_skus_path,
|
267
|
+
'Segments' => :segments_path,
|
322
268
|
'Orders dashboard' => :orders_dashboards_path,
|
323
269
|
'Catalog dashboard' => :catalog_dashboards_path,
|
324
270
|
'Store dashboard' => :store_dashboards_path,
|
@@ -342,10 +288,13 @@ module Workarea
|
|
342
288
|
'Sales by SKU Report' => :sales_by_sku_report_path,
|
343
289
|
'Sales by Discount Report' => :sales_by_discount_report_path,
|
344
290
|
'Sales by Country Report' => :sales_by_country_report_path,
|
291
|
+
'Sales by Tender Report' => :sales_by_tender_report_path,
|
345
292
|
'Customers Report' => :customers_report_path,
|
346
293
|
'First-time vs Returning Sales Report' => :first_time_vs_returning_sales_report_path,
|
347
294
|
'Searches Report' => :searches_report_path,
|
348
|
-
'Low Inventory Report' => :low_inventory_report_path
|
295
|
+
'Low Inventory Report' => :low_inventory_report_path,
|
296
|
+
'Configuration' => :configuration_path,
|
297
|
+
'Fulfillment SKUs' => :fulfillment_skus_path
|
349
298
|
}
|
350
299
|
|
351
300
|
# Params to permit when creating URLs on browse pages for facet links
|
@@ -376,9 +325,6 @@ module Workarea
|
|
376
325
|
# Fields to be skipped when storing changesets for releases
|
377
326
|
config.untracked_release_changes_fields = %w(created_at updated_at slug)
|
378
327
|
|
379
|
-
# Placeholder text used for content block default data.
|
380
|
-
config.placeholder_text = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin sagittis faucibus augue, sit amet mattis leo tincidunt ac. Nullam vulputate eleifend enim. Nunc eu lorem semper, convallis ipsum pharetra, pretium metus. Donec lobortis dolor ac metus vulputate vulputate nec at nulla. Suspendisse potenti. Praesent placerat elementum justo quis malesuada. Donec sollicitudin ligula augue, rutrum vestibulum ex rutrum in. Integer id orci eu nisl accumsan suscipit a ut sapien. Nam non justo at nibh laoreet tempus. Sed sagittis velit eu tellus imperdiet, et ultricies justo aliquet. Fusce id felis sem.'
|
381
|
-
|
382
328
|
# Maximum number of most visited to show for admin shortcuts
|
383
329
|
config.admin_max_most_visited = 3
|
384
330
|
|
@@ -413,6 +359,7 @@ module Workarea
|
|
413
359
|
Workarea::CustomerServiceNavigationSeeds
|
414
360
|
Workarea::SystemContentSeeds
|
415
361
|
|
362
|
+
Workarea::SegmentsSeeds
|
416
363
|
Workarea::AdminsSeeds
|
417
364
|
Workarea::CustomersSeeds
|
418
365
|
Workarea::OrdersSeeds
|
@@ -446,16 +393,6 @@ module Workarea
|
|
446
393
|
# query, post_filter, and aggregations are always included.
|
447
394
|
config.search_query_options = %w(sort size from suggest)
|
448
395
|
|
449
|
-
# The number of filter results returned for each filter type. As of
|
450
|
-
# ElasticSearch 5, 0 no longer denotes returning all values. A value
|
451
|
-
# greater than 0 must be defined.
|
452
|
-
config.default_search_facet_result_sizes = 10
|
453
|
-
|
454
|
-
# The number of filter results returned for any specified filter type.
|
455
|
-
# If no size is defined for a filter type, the default will be
|
456
|
-
# what's specified in the default config above.
|
457
|
-
config.search_facet_result_sizes = { color: 10, size: 10 }
|
458
|
-
|
459
396
|
# Define how facet values should be sorted when displayed on the
|
460
397
|
# storefront. You can provide a symbol for elasticsearch supported order
|
461
398
|
# options - :count, :alphabetical_asc, or :alphabetical_desc. You can also
|
@@ -472,9 +409,8 @@ module Workarea
|
|
472
409
|
size: 'Workarea::Search::FacetSorting::Size'
|
473
410
|
}
|
474
411
|
|
475
|
-
# The default sorting
|
476
|
-
#
|
477
|
-
# valid options.
|
412
|
+
# The default sorting for search facets types that do not have an
|
413
|
+
# explicitly defined sort in `search_facet_sorts`
|
478
414
|
config.search_facet_default_sort = :count
|
479
415
|
|
480
416
|
# The size to use for a facet aggregation when being ordered dynamically
|
@@ -483,11 +419,6 @@ module Workarea
|
|
483
419
|
# in Workarea.config.search_facet_result_sizes
|
484
420
|
config.search_facet_dynamic_sorting_size = 100
|
485
421
|
|
486
|
-
# The order the size facets will be rendered in on storefront search
|
487
|
-
# results and category browse.
|
488
|
-
config.search_facet_size_sort =
|
489
|
-
['Extra Small', 'Small', 'Medium', 'Large', 'Extra Large']
|
490
|
-
|
491
422
|
# Countries available for use
|
492
423
|
config.countries = [Country['US'], Country['CA']]
|
493
424
|
|
@@ -755,10 +686,6 @@ module Workarea
|
|
755
686
|
# The paths to exclude from logged admin page visits
|
756
687
|
config.admin_visit_excluded_paths = %w(root_path toolbar_path)
|
757
688
|
|
758
|
-
# Minimum available quantity for a sku before
|
759
|
-
# low inventory status is displayed.
|
760
|
-
config.low_inventory_threshold = 5
|
761
|
-
|
762
689
|
# Maximum number of similar products to store with each product.
|
763
690
|
# See https://github.com/Pathgather/predictor#limiting-similarities
|
764
691
|
config.max_recommendation_similarities = 64
|
@@ -818,6 +745,7 @@ module Workarea
|
|
818
745
|
Workarea::Order::Status::Cart
|
819
746
|
Workarea::Order::Status::Canceled
|
820
747
|
Workarea::Order::Status::Placed
|
748
|
+
Workarea::Order::Status::SuspectedFraud
|
821
749
|
Workarea::Order::Status::Checkout
|
822
750
|
Workarea::Order::Status::Abandoned
|
823
751
|
)
|
@@ -836,6 +764,16 @@ module Workarea
|
|
836
764
|
)
|
837
765
|
)
|
838
766
|
|
767
|
+
# Classes used to determine the status of a Workarea::Inventory::Collection
|
768
|
+
config.inventory_status_calculators = SwappableList.new(
|
769
|
+
%w(
|
770
|
+
Workarea::Inventory::CollectionStatus::Backordered
|
771
|
+
Workarea::Inventory::CollectionStatus::LowInventory
|
772
|
+
Workarea::Inventory::CollectionStatus::OutOfStock
|
773
|
+
Workarea::Inventory::CollectionStatus::Available
|
774
|
+
)
|
775
|
+
)
|
776
|
+
|
839
777
|
# Defines the state level for payment and fulfillment statuses.
|
840
778
|
config.status_state_indicators = {
|
841
779
|
open: 'pending',
|
@@ -859,8 +797,6 @@ module Workarea
|
|
859
797
|
Workarea::Release::Status::Unscheduled
|
860
798
|
Workarea::Release::Status::Scheduled
|
861
799
|
Workarea::Release::Status::Published
|
862
|
-
Workarea::Release::Status::Undone
|
863
|
-
Workarea::Release::Status::ScheduledUndo
|
864
800
|
)
|
865
801
|
)
|
866
802
|
|
@@ -879,6 +815,18 @@ module Workarea
|
|
879
815
|
)
|
880
816
|
)
|
881
817
|
|
818
|
+
# Classes used to dictate how an item is fulfilled. Must inherit from
|
819
|
+
# Workarea::Fulfillment::Policies::Base. The first in this list will be
|
820
|
+
# used as the default. Ship is a no op, but requires shipping, and highly
|
821
|
+
# recommended as the default policy.
|
822
|
+
config.fulfillment_policies = SwappableList.new(
|
823
|
+
%w(
|
824
|
+
Workarea::Fulfillment::Policies::Ship
|
825
|
+
Workarea::Fulfillment::Policies::Ignore
|
826
|
+
Workarea::Fulfillment::Policies::Download
|
827
|
+
)
|
828
|
+
)
|
829
|
+
|
882
830
|
# Classes used to calculate pricing. They are run in this order.
|
883
831
|
config.pricing_calculators = SwappableList.new(
|
884
832
|
%w(
|
@@ -1001,11 +949,11 @@ module Workarea
|
|
1001
949
|
# migration.
|
1002
950
|
config.localized_active_fields = true
|
1003
951
|
|
1004
|
-
# Options passed to
|
1005
|
-
|
1006
|
-
|
1007
|
-
#
|
1008
|
-
config.
|
952
|
+
# Options passed to the Selenium driver's capabilities
|
953
|
+
config.headless_chrome_options = { w3c: false }
|
954
|
+
|
955
|
+
# Arguments passed to headless Chrome for running system tests
|
956
|
+
config.headless_chrome_args = [
|
1009
957
|
'headless',
|
1010
958
|
'disable-gpu',
|
1011
959
|
'disable-popup-blocking',
|
@@ -1034,7 +982,7 @@ module Workarea
|
|
1034
982
|
config.permissions_fields = %i(admin releases_access store_access
|
1035
983
|
catalog_access search_access orders_access people_access reports_access
|
1036
984
|
settings_access marketing_access help_admin permissions_manager
|
1037
|
-
can_publish_now can_restore)
|
985
|
+
can_publish_now can_restore orders_manager)
|
1038
986
|
|
1039
987
|
# Whitelist of sizes that will be processed with AssetEndpoints::Favicons
|
1040
988
|
# Used for favicons_path(size)
|
@@ -1223,7 +1171,12 @@ module Workarea
|
|
1223
1171
|
}
|
1224
1172
|
|
1225
1173
|
# Configuration keys to hide from Settings Dashboard
|
1226
|
-
config.hide_from_settings = %i(
|
1174
|
+
config.hide_from_settings = %i(
|
1175
|
+
hide_from_settings
|
1176
|
+
gateways
|
1177
|
+
admin_definition
|
1178
|
+
email_theme
|
1179
|
+
)
|
1227
1180
|
|
1228
1181
|
# The default length of time to tell elasticsearch to keep the scroll
|
1229
1182
|
# context alive.
|
@@ -1238,7 +1191,7 @@ module Workarea
|
|
1238
1191
|
config.admin_sparkline_size = 10
|
1239
1192
|
|
1240
1193
|
# The maximum number of categories that are returned by
|
1241
|
-
# +Search::Storefront::
|
1194
|
+
# +Search::Storefront::CategoryQuery.find!+ when
|
1242
1195
|
# a user attempts to view all categories by rules for a given
|
1243
1196
|
# product in the admin.
|
1244
1197
|
config.product_categories_by_rules_max_count = 100
|
@@ -1255,6 +1208,40 @@ module Workarea
|
|
1255
1208
|
pass
|
1256
1209
|
)
|
1257
1210
|
|
1211
|
+
# The maximum amount of time an order might be expected to be in transit
|
1212
|
+
# to a customer. For use in Schema.org JSON-LD entry of the Fulfillment
|
1213
|
+
# Shipped mailer. Setting this to `nil` will effectively render the entry
|
1214
|
+
# invalid, so it should be defined for the app by using ActiveShipping and
|
1215
|
+
# set to an accurate value via the carrier's API.
|
1216
|
+
config.order_expected_arrival = ->(order, package) { nil }
|
1217
|
+
|
1218
|
+
# How long release publish events show as in the calendar feed.
|
1219
|
+
config.release_publish_calendar_event_size = 15.minutes
|
1220
|
+
|
1221
|
+
# How many documents to bulk index in a batch.
|
1222
|
+
config.bulk_index_batch_size = 1000
|
1223
|
+
|
1224
|
+
# How many orders someone has to have to fall into the "Loyal Customer"
|
1225
|
+
# life cycle segment.
|
1226
|
+
config.loyal_customers_min_orders = 3
|
1227
|
+
|
1228
|
+
# How recently someone needs to have purchased to be in the "Loyal Customer"
|
1229
|
+
# life cycle segment.
|
1230
|
+
config.loyal_customers_last_order_days_ago = 180
|
1231
|
+
|
1232
|
+
# The list of types of rules for setting up custom segments in the admin
|
1233
|
+
config.segment_rule_types = %w(
|
1234
|
+
Workarea::Segment::Rules::BrowserInfo
|
1235
|
+
Workarea::Segment::Rules::Geolocation
|
1236
|
+
Workarea::Segment::Rules::Orders
|
1237
|
+
Workarea::Segment::Rules::Revenue
|
1238
|
+
Workarea::Segment::Rules::TrafficReferrer
|
1239
|
+
Workarea::Segment::Rules::Sessions
|
1240
|
+
Workarea::Segment::Rules::LastOrder
|
1241
|
+
Workarea::Segment::Rules::LoggedIn
|
1242
|
+
Workarea::Segment::Rules::Tags
|
1243
|
+
)
|
1244
|
+
|
1258
1245
|
# Taxonomy for default seeds
|
1259
1246
|
config.default_seeds_taxonomy = {
|
1260
1247
|
'Clothing' => ['T-Shirts', 'Shoes', 'Loungewear'],
|
@@ -1263,43 +1250,29 @@ module Workarea
|
|
1263
1250
|
'Toys' => ['Puzzles', 'Board Games', 'Outdoor']
|
1264
1251
|
}
|
1265
1252
|
|
1253
|
+
# How many products/categories/searches to return by default in {Metrics::Affinity}
|
1254
|
+
config.affinity_default_recent_size = 3
|
1255
|
+
|
1266
1256
|
# Options for reading and decoding CSV import data. Use this
|
1267
1257
|
# setting to configure the `:encoding` options for `CSV.foreach`
|
1268
1258
|
# if your CSV files are failing to import with a UTF-8 encoding
|
1269
1259
|
# error.
|
1270
|
-
config.csv_import_options = {
|
1271
|
-
|
1272
|
-
#
|
1273
|
-
#
|
1274
|
-
|
1275
|
-
|
1276
|
-
'
|
1277
|
-
'
|
1278
|
-
'Workarea::Catalog::Variant' => 2,
|
1279
|
-
'Workarea::Catalog::Product' => 3,
|
1280
|
-
'Workarea::Content::Block' => 4,
|
1281
|
-
'Workarea::Content' => 5,
|
1282
|
-
'Workarea::Content::Page' => 6,
|
1283
|
-
'Workarea::Catalog::Category' => 7,
|
1284
|
-
'Workarea::Navigation::Menu' => 1_000
|
1260
|
+
config.csv_import_options = {}
|
1261
|
+
|
1262
|
+
# Determines what payment action happens when "place order" is submitted.
|
1263
|
+
# These correspond to methods on the {Checkout}'s instance of {Payment}
|
1264
|
+
config.checkout_payment_action = {
|
1265
|
+
shipped: 'authorize!',
|
1266
|
+
not_shipped: 'purchase!',
|
1267
|
+
mixed: 'purchase!'
|
1285
1268
|
}
|
1286
1269
|
|
1287
|
-
#
|
1288
|
-
config.
|
1289
|
-
|
1290
|
-
#
|
1291
|
-
|
1292
|
-
|
1293
|
-
# Attributes that will be sliced out of params and persisted on
|
1294
|
-
# the credit card tender during checkout.
|
1295
|
-
config.credit_card_attributes = %i[
|
1296
|
-
month
|
1297
|
-
year
|
1298
|
-
saved_card_id
|
1299
|
-
number
|
1300
|
-
cvv
|
1301
|
-
amount
|
1302
|
-
]
|
1270
|
+
# Class used to determine if an order is fraudlent
|
1271
|
+
config.fraud_analyzer = 'Workarea::Checkout::Fraud::NoDecisionAnalyzer'
|
1272
|
+
|
1273
|
+
# Max number of non-unique affinity items that will be stored, older items
|
1274
|
+
# will be evicted first.
|
1275
|
+
config.max_affinity_items = 50
|
1303
1276
|
end
|
1304
1277
|
end
|
1305
1278
|
end
|
data/lib/workarea/core/engine.rb
CHANGED
@@ -49,9 +49,6 @@ module Workarea
|
|
49
49
|
PingHomeBase.ping unless Rails.env.development? || Rails.env.test?
|
50
50
|
|
51
51
|
if Rails.env.test?
|
52
|
-
# This is here to help transition a poorly named configuration
|
53
|
-
Configuration::HeadlessChrome.load
|
54
|
-
|
55
52
|
# System tests can timeout without this, due to slow template resolution
|
56
53
|
# if you have many plugins installed.
|
57
54
|
ActionView::Resolver.caching = true
|
@@ -70,63 +67,11 @@ module Workarea
|
|
70
67
|
Configuration::Mongoid.load unless Mongoid::Config.configured?
|
71
68
|
Configuration::Dragonfly.load
|
72
69
|
Configuration::LocalizedActiveFields.load
|
70
|
+
Configuration::ContentBlocks.load
|
73
71
|
|
74
72
|
Workarea::ScheduledJobs.clean
|
75
|
-
|
76
|
-
|
77
|
-
warn <<~eos
|
78
|
-
**************************************************
|
79
|
-
⛔️ WARNING: Rails.application.config.time_zone is set to UTC, which you \
|
80
|
-
probably don't want.
|
81
|
-
As of Workarea 3.2, we use that value as the standard \
|
82
|
-
timezone for the admin side of the application.
|
83
|
-
We recommend setting this to the timezone of the retailer. Contact them to \
|
84
|
-
find their preference.
|
85
|
-
**************************************************
|
86
|
-
eos
|
87
|
-
end
|
88
|
-
|
89
|
-
auto_redirect = 'Workarea::Search::StorefrontSearch::ProductAutoRedirect'
|
90
|
-
if Workarea.config.storefront_search_middleware.include?(auto_redirect)
|
91
|
-
warn <<~eos
|
92
|
-
DEPRECATION WARNING: #{auto_redirect} is deprecated and will be removed in Workarea 3.3. \
|
93
|
-
Remove it from Workarea.config.storefront_search_middleware.
|
94
|
-
eos
|
95
|
-
end
|
96
|
-
|
97
|
-
if (!Rails.env.test? &&
|
98
|
-
!Workarea.config.skip_service_connections &&
|
99
|
-
Configuration::Mongoid.indexes_enforced?)
|
100
|
-
warn <<~eos
|
101
|
-
**************************************************
|
102
|
-
⛔️ WARNING: MongoDB is configured with notablescan.
|
103
|
-
|
104
|
-
This means that MongoDB won't run queries that require a collection scan and will return an error.
|
105
|
-
Workarea turns this on for running tests to assert that queries have indexes, and turns it off at the end of the test run.
|
106
|
-
Since you're not running in the test environment and this is turned on, it might mean the test process was killed, preventing Workarea from turning it off.
|
107
|
-
|
108
|
-
To turn this off, start the mongo shell and run this command:
|
109
|
-
db.getSiblingDB("admin").runCommand( { setParameter: 1, notablescan: 0 } )
|
110
|
-
**************************************************
|
111
|
-
eos
|
112
|
-
end
|
113
|
-
|
114
|
-
if !Rails.env.test? && !Rails.env.development? &&
|
115
|
-
Dragonfly.app(:workarea).datastore.is_a?(Dragonfly::FileDataStore)
|
116
|
-
|
117
|
-
warn <<~eos
|
118
|
-
**************************************************
|
119
|
-
⛔️ WARNING: Dragonfly is configured to use the filesystem.
|
120
|
-
|
121
|
-
This means all Dragonfly assets (assets, product images, etc.) will be stored
|
122
|
-
locally and not accessible to all servers within your environment.
|
123
|
-
|
124
|
-
We recommend using S3 when running in a live environment by setting
|
125
|
-
WORKAREA_S3_REGION and WORKAREA_S3_BUCKET_NAME in your environment variables,
|
126
|
-
and setting `Workarea.config.asset_store = :s3` in an initializer.
|
127
|
-
**************************************************
|
128
|
-
eos
|
129
|
-
end
|
73
|
+
Workarea::Warnings.check
|
74
|
+
Configuration::Session.validate!
|
130
75
|
end
|
131
76
|
end
|
132
77
|
end
|
data/lib/workarea/core.rb
CHANGED
@@ -92,6 +92,7 @@ require 'haml'
|
|
92
92
|
require 'ejs'
|
93
93
|
require 'jbuilder'
|
94
94
|
require 'redcarpet'
|
95
|
+
require 'tribute'
|
95
96
|
require 'turbolinks'
|
96
97
|
require 'csv'
|
97
98
|
require 'icalendar'
|
@@ -106,6 +107,8 @@ require 'dragonfly/s3_data_store'
|
|
106
107
|
require 'serviceworker-rails'
|
107
108
|
require 'chartkick'
|
108
109
|
require 'logstasher' if ENV['WORKAREA_LOGSTASH'] =~ /true/i
|
110
|
+
require 'mongoid/encrypted'
|
111
|
+
require 'browser'
|
109
112
|
|
110
113
|
#
|
111
114
|
# Extensions
|
@@ -126,21 +129,20 @@ require 'workarea/ext/freedom_patches/country'
|
|
126
129
|
require 'workarea/ext/freedom_patches/net_http_ssl_connection'
|
127
130
|
require 'workarea/ext/freedom_patches/dragonfly_job_fetch_url'
|
128
131
|
require 'workarea/ext/freedom_patches/dragonfly_callable_url_host'
|
129
|
-
require 'workarea/ext/freedom_patches/
|
130
|
-
require 'workarea/ext/freedom_patches/
|
132
|
+
require 'workarea/ext/freedom_patches/active_support_duration'
|
133
|
+
require 'workarea/ext/freedom_patches/premailer'
|
131
134
|
require 'workarea/ext/mongoid/list_field'
|
132
135
|
require 'workarea/ext/mongoid/each_by'
|
133
136
|
require 'workarea/ext/mongoid/except'
|
134
137
|
require 'workarea/ext/mongoid/moped_bson'
|
135
138
|
require 'workarea/ext/mongoid/timestamps_timeless'
|
136
139
|
require 'workarea/ext/mongoid/error'
|
140
|
+
require 'workarea/ext/mongoid/lookup_hash'
|
137
141
|
require 'workarea/ext/active_shipping/workarea'
|
138
142
|
require 'workarea/ext/mongoid/audit_log_entry.decorator'
|
139
143
|
require 'workarea/ext/mongoid/find_ordered'
|
140
144
|
require 'workarea/ext/sprockets/ruby_processor'
|
141
145
|
require 'workarea/ext/jbuilder/jbuilder_append_partials'
|
142
|
-
require 'workarea/ext/jbuilder/jbuilder_cache'
|
143
|
-
require 'workarea/ext/referer_parser/parser.decorator'
|
144
146
|
|
145
147
|
if Rails.env.development?
|
146
148
|
require 'workarea/ext/freedom_patches/routes_reloader'
|
@@ -157,6 +159,10 @@ end
|
|
157
159
|
#
|
158
160
|
|
159
161
|
require 'workarea/configuration'
|
162
|
+
require 'workarea/configuration/administrable/field'
|
163
|
+
require 'workarea/configuration/administrable/fieldset'
|
164
|
+
require 'workarea/configuration/administrable/definition'
|
165
|
+
require 'workarea/configuration/administrable_options'
|
160
166
|
require 'workarea/configuration/mongoid_client'
|
161
167
|
require 'workarea/configuration/mongoid'
|
162
168
|
require 'workarea/configuration/elasticsearch'
|
@@ -171,7 +177,8 @@ require 'workarea/configuration/action_mailer'
|
|
171
177
|
require 'workarea/configuration/logstasher'
|
172
178
|
require 'workarea/configuration/error_handling'
|
173
179
|
require 'workarea/configuration/i18n'
|
174
|
-
require 'workarea/configuration/
|
180
|
+
require 'workarea/configuration/session'
|
181
|
+
require 'workarea/configuration/content_blocks'
|
175
182
|
require 'workarea/elasticsearch/index'
|
176
183
|
require 'workarea/elasticsearch/document'
|
177
184
|
require 'workarea/elasticsearch/query_cache'
|
@@ -189,7 +196,6 @@ require 'workarea/plugin'
|
|
189
196
|
require 'workarea/plugin/asset_appends_helper'
|
190
197
|
require 'workarea/image_optim_processor'
|
191
198
|
require 'workarea/url_token'
|
192
|
-
require 'workarea/robots'
|
193
199
|
require 'workarea/paged_array'
|
194
200
|
require 'workarea/geolocation'
|
195
201
|
require 'workarea/autoexpire_cache_redis'
|
@@ -210,17 +216,15 @@ require 'workarea/cache'
|
|
210
216
|
require 'workarea/scheduled_jobs'
|
211
217
|
require 'workarea/string_id'
|
212
218
|
require 'workarea/mail_interceptor'
|
213
|
-
require 'workarea/
|
219
|
+
require 'workarea/visit'
|
220
|
+
require 'workarea/warnings'
|
214
221
|
|
215
222
|
#
|
216
|
-
#
|
223
|
+
# Core
|
217
224
|
#
|
218
225
|
#
|
219
226
|
require 'workarea/version'
|
220
227
|
require 'workarea/core/engine'
|
221
|
-
require 'workarea/admin/engine'
|
222
|
-
require 'workarea/storefront/engine'
|
223
|
-
require 'workarea/testing/engine' if Rails.env.test?
|
224
228
|
|
225
229
|
#
|
226
230
|
# Testing
|