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
@@ -2,6 +2,7 @@ module Workarea
|
|
2
2
|
class SaveOrderMetrics
|
3
3
|
include Sidekiq::Worker
|
4
4
|
include Sidekiq::CallbacksWorker
|
5
|
+
include SaveMetrics
|
5
6
|
|
6
7
|
sidekiq_options enqueue_on: { Order => :place }, queue: 'low'
|
7
8
|
|
@@ -15,87 +16,22 @@ module Workarea
|
|
15
16
|
save_catalog(metrics)
|
16
17
|
save_traffic(metrics)
|
17
18
|
save_pricing(metrics)
|
19
|
+
save_tenders(metrics)
|
20
|
+
save_segments(metrics)
|
18
21
|
|
19
22
|
order.metrics_saved!
|
20
23
|
end
|
21
24
|
|
22
|
-
def save_sales(metrics)
|
23
|
-
Metrics::SalesByDay.inc(at: metrics.placed_at, **metrics.sales_data)
|
24
|
-
end
|
25
|
-
|
26
25
|
def save_user(metrics)
|
27
|
-
Metrics::User.save_order(
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
26
|
+
Metrics::User.save_order(at: metrics.occured_at, **metrics.user_data)
|
27
|
+
Metrics::User.save_affinity(
|
28
|
+
id: metrics.email,
|
29
|
+
action: 'purchased',
|
30
|
+
product_ids: metrics.products.keys,
|
31
|
+
category_ids: metrics.categories.keys,
|
32
|
+
search_ids: metrics.searches.keys
|
32
33
|
)
|
33
34
|
end
|
34
|
-
|
35
|
-
def save_catalog(metrics)
|
36
|
-
metrics.products.each do |product_id, data|
|
37
|
-
Metrics::ProductByDay.inc(
|
38
|
-
key: { product_id: product_id },
|
39
|
-
at: metrics.placed_at,
|
40
|
-
**data
|
41
|
-
)
|
42
|
-
end
|
43
|
-
|
44
|
-
metrics.categories.each do |category_id, data|
|
45
|
-
Metrics::CategoryByDay.inc(
|
46
|
-
key: { category_id: category_id },
|
47
|
-
at: metrics.placed_at,
|
48
|
-
**data
|
49
|
-
)
|
50
|
-
end
|
51
|
-
|
52
|
-
metrics.skus.each do |sku, data|
|
53
|
-
Metrics::SkuByDay.inc(
|
54
|
-
key: { sku: sku },
|
55
|
-
at: metrics.placed_at,
|
56
|
-
**data
|
57
|
-
)
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
def save_traffic(metrics)
|
62
|
-
if metrics.country.present?
|
63
|
-
Metrics::CountryByDay.inc(
|
64
|
-
key: { country: metrics.country },
|
65
|
-
at: metrics.placed_at,
|
66
|
-
**metrics.sales_data
|
67
|
-
)
|
68
|
-
end
|
69
|
-
|
70
|
-
metrics.searches.each do |query_id, data|
|
71
|
-
Metrics::SearchByDay.inc(
|
72
|
-
key: { query_id: query_id },
|
73
|
-
at: metrics.placed_at,
|
74
|
-
**metrics.sales_data
|
75
|
-
)
|
76
|
-
end
|
77
|
-
|
78
|
-
if metrics.traffic_referrer.present?
|
79
|
-
Metrics::TrafficReferrerByDay.inc(
|
80
|
-
key: {
|
81
|
-
medium: metrics.traffic_referrer.medium,
|
82
|
-
source: metrics.traffic_referrer.source
|
83
|
-
},
|
84
|
-
at: metrics.placed_at,
|
85
|
-
**metrics.sales_data
|
86
|
-
)
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
def save_pricing(metrics)
|
91
|
-
metrics.discounts.each do |discount_id, data|
|
92
|
-
Metrics::DiscountByDay.inc(
|
93
|
-
key: { discount_id: discount_id },
|
94
|
-
at: metrics.placed_at,
|
95
|
-
**data
|
96
|
-
)
|
97
|
-
end
|
98
|
-
end
|
99
35
|
end
|
100
36
|
|
101
37
|
def perform(order_id)
|
@@ -3,10 +3,8 @@ module Workarea
|
|
3
3
|
include Sidekiq::Worker
|
4
4
|
|
5
5
|
def perform(*)
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
Admin::StatusReportMailer.report(emails, yesterday).deliver_now
|
6
|
+
users = User.status_email_recipients.to_a
|
7
|
+
Admin::StatusReportMailer.report_to_many(users).each(&:deliver_now)
|
10
8
|
end
|
11
9
|
end
|
12
10
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Workarea
|
2
|
+
class SynchronizeUserMetrics
|
3
|
+
include Sidekiq::Worker
|
4
|
+
include Sidekiq::CallbacksWorker
|
5
|
+
|
6
|
+
sidekiq_options(
|
7
|
+
enqueue_on: { User => :save, only_if: -> { admin_changed? || tags_changed? } },
|
8
|
+
queue: 'low'
|
9
|
+
)
|
10
|
+
|
11
|
+
def perform(id)
|
12
|
+
user = User.find(id)
|
13
|
+
metrics = Metrics::User.find_or_create_by(id: user.email)
|
14
|
+
metrics.set(admin: user.admin?, tags: user.tags)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Workarea
|
2
|
+
class UpdatePaymentProfileEmail
|
3
|
+
include Sidekiq::Worker
|
4
|
+
include Sidekiq::CallbacksWorker
|
5
|
+
|
6
|
+
sidekiq_options(
|
7
|
+
enqueue_on: { User => :update, with: -> { [id, changes] } }
|
8
|
+
)
|
9
|
+
|
10
|
+
def perform(id, changes)
|
11
|
+
if changes['email'].present? && changes['email'].first.present?
|
12
|
+
old_email = changes['email'].first
|
13
|
+
new_email = changes['email'].last
|
14
|
+
|
15
|
+
user = User.find(id)
|
16
|
+
user.email = old_email # set old email so we lookup by old email value
|
17
|
+
|
18
|
+
Payment::Profile.update_email(PaymentReference.new(user), new_email)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -1,14 +1,15 @@
|
|
1
1
|
module Workarea
|
2
|
-
# Verify that jobs for publishing
|
3
|
-
# unintentionally from
|
2
|
+
# Verify that jobs for publishing releases do not get removed
|
3
|
+
# unintentionally from Sidekiq and prevent the release from updating at the
|
4
4
|
# expected time. If any are found missing, add a new job.
|
5
5
|
# Runs hourly by default, 5 minutes before each hour.
|
6
6
|
#
|
7
7
|
class VerifyScheduledReleases
|
8
8
|
include Sidekiq::Worker
|
9
|
+
sidekiq_options queue: 'releases'
|
9
10
|
|
10
11
|
def perform(*)
|
11
|
-
#
|
12
|
+
# PublishRelease uses the default queue,
|
12
13
|
# so only look there for scheduled release jobs
|
13
14
|
job_ids = Sidekiq::Queue.new.map { |job| job.jid }
|
14
15
|
now = Time.current
|
@@ -21,14 +22,6 @@ module Workarea
|
|
21
22
|
release.set_publish_job
|
22
23
|
release.save!
|
23
24
|
end
|
24
|
-
|
25
|
-
if release.undo_at.present? &&
|
26
|
-
release.undo_at > now &&
|
27
|
-
!job_ids.include?(release.undo_job_id)
|
28
|
-
|
29
|
-
release.set_undo_job
|
30
|
-
release.save!
|
31
|
-
end
|
32
25
|
end
|
33
26
|
end
|
34
27
|
end
|
@@ -0,0 +1,185 @@
|
|
1
|
+
Workarea::Configuration.define_fields do
|
2
|
+
fieldset 'Users', namespaced: false do
|
3
|
+
field 'Allowed Login Attempts',
|
4
|
+
type: :integer,
|
5
|
+
default: 6,
|
6
|
+
description: 'How many failed login attempts before marking the user locked out'
|
7
|
+
|
8
|
+
field 'Password Reset Timeout',
|
9
|
+
type: :duration,
|
10
|
+
default: 2.hours,
|
11
|
+
description: 'How long a password reset URL stays valid'
|
12
|
+
|
13
|
+
field 'Password Strength',
|
14
|
+
type: :symbol,
|
15
|
+
default: :weak,
|
16
|
+
values: [
|
17
|
+
['Weak', :weak, title: 'Requires minimum 7 characters'],
|
18
|
+
['Medium', :medium, title: 'Requires minimum 7 characters of letters and numbers'],
|
19
|
+
['Strong', :strong, title: 'Requires minimum 8 characters consisting of letters, numbers, and special characters.']
|
20
|
+
],
|
21
|
+
description: 'Password requirement level for customers. Admin users always require a strong password.'
|
22
|
+
end
|
23
|
+
|
24
|
+
fieldset 'Checkout', namespaced: false do
|
25
|
+
field 'Checkout Expiration',
|
26
|
+
type: :duration,
|
27
|
+
default: 15.minutes,
|
28
|
+
description: 'How long a checkout can be idle before the user is forced to restart'
|
29
|
+
|
30
|
+
field 'Item Count Limit',
|
31
|
+
type: :integer,
|
32
|
+
default: 100,
|
33
|
+
description: 'How many unique items can be added to a single cart'
|
34
|
+
end
|
35
|
+
|
36
|
+
fieldset 'Orders', namespaced: false do
|
37
|
+
field 'Order Active Period',
|
38
|
+
type: :duration,
|
39
|
+
default: 2.hours,
|
40
|
+
description: 'How long an order is active without changing before considering it abandoned'
|
41
|
+
|
42
|
+
field 'Order Expiration Period',
|
43
|
+
type: :duration,
|
44
|
+
default: 6.months,
|
45
|
+
description: 'How long to wait until abandoned orders are deleted from the database'
|
46
|
+
|
47
|
+
field 'Recent Order Count',
|
48
|
+
type: :integer,
|
49
|
+
default: 3,
|
50
|
+
description: 'Number of orders to show in account summary dashboard'
|
51
|
+
|
52
|
+
field 'Storefront User Order Display Count',
|
53
|
+
type: :integer,
|
54
|
+
default: 50,
|
55
|
+
description: 'Number of orders to display on the user order history page'
|
56
|
+
end
|
57
|
+
|
58
|
+
fieldset 'Shipping', namespaced: false do
|
59
|
+
field 'Allow Shipping Address P.O. Box',
|
60
|
+
id: :allow_shipping_address_po_box,
|
61
|
+
type: :boolean,
|
62
|
+
default: false,
|
63
|
+
description: 'Whether or not to allow P.O. Box addresses for shipping addresses'
|
64
|
+
|
65
|
+
field 'Shipping Dimensions',
|
66
|
+
type: :array,
|
67
|
+
default: [1, 1, 1],
|
68
|
+
description: %(
|
69
|
+
Default package dimensions to use for calculating shipping costs.
|
70
|
+
It's recommended to set these to your average or standard box size when
|
71
|
+
using shipping rates from a carrier. Dimensions on specific shipping SKUs
|
72
|
+
will override this value.
|
73
|
+
).squish
|
74
|
+
|
75
|
+
field 'Shipping Origin',
|
76
|
+
type: :hash,
|
77
|
+
default: {
|
78
|
+
country: 'US',
|
79
|
+
state: 'PA',
|
80
|
+
city: 'Philadelphia',
|
81
|
+
zip: '19106'
|
82
|
+
},
|
83
|
+
description: 'Origin location for calculating shipping costs'
|
84
|
+
end
|
85
|
+
|
86
|
+
fieldset 'Payment', namespaced: false do
|
87
|
+
field 'Allow Payment Address P.O. Box',
|
88
|
+
id: :allow_payment_address_po_box,
|
89
|
+
type: :boolean,
|
90
|
+
default: true,
|
91
|
+
description: 'Whether or not to allow P.O. Box addresses for billing addresses'
|
92
|
+
end
|
93
|
+
|
94
|
+
fieldset 'Inventory', namespaced: false do
|
95
|
+
field 'Low Inventory Threshold',
|
96
|
+
type: :integer,
|
97
|
+
default: 5,
|
98
|
+
description: 'Minimum available quantity for a sku before inventory is considered low'
|
99
|
+
end
|
100
|
+
|
101
|
+
fieldset 'Content', namespaced: false do
|
102
|
+
field 'Minimum Content Search Words',
|
103
|
+
type: :integer,
|
104
|
+
default: 5,
|
105
|
+
description: 'Minimum number of words for content to be searchable on the storefront'
|
106
|
+
|
107
|
+
field 'Placeholder Text',
|
108
|
+
type: :string,
|
109
|
+
default: %(
|
110
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin sagittis
|
111
|
+
faucibus augue, sit amet mattis leo tincidunt ac. Nullam vulputate
|
112
|
+
eleifend enim. Nunc eu lorem semper, convallis ipsum pharetra, pretium
|
113
|
+
metus. Donec lobortis dolor ac metus vulputate vulputate nec at nulla.
|
114
|
+
Suspendisse potenti. Praesent placerat elementum justo quis malesuada.
|
115
|
+
Donec sollicitudin ligula augue, rutrum vestibulum ex rutrum in.
|
116
|
+
Integer id orci eu nisl accumsan suscipit a ut sapien. Nam non justo at
|
117
|
+
nibh laoreet tempus. Sed sagittis velit eu tellus imperdiet, et ultricies
|
118
|
+
justo aliquet. Fusce id felis sem.
|
119
|
+
).squish,
|
120
|
+
description: 'Placeholder text used for content block default data'
|
121
|
+
end
|
122
|
+
|
123
|
+
fieldset 'Search', namespaced: false do
|
124
|
+
field 'Default Search Facet Result Sizes',
|
125
|
+
type: :integer,
|
126
|
+
default: 10,
|
127
|
+
description: 'The number of filter results returned for each filter type.'
|
128
|
+
|
129
|
+
field 'Search Facet Result Sizes',
|
130
|
+
type: :hash,
|
131
|
+
values_type: :integer,
|
132
|
+
default: { color: 10, size: 10 },
|
133
|
+
description: %(
|
134
|
+
The number of filter results returned for any specified filter type. If no
|
135
|
+
size is defined for a filter type, the default will be what is specified
|
136
|
+
in the default config above.
|
137
|
+
).squish
|
138
|
+
|
139
|
+
field 'Search Size Facet Sort',
|
140
|
+
id: :search_facet_size_sort,
|
141
|
+
type: :array,
|
142
|
+
default: ['Extra Small', 'Small', 'Medium', 'Large', 'Extra Large'],
|
143
|
+
description: %(
|
144
|
+
The order the size facets will be displayed on storefront search results
|
145
|
+
and category browse.
|
146
|
+
).squish
|
147
|
+
|
148
|
+
field 'Search Sufficient Results',
|
149
|
+
type: :integer,
|
150
|
+
default: 2,
|
151
|
+
description: %(
|
152
|
+
The minimum number of search results required to consider the results
|
153
|
+
sufficient. If a search result set is not sufficient, the search will
|
154
|
+
try another pass with looser options to bring in more matches.
|
155
|
+
).squish
|
156
|
+
|
157
|
+
field 'Search Suggestions',
|
158
|
+
type: :integer,
|
159
|
+
default: 5,
|
160
|
+
description: 'How many search suggestions should be shown in the autocomplete searches.'
|
161
|
+
end
|
162
|
+
|
163
|
+
fieldset 'Communication', namespaced: false do
|
164
|
+
field 'Email From',
|
165
|
+
type: :string,
|
166
|
+
default: 'noreply@example.com',
|
167
|
+
description: 'The email address used as the sender of system emails'
|
168
|
+
|
169
|
+
field 'Email To',
|
170
|
+
type: :string,
|
171
|
+
default: 'customerservice@example.com',
|
172
|
+
description: 'The email address that receives user generated emails, e.g. contact us inquiries'
|
173
|
+
|
174
|
+
field 'Inquiry Subjects',
|
175
|
+
type: :hash,
|
176
|
+
default: {
|
177
|
+
'orders' => 'Orders',
|
178
|
+
'returns' => 'Returns and Exchanges',
|
179
|
+
'products' => 'Product Information',
|
180
|
+
'feedback' => 'Feedback',
|
181
|
+
'general' => 'General Inquiry'
|
182
|
+
},
|
183
|
+
description: 'Subjects list for the contact form'
|
184
|
+
end
|
185
|
+
end
|
@@ -13,13 +13,6 @@ unless Workarea.config.skip_service_connections
|
|
13
13
|
queue: 'low'
|
14
14
|
)
|
15
15
|
|
16
|
-
Sidekiq::Cron::Job.create(
|
17
|
-
name: 'Workarea::CleanUserActivity',
|
18
|
-
klass: 'Workarea::CleanUserActivity',
|
19
|
-
cron: "0 0 * * * #{Time.zone.tzinfo.identifier}",
|
20
|
-
queue: 'low'
|
21
|
-
)
|
22
|
-
|
23
16
|
Sidekiq::Cron::Job.create(
|
24
17
|
name: 'Workarea::ProcessProductRecommendations',
|
25
18
|
klass: 'Workarea::ProcessProductRecommendations',
|
@@ -7,7 +7,6 @@ if !app.config.action_dispatch.rack_cache
|
|
7
7
|
else
|
8
8
|
require 'rack/cache'
|
9
9
|
app.config.middleware.insert_after Rack::Cache, Dragonfly::Middleware, :workarea
|
10
|
-
app.config.middleware.insert_before Rack::Cache, Workarea::RackCacheConfigMiddleware
|
11
10
|
end
|
12
11
|
|
13
12
|
unless Rails.env.test? || Rails.env.development?
|
@@ -23,7 +22,5 @@ Rails.application.config.middleware.insert_after(
|
|
23
22
|
)
|
24
23
|
|
25
24
|
app.config.middleware.use Workarea::EnforceHostMiddleware
|
26
|
-
|
27
|
-
if Rails.env.test?
|
28
|
-
app.config.middleware.insert(0, Workarea::StripHttpCachingMiddleware)
|
29
|
-
end
|
25
|
+
app.config.middleware.insert(0, Workarea::ApplicationMiddleware)
|
26
|
+
app.config.middleware.insert(0, Workarea::StripHttpCachingMiddleware) if Rails.env.test?
|
@@ -2,6 +2,10 @@ if Rails.env.test? || Rails.env.development?
|
|
2
2
|
ActiveMerchant::Billing::Base.mode = :test
|
3
3
|
end
|
4
4
|
|
5
|
+
if Rails.env.test?
|
6
|
+
Workarea.config.fraud_analyzer = "Workarea::Checkout::Fraud::TestAnalyzer"
|
7
|
+
end
|
8
|
+
|
5
9
|
if Workarea.config.gateways.credit_card.blank?
|
6
10
|
Workarea.config.gateways.credit_card = ActiveMerchant::Billing::BogusGateway.new
|
7
11
|
ActiveMerchant::Billing::Base.mode = :test
|
@@ -30,7 +30,7 @@ class Rack::Attack
|
|
30
30
|
#
|
31
31
|
# Key: "rack::attack:ignore/cookies/admin"
|
32
32
|
safelist('ignore/admins') do |request|
|
33
|
-
request.
|
33
|
+
request.env['workarea.visit']&.admin?
|
34
34
|
end
|
35
35
|
|
36
36
|
#
|
@@ -157,9 +157,7 @@ class Rack::Attack
|
|
157
157
|
# number is usable.
|
158
158
|
#
|
159
159
|
blocklist('req/credit_cards') do |request|
|
160
|
-
|
161
|
-
|
162
|
-
Rack::Attack::Allow2Ban.filter(key, maxretry: 10, findtime: 1.hour, bantime: 1.day) do
|
160
|
+
Rack::Attack::Allow2Ban.filter(request.ip, maxretry: 10, findtime: 1.hour, bantime: 1.day) do
|
163
161
|
request.path =~ /place_order|credit_cards/ && !request.get?
|
164
162
|
end
|
165
163
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
Workarea
|
1
|
+
Workarea.define_content_block_types do
|
2
2
|
#
|
3
3
|
# Columnar Blocks
|
4
4
|
#
|
@@ -8,8 +8,8 @@ Workarea::Content.define_block_types do
|
|
8
8
|
description 'Positionable button over a background image.'
|
9
9
|
|
10
10
|
fieldset 'Image' do
|
11
|
-
field 'Asset', :asset, required: true, file_types: 'image', default: find_asset_id_by_file_name('960x470_light.png')
|
12
|
-
field 'Alt Text', :string, default: '
|
11
|
+
field 'Asset', :asset, required: true, file_types: 'image', default: find_asset_id_by_file_name('960x470_light.png'), alt_field: 'Alt Text'
|
12
|
+
field 'Alt Text', :string, default: ''
|
13
13
|
end
|
14
14
|
|
15
15
|
fieldset 'Button' do
|
@@ -38,8 +38,8 @@ Workarea::Content.define_block_types do
|
|
38
38
|
tags %w(image)
|
39
39
|
description 'An image with an optional link.'
|
40
40
|
|
41
|
-
field 'Image', :asset, required: true, file_types: 'image', default: find_asset_id_by_file_name('960x470_light.png')
|
42
|
-
field 'Alt', :string, default: '
|
41
|
+
field 'Image', :asset, required: true, file_types: 'image', default: find_asset_id_by_file_name('960x470_light.png'), alt_field: 'Alt'
|
42
|
+
field 'Alt', :string, default: ''
|
43
43
|
field 'Link', :url, default: '/'
|
44
44
|
field 'Align', :options, values: %w(Left Center Right), default: 'Center'
|
45
45
|
end
|
@@ -77,8 +77,8 @@ Workarea::Content.define_block_types do
|
|
77
77
|
end
|
78
78
|
|
79
79
|
fieldset 'Image' do
|
80
|
-
field 'Image', :asset, file_types: 'image', default: find_asset_id_by_file_name('100x100.png')
|
81
|
-
field 'Image Alt', :string, default: '
|
80
|
+
field 'Image', :asset, file_types: 'image', default: find_asset_id_by_file_name('100x100.png'), alt_field: 'Image Alt'
|
81
|
+
field 'Image Alt', :string, default: ''
|
82
82
|
field 'Image Link', :url, default: '/'
|
83
83
|
field 'Image Position', :options, values: %w(Right Left), default: 'Left'
|
84
84
|
end
|
@@ -96,8 +96,8 @@ Workarea::Content.define_block_types do
|
|
96
96
|
end
|
97
97
|
|
98
98
|
fieldset 'Image' do
|
99
|
-
field 'Image', :asset, file_types: 'image', default: find_asset_id_by_file_name('100x100.png')
|
100
|
-
field 'Image Alt', :string, default: '
|
99
|
+
field 'Image', :asset, file_types: 'image', default: find_asset_id_by_file_name('100x100.png'), alt_field: 'Image Alt'
|
100
|
+
field 'Image Alt', :string, default: ''
|
101
101
|
field 'Image Link', :url, default: '/'
|
102
102
|
field 'Image Position', :options, values: %w(Right Left), default: 'Left'
|
103
103
|
end
|
@@ -115,8 +115,8 @@ Workarea::Content.define_block_types do
|
|
115
115
|
end
|
116
116
|
|
117
117
|
fieldset 'Image' do
|
118
|
-
field 'Image', :asset, file_types: 'image', default: find_asset_id_by_file_name('100x100.png')
|
119
|
-
field 'Image Alt', :string, default: '
|
118
|
+
field 'Image', :asset, file_types: 'image', default: find_asset_id_by_file_name('100x100.png'), alt_field: 'Image Alt'
|
119
|
+
field 'Image Alt', :string, default: ''
|
120
120
|
field 'Image Link', :url, default: '/'
|
121
121
|
field 'Image Position', :options, values: %w(Right Left), default: 'Left'
|
122
122
|
end
|
@@ -126,7 +126,7 @@ Workarea::Content.define_block_types do
|
|
126
126
|
tags %w(quote)
|
127
127
|
description 'A block of text styled like a quote.'
|
128
128
|
|
129
|
-
field 'Quote', :text, required: true, default: Workarea.config.placeholder_text
|
129
|
+
field 'Quote', :text, required: true, default: -> { Workarea.config.placeholder_text }
|
130
130
|
field 'Author', :string, default: ''
|
131
131
|
end
|
132
132
|
|
@@ -140,8 +140,8 @@ Workarea::Content.define_block_types do
|
|
140
140
|
description 'A group of images.'
|
141
141
|
|
142
142
|
series 6 do
|
143
|
-
field 'Image', :asset, default: find_asset_id_by_file_name('960x470_dark.png')
|
144
|
-
field 'Alt', :string, default: '
|
143
|
+
field 'Image', :asset, default: find_asset_id_by_file_name('960x470_dark.png'), alt_field: 'Alt'
|
144
|
+
field 'Alt', :string, default: ''
|
145
145
|
field 'Link', :url, default: '/'
|
146
146
|
end
|
147
147
|
end
|
@@ -151,8 +151,8 @@ Workarea::Content.define_block_types do
|
|
151
151
|
description 'Image and formatted text including headings, lists, bold, and italic.'
|
152
152
|
|
153
153
|
fieldset 'Image' do
|
154
|
-
field 'Image', :asset, required: true, file_types: 'image', default: find_asset_id_by_file_name('100x100.png')
|
155
|
-
field 'Image Alt', :string, default: '
|
154
|
+
field 'Image', :asset, required: true, file_types: 'image', default: find_asset_id_by_file_name('100x100.png'), alt_field: 'Image Alt'
|
155
|
+
field 'Image Alt', :string, default: ''
|
156
156
|
field 'Image Link', :url, default: '/'
|
157
157
|
field 'Image Position', :options, values: %w(Right Left), default: 'Left'
|
158
158
|
end
|
@@ -3,8 +3,7 @@
|
|
3
3
|
#
|
4
4
|
Easymon::Repository.add(
|
5
5
|
'mongodb',
|
6
|
-
Workarea::Monitoring::MongoidCheck.new
|
7
|
-
:critical
|
6
|
+
Workarea::Monitoring::MongoidCheck.new
|
8
7
|
)
|
9
8
|
|
10
9
|
#
|
@@ -12,8 +11,7 @@ Easymon::Repository.add(
|
|
12
11
|
#
|
13
12
|
Easymon::Repository.add(
|
14
13
|
'elasticsearch',
|
15
|
-
Workarea::Monitoring::ElasticsearchCheck.new
|
16
|
-
:critical
|
14
|
+
Workarea::Monitoring::ElasticsearchCheck.new
|
17
15
|
)
|
18
16
|
|
19
17
|
#
|
@@ -23,8 +21,7 @@ Easymon::Repository.add(
|
|
23
21
|
"redis",
|
24
22
|
Easymon::RedisCheck.new(
|
25
23
|
Workarea::Configuration::Redis.persistent.to_h
|
26
|
-
)
|
27
|
-
:critical
|
24
|
+
)
|
28
25
|
)
|
29
26
|
|
30
27
|
#
|
File without changes
|
data/config/locales/en.yml
CHANGED
@@ -50,33 +50,12 @@ en:
|
|
50
50
|
unit: instance
|
51
51
|
csv:
|
52
52
|
unit: row
|
53
|
-
duration:
|
54
|
-
years:
|
55
|
-
one: '%{count} year'
|
56
|
-
other: '%{count} years'
|
57
|
-
months:
|
58
|
-
one: '%{count} month'
|
59
|
-
other: '%{count} months'
|
60
|
-
weeks:
|
61
|
-
one: '%{count} week'
|
62
|
-
other: '%{count} weeks'
|
63
|
-
days:
|
64
|
-
one: '%{count} day'
|
65
|
-
other: '%{count} days'
|
66
|
-
hours:
|
67
|
-
one: '%{count} hour'
|
68
|
-
other: '%{count} hours'
|
69
|
-
minutes:
|
70
|
-
one: '%{count} minute'
|
71
|
-
other: '%{count} minutes'
|
72
|
-
seconds:
|
73
|
-
one: '%{count} second'
|
74
|
-
other: '%{count} seconds'
|
75
53
|
errors:
|
76
54
|
messages:
|
77
55
|
contains_type: cannot contain 'type'
|
78
56
|
not_a_date: must be a date
|
79
57
|
invalid_credit_card_number: is not a valid credit card number
|
58
|
+
invalid_credit_card_issuer: '%{value} cards are not accepted. We accept %{issuers}.'
|
80
59
|
expired_date: is an expired date
|
81
60
|
incomplete: is incomplete
|
82
61
|
must_be_future: must be in the future
|
@@ -91,14 +70,16 @@ en:
|
|
91
70
|
must_be_unique: must be unique
|
92
71
|
not_star_query: "cannot be '*'"
|
93
72
|
undo_unpublished_release: cannot be set when Publish Date is blank
|
73
|
+
max_allowed_segments: You cannot have more than 15 total segments in Workarea.
|
74
|
+
unsupported_segmentation: aren't supported for pricing.
|
94
75
|
facets:
|
95
76
|
price_range:
|
96
77
|
over: 'Over %{price}'
|
97
78
|
under: 'Under %{price}'
|
79
|
+
fulfillment_sku:
|
80
|
+
name: "Fulfillment SKU %{id}"
|
98
81
|
inventory_sku:
|
99
82
|
name: "Inventory %{id}"
|
100
|
-
inquiry:
|
101
|
-
subjects: {}
|
102
83
|
order:
|
103
84
|
name: "Order %{id}"
|
104
85
|
traffic_referrer:
|
@@ -108,6 +89,8 @@ en:
|
|
108
89
|
search: search
|
109
90
|
social: social
|
110
91
|
unknown: unknown
|
92
|
+
errors:
|
93
|
+
count_limit: Orders cannot exceed %{size} items.
|
111
94
|
messages:
|
112
95
|
info: Info
|
113
96
|
error: Error
|
@@ -131,10 +114,14 @@ en:
|
|
131
114
|
description: Price Override
|
132
115
|
pricing_sku:
|
133
116
|
name: "Pricing %{id}"
|
117
|
+
release:
|
118
|
+
undo: Undo %{name}
|
134
119
|
sorts:
|
135
120
|
available: Available
|
136
121
|
average_order_value: Average Order Total
|
122
|
+
country: Country
|
137
123
|
destination: Destination
|
124
|
+
downloads: Most Downloaded
|
138
125
|
end: End Date
|
139
126
|
last_updated: Recently Updated
|
140
127
|
modified: Last Updated
|
@@ -147,6 +134,7 @@ en:
|
|
147
134
|
path: Path
|
148
135
|
pending: Pending
|
149
136
|
popularity: Most Popular
|
137
|
+
postal_code: Postal Code
|
150
138
|
price_asc: Price, Low to High
|
151
139
|
price_desc: Price, High to Low
|
152
140
|
published_date: Published Date
|
@@ -154,6 +142,7 @@ en:
|
|
154
142
|
query: Search Terms
|
155
143
|
rating: Highest Rated
|
156
144
|
redemptions: Most Redeemed
|
145
|
+
region: Region
|
157
146
|
relevance: Relevance
|
158
147
|
sales: Sales
|
159
148
|
sku: SKU
|