workarea-admin 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/images/workarea/admin/email_logo.png +0 -0
- data/app/assets/javascripts/workarea/admin/application.js.erb +11 -1
- data/app/assets/javascripts/workarea/admin/config.js.erb +96 -0
- data/app/assets/javascripts/workarea/admin/modules/active_by_segment_tooltips.js +108 -0
- data/app/assets/javascripts/workarea/admin/modules/calendars.js +1 -1
- data/app/assets/javascripts/workarea/admin/modules/categorized_autocomplete_fields.js +1 -1
- data/app/assets/javascripts/workarea/admin/modules/impersonation_notification.js +44 -0
- data/app/assets/javascripts/workarea/admin/modules/jump_to_menus.js +74 -0
- data/app/assets/javascripts/workarea/admin/modules/new_navigation_taxons.js +1 -2
- data/app/assets/javascripts/workarea/admin/modules/release_reminder.js +1 -0
- data/app/assets/javascripts/workarea/admin/modules/selects.js +33 -0
- data/app/assets/javascripts/workarea/admin/modules/style_guide_autocomplete_fields.js +42 -0
- data/app/assets/javascripts/workarea/admin/modules/timeline_report_chart.js +105 -0
- data/app/assets/javascripts/workarea/admin/modules/toggle_elements.js +27 -0
- data/app/assets/javascripts/workarea/admin/modules/tribute_areas.js +91 -0
- data/app/assets/javascripts/workarea/admin/templates/chart_legend.jst.ejs +17 -9
- data/app/assets/javascripts/workarea/admin/templates/jump_to_menu.jst.ejs +13 -0
- data/app/assets/stylesheets/workarea/admin/application.scss.erb +3 -0
- data/app/assets/stylesheets/workarea/admin/base/_forms.scss +2 -2
- data/app/assets/stylesheets/workarea/admin/components/_activity.scss +24 -16
- data/app/assets/stylesheets/workarea/admin/components/_activity_group.scss +3 -19
- data/app/assets/stylesheets/workarea/admin/components/_box.scss +21 -5
- data/app/assets/stylesheets/workarea/admin/components/_calendar.scss +102 -140
- data/app/assets/stylesheets/workarea/admin/components/_chart_legend.scss +10 -13
- data/app/assets/stylesheets/workarea/admin/components/_checkbox.scss +49 -23
- data/app/assets/stylesheets/workarea/admin/components/_content_block_list.scss +5 -3
- data/app/assets/stylesheets/workarea/admin/components/_date_marker.scss +24 -3
- data/app/assets/stylesheets/workarea/admin/components/_index_table.scss +5 -0
- data/app/assets/stylesheets/workarea/admin/components/_jump_to_menu.scss +57 -0
- data/app/assets/stylesheets/workarea/admin/components/_product_summary.scss +46 -0
- data/app/assets/stylesheets/workarea/admin/components/_toggle_button.scss +1 -4
- data/app/assets/stylesheets/workarea/admin/email/_base.scss +30 -2
- data/app/assets/stylesheets/workarea/admin/email/_components.scss +66 -5
- data/app/assets/stylesheets/workarea/admin/email/_helpers.scss +16 -5
- data/app/assets/stylesheets/workarea/admin/email/{_settings.scss → _settings.scss.erb} +4 -4
- data/app/controllers/workarea/admin/application_controller.rb +2 -4
- data/app/controllers/workarea/admin/bulk_action_sequential_product_edits_controller.rb +4 -6
- data/app/controllers/workarea/admin/bulk_variant_saving.rb +1 -2
- data/app/controllers/workarea/admin/catalog_products_controller.rb +4 -6
- data/app/controllers/workarea/admin/catalog_variants_controller.rb +2 -3
- data/app/controllers/workarea/admin/comments_controller.rb +9 -0
- data/app/controllers/workarea/admin/configurations_controller.rb +29 -0
- data/app/controllers/workarea/admin/content_assets_controller.rb +3 -1
- data/app/controllers/workarea/admin/content_blocks_controller.rb +1 -7
- data/app/controllers/workarea/admin/create_catalog_products_controller.rb +2 -8
- data/app/controllers/workarea/admin/create_release_undos_controller.rb +43 -0
- data/app/controllers/workarea/admin/create_segments_controller.rb +68 -0
- data/app/controllers/workarea/admin/dashboards_controller.rb +2 -0
- data/app/controllers/workarea/admin/data_file_imports_controller.rb +7 -2
- data/app/controllers/workarea/admin/fulfillment_skus_controller.rb +58 -0
- data/app/controllers/workarea/admin/fulfillment_tokens_controller.rb +56 -0
- data/app/controllers/workarea/admin/guest_browsings_controller.rb +2 -2
- data/app/controllers/workarea/admin/impersonations_controller.rb +3 -4
- data/app/controllers/workarea/admin/orders_controller.rb +3 -0
- data/app/controllers/workarea/admin/pricing_discount_redemptions_controller.rb +13 -0
- data/app/controllers/workarea/admin/pricing_overrides_controller.rb +1 -1
- data/app/controllers/workarea/admin/product_rules_controller.rb +1 -2
- data/app/controllers/workarea/admin/releases_controller.rb +8 -13
- data/app/controllers/workarea/admin/reports_controller.rb +18 -0
- data/app/controllers/workarea/admin/segment_overrides_controller.rb +19 -0
- data/app/controllers/workarea/admin/segment_rules_controller.rb +62 -0
- data/app/controllers/workarea/admin/segments_controller.rb +48 -0
- data/app/controllers/workarea/admin/tax_rates_controller.rb +62 -1
- data/app/controllers/workarea/admin/unsubscribes_controller.rb +40 -0
- data/app/controllers/workarea/admin/users_controller.rb +19 -0
- data/app/helpers/workarea/admin/application_helper.rb +2 -12
- data/app/helpers/workarea/admin/configurations_helper.rb +9 -0
- data/app/helpers/workarea/admin/content_helper.rb +2 -3
- data/app/helpers/workarea/admin/fulfillment_helper.rb +10 -0
- data/app/helpers/workarea/admin/icons_helper.rb +26 -0
- data/app/helpers/workarea/admin/navigation_helper.rb +1 -0
- data/app/helpers/workarea/admin/pricing_overrides_helper.rb +1 -1
- data/app/helpers/workarea/admin/products_helper.rb +13 -0
- data/app/helpers/workarea/admin/releases_helper.rb +5 -21
- data/app/helpers/workarea/admin/segments_helper.rb +68 -0
- data/app/helpers/workarea/admin/settings_helper.rb +11 -3
- data/app/mailers/workarea/admin/comment_mailer.rb +3 -3
- data/app/mailers/workarea/admin/status_report_mailer.rb +19 -6
- data/app/view_models/workarea/admin/bulk_action_product_edit_view_model.rb +5 -0
- data/app/view_models/workarea/admin/changeset_view_model.rb +15 -3
- data/app/view_models/workarea/admin/code_list_view_model.rb +1 -1
- data/app/view_models/workarea/admin/commentable_view_model.rb +4 -0
- data/app/view_models/workarea/admin/content_view_model.rb +2 -0
- data/app/view_models/workarea/admin/dashboards/marketing_view_model.rb +5 -9
- data/app/view_models/workarea/admin/dashboards/reports_view_model.rb +25 -0
- data/app/view_models/workarea/admin/discounts/buy_some_get_some_view_model.rb +6 -0
- data/app/view_models/workarea/admin/discounts/category_view_model.rb +6 -0
- data/app/view_models/workarea/admin/discounts/free_gift_view_model.rb +6 -0
- data/app/view_models/workarea/admin/discounts/order_total_view_model.rb +6 -0
- data/app/view_models/workarea/admin/discounts/product_attribute_view_model.rb +6 -0
- data/app/view_models/workarea/admin/discounts/product_view_model.rb +6 -0
- data/app/view_models/workarea/admin/discounts/quantity_fixed_price_view_model.rb +6 -0
- data/app/view_models/workarea/admin/discounts/shipping_view_model.rb +6 -0
- data/app/view_models/workarea/admin/featured_products_view_model.rb +6 -12
- data/app/view_models/workarea/admin/fulfillment_sku_view_model.rb +22 -0
- data/app/view_models/workarea/admin/fulfillment_token_view_model.rb +15 -0
- data/app/view_models/workarea/admin/fulfillment_view_model.rb +14 -0
- data/app/view_models/workarea/admin/insight_view_model.rb +2 -2
- data/app/view_models/workarea/admin/insights/product_view_model.rb +2 -2
- data/app/view_models/workarea/admin/insights/segment_view_model.rb +25 -0
- data/app/view_models/workarea/admin/order_view_model.rb +4 -0
- data/app/view_models/workarea/admin/pricing_sku_view_model.rb +0 -51
- data/app/view_models/workarea/admin/product_rules_preview_view_model.rb +2 -2
- data/app/view_models/workarea/admin/product_view_model.rb +26 -5
- data/app/view_models/workarea/admin/recommendations_view_model.rb +3 -11
- data/app/view_models/workarea/admin/release_calendar_view_model.rb +4 -9
- data/app/view_models/workarea/admin/release_event_view_model.rb +8 -41
- data/app/view_models/workarea/admin/release_view_model.rb +10 -17
- data/app/view_models/workarea/admin/releases_feed_view_model.rb +5 -13
- data/app/view_models/workarea/admin/reports/customers_view_model.rb +4 -2
- data/app/view_models/workarea/admin/reports/low_inventory_view_model.rb +2 -5
- data/app/view_models/workarea/admin/reports/sales_by_category_view_model.rb +2 -5
- data/app/view_models/workarea/admin/reports/sales_by_discount_view_model.rb +2 -5
- data/app/view_models/workarea/admin/reports/sales_by_product_view_model.rb +2 -5
- data/app/view_models/workarea/admin/reports/sales_by_tender_view_model.rb +13 -0
- data/app/view_models/workarea/admin/reports/timeline_view_model.rb +74 -0
- data/app/view_models/workarea/admin/search_customization_product_rules_view_model.rb +1 -1
- data/app/view_models/workarea/admin/segment_view_model.rb +19 -0
- data/app/view_models/workarea/admin/user_view_model.rb +6 -9
- data/app/view_models/workarea/admin/variant_view_model.rb +8 -0
- data/app/views/layouts/workarea/admin/application.html.haml +1 -1
- data/app/views/layouts/workarea/admin/email.html.haml +35 -41
- data/app/views/workarea/admin/activities/_configuration_admin_update.html.haml +10 -0
- data/app/views/workarea/admin/activities/_fulfillment_sku_create.html.haml +12 -0
- data/app/views/workarea/admin/activities/_fulfillment_sku_destroy.html.haml +10 -0
- data/app/views/workarea/admin/activities/_fulfillment_sku_update.html.haml +10 -0
- data/app/views/workarea/admin/activities/_segment_create.html.haml +12 -0
- data/app/views/workarea/admin/activities/_segment_destroy.html.haml +10 -0
- data/app/views/workarea/admin/activities/_segment_update.html.haml +10 -0
- data/app/views/workarea/admin/activities/show.html.haml +18 -11
- data/app/views/workarea/admin/bulk_action_product_edits/edit.html.haml +4 -0
- data/app/views/workarea/admin/bulk_action_product_edits/review.html.haml +11 -4
- data/app/views/workarea/admin/bulk_action_sequential_product_edits/product.html.haml +1 -1
- data/app/views/workarea/admin/catalog_categories/_cards.html.haml +3 -1
- data/app/views/workarea/admin/catalog_categories/edit.html.haml +1 -4
- data/app/views/workarea/admin/catalog_categories/index.html.haml +1 -0
- data/app/views/workarea/admin/catalog_product_images/edit.html.haml +1 -1
- data/app/views/workarea/admin/catalog_products/_cards.html.haml +2 -4
- data/app/views/workarea/admin/catalog_products/edit.html.haml +2 -1
- data/app/views/workarea/admin/catalog_products/index.html.haml +4 -2
- data/app/views/workarea/admin/catalog_products/insights.html.haml +2 -0
- data/app/views/workarea/admin/catalog_variants/edit.html.haml +6 -1
- data/app/views/workarea/admin/catalog_variants/index.html.haml +2 -0
- data/app/views/workarea/admin/catalog_variants/new.html.haml +5 -0
- data/app/views/workarea/admin/changesets/fields/_active_segment_ids.html.haml +4 -0
- data/app/views/workarea/admin/comment_mailer/notify.html.haml +27 -19
- data/app/views/workarea/admin/comments/index.html.haml +18 -12
- data/app/views/workarea/admin/configurations/_overridden.html.haml +2 -0
- data/app/views/workarea/admin/configurations/show.html.haml +49 -0
- data/app/views/workarea/admin/configurations/types/_array.html.haml +3 -0
- data/app/views/workarea/admin/configurations/types/_boolean.html.haml +1 -0
- data/app/views/workarea/admin/configurations/types/_duration.html.haml +2 -0
- data/app/views/workarea/admin/configurations/types/_encrypted.html.haml +1 -0
- data/app/views/workarea/admin/configurations/types/_float.html.haml +1 -0
- data/app/views/workarea/admin/configurations/types/_hash.html.haml +17 -0
- data/app/views/workarea/admin/configurations/types/_integer.html.haml +1 -0
- data/app/views/workarea/admin/configurations/types/_select.html.haml +1 -0
- data/app/views/workarea/admin/configurations/types/_string.html.haml +1 -0
- data/app/views/workarea/admin/configurations/types/_symbol.html.haml +1 -0
- data/app/views/workarea/admin/content/_edit.html.haml +8 -1
- data/app/views/workarea/admin/content/_form.html.haml +13 -7
- data/app/views/workarea/admin/content/advanced.html.haml +18 -10
- data/app/views/workarea/admin/content_assets/_cards.html.haml +3 -0
- data/app/views/workarea/admin/content_assets/_summary.html.haml +1 -1
- data/app/views/workarea/admin/content_assets/edit.html.haml +6 -0
- data/app/views/workarea/admin/content_assets/index.html.haml +7 -2
- data/app/views/workarea/admin/content_assets/new.html.haml +10 -3
- data/app/views/workarea/admin/content_blocks/_asset.html.haml +8 -1
- data/app/views/workarea/admin/content_pages/_cards.html.haml +1 -0
- data/app/views/workarea/admin/content_pages/edit.html.haml +1 -1
- data/app/views/workarea/admin/content_pages/index.html.haml +1 -0
- data/app/views/workarea/admin/create_catalog_categories/publish.html.haml +1 -0
- data/app/views/workarea/admin/create_catalog_products/content.html.haml +1 -1
- data/app/views/workarea/admin/create_catalog_products/publish.html.haml +1 -0
- data/app/views/workarea/admin/create_content_pages/publish.html.haml +1 -0
- data/app/views/workarea/admin/create_pricing_discounts/publish.html.haml +1 -0
- data/app/views/workarea/admin/create_release_undos/new.html.haml +45 -0
- data/app/views/workarea/admin/create_release_undos/review.html.haml +51 -0
- data/app/views/workarea/admin/create_releases/plan.html.haml +4 -3
- data/app/views/workarea/admin/create_releases/setup.html.haml +8 -12
- data/app/views/workarea/admin/create_segments/rules.html.haml +55 -0
- data/app/views/workarea/admin/create_segments/setup.html.haml +42 -0
- data/app/views/workarea/admin/create_users/admin.html.haml +0 -2
- data/app/views/workarea/admin/dashboards/catalog.html.haml +1 -0
- data/app/views/workarea/admin/dashboards/people.html.haml +1 -1
- data/app/views/workarea/admin/dashboards/reports.html.haml +31 -0
- data/app/views/workarea/admin/dashboards/settings.html.haml +23 -3
- data/app/views/workarea/admin/data_file_imports/new.html.haml +4 -2
- data/app/views/workarea/admin/data_file_mailer/export.html.haml +2 -0
- data/app/views/workarea/admin/data_file_mailer/import.html.haml +2 -0
- data/app/views/workarea/admin/data_file_mailer/import_failure.html.haml +2 -0
- data/app/views/workarea/admin/facets/_applied.html.haml +1 -1
- data/app/views/workarea/admin/featured_products/_selected.html.haml +3 -2
- data/app/views/workarea/admin/featured_products/_unselected.html.haml +3 -1
- data/app/views/workarea/admin/featured_products/edit.html.haml +3 -3
- data/app/views/workarea/admin/featured_products/select.html.haml +0 -1
- data/app/views/workarea/admin/fulfillment_skus/_aux_navigation.html.haml +3 -0
- data/app/views/workarea/admin/fulfillment_skus/_cards.html.haml +57 -0
- data/app/views/workarea/admin/fulfillment_skus/_summary.html.haml +6 -0
- data/app/views/workarea/admin/fulfillment_skus/edit.html.haml +53 -0
- data/app/views/workarea/admin/fulfillment_skus/index.html.haml +75 -0
- data/app/views/workarea/admin/fulfillment_skus/new.html.haml +41 -0
- data/app/views/workarea/admin/fulfillment_skus/show.html.haml +17 -0
- data/app/views/workarea/admin/fulfillment_tokens/index.html.haml +73 -0
- data/app/views/workarea/admin/fulfillments/show.html.haml +41 -6
- data/app/views/workarea/admin/insights/_most_discounted_products.html.haml +4 -4
- data/app/views/workarea/admin/inventory_skus/show.html.haml +1 -1
- data/app/views/workarea/admin/navigation_menus/_summary.html.haml +1 -1
- data/app/views/workarea/admin/navigation_menus/edit.html.haml +1 -1
- data/app/views/workarea/admin/navigation_menus/index.html.haml +3 -1
- data/app/views/workarea/admin/navigation_redirects/index.html.haml +0 -5
- data/app/views/workarea/admin/navigation_taxons/index.html.haml +20 -4
- data/app/views/workarea/admin/orders/_cards.html.haml +23 -5
- data/app/views/workarea/admin/orders/attributes.html.haml +4 -1
- data/app/views/workarea/admin/orders/fraud.html.haml +43 -0
- data/app/views/workarea/admin/orders/index.html.haml +1 -0
- data/app/views/workarea/admin/orders/timeline.html.haml +1 -1
- data/app/views/workarea/admin/pricing_discount_code_lists/_cards.html.haml +1 -1
- data/app/views/workarea/admin/pricing_discount_code_lists/promo_codes.html.haml +1 -1
- data/app/views/workarea/admin/pricing_discount_redemptions/index.html.haml +44 -0
- data/app/views/workarea/admin/pricing_discounts/_cards.html.haml +22 -0
- data/app/views/workarea/admin/pricing_discounts/conditions/_segments.html.haml +5 -0
- data/app/views/workarea/admin/pricing_discounts/edit.html.haml +5 -15
- data/app/views/workarea/admin/pricing_discounts/index.html.haml +1 -0
- data/app/views/workarea/admin/pricing_discounts/properties/_buy_some_get_some.html.haml +1 -0
- data/app/views/workarea/admin/pricing_discounts/properties/_category.html.haml +1 -0
- data/app/views/workarea/admin/pricing_discounts/properties/_free_gift.html.haml +1 -0
- data/app/views/workarea/admin/pricing_discounts/properties/_order_total.html.haml +1 -0
- data/app/views/workarea/admin/pricing_discounts/properties/_product.html.haml +1 -0
- data/app/views/workarea/admin/pricing_discounts/properties/_product_attribute.html.haml +2 -1
- data/app/views/workarea/admin/pricing_discounts/properties/_quantity_fixed_price.html.haml +1 -0
- data/app/views/workarea/admin/pricing_discounts/properties/_shipping.html.haml +1 -0
- data/app/views/workarea/admin/pricing_skus/_cards.html.haml +7 -7
- data/app/views/workarea/admin/pricing_skus/edit.html.haml +5 -5
- data/app/views/workarea/admin/pricing_skus/index.html.haml +4 -4
- data/app/views/workarea/admin/pricing_skus/new.html.haml +6 -9
- data/app/views/workarea/admin/product_rules/_card.html.haml +2 -2
- data/app/views/workarea/admin/product_rules/_form.html.haml +1 -0
- data/app/views/workarea/admin/product_rules/index.html.haml +2 -0
- data/app/views/workarea/admin/releases/_cards.html.haml +50 -12
- data/app/views/workarea/admin/releases/_publish.html.haml +1 -1
- data/app/views/workarea/admin/releases/edit.html.haml +33 -46
- data/app/views/workarea/admin/releases/index.html.haml +81 -90
- data/app/views/workarea/admin/releases/list.html.haml +107 -0
- data/app/views/workarea/admin/releases/original.html.haml +50 -0
- data/app/views/workarea/admin/releases/show.html.haml +3 -17
- data/app/views/workarea/admin/releases/undo.html.haml +64 -0
- data/app/views/workarea/admin/reports/average_order_value.html.haml +1 -1
- data/app/views/workarea/admin/reports/customers.html.haml +4 -0
- data/app/views/workarea/admin/reports/first_time_vs_returning_sales.html.haml +1 -1
- data/app/views/workarea/admin/reports/reference.html.haml +19 -60
- data/app/views/workarea/admin/reports/sales_by_country.html.haml +6 -0
- data/app/views/workarea/admin/reports/sales_by_product.html.haml +6 -0
- data/app/views/workarea/admin/reports/sales_by_sku.html.haml +6 -0
- data/app/views/workarea/admin/reports/sales_by_tender.html.haml +30 -0
- data/app/views/workarea/admin/reports/sales_over_time.html.haml +5 -1
- data/app/views/workarea/admin/reports/timeline.html.haml +20 -0
- data/app/views/workarea/admin/search_customizations/_cards.html.haml +1 -0
- data/app/views/workarea/admin/search_customizations/edit.html.haml +1 -1
- data/app/views/workarea/admin/search_customizations/index.html.haml +1 -0
- data/app/views/workarea/admin/searches/show.html.haml +6 -5
- data/app/views/workarea/admin/segment_overrides/show.html.haml +29 -0
- data/app/views/workarea/admin/segment_rules/_form.html.haml +13 -0
- data/app/views/workarea/admin/segment_rules/fields/_browser_info.html.haml +13 -0
- data/app/views/workarea/admin/segment_rules/fields/_geolocation.html.haml +4 -0
- data/app/views/workarea/admin/segment_rules/fields/_last_order.html.haml +3 -0
- data/app/views/workarea/admin/segment_rules/fields/_logged_in.html.haml +2 -0
- data/app/views/workarea/admin/segment_rules/fields/_orders.html.haml +5 -0
- data/app/views/workarea/admin/segment_rules/fields/_revenue.html.haml +9 -0
- data/app/views/workarea/admin/segment_rules/fields/_sessions.html.haml +5 -0
- data/app/views/workarea/admin/segment_rules/fields/_tags.html.haml +4 -0
- data/app/views/workarea/admin/segment_rules/fields/_traffic_referrer.html.haml +13 -0
- data/app/views/workarea/admin/segment_rules/geolocation_options.json.jbuilder +4 -0
- data/app/views/workarea/admin/segment_rules/index.html.haml +25 -0
- data/app/views/workarea/admin/segment_rules/summaries/_browser_info.html.haml +11 -0
- data/app/views/workarea/admin/segment_rules/summaries/_geolocation.html.haml +2 -0
- data/app/views/workarea/admin/segment_rules/summaries/_last_order.html.haml +2 -0
- data/app/views/workarea/admin/segment_rules/summaries/_logged_in.html.haml +5 -0
- data/app/views/workarea/admin/segment_rules/summaries/_orders.html.haml +6 -0
- data/app/views/workarea/admin/segment_rules/summaries/_revenue.html.haml +7 -0
- data/app/views/workarea/admin/segment_rules/summaries/_sessions.html.haml +6 -0
- data/app/views/workarea/admin/segment_rules/summaries/_tags.html.haml +2 -0
- data/app/views/workarea/admin/segment_rules/summaries/_traffic_referrer.html.haml +10 -0
- data/app/views/workarea/admin/segments/_cards.html.haml +81 -0
- data/app/views/workarea/admin/segments/_publish.html.haml +10 -0
- data/app/views/workarea/admin/segments/edit.html.haml +41 -0
- data/app/views/workarea/admin/segments/index.html.haml +64 -0
- data/app/views/workarea/admin/segments/insights.html.haml +52 -0
- data/app/views/workarea/admin/segments/show.html.haml +20 -0
- data/app/views/workarea/admin/shared/_active_field.html.haml +17 -0
- data/app/views/workarea/admin/shared/_bulk_actions.html.haml +10 -8
- data/app/views/workarea/admin/shared/_primary_nav.html.haml +5 -2
- data/app/views/workarea/admin/shared/_toggle_button.html.haml +1 -1
- data/app/views/workarea/admin/shipping_services/edit.html.haml +0 -4
- data/app/views/workarea/admin/shipping_services/new.html.haml +0 -4
- data/app/views/workarea/admin/status_report_mailer/report.html.haml +83 -86
- data/app/views/workarea/admin/style_guides/components/_activity.html.haml +3 -5
- data/app/views/workarea/admin/style_guides/components/_activity_group.html.haml +9 -15
- data/app/views/workarea/admin/style_guides/components/_box.html.haml +12 -7
- data/app/views/workarea/admin/style_guides/components/_checkbox.html.haml +21 -2
- data/app/views/workarea/admin/style_guides/components/_release_changeset.html.haml +3 -5
- data/app/views/workarea/admin/tax_rates/edit.html.haml +64 -0
- data/app/views/workarea/admin/tax_rates/index.html.haml +59 -20
- data/app/views/workarea/admin/tax_rates/new.html.haml +62 -0
- data/app/views/workarea/admin/timeline/show.html.haml +34 -41
- data/app/views/workarea/admin/toolbar/show.html.haml +11 -1
- data/app/views/workarea/admin/trash/index.html.haml +1 -1
- data/app/views/workarea/admin/users/edit.html.haml +60 -57
- data/app/views/workarea/admin/users/index.html.haml +1 -3
- data/app/views/workarea/admin/users/index.json.jbuilder +8 -0
- data/app/views/workarea/admin/users/insights.html.haml +31 -23
- data/app/views/workarea/admin/users/permissions.html.haml +10 -1
- data/app/views/workarea/admin/users/show.html.haml +7 -0
- data/config/locales/en.yml +569 -124
- data/config/routes.rb +57 -5
- data/lib/workarea/mailer_previews/admin/status_report_mailer_preview.rb +3 -1
- data/public/workarea/import_samples/tax_rates.csv +3 -3
- data/test/dummy/config/initializers/session_store.rb +1 -1
- data/test/helpers/workarea/admin/application_helper_test.rb +0 -16
- data/test/helpers/workarea/admin/icons_helper_test.rb +9 -0
- data/test/helpers/workarea/admin/products_helper_test.rb +73 -0
- data/test/helpers/workarea/admin/releases_helper_test.rb +0 -49
- data/test/helpers/workarea/admin/settings_helper_test.rb +22 -1
- data/test/integration/workarea/admin/assets_integration_test.rb +2 -5
- data/test/integration/workarea/admin/comments_integration_test.rb +27 -7
- data/test/integration/workarea/admin/configurations_integration_test.rb +21 -0
- data/test/integration/workarea/admin/create_release_undos_integration_test.rb +29 -0
- data/test/integration/workarea/admin/create_segments_integration_test.rb +26 -0
- data/test/integration/workarea/admin/data_file_imports_integration_test.rb +34 -8
- data/test/integration/workarea/admin/fulfillment_skus_integration_test.rb +55 -0
- data/test/integration/workarea/admin/fulfillment_tokens_integration_test.rb +43 -0
- data/test/integration/workarea/admin/guest_browsings_integration_test.rb +8 -32
- data/test/integration/workarea/admin/impersonations_integration_test.rb +13 -57
- data/test/integration/workarea/admin/jump_to_integration_test.rb +0 -29
- data/test/integration/workarea/admin/pricing_overrides_integration_test.rb +11 -0
- data/test/integration/workarea/admin/products_integration_test.rb +0 -13
- data/test/integration/workarea/admin/releases_integration_test.rb +71 -87
- data/test/integration/workarea/admin/segment_overrides_integration_test.rb +28 -0
- data/test/integration/workarea/admin/segment_rules_integration_test.rb +49 -0
- data/test/integration/workarea/admin/segments_integration_test.rb +31 -0
- data/test/integration/workarea/admin/shipping_service_integration_test.rb +1 -3
- data/test/integration/workarea/admin/tax_categories_integration_test.rb +1 -1
- data/test/integration/workarea/admin/unsubscribes_integration_test.rb +32 -0
- data/test/integration/workarea/admin/users_integration_test.rb +32 -0
- data/test/javascripts/fixtures/release_reminder.html.haml +3 -3
- data/test/javascripts/new_navigation_taxons_spec.js +1 -12
- data/test/mailers/workarea/admin/comment_mailer_test.rb +35 -0
- data/test/mailers/workarea/admin/status_report_mailer_test.rb +30 -25
- data/test/system/workarea/admin/alerts_system_test.rb +2 -1
- data/test/system/workarea/admin/bulk_actions_system_test.rb +1 -1
- data/test/system/workarea/admin/comments_system_test.rb +43 -0
- data/test/system/workarea/admin/content_system_test.rb +6 -0
- data/test/system/workarea/admin/dashboard_system_test.rb +8 -9
- data/test/system/workarea/admin/data_files_system_test.rb +1 -1
- data/test/system/workarea/admin/discounts_system_test.rb +18 -0
- data/test/system/workarea/admin/featured_products_system_test.rb +3 -0
- data/test/system/workarea/admin/fulfillment_skus_system_test.rb +48 -0
- data/test/system/workarea/admin/impersonation_system_test.rb +5 -2
- data/test/system/workarea/admin/orders_system_test.rb +32 -21
- data/test/system/workarea/admin/payment_transactions_system_test.rb +34 -32
- data/test/system/workarea/admin/releases_system_test.rb +151 -37
- data/test/system/workarea/admin/reports_system_test.rb +29 -0
- data/test/system/workarea/admin/segments_system_test.rb +124 -0
- data/test/system/workarea/admin/tax_categories_system_test.rb +166 -16
- data/test/system/workarea/admin/users_system_test.rb +15 -0
- data/test/view_models/workarea/admin/changeset_view_model_test.rb +59 -9
- data/test/view_models/workarea/admin/code_list_view_model_test.rb +0 -5
- data/test/view_models/workarea/admin/content_view_model_test.rb +13 -11
- data/test/view_models/workarea/admin/insights/product_view_model_test.rb +4 -4
- data/test/view_models/workarea/admin/insights/segment_view_model_test.rb +73 -0
- data/test/view_models/workarea/admin/product_rules_preview_view_model_test.rb +37 -0
- data/test/view_models/workarea/admin/product_view_model_test.rb +13 -19
- data/test/view_models/workarea/admin/release_calendar_view_model_test.rb +16 -0
- data/test/view_models/workarea/admin/release_view_model_test.rb +13 -56
- data/test/view_models/workarea/admin/releases_feed_view_model_test.rb +8 -21
- data/test/view_models/workarea/admin/reports/timeline_view_model_test.rb +76 -0
- data/test/view_models/workarea/admin/search_analysis_view_model_test.rb +14 -16
- data/test/view_models/workarea/admin/timeline_view_model_test.rb +1 -1
- metadata +128 -17
- data/app/views/workarea/admin/featured_products/_release_preview_warning.html.haml +0 -4
- data/app/views/workarea/admin/releases/calendar.html.haml +0 -54
- data/test/dummy/tmp/screenshots/.keep +0 -0
- data/test/helpers/workarea/admin/content_helper_test.rb +0 -17
- data/test/integration/workarea/admin/index_tracking_integration_test.rb +0 -21
- data/test/javascripts/fixtures/existing_navigation_taxon.html.haml +0 -10
- data/test/view_models/workarea/admin/pricing_sku_view_model_test.rb +0 -84
@@ -0,0 +1,48 @@
|
|
1
|
+
module Workarea
|
2
|
+
module Admin
|
3
|
+
class SegmentsController < Admin::ApplicationController
|
4
|
+
required_permissions :people
|
5
|
+
|
6
|
+
before_action :find_segment, except: :index
|
7
|
+
|
8
|
+
def index
|
9
|
+
query = Search::AdminSegments.new(params)
|
10
|
+
@search = SearchViewModel.new(query, view_model_options)
|
11
|
+
@segments = SegmentViewModel.wrap(Segment.all, view_model_options)
|
12
|
+
end
|
13
|
+
|
14
|
+
def show
|
15
|
+
end
|
16
|
+
|
17
|
+
def edit
|
18
|
+
end
|
19
|
+
|
20
|
+
def update
|
21
|
+
if @segment.update_attributes(params[:segment])
|
22
|
+
flash[:success] = t('workarea.admin.segments.flash_messages.saved')
|
23
|
+
redirect_to segment_path(@segment)
|
24
|
+
else
|
25
|
+
flash[:error] = @segment.errors.full_messages.to_sentence
|
26
|
+
render :edit, status: :unprocessable_entity
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def insights
|
31
|
+
end
|
32
|
+
|
33
|
+
def destroy
|
34
|
+
head :unprocessable_entity && return if @segment.life_cycle?
|
35
|
+
|
36
|
+
@segment.destroy
|
37
|
+
flash[:success] = t('workarea.admin.segments.flash_messages.removed')
|
38
|
+
redirect_to segments_path
|
39
|
+
end
|
40
|
+
|
41
|
+
private
|
42
|
+
|
43
|
+
def find_segment
|
44
|
+
@segment = Admin::SegmentViewModel.new(Segment.find(params[:id]))
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -3,11 +3,72 @@ module Workarea
|
|
3
3
|
class TaxRatesController < Admin::ApplicationController
|
4
4
|
required_permissions :catalog
|
5
5
|
|
6
|
+
before_action :find_category
|
7
|
+
before_action :find_rate, only: [:edit, :update, :destroy]
|
8
|
+
|
6
9
|
def index
|
10
|
+
@rates = @category.rates.search(params[:q])
|
11
|
+
.page(params[:page])
|
12
|
+
.order_by(find_sort(Tax::Rate))
|
13
|
+
end
|
14
|
+
|
15
|
+
def new
|
16
|
+
@rate = @category.rates.new
|
17
|
+
end
|
18
|
+
|
19
|
+
def create
|
20
|
+
if @category.rates.new(rate_params).save
|
21
|
+
flash[:success] = t('workarea.admin.tax_rates.flash_messages.saved')
|
22
|
+
redirect_to tax_category_rates_path
|
23
|
+
else
|
24
|
+
flash[:error] = t('workarea.admin.tax_rates.flash_messages.changes_error')
|
25
|
+
render :new
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def edit
|
30
|
+
end
|
31
|
+
|
32
|
+
def update
|
33
|
+
if @rate.update_attributes(rate_params)
|
34
|
+
flash[:success] = t('workarea.admin.tax_rates.flash_messages.saved')
|
35
|
+
redirect_to tax_category_rates_path
|
36
|
+
else
|
37
|
+
flash[:error] = t('workarea.admin.tax_rates.flash_messages.changes_error')
|
38
|
+
render :edit
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def destroy
|
43
|
+
@rate.destroy
|
44
|
+
|
45
|
+
flash[:success] = t('workarea.admin.tax_rates.flash_messages.removed')
|
46
|
+
redirect_to tax_category_rates_path
|
47
|
+
end
|
48
|
+
|
49
|
+
private
|
50
|
+
|
51
|
+
def find_category
|
7
52
|
model = Tax::Category.find(params[:tax_category_id])
|
8
53
|
@category = TaxCategoryViewModel.wrap(model, view_model_options)
|
54
|
+
end
|
55
|
+
|
56
|
+
def find_rate
|
57
|
+
@rate = @category.rates.find(params[:id])
|
58
|
+
end
|
59
|
+
|
60
|
+
def percentage_fields
|
61
|
+
%w[country_percentage region_percentage postal_code_percentage]
|
62
|
+
end
|
63
|
+
|
64
|
+
def rate_params
|
65
|
+
params[:rate].to_h.map do |field, value|
|
66
|
+
if field.in?(percentage_fields) && value.to_f > 0
|
67
|
+
value = value.to_f / 100
|
68
|
+
end
|
9
69
|
|
10
|
-
|
70
|
+
[field, value]
|
71
|
+
end.to_h
|
11
72
|
end
|
12
73
|
end
|
13
74
|
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module Workarea
|
2
|
+
module Admin
|
3
|
+
class UnsubscribesController < Admin::ApplicationController
|
4
|
+
skip_before_action :require_login
|
5
|
+
skip_before_action :require_admin
|
6
|
+
before_action :set_user
|
7
|
+
|
8
|
+
def status_report
|
9
|
+
if @user&.update(status_email_recipient: false)
|
10
|
+
flash[:success] = t('workarea.admin.unsubscribe.flash_messages.status_report_success')
|
11
|
+
else
|
12
|
+
flash[:error] = t('workarea.admin.unsubscribe.flash_messages.status_report_error')
|
13
|
+
end
|
14
|
+
|
15
|
+
redirect_to storefront.root_url
|
16
|
+
end
|
17
|
+
|
18
|
+
def commentable
|
19
|
+
commentable = GlobalID::Locator.locate(params[:commentable_id])
|
20
|
+
|
21
|
+
if @user.present? && commentable&.remove_subscription(@user.id)
|
22
|
+
flash[:success] = t(
|
23
|
+
'workarea.admin.unsubscribe.flash_messages.commentable_success',
|
24
|
+
commentable: commentable.name
|
25
|
+
)
|
26
|
+
else
|
27
|
+
flash[:error] = t('workarea.admin.unsubscribe.flash_messages.commentable_error')
|
28
|
+
end
|
29
|
+
|
30
|
+
redirect_to storefront.root_url
|
31
|
+
end
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
def set_user
|
36
|
+
@user ||= User.find_by_token(params[:id])
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -6,6 +6,7 @@ module Workarea
|
|
6
6
|
required_permissions :people
|
7
7
|
|
8
8
|
before_action :find_user, except: :index
|
9
|
+
around_action :inline_metrics_synchronizing
|
9
10
|
after_action :track_index_filters, only: :index
|
10
11
|
|
11
12
|
def index
|
@@ -59,6 +60,20 @@ module Workarea
|
|
59
60
|
@insights = InsightViewModel.wrap(models, view_model_options)
|
60
61
|
end
|
61
62
|
|
63
|
+
def send_password_reset
|
64
|
+
password_reset = User::PasswordReset.create!(user: @user.model)
|
65
|
+
Storefront::AccountMailer.password_reset(password_reset.id.to_s).deliver_later
|
66
|
+
|
67
|
+
flash[:success] = t('workarea.admin.users.flash_messages.password_reset')
|
68
|
+
redirect_to user_path(@user)
|
69
|
+
end
|
70
|
+
|
71
|
+
def unlock
|
72
|
+
@user.unlock_login!
|
73
|
+
flash[:success] = t('workarea.admin.users.flash_messages.unlocked')
|
74
|
+
redirect_to user_path(@user)
|
75
|
+
end
|
76
|
+
|
62
77
|
private
|
63
78
|
|
64
79
|
def update_email_signup
|
@@ -72,6 +87,10 @@ module Workarea
|
|
72
87
|
def find_user
|
73
88
|
@user = Admin::UserViewModel.new(User.find(params[:id]))
|
74
89
|
end
|
90
|
+
|
91
|
+
def inline_metrics_synchronizing
|
92
|
+
Sidekiq::Callbacks.inline(SynchronizeUserMetrics) { yield }
|
93
|
+
end
|
75
94
|
end
|
76
95
|
end
|
77
96
|
end
|
@@ -157,18 +157,8 @@ module Workarea
|
|
157
157
|
"#{request.path}?#{new_query_string_params.to_query}"
|
158
158
|
end
|
159
159
|
|
160
|
-
def
|
161
|
-
|
162
|
-
return t('workarea.duration.seconds', count: 0) if parts.empty?
|
163
|
-
|
164
|
-
parts
|
165
|
-
.sort_by { |unit, _ | ActiveSupport::Duration::PARTS.index(unit) }
|
166
|
-
.map { |unit, val| t("workarea.duration.#{unit}", count: val) }
|
167
|
-
.to_sentence
|
168
|
-
end
|
169
|
-
|
170
|
-
def navigation_redirects_enabled?
|
171
|
-
!Rails.application.config.consider_all_requests_local
|
160
|
+
def s3?
|
161
|
+
Configuration::S3.configured?
|
172
162
|
end
|
173
163
|
end
|
174
164
|
end
|
@@ -34,10 +34,9 @@ module Workarea
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def options_for_category(category_id)
|
37
|
-
|
38
|
-
|
39
|
-
return '' unless model.present?
|
37
|
+
return nil unless category_id.present?
|
40
38
|
|
39
|
+
model = Catalog::Category.find(category_id)
|
41
40
|
options_for_select({ model.name => model.id }, model.id)
|
42
41
|
end
|
43
42
|
|
@@ -40,6 +40,22 @@ module Workarea
|
|
40
40
|
)
|
41
41
|
end
|
42
42
|
|
43
|
+
def fraud_icon_for(model)
|
44
|
+
return unless model.fraud_suspected?
|
45
|
+
svg = inline_svg(
|
46
|
+
'workarea/admin/icons/alert.svg',
|
47
|
+
title: t('workarea.admin.orders.cards.fraud.suspected_fraud'),
|
48
|
+
class: 'svg-icon svg-icon--small svg-icon--link-color'
|
49
|
+
)
|
50
|
+
|
51
|
+
link_to(
|
52
|
+
svg,
|
53
|
+
fraud_order_path(model),
|
54
|
+
title: t('workarea.admin.orders.cards.fraud.suspected_fraud'),
|
55
|
+
class: 'link link--no-underline'
|
56
|
+
)
|
57
|
+
end
|
58
|
+
|
43
59
|
def admin_icon_for(model)
|
44
60
|
return unless model.admin?
|
45
61
|
|
@@ -90,6 +106,16 @@ module Workarea
|
|
90
106
|
class: 'svg-icon svg-icon--small svg-icon--gray'
|
91
107
|
)
|
92
108
|
end
|
109
|
+
|
110
|
+
def segments_icon_for(model)
|
111
|
+
return unless model.active_segment_ids.present?
|
112
|
+
|
113
|
+
inline_svg(
|
114
|
+
'workarea/admin/icons/user.svg',
|
115
|
+
title: t('workarea.admin.insights.icons.segments'),
|
116
|
+
class: 'svg-icon svg-icon--small svg-icon--link-color'
|
117
|
+
)
|
118
|
+
end
|
93
119
|
end
|
94
120
|
end
|
95
121
|
end
|
@@ -6,5 +6,18 @@ module Workarea
|
|
6
6
|
"#{content_tag(:strong, name)}: #{joined}"
|
7
7
|
end.join(', ').html_safe
|
8
8
|
end
|
9
|
+
|
10
|
+
def summary_inventory_status_css_classes(product)
|
11
|
+
status_issue_class =
|
12
|
+
if !product.active?
|
13
|
+
'product-summary--inactive'
|
14
|
+
elsif !product.inventory.available?
|
15
|
+
"product-summary--#{product.inventory.status.to_s.dasherize}"
|
16
|
+
end
|
17
|
+
|
18
|
+
return [] unless status_issue_class.present?
|
19
|
+
return [] if product.inventory.any?(&:displayable_when_out_of_stock?)
|
20
|
+
[status_issue_class, 'product-summary--status-issue']
|
21
|
+
end
|
9
22
|
end
|
10
23
|
end
|
@@ -99,6 +99,10 @@ module Workarea
|
|
99
99
|
model_links(Pricing::Discount, ids)
|
100
100
|
end
|
101
101
|
|
102
|
+
def segment_links(ids)
|
103
|
+
model_links(Segment, ids)
|
104
|
+
end
|
105
|
+
|
102
106
|
def for_each_content_block_from_changeset(content, change_hash)
|
103
107
|
change_hash.each do |id, changes|
|
104
108
|
block = content.blocks.detect { |b| b.id.to_s == id.to_s }
|
@@ -171,7 +175,7 @@ module Workarea
|
|
171
175
|
|
172
176
|
def calendar_day_classes(day)
|
173
177
|
date = Date.parse(day)
|
174
|
-
today =
|
178
|
+
today = Date.current
|
175
179
|
|
176
180
|
classes = ['calendar__day']
|
177
181
|
classes << 'calendar__day--odd-month' if date.month.odd?
|
@@ -182,26 +186,6 @@ module Workarea
|
|
182
186
|
classes
|
183
187
|
end
|
184
188
|
|
185
|
-
def calendar_release_classes(day, release)
|
186
|
-
date = Date.parse(day)
|
187
|
-
|
188
|
-
classes = ['calendar__release']
|
189
|
-
classes << 'calendar__release--start' if release.published_on_date?(date)
|
190
|
-
classes << 'calendar__release--end' if release.ended_on_date?(date)
|
191
|
-
classes << 'calendar__release--content' if release.content_release?
|
192
|
-
|
193
|
-
classes
|
194
|
-
end
|
195
|
-
|
196
|
-
def calendar_release_styles(release)
|
197
|
-
return if release.undo_at.blank?
|
198
|
-
|
199
|
-
color = Digest::MD5.hexdigest(release.name)[0, 6]
|
200
|
-
text_color = release_text_color(color)
|
201
|
-
|
202
|
-
"background-color: ##{color}; color: ##{text_color};"
|
203
|
-
end
|
204
|
-
|
205
189
|
private
|
206
190
|
|
207
191
|
def model_links(klass, ids)
|
@@ -0,0 +1,68 @@
|
|
1
|
+
module Workarea
|
2
|
+
module Admin
|
3
|
+
module SegmentsHelper
|
4
|
+
def segment_rule_types_options
|
5
|
+
Workarea.config.segment_rule_types.map do |string|
|
6
|
+
rule = string.constantize
|
7
|
+
[t("workarea.admin.fields.#{rule.slug}", default: rule.slug.to_s), rule.slug]
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def traffic_referrer_medium_options
|
12
|
+
{
|
13
|
+
t('workarea.admin.segment_rules.unknown') => 'unknown',
|
14
|
+
t('workarea.admin.segment_rules.email') => 'email',
|
15
|
+
t('workarea.admin.segment_rules.social') => 'social',
|
16
|
+
t('workarea.admin.segment_rules.search') => 'search'
|
17
|
+
}
|
18
|
+
end
|
19
|
+
|
20
|
+
def segments
|
21
|
+
@segments ||= Segment.all
|
22
|
+
end
|
23
|
+
|
24
|
+
def selected_segment_geolocation_options(selected)
|
25
|
+
selected.map { |l| [Segment::Rules::GeolocationOption[l]&.name || l, l] }
|
26
|
+
end
|
27
|
+
|
28
|
+
def browser_info_options
|
29
|
+
{
|
30
|
+
t('workarea.admin.segment_rules.browser_info.bot') => 'bot',
|
31
|
+
t('workarea.admin.segment_rules.browser_info.chrome') => 'chrome',
|
32
|
+
t('workarea.admin.segment_rules.browser_info.edge') => 'edge',
|
33
|
+
t('workarea.admin.segment_rules.browser_info.firefox') => 'firefox',
|
34
|
+
t('workarea.admin.segment_rules.browser_info.ie') => 'ie',
|
35
|
+
t('workarea.admin.segment_rules.browser_info.opera') => 'opera',
|
36
|
+
t('workarea.admin.segment_rules.browser_info.safari') => 'safari'
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
def device_type_options
|
41
|
+
{
|
42
|
+
t('workarea.admin.segment_rules.devices.console') => 'console',
|
43
|
+
t('workarea.admin.segment_rules.devices.ipad') => 'ipad',
|
44
|
+
t('workarea.admin.segment_rules.devices.iphone') => 'iphone',
|
45
|
+
t('workarea.admin.segment_rules.devices.ipod_touch') => 'ipod_touch',
|
46
|
+
t('workarea.admin.segment_rules.devices.kindle') => 'kindle',
|
47
|
+
t('workarea.admin.segment_rules.devices.mobile') => 'mobile',
|
48
|
+
t('workarea.admin.segment_rules.devices.nintendo') => 'nintendo',
|
49
|
+
t('workarea.admin.segment_rules.devices.playstation') => 'playstation',
|
50
|
+
t('workarea.admin.segment_rules.devices.tablet') => 'tablet',
|
51
|
+
t('workarea.admin.segment_rules.devices.tv') => 'tv',
|
52
|
+
t('workarea.admin.segment_rules.devices.xbox') => 'xbox'
|
53
|
+
}
|
54
|
+
end
|
55
|
+
|
56
|
+
def platform_options
|
57
|
+
{
|
58
|
+
t('workarea.admin.segment_rules.platform.android') => 'android',
|
59
|
+
t('workarea.admin.segment_rules.platform.blackberry') => 'blackberry',
|
60
|
+
t('workarea.admin.segment_rules.platform.ios') => 'ios',
|
61
|
+
t('workarea.admin.segment_rules.platform.linux') => 'linux',
|
62
|
+
t('workarea.admin.segment_rules.platform.mac') => 'mac',
|
63
|
+
t('workarea.admin.segment_rules.platform.windows') => 'windows'
|
64
|
+
}
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -2,15 +2,23 @@ module Workarea
|
|
2
2
|
module Admin
|
3
3
|
module SettingsHelper
|
4
4
|
def sanitize_config_value(value)
|
5
|
-
return if value.blank?
|
5
|
+
return if value.blank? && value.to_s != 'false'
|
6
6
|
|
7
7
|
case value
|
8
|
-
when
|
9
|
-
|
8
|
+
when ActiveSupport::Duration
|
9
|
+
amount, unit = value.parts.first.reverse
|
10
|
+
duration = pluralize(amount, unit.to_s.singularize)
|
11
|
+
tag.code html_escape(duration), class: 'code code--block'
|
12
|
+
when SwappableList
|
13
|
+
tag.pre data: { expandable: '' } do
|
14
|
+
tag.code JSON.pretty_generate(value.to_a), class: 'code code--block'
|
15
|
+
end
|
10
16
|
when Hash, Array
|
11
17
|
tag.pre data: { expandable: '' } do
|
12
18
|
tag.code JSON.pretty_generate(value), class: 'code code--block'
|
13
19
|
end
|
20
|
+
else
|
21
|
+
tag.code html_escape(value.to_s), class: 'code code--block'
|
14
22
|
end
|
15
23
|
end
|
16
24
|
end
|
@@ -2,8 +2,8 @@ module Workarea
|
|
2
2
|
module Admin
|
3
3
|
class CommentMailer < Admin::ApplicationMailer
|
4
4
|
def notify(user_id, comment_id)
|
5
|
-
|
6
|
-
return false unless email.present?
|
5
|
+
@user = User.find(user_id) rescue nil
|
6
|
+
return false unless @user&.email.present?
|
7
7
|
|
8
8
|
model = Comment.where(id: comment_id).first
|
9
9
|
return false unless model.present?
|
@@ -19,7 +19,7 @@ module Workarea
|
|
19
19
|
set_colors
|
20
20
|
|
21
21
|
mail(
|
22
|
-
to: email,
|
22
|
+
to: @user.email,
|
23
23
|
from: Workarea.config.email_from,
|
24
24
|
subject: t(
|
25
25
|
'workarea.admin.comment_mailer.notify.subject',
|
@@ -3,15 +3,28 @@ module Workarea
|
|
3
3
|
class StatusReportMailer < Admin::ApplicationMailer
|
4
4
|
add_template_helper(InsightsHelper)
|
5
5
|
|
6
|
-
def
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
def self.report_to_many(users)
|
7
|
+
alerts = AlertsViewModel.wrap(Alerts.new)
|
8
|
+
dashboard = Dashboards::IndexViewModel.new
|
9
|
+
|
10
|
+
users.map do |user|
|
11
|
+
report(user.email, user: user, alerts: alerts, dashboard: dashboard)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def report(email, user: nil, alerts: nil, dashboard: nil)
|
16
|
+
@date = Time.current - 1.day
|
17
|
+
@user = user || User.find_by_email(email)
|
18
|
+
@alerts = alerts || AlertsViewModel.wrap(Alerts.new)
|
19
|
+
@dashboard = dashboard || Dashboards::IndexViewModel.new
|
10
20
|
|
11
21
|
mail(
|
12
|
-
|
22
|
+
to: email,
|
13
23
|
from: Workarea.config.email_from,
|
14
|
-
subject: t(
|
24
|
+
subject: t(
|
25
|
+
'workarea.admin.status_report_mailer.subject',
|
26
|
+
site: Workarea.config.site_name
|
27
|
+
)
|
15
28
|
)
|
16
29
|
end
|
17
30
|
end
|
@@ -20,6 +20,11 @@ module Workarea
|
|
20
20
|
def pricing_prices
|
21
21
|
pricing.fetch('prices', []).first || {}
|
22
22
|
end
|
23
|
+
|
24
|
+
def segments
|
25
|
+
return [] if settings['active_segment_ids'].blank?
|
26
|
+
@segments ||= Segment.in(id: settings['active_segment_ids']).to_a
|
27
|
+
end
|
23
28
|
end
|
24
29
|
end
|
25
30
|
end
|
@@ -15,7 +15,8 @@ module Workarea
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def root
|
18
|
-
@root
|
18
|
+
return @root if defined?(@root)
|
19
|
+
@root = Mongoid::DocumentPath.find(model.document_path.take(1)) rescue nil
|
19
20
|
end
|
20
21
|
|
21
22
|
def localized_change?(field, value)
|
@@ -39,8 +40,13 @@ module Workarea
|
|
39
40
|
end
|
40
41
|
|
41
42
|
def old_value_for(field)
|
42
|
-
|
43
|
-
|
43
|
+
if release.previous.present?
|
44
|
+
old_value_from_release_for(release.previous, field)
|
45
|
+
elsif release.undoes?
|
46
|
+
old_value_from_release_for(release.undoes, field)
|
47
|
+
else
|
48
|
+
current_releasable.send(field)
|
49
|
+
end
|
44
50
|
end
|
45
51
|
|
46
52
|
def release_date
|
@@ -76,6 +82,12 @@ module Workarea
|
|
76
82
|
def current_releasable
|
77
83
|
@current_releasable ||= Release.with_current(nil) { releasable.reload }
|
78
84
|
end
|
85
|
+
|
86
|
+
def old_value_from_release_for(release, field)
|
87
|
+
release.as_current { current_releasable.reload.send(field) }
|
88
|
+
ensure
|
89
|
+
current_releasable.reload
|
90
|
+
end
|
79
91
|
end
|
80
92
|
end
|
81
93
|
end
|
@@ -131,6 +131,8 @@ module Workarea
|
|
131
131
|
@open_graph_asset ||=
|
132
132
|
if model.open_graph_asset_id.present?
|
133
133
|
Content::Asset.find(model.open_graph_asset_id)
|
134
|
+
elsif (og_default = Content::Asset.open_graph_default).present?
|
135
|
+
og_default
|
134
136
|
else
|
135
137
|
Content::Asset.open_graph_placeholder
|
136
138
|
end
|
@@ -37,17 +37,17 @@ module Workarea
|
|
37
37
|
{
|
38
38
|
'$match' => {
|
39
39
|
'created_at' => {
|
40
|
-
'$gte' => starts_at.beginning_of_day
|
41
|
-
'$lte' => ends_at.end_of_day
|
40
|
+
'$gte' => starts_at.beginning_of_day,
|
41
|
+
'$lte' => ends_at.end_of_day
|
42
42
|
}
|
43
43
|
}
|
44
44
|
},
|
45
45
|
{
|
46
46
|
'$group' => {
|
47
47
|
'_id' => {
|
48
|
-
'day' => { '$dayOfMonth' =>
|
49
|
-
'month' => { '$month' =>
|
50
|
-
'year' => { '$year' =>
|
48
|
+
'day' => { '$dayOfMonth' => '$created_at' },
|
49
|
+
'month' => { '$month' => '$created_at' },
|
50
|
+
'year' => { '$year' => '$created_at' }
|
51
51
|
},
|
52
52
|
'created_at' => { '$first' => '$created_at' },
|
53
53
|
'count' => { '$sum' => 1 }
|
@@ -61,10 +61,6 @@ module Workarea
|
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
|
-
def created_at_in_time_zone
|
65
|
-
{ 'date' => '$created_at', 'timezone' => Time.zone.tzinfo.name }
|
66
|
-
end
|
67
|
-
|
68
64
|
def insights
|
69
65
|
@insights ||= InsightViewModel.wrap(
|
70
66
|
Workarea::Insights::Base.by_dashboard('marketing').page(options[:page])
|