workarea-storefront 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.
Files changed (156) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +52 -0
  3. data/app/assets/javascripts/workarea/storefront/application.js.erb +2 -12
  4. data/app/assets/javascripts/workarea/storefront/config.js.erb +0 -5
  5. data/app/assets/javascripts/workarea/storefront/modules/{analytics.js → analytics.js.erb} +17 -0
  6. data/app/assets/javascripts/workarea/storefront/modules/dialog_buttons.js +1 -1
  7. data/app/assets/javascripts/workarea/storefront/modules/workarea_analytics.js +4 -0
  8. data/app/assets/stylesheets/workarea/storefront/application.scss.erb +0 -2
  9. data/app/assets/stylesheets/workarea/storefront/email/_base.scss +9 -1
  10. data/app/assets/stylesheets/workarea/storefront/email/_components.scss +1 -1
  11. data/app/assets/stylesheets/workarea/storefront/email/_helpers.scss +16 -0
  12. data/app/assets/stylesheets/workarea/storefront/email/{_settings.scss → _settings.scss.erb} +1 -1
  13. data/app/controllers/workarea/storefront/analytics_controller.rb +36 -21
  14. data/app/controllers/workarea/storefront/application_controller.rb +2 -4
  15. data/app/controllers/workarea/storefront/cart_items_controller.rb +1 -2
  16. data/app/controllers/workarea/storefront/checkout/addresses_controller.rb +0 -2
  17. data/app/controllers/workarea/storefront/checkouts_controller.rb +6 -4
  18. data/app/controllers/workarea/storefront/content_areas_controller.rb +1 -0
  19. data/app/controllers/workarea/storefront/content_blocks_controller.rb +1 -0
  20. data/app/controllers/workarea/storefront/current_checkout.rb +20 -14
  21. data/app/controllers/workarea/storefront/downloads_controller.rb +18 -0
  22. data/app/controllers/workarea/storefront/email_signups_controller.rb +1 -0
  23. data/app/controllers/workarea/storefront/errors_controller.rb +6 -0
  24. data/app/controllers/workarea/storefront/recent_views_controller.rb +2 -35
  25. data/app/controllers/workarea/storefront/recommendations_controller.rb +2 -2
  26. data/app/controllers/workarea/storefront/searches_controller.rb +0 -11
  27. data/app/controllers/workarea/storefront/users/accounts_controller.rb +2 -7
  28. data/app/controllers/workarea/storefront/users/credit_cards_controller.rb +5 -2
  29. data/app/controllers/workarea/storefront/users/passwords_controller.rb +1 -5
  30. data/app/helpers/workarea/storefront/application_helper.rb +19 -3
  31. data/app/helpers/workarea/storefront/content_helper.rb +1 -1
  32. data/app/helpers/workarea/storefront/favicons_helper.rb +6 -7
  33. data/app/helpers/workarea/storefront/navigation_helper.rb +10 -0
  34. data/app/helpers/workarea/storefront/schema_org_helper.rb +156 -0
  35. data/app/mailers/workarea/storefront/application_mailer.rb +1 -0
  36. data/app/view_models/workarea/storefront/category_view_model.rb +2 -2
  37. data/app/view_models/workarea/storefront/content_block_view_model.rb +41 -10
  38. data/app/view_models/workarea/storefront/content_blocks/product_insights_view_model.rb +1 -1
  39. data/app/view_models/workarea/storefront/display_content.rb +3 -1
  40. data/app/view_models/workarea/storefront/inquiry_view_model.rb +1 -7
  41. data/app/view_models/workarea/storefront/inventory_status_view_model.rb +10 -6
  42. data/app/view_models/workarea/storefront/order_item_view_model.rb +14 -0
  43. data/app/view_models/workarea/storefront/product_view_model.rb +22 -4
  44. data/app/view_models/workarea/storefront/recommendations_view_model.rb +8 -4
  45. data/app/view_models/workarea/storefront/search_view_model.rb +1 -1
  46. data/app/view_models/workarea/storefront/user_activity_view_model.rb +6 -17
  47. data/app/views/layouts/workarea/storefront/application.html.haml +13 -17
  48. data/app/views/layouts/workarea/storefront/checkout.html.haml +1 -1
  49. data/app/views/layouts/workarea/storefront/content_preview.html.haml +1 -0
  50. data/app/views/layouts/workarea/storefront/email.html.haml +33 -26
  51. data/app/views/layouts/workarea/storefront/empty.html.haml +1 -0
  52. data/app/views/layouts/workarea/storefront/navigation.html.haml +1 -1
  53. data/app/views/workarea/storefront/account_mailer/creation.html.haml +2 -0
  54. data/app/views/workarea/storefront/account_mailer/password_reset.html.haml +2 -0
  55. data/app/views/workarea/storefront/cart_items/create.html.haml +1 -1
  56. data/app/views/workarea/storefront/carts/show.html.haml +1 -1
  57. data/app/views/workarea/storefront/categories/show.html.haml +3 -2
  58. data/app/views/workarea/storefront/checkouts/confirmation.html.haml +1 -1
  59. data/app/views/workarea/storefront/contacts/show.html.haml +4 -2
  60. data/app/views/workarea/storefront/content_areas/show.html.haml +1 -0
  61. data/app/views/workarea/storefront/content_blocks/_category_summary.html.haml +2 -1
  62. data/app/views/workarea/storefront/content_blocks/_product_insights.html.haml +2 -1
  63. data/app/views/workarea/storefront/content_blocks/_product_list.html.haml +2 -1
  64. data/app/views/workarea/storefront/errors/show.html.haml +1 -0
  65. data/app/views/workarea/storefront/fulfillment_mailer/shipped.html.haml +3 -1
  66. data/app/views/workarea/storefront/order_mailer/_summary.html.haml +6 -0
  67. data/app/views/workarea/storefront/order_mailer/confirmation.html.haml +3 -0
  68. data/app/views/workarea/storefront/order_mailer/reminder.html.haml +3 -0
  69. data/app/views/workarea/storefront/orders/_summary.html.haml +3 -1
  70. data/app/views/workarea/storefront/orders/show.html.haml +3 -3
  71. data/app/views/workarea/storefront/pages/home_page.html.haml +4 -0
  72. data/app/views/workarea/storefront/pages/robots.text.erb +0 -1
  73. data/app/views/workarea/storefront/pages/show.html.haml +1 -0
  74. data/app/views/workarea/storefront/products/_price.html.haml +1 -2
  75. data/app/views/workarea/storefront/products/_pricing.html.haml +12 -6
  76. data/app/views/workarea/storefront/products/_summary.html.haml +3 -3
  77. data/app/views/workarea/storefront/products/show.html.haml +6 -4
  78. data/app/views/workarea/storefront/products/templates/_generic.html.haml +5 -5
  79. data/app/views/workarea/storefront/products/templates/_option_selects.html.haml +5 -7
  80. data/app/views/workarea/storefront/products/templates/_option_thumbnails.html.haml +5 -7
  81. data/app/views/workarea/storefront/recent_views/aside.html.haml +3 -10
  82. data/app/views/workarea/storefront/recent_views/narrow.html.haml +3 -10
  83. data/app/views/workarea/storefront/recent_views/show.html.haml +3 -10
  84. data/app/views/workarea/storefront/recommendations/show.html.haml +1 -1
  85. data/app/views/workarea/storefront/searches/show.html.haml +4 -5
  86. data/app/views/workarea/storefront/users/accounts/edit.html.haml +3 -3
  87. data/app/views/workarea/storefront/users/accounts/show.html.haml +3 -3
  88. data/app/views/workarea/storefront/users/addresses/edit.html.haml +3 -3
  89. data/app/views/workarea/storefront/users/addresses/new.html.haml +3 -3
  90. data/app/views/workarea/storefront/users/credit_cards/edit.html.haml +3 -3
  91. data/app/views/workarea/storefront/users/credit_cards/new.html.haml +3 -3
  92. data/app/views/workarea/storefront/users/orders/index.html.haml +3 -3
  93. data/app/views/workarea/storefront/users/orders/show.html.haml +4 -4
  94. data/app/views/workarea/storefront/users/passwords/new.html.haml +3 -3
  95. data/config/locales/en.yml +16 -3
  96. data/config/routes.rb +4 -2
  97. data/test/dummy/config/initializers/session_store.rb +1 -1
  98. data/test/helpers/workarea/storefront/content_helper_test.rb +1 -0
  99. data/test/helpers/workarea/storefront/navigation_helper_test.rb +4 -0
  100. data/test/helpers/workarea/storefront/schema_org_helper_test.rb +27 -0
  101. data/test/integration/workarea/storefront/analytics_integration_test.rb +44 -4
  102. data/test/integration/workarea/storefront/cart_items_integration_test.rb +0 -12
  103. data/test/integration/workarea/storefront/categories_integration_test.rb +0 -10
  104. data/test/integration/workarea/storefront/checkout_side_effects_integration_test.rb +15 -1
  105. data/test/integration/workarea/storefront/checkouts_integration_test.rb +68 -11
  106. data/test/integration/workarea/storefront/contact_form_integration_test.rb +18 -20
  107. data/test/integration/workarea/storefront/content_blocks_integration_test.rb +1 -4
  108. data/test/integration/workarea/storefront/current_checkout_integration_test.rb +53 -2
  109. data/test/integration/workarea/storefront/downloads_integration_test.rb +38 -0
  110. data/test/integration/workarea/storefront/email_signups_integration_test.rb +2 -0
  111. data/test/integration/workarea/storefront/guest_browsing_integration_test.rb +2 -2
  112. data/test/integration/workarea/storefront/impersonations_integration_test.rb +2 -2
  113. data/test/integration/workarea/storefront/login_integration_test.rb +3 -9
  114. data/test/integration/workarea/storefront/order_data_integration_test.rb +1 -9
  115. data/test/integration/workarea/storefront/place_order_integration_test.rb +5 -7
  116. data/test/integration/workarea/storefront/placing_order_integration_test.rb +1 -1
  117. data/test/integration/workarea/storefront/recent_views_integration_test.rb +29 -0
  118. data/test/integration/workarea/storefront/releases_integration_test.rb +132 -0
  119. data/test/integration/workarea/storefront/search_integration_test.rb +0 -46
  120. data/test/integration/workarea/storefront/segment_overrides_integration_test.rb +48 -0
  121. data/test/integration/workarea/storefront/segments_integration_test.rb +250 -0
  122. data/test/integration/workarea/storefront/store_credit_integration_test.rb +1 -1
  123. data/test/integration/workarea/storefront/users/credit_cards_integration_test.rb +2 -2
  124. data/test/integration/workarea/storefront/users/passwords_integration_test.rb +0 -19
  125. data/test/javascripts/traffic_referrer_spec.js +1 -1
  126. data/test/mailers/workarea/storefront/transactional_mailer_test.rb +9 -13
  127. data/test/system/workarea/storefront/analytics_system_test.rb +54 -40
  128. data/test/system/workarea/storefront/content_system_test.rb +10 -1
  129. data/test/system/workarea/storefront/digital_products_system_test.rb +2 -0
  130. data/test/system/workarea/storefront/download_system_test.rb +145 -0
  131. data/test/system/workarea/storefront/guest_checkout_system_test.rb +20 -0
  132. data/test/system/workarea/storefront/logged_in_checkout_system_test.rb +31 -32
  133. data/test/system/workarea/storefront/passwords_system_test.rb +35 -37
  134. data/test/system/workarea/storefront/pricing_overrides_system_test.rb +13 -2
  135. data/test/system/workarea/storefront/segment_overrides_system_test.rb +69 -0
  136. data/test/view_models/workarea/storefront/category_view_model_test.rb +20 -0
  137. data/test/view_models/workarea/storefront/content_block_view_model_test.rb +135 -3
  138. data/test/view_models/workarea/storefront/display_content_test.rb +4 -0
  139. data/test/view_models/workarea/storefront/product_view_model/option_set_test.rb +7 -8
  140. data/test/view_models/workarea/storefront/product_view_model_test.rb +17 -10
  141. data/test/view_models/workarea/storefront/search_view_model_test.rb +0 -6
  142. data/test/view_models/workarea/storefront/user_activity_view_model_test.rb +18 -20
  143. metadata +20 -22
  144. data/app/assets/javascripts/workarea/storefront/modules/recent_views.js +0 -25
  145. data/app/assets/javascripts/workarea/storefront/modules/search_fields.js +0 -59
  146. data/app/assets/javascripts/workarea/storefront/templates/ui_menu_heading.jst.ejs +0 -1
  147. data/app/assets/javascripts/workarea/storefront/templates/ui_menu_item.jst.ejs +0 -8
  148. data/app/assets/stylesheets/jquery_ui/storefront/_ui_autocomplete.scss +0 -17
  149. data/app/assets/stylesheets/jquery_ui/storefront/_ui_menu.scss +0 -40
  150. data/app/controllers/workarea/storefront/http_caching.rb +0 -33
  151. data/app/controllers/workarea/storefront/user_activity.rb +0 -19
  152. data/app/view_models/workarea/storefront/search_suggestion_view_model.rb +0 -87
  153. data/app/views/workarea/storefront/searches/index.json.jbuilder +0 -1
  154. data/app/views/workarea/storefront/style_guides/components/_ui_autocomplete.html.haml +0 -11
  155. data/test/dummy/tmp/screenshots/.keep +0 -0
  156. data/test/view_models/workarea/storefront/search_suggestion_view_model_test.rb +0 -42
@@ -1,11 +1,12 @@
1
- - if @recent_views.products.any? || @recent_views.categories.any? || @recent_views.searches.any?
1
+ - if @recent_views.products.any? || @recent_views.categories.any?
2
2
  .recent-views.recent-views--aside
3
3
 
4
4
  - if @recent_views.products.any?
5
5
  .recent-views__section.recent-views__section--products
6
6
  %h2.recent-views__heading= t('workarea.storefront.recommendations.recent_products')
7
7
  - @recent_views.products.each do |product|
8
- .product-summary.product-summary--small{ itemscope: true, itemtype: 'http://schema.org/Product' }
8
+ = render_schema_org(product_schema(product))
9
+ .product-summary.product-summary--small
9
10
  = render 'workarea/storefront/products/summary', product: product
10
11
 
11
12
  - if @recent_views.categories.any?
@@ -15,11 +16,3 @@
15
16
  - @recent_views.categories.each do |category|
16
17
  %li.recent-views__item
17
18
  = link_to category.name, category_path(category), class: 'recent-views__link'
18
-
19
- - if @recent_views.searches.any?
20
- .recent-views__section.recent-views__section--searches
21
- %h2.recent-views__heading= t('workarea.storefront.recommendations.recent_searches')
22
- %ul.recent-views__list
23
- - @recent_views.searches.each do |search|
24
- %li.recent-views__item
25
- = link_to search, search_path(q: search), class: 'recent-views__link'
@@ -1,11 +1,12 @@
1
- - if @recent_views.products.any? || @recent_views.categories.any? || @recent_views.searches.any?
1
+ - if @recent_views.products.any? || @recent_views.categories.any?
2
2
  .recent-views
3
3
 
4
4
  - if @recent_views.products.any?
5
5
  .recent-views__section.recent-views__section--products
6
6
  %h2.recent-views__heading= t('workarea.storefront.recommendations.recent_products')
7
7
  - @recent_views.products.each do |product|
8
- .product-summary.product-summary--small{ itemscope: true, itemtype: 'http://schema.org/Product' }
8
+ = render_schema_org(product_schema(product))
9
+ .product-summary.product-summary--small
9
10
  = render 'workarea/storefront/products/summary', product: product
10
11
 
11
12
  - if @recent_views.categories.any?
@@ -15,11 +16,3 @@
15
16
  - @recent_views.categories.each do |category|
16
17
  %li.recent-views__item
17
18
  = link_to category.name, category_path(category), class: 'recent-views__link'
18
-
19
- - if @recent_views.searches.any?
20
- .recent-views__section.recent-views__section--searches
21
- %h2.recent-views__heading= t('workarea.storefront.recommendations.recent_searches')
22
- %ul.recent-views__list
23
- - @recent_views.searches.each do |search|
24
- %li.recent-views__item
25
- = link_to search, search_path(q: search), class: 'recent-views__link'
@@ -1,4 +1,4 @@
1
- - if @recent_views.products.any? || @recent_views.categories.any? || @recent_views.searches.any?
1
+ - if @recent_views.products.any? || @recent_views.categories.any?
2
2
  .recent-views
3
3
 
4
4
  - if @recent_views.products.any?
@@ -6,8 +6,9 @@
6
6
  %h2.recent-views__heading= t('workarea.storefront.recommendations.recent_products')
7
7
  .grid
8
8
  - @recent_views.products.each do |product|
9
+ = render_schema_org(product_schema(product))
9
10
  .grid__cell.grid__cell--50.grid__cell--33-at-medium.grid__cell--16-at-wide
10
- .product-summary.product-summary--small{ itemscope: true, itemtype: 'http://schema.org/Product' }
11
+ .product-summary.product-summary--small
11
12
  = render 'workarea/storefront/products/summary', product: product
12
13
 
13
14
  - if @recent_views.categories.any?
@@ -17,11 +18,3 @@
17
18
  - @recent_views.categories.each do |category|
18
19
  %li.recent-views__item
19
20
  = link_to category.name, category_path(category), class: 'recent-views__link'
20
-
21
- - if @recent_views.searches.any?
22
- .recent-views__section.recent-views__section--searches
23
- %h2.recent-views__heading= t('workarea.storefront.recommendations.recent_searches')
24
- %ul.recent-views__list
25
- - @recent_views.searches.each do |search|
26
- %li.recent-views__item
27
- = link_to search, search_path(q: search), class: 'recent-views__link'
@@ -8,5 +8,5 @@
8
8
  .grid
9
9
  - @recommendations.each do |product|
10
10
  .grid__cell.grid__cell--50.grid__cell--33-at-medium.grid__cell--16-at-wide
11
- .product-summary.product-summary--small{ itemscope: true, itemtype: 'http://schema.org/Product' }
11
+ .product-summary.product-summary--small
12
12
  = render 'workarea/storefront/products/summary', product: product
@@ -1,7 +1,6 @@
1
1
  - @title = t('workarea.storefront.searches.title')
2
2
 
3
3
  - content_for :head do
4
- %meta{ property: 'recent-view', content: recent_view_content(search: @search.query_string) }
5
4
  %meta{ name: 'robots', content: 'noindex' }
6
5
  = append_partials('storefront.search_head', search: @search)
7
6
 
@@ -13,11 +12,11 @@
13
12
 
14
13
  - content_for :breadcrumbs do
15
14
  %p.breadcrumbs__node-group
16
- %span.breadcrumbs__node{ itemprop: 'breadcrumb' }
15
+ %span.breadcrumbs__node
17
16
  = link_to t('workarea.storefront.layouts.home'), root_path, rel: 'home', class: 'breadcrumbs__link'
18
- %span.breadcrumbs__node{ itemprop: 'breadcrumb' }
17
+ %span.breadcrumbs__node
19
18
  %span.breadcrumbs__text= t('workarea.storefront.searches.title')
20
- %span.breadcrumbs__node{ itemprop: 'breadcrumb' }
19
+ %span.breadcrumbs__node
21
20
  %span.breadcrumbs__text= @search.query_string
22
21
 
23
22
  - content_for :page_aside do
@@ -92,7 +91,7 @@
92
91
  = append_partials('storefront.search_grid_item', product: product, position: position)
93
92
 
94
93
  .grid__cell.grid__cell--50.grid__cell--25-at-medium.grid__cell--20-at-wide{ data: { pagination_item: '' } }
95
- .product-summary{ itemscope: true, itemtype: 'http://schema.org/Product', data: { search_results_product_grid_summary: { id: product.catalog_id, position: position }.to_json } }
94
+ .product-summary{ data: { search_results_product_grid_summary: { id: product.catalog_id, position: position }.to_json } }
96
95
  = render 'workarea/storefront/products/summary', product: product
97
96
  - if show_pagination?(@search.products)
98
97
  .pagination__button
@@ -2,11 +2,11 @@
2
2
 
3
3
  - content_for :breadcrumbs do
4
4
  %p.breadcrumbs__node-group
5
- %span.breadcrumbs__node{ itemprop: 'breadcrumb' }
5
+ %span.breadcrumbs__node
6
6
  = link_to t('workarea.storefront.layouts.home'), root_path, rel: 'home', class: 'breadcrumbs__link'
7
- %span.breadcrumbs__node{ itemprop: 'breadcrumb' }
7
+ %span.breadcrumbs__node
8
8
  = link_to t('workarea.storefront.users.account'), users_account_path, class: 'breadcrumbs__link'
9
- %span.breadcrumbs__node{ itemprop: 'breadcrumb' }
9
+ %span.breadcrumbs__node
10
10
  %span.breadcrumbs__text= t('workarea.storefront.users.edit_title')
11
11
 
12
12
  .view
@@ -2,9 +2,9 @@
2
2
 
3
3
  - content_for :breadcrumbs do
4
4
  %p.breadcrumbs__node-group
5
- %span.breadcrumbs__node{ itemprop: 'breadcrumb' }
5
+ %span.breadcrumbs__node
6
6
  = link_to t('workarea.storefront.layouts.home'), root_path, rel: 'home', class: 'breadcrumbs__link'
7
- %span.breadcrumbs__node{ itemprop: 'breadcrumb' }
7
+ %span.breadcrumbs__node
8
8
  %span.breadcrumbs__text= t('workarea.storefront.users.account')
9
9
 
10
10
  .view
@@ -114,5 +114,5 @@
114
114
  .grid
115
115
  - @recommendations.each do |product|
116
116
  .grid__cell.grid__cell--50.grid__cell--33-at-medium.grid__cell--16-at-wide
117
- .product-summary.product-summary--small{ itemscope: true, itemtype: 'http://schema.org/Product' }
117
+ .product-summary.product-summary--small
118
118
  = render 'workarea/storefront/products/summary', product: product
@@ -2,11 +2,11 @@
2
2
 
3
3
  - content_for :breadcrumbs do
4
4
  %p.breadcrumbs__node-group
5
- %span.breadcrumbs__node{ itemprop: 'breadcrumb' }
5
+ %span.breadcrumbs__node
6
6
  = link_to t('workarea.storefront.layouts.home'), root_path, rel: 'home', class: 'breadcrumbs__link'
7
- %span.breadcrumbs__node{ itemprop: 'breadcrumb' }
7
+ %span.breadcrumbs__node
8
8
  = link_to t('workarea.storefront.users.account'), users_account_path, class: 'breadcrumbs__link'
9
- %span.breadcrumbs__node{ itemprop: 'breadcrumb' }
9
+ %span.breadcrumbs__node
10
10
  %span.breadcrumbs__text= t('workarea.storefront.users.edit_address')
11
11
 
12
12
  .view
@@ -2,11 +2,11 @@
2
2
 
3
3
  - content_for :breadcrumbs do
4
4
  %p.breadcrumbs__node-group
5
- %span.breadcrumbs__node{ itemprop: 'breadcrumb' }
5
+ %span.breadcrumbs__node
6
6
  = link_to t('workarea.storefront.layouts.home'), root_path, rel: 'home', class: 'breadcrumbs__link'
7
- %span.breadcrumbs__node{ itemprop: 'breadcrumb' }
7
+ %span.breadcrumbs__node
8
8
  = link_to t('workarea.storefront.users.account'), users_account_path, class: 'breadcrumbs__link'
9
- %span.breadcrumbs__node{ itemprop: 'breadcrumb' }
9
+ %span.breadcrumbs__node
10
10
  %span.breadcrumbs__text= t('workarea.storefront.users.add_address')
11
11
 
12
12
  .view
@@ -2,11 +2,11 @@
2
2
 
3
3
  - content_for :breadcrumbs do
4
4
  %p.breadcrumbs__node-group
5
- %span.breadcrumbs__node{ itemprop: 'breadcrumb' }
5
+ %span.breadcrumbs__node
6
6
  = link_to t('workarea.storefront.layouts.home'), root_path, rel: 'home', class: 'breadcrumbs__link'
7
- %span.breadcrumbs__node{ itemprop: 'breadcrumb' }
7
+ %span.breadcrumbs__node
8
8
  = link_to t('workarea.storefront.users.account'), users_account_path, class: 'breadcrumbs__link'
9
- %span.breadcrumbs__node{ itemprop: 'breadcrumb' }
9
+ %span.breadcrumbs__node
10
10
  %span.breadcrumbs__text= t('workarea.storefront.users.edit_credit_card')
11
11
 
12
12
  .view
@@ -3,11 +3,11 @@
3
3
 
4
4
  - content_for :breadcrumbs do
5
5
  %p.breadcrumbs__node-group
6
- %span.breadcrumbs__node{ itemprop: 'breadcrumb' }
6
+ %span.breadcrumbs__node
7
7
  = link_to t('workarea.storefront.layouts.home'), root_path, rel: 'home', class: 'breadcrumbs__link'
8
- %span.breadcrumbs__node{ itemprop: 'breadcrumb' }
8
+ %span.breadcrumbs__node
9
9
  = link_to t('workarea.storefront.users.account'), users_account_path, class: 'breadcrumbs__link'
10
- %span.breadcrumbs__node{ itemprop: 'breadcrumb' }
10
+ %span.breadcrumbs__node
11
11
  %span.breadcrumbs__text= t('workarea.storefront.users.add_credit_card')
12
12
 
13
13
  .view
@@ -2,11 +2,11 @@
2
2
 
3
3
  - content_for :breadcrumbs do
4
4
  %p.breadcrumbs__node-group
5
- %span.breadcrumbs__node{ itemprop: 'breadcrumb' }
5
+ %span.breadcrumbs__node
6
6
  = link_to t('workarea.storefront.layouts.home'), root_path, rel: 'home', class: 'breadcrumbs__link'
7
- %span.breadcrumbs__node{ itemprop: 'breadcrumb' }
7
+ %span.breadcrumbs__node
8
8
  = link_to t('workarea.storefront.users.account'), users_account_path, class: 'breadcrumbs__link'
9
- %span.breadcrumbs__node{ itemprop: 'breadcrumb' }
9
+ %span.breadcrumbs__node
10
10
  %span.breadcrumbs__text= t('workarea.storefront.users.order_history')
11
11
 
12
12
  .view
@@ -2,13 +2,13 @@
2
2
 
3
3
  - content_for :breadcrumbs do
4
4
  %p.breadcrumbs__node-group
5
- %span.breadcrumbs__node{ itemprop: 'breadcrumb' }
5
+ %span.breadcrumbs__node
6
6
  = link_to t('workarea.storefront.layouts.home'), root_path, rel: 'home', class: 'breadcrumbs__link'
7
- %span.breadcrumbs__node{ itemprop: 'breadcrumb' }
7
+ %span.breadcrumbs__node
8
8
  = link_to t('workarea.storefront.users.account'), users_account_path, class: 'breadcrumbs__link'
9
- %span.breadcrumbs__node{ itemprop: 'breadcrumb' }
9
+ %span.breadcrumbs__node
10
10
  = link_to t('workarea.storefront.users.order_history'), users_orders_path, class: 'breadcrumbs__link'
11
- %span.breadcrumbs__node{ itemprop: 'breadcrumb' }
11
+ %span.breadcrumbs__node
12
12
  %span.breadcrumbs__text= t('workarea.storefront.users.order_details')
13
13
 
14
14
  .view
@@ -2,11 +2,11 @@
2
2
 
3
3
  - content_for :breadcrumbs do
4
4
  %p.breadcrumbs__node-group
5
- %span.breadcrumbs__node{ itemprop: 'breadcrumb' }
5
+ %span.breadcrumbs__node
6
6
  = link_to t('workarea.storefront.layouts.home'), root_path, rel: 'home', class: 'breadcrumbs__link'
7
- %span.breadcrumbs__node{ itemprop: 'breadcrumb' }
7
+ %span.breadcrumbs__node
8
8
  = link_to t('workarea.storefront.users.login'), login_path, class: 'breadcrumbs__link'
9
- %span.breadcrumbs__node{ itemprop: 'breadcrumb' }
9
+ %span.breadcrumbs__node
10
10
  %span.breadcrumbs__text= t('workarea.storefront.users.forgot_password')
11
11
 
12
12
  .view
@@ -127,10 +127,14 @@ en:
127
127
  info_text: You can update your information at any time by visiting
128
128
  closing_html: Have a great day!
129
129
  closing_text: Have a great day!
130
+ email_action:
131
+ name: View Account
130
132
  password_reset:
131
133
  subject: Reset Your Password
132
134
  info_html: Click this link to reset your password
133
135
  info_text: Click this link to reset your password
136
+ email_action:
137
+ name: Reset Password
134
138
  inquiry:
135
139
  heading: Customer Service Inquiry on %{subject}
136
140
  name: Name
@@ -149,6 +153,8 @@ en:
149
153
  order_confirmation:
150
154
  subject: Order %{order_id} Confirmation
151
155
  heading: Order %{order_id} Confirmation
156
+ email_action:
157
+ name: View Order
152
158
  order_refund:
153
159
  subject: Order %{order_id} Refund
154
160
  heading: Order %{order_id} Refund
@@ -159,6 +165,9 @@ en:
159
165
  info_html: We noticed that you didn't complete checkout, and we wanted to help. To complete your order, %{link}. Please let us know if there is any other way we can help.
160
166
  info_text: We noticed that you didn't complete checkout, and we wanted to help. To complete your order, visit the link below. Please let us know if there is any other way we can help.
161
167
  resume_link: resume your checkout
168
+ email_action:
169
+ name: Resume Order
170
+ description: Continue checkout to complete your order
162
171
  recommendations: You may also like…
163
172
 
164
173
  flash_messages:
@@ -201,14 +210,14 @@ en:
201
210
  credit_card_update_error: There were errors updating your credit card.
202
211
  credit_card_removed: Your credit card has been removed.
203
212
  password_reset_expired: This password reset is expired.
204
- password_reset_email_sent: If a valid email address was entered, instructions to reset your password have been sent to "%{email}"
213
+ password_reset_email_sent: If a valid e-mail address was entered, instructions to reset your password have been sent to "%{email}"
205
214
  password_reset: Your password has been reset.
206
215
  old_password_invalid: Your old password is not valid.
207
216
  password_required: Password is required.
208
217
  items_required: You must add an item to your cart to checkout
209
218
  order_custom_pricing: Your cart has custom pricing, you cannot edit the contents of your cart.
210
- no_available_shipping_options: There are no available shipping options for your shipping address.
211
219
  download_unavailable: This download is no longer available. Contact customer support for more information.
220
+ no_available_shipping_options: There are no available shipping options for your shipping adddress.
212
221
 
213
222
  forms:
214
223
  required: '*'
@@ -222,7 +231,8 @@ en:
222
231
  go: Go
223
232
  email_placeholder: name@example.com
224
233
  confirmation_alert: Are you sure you want to delete this?
225
-
234
+ fraud:
235
+ default_message: Workarea default fraud check. Automatic no decision.
226
236
  layouts:
227
237
  accessibility_info: Accessibility Information
228
238
  main_content: Skip to Main Content
@@ -238,6 +248,8 @@ en:
238
248
  locale: Select locale
239
249
  mobile_navigation: Mobile Navigation
240
250
  default_meta_description: Shop online for %{site_name} products
251
+ page_title: '%{site_name}'
252
+ page_title_with_content: '%{title_content} - %{site_name}'
241
253
 
242
254
  messages:
243
255
  info: Info
@@ -298,6 +310,7 @@ en:
298
310
  sku: SKU
299
311
  each: each
300
312
  view_order: View Order
313
+ download: Download
301
314
 
302
315
  pagination:
303
316
  loading_more: Loading More...
data/config/routes.rb CHANGED
@@ -28,7 +28,6 @@ Workarea::Storefront::Engine.routes.draw do
28
28
  end
29
29
 
30
30
  resource :email_signup, only: [:show, :create]
31
- resources :searches, only: :index
32
31
  resource :search, only: :show
33
32
 
34
33
  get '/current_user', to: 'application#current_user_info', as: :current_user
@@ -67,7 +66,9 @@ Workarea::Storefront::Engine.routes.draw do
67
66
  get 'confirmation', to: 'place_order#confirmation'
68
67
  end
69
68
 
70
- resource :recent_views, only: [:show, :update]
69
+ resources :downloads, only: :show
70
+
71
+ resource :recent_views, only: :show
71
72
  resource :recommendations, only: :show
72
73
 
73
74
  resource :sitemap, only: :show
@@ -94,6 +95,7 @@ Workarea::Storefront::Engine.routes.draw do
94
95
  get 'style_guides/:category', to: 'style_guides#category', as: :style_guides_category
95
96
  get 'style_guides/:category/:id', to: 'style_guides#show', as: :style_guide
96
97
 
98
+ post 'analytics/new_session', to: 'analytics#new_session', as: :analytics_new_session
97
99
  post 'analytics/product_view/:product_id', to: 'analytics#product_view', as: :analytics_product_view
98
100
  post 'analytics/category_view/:category_id', to: 'analytics#category_view', as: :analytics_category_view
99
101
  post 'analytics/search', to: 'analytics#search', as: :analytics_search
@@ -1,3 +1,3 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
- Rails.application.config.session_store :cookie_store, key: '_dummy_session'
3
+ Rails.application.config.session_store :cookie_store, key: '_dummy_session', expire_after: 30.minutes
@@ -11,6 +11,7 @@ module Workarea
11
11
  blocks = ContentBlockViewModel.wrap(content.blocks)
12
12
 
13
13
  self.expects(:current_user).returns(nil)
14
+ self.expects(:request).returns(OpenStruct.new(env: {}))
14
15
  Rails.cache.expects(:fetch).once
15
16
  render_content_blocks(blocks)
16
17
 
@@ -15,6 +15,10 @@ module Workarea
15
15
 
16
16
  taxon = Navigation::SearchResults.new(q: 'foo').taxon
17
17
  assert_equal(search_path(q: 'foo'), storefront_path_for(taxon))
18
+
19
+ product = create_product
20
+ taxon = create_taxon(navigable: product)
21
+ assert_equal(storefront.product_path(product.slug), storefront_path_for(taxon))
18
22
  end
19
23
 
20
24
  def test_mobile_nav_return_path
@@ -0,0 +1,27 @@
1
+ require 'test_helper'
2
+
3
+ module Workarea
4
+ module Storefront
5
+ class SchemaOrgHelperTest < ViewTest
6
+ include NavigationHelper
7
+ include Engine.routes.url_helpers
8
+
9
+ def test_breadcrumb_list_schema
10
+ product = create_product
11
+ category = create_category(product_ids: [product.id]) # so the product will have a parent
12
+ create_taxon(navigable: category)
13
+
14
+ view_model = ProductViewModel.wrap(product)
15
+ breadcrumbs = view_model.breadcrumbs.map { |t| [t.name, storefront_url_for(t)] }
16
+ schema = breadcrumb_list_schema(breadcrumbs)
17
+ urls = schema[:itemListElement].map { |e| e[:item][:@id] }
18
+ product_url = storefront.product_url(product, host: Workarea.config.host)
19
+
20
+ assert_equal('http://schema.org', schema[:@context])
21
+ assert_equal('BreadcrumbList', schema[:@type])
22
+ assert_equal(product_url, urls.last)
23
+ assert_includes(urls, product_url)
24
+ end
25
+ end
26
+ end
27
+ end
@@ -4,21 +4,42 @@ module Workarea
4
4
  module Storefront
5
5
  class AnalyticsIntegrationTest < Workarea::IntegrationTest
6
6
  def test_saving_product_view
7
+ post storefront.analytics_product_view_path(product_id: ' ')
8
+ assert_equal(0, Metrics::ProductByDay.count)
9
+
7
10
  post storefront.analytics_product_view_path(product_id: 'foo')
11
+
8
12
  assert_equal(1, Metrics::ProductByDay.first.views)
13
+ user = Metrics::User.first
14
+ assert_equal(session.id, user.id)
15
+ assert_equal(['foo'], user.viewed.product_ids)
9
16
  end
10
17
 
11
18
  def test_saving_search
12
- post storefront.analytics_search_path(q: 'foo', total_results: '5')
19
+ post storefront.analytics_search_path(q: ' ', total_results: '5')
20
+ assert_equal(0, Metrics::SearchByDay.count)
21
+
22
+ post storefront.analytics_search_path(q: 'foods', total_results: '5')
13
23
 
14
- insights = Metrics::SearchByDay.first
15
- assert_equal(1, insights.searches)
16
- assert_equal(5, insights.total_results)
24
+ metrics = Metrics::SearchByDay.first
25
+ assert_equal(1, metrics.searches)
26
+ assert_equal(5, metrics.total_results)
27
+
28
+ user = Metrics::User.first
29
+ assert_equal(session.id, user.id)
30
+ assert_equal(['food'], user.viewed.search_ids)
17
31
  end
18
32
 
19
33
  def test_saving_category_view
34
+ post storefront.analytics_category_view_path(category_id: ' ')
35
+ assert_equal(0, Metrics::CategoryByDay.count)
36
+
20
37
  post storefront.analytics_category_view_path(category_id: 'foo')
38
+
21
39
  assert_equal(1, Metrics::CategoryByDay.first.views)
40
+ user = Metrics::User.first
41
+ assert_equal(session.id, user.id)
42
+ assert_equal(['foo'], user.viewed.category_ids)
22
43
  end
23
44
 
24
45
  def test_blocking_bots
@@ -26,6 +47,25 @@ module Workarea
26
47
  headers: { 'HTTP_USER_AGENT' => 'Googlebot' }
27
48
 
28
49
  assert(Metrics::ProductByDay.count.zero?)
50
+ assert(Metrics::User.count.zero?)
51
+ end
52
+
53
+ def test_merging_metrics_on_login
54
+ create_user(email: 'bcrouse@workarea.com', password: 'W3bl1nc!')
55
+ Metrics::User.save_order(email: 'bcrouse@workarea.com', revenue: 10)
56
+ Metrics::User.save_affinity(id: 'bcrouse@workarea.com', action: :viewed, product_ids: ['bar'])
57
+ login_metrics = Metrics::User.find('bcrouse@workarea.com')
58
+
59
+ post storefront.analytics_product_view_path(product_id: 'foo')
60
+ session_metrics = Metrics::User.find(session.id)
61
+ assert_equal(['foo'], session_metrics.viewed.product_ids)
62
+
63
+ post storefront.login_path,
64
+ params: { email: 'bcrouse@workarea.com', password: 'W3bl1nc!' }
65
+
66
+ login_metrics.reload
67
+ assert_equal(1, login_metrics.orders)
68
+ assert_equal(%w(bar foo), login_metrics.viewed.product_ids)
29
69
  end
30
70
  end
31
71
  end