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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 79997ad2dc6268254d6b3c331346ccd0fba6d88563720f34d3d511f203d0a644
4
- data.tar.gz: 68811cc13b62ec692c4e0128333477fb1c125b24b449beacad48fd2ab99b634c
3
+ metadata.gz: 0fc7579774a32bc9746b0213537251f654ade0cb5cfa5764b7a80e211cc457d2
4
+ data.tar.gz: 640c178f253dc782cf057823ed1ca695b8fc80d17d1fb2fca58f512c6381b4dd
5
5
  SHA512:
6
- metadata.gz: 52904468d65dd0c581c2c9a1e7304434c4312969564981c4830a24feac3a4ec075f65de7742653d118bb2d3c48f62806463c1cd22d97444abb3d7680819aa032
7
- data.tar.gz: b1a4d9f022455601c3b91b0de6a786f9cea15ba7f9e9210a0c1343827a4e0b693ab8b63c1e34b27138c4e787c187cac21462a5adf3e5a4f90b2235bfd893a12c
6
+ metadata.gz: 6682f2b247acfc7eab72935986f0e58f634f1e2ee903203cda187aca005bcdfc209b624b64da25550f07eb46320df539ebe3a7b6662ccf0718a23a01220d59e2
7
+ data.tar.gz: b29492053eaeb0185cdb11f61b2efc777df1da1e0f855c5ed4b155d914b51480a8b1755108b63bb69c7feea8605cb51a40674dd97fe0e78f1bf1a18450302853
data/LICENSE.txt ADDED
@@ -0,0 +1,52 @@
1
+ WebLinc
2
+ Business Source License
3
+
4
+ Licensor: WebLinc Corporation, 22 S. 3rd Street, 2nd Floor, Philadelphia PA 19106
5
+
6
+ Licensed Work: Workarea Commerce Platform
7
+ The Licensed Work is (c) 2019 WebLinc Corporation
8
+
9
+ Additional Use Grant:
10
+ You may make production use of the Licensed Work without an additional license agreement with WebLinc so long as you do not use the Licensed Work for a Commerce Service.
11
+
12
+ A "Commerce Service" is a commercial offering that allows third parties (other than your employees and contractors) to access the functionality of the Licensed Work by creating or managing commerce functionality, the products, taxonomy, assets and/or content of which are controlled by such third parties.
13
+
14
+ For information about obtaining an additional license agreement with WebLinc, contact licensing@workarea.com.
15
+
16
+ Change Date: 2019-08-20
17
+
18
+ Change License: Version 2.0 or later of the GNU General Public License as published by the Free Software Foundation
19
+
20
+ Terms
21
+
22
+ The Licensor hereby grants you the right to copy, modify, create derivative works, redistribute, and make non-production use of the Licensed Work. The Licensor may make an Additional Use Grant, above, permitting limited production use.
23
+
24
+ Effective on the Change Date, or the fourth anniversary of the first publicly available distribution of a specific version of the Licensed Work under this License, whichever comes first, the Licensor hereby grants you rights under the terms of the Change License, and the rights granted in the paragraph above terminate.
25
+
26
+ If your use of the Licensed Work does not comply with the requirements currently in effect as described in this License, you must purchase a commercial license from the Licensor, its affiliated entities, or authorized resellers, or you must refrain from using the Licensed Work.
27
+
28
+ All copies of the original and modified Licensed Work, and derivative works of the Licensed Work, are subject to this License. This License applies separately for each version of the Licensed Work and the Change Date may vary for each version of the Licensed Work released by Licensor.
29
+
30
+ You must conspicuously display this License on each original or modified copy of the Licensed Work. If you receive the Licensed Work in original or modified form from a third party, the terms and conditions set forth in this License apply to your use of that work.
31
+
32
+ Any use of the Licensed Work in violation of this License will automatically terminate your rights under this License for the current and all other versions of the Licensed Work.
33
+
34
+ This License does not grant you any right in any trademark or logo of Licensor or its affiliates (provided that you may use a trademark or logo of Licensor as expressly required by this License). TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND TITLE. MariaDB hereby grants you permission to use this License’s text to license your works and to refer to it using the trademark "Business Source License" as long as you comply with the Covenants of Licensor below.
35
+
36
+ Covenants of Licensor
37
+ In consideration of the right to use this License’s text and the "Business Source License" name and trademark, Licensor covenants to MariaDB, and to all other recipients of the licensed work to be provided by Licensor:
38
+
39
+ To specify as the Change License the GPL Version 2.0 or any later version, or a license that is compatible with GPL Version 2.0 or a later version, where "compatible" means that software provided under the Change License can be included in a program with software provided under GPL Version 2.0 or a later version. Licensor may specify additional Change Licenses without limitation.
40
+
41
+ To either: (a) specify an additional grant of rights to use that does not impose any additional restriction on the right granted in this License, as the Additional Use Grant; or (b) insert the text "None."
42
+
43
+ To specify a Change Date.
44
+
45
+ Not to modify this License in any other way.
46
+
47
+ Notice
48
+ The Business Source License (this document, or the "License") is not an Open Source license. However, the Licensed Work will eventually be made available under an Open Source License, as stated in this License.
49
+
50
+ For more information on the use of the Business Source License generally, please visit the Adopting and Developing Business Source License FAQ.
51
+
52
+ License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved. "Business Source License" is a trademark of MariaDB Corporation Ab.
@@ -23,7 +23,6 @@
23
23
  jquery-ui/widgets/mouse
24
24
  jquery-ui/widgets/draggable
25
25
  jquery-ui/widgets/resizable
26
- jquery-ui/widgets/autocomplete
27
26
  jquery-ui/widgets/button
28
27
  jquery-ui/widgets/dialog
29
28
  jquery-ui/widgets/menu
@@ -44,8 +43,6 @@
44
43
  %w(
45
44
  workarea/core/templates/lorem_ipsum_view
46
45
  workarea/core/templates/reveal_password_button
47
- workarea/storefront/templates/ui_menu_heading
48
- workarea/storefront/templates/ui_menu_item
49
46
  workarea/storefront/templates/loading
50
47
  workarea/storefront/templates/message
51
48
  workarea/storefront/templates/message_dismiss_action
@@ -66,12 +63,8 @@
66
63
  # Plugin JST Templates
67
64
  append_javascripts('storefront.templates')
68
65
 
69
- # Library Extensions
70
- %w(
71
- jquery_ui/storefront/categorized_autocomplete
72
- ).each do |asset|
73
- require_asset asset
74
- end
66
+ # Plugin Library Extensions
67
+ append_javascripts('storefront.extensions')
75
68
 
76
69
  # Workarea Module Controller
77
70
  require_asset 'workarea/core/workarea'
@@ -107,7 +100,6 @@
107
100
  workarea/core/modules/form_submitting_controls
108
101
  workarea/core/modules/jquery
109
102
  workarea/core/modules/style_guide_empty_links
110
- workarea/core/modules/style_guide_autocomplete_fields
111
103
  workarea/core/modules/reveal_password
112
104
  workarea/core/modules/local_time
113
105
  workarea/storefront/modules/forms
@@ -124,7 +116,6 @@
124
116
  workarea/storefront/modules/primary_nav_content
125
117
  workarea/storefront/modules/product_details_sku_selects
126
118
  workarea/storefront/modules/popup_buttons
127
- workarea/storefront/modules/search_fields
128
119
  workarea/storefront/modules/alternate_image_buttons
129
120
  workarea/storefront/modules/scroll_to_buttons
130
121
  workarea/storefront/modules/address_region_fields
@@ -137,7 +128,6 @@
137
128
  workarea/storefront/modules/analytics
138
129
  workarea/storefront/modules/cart_count
139
130
  workarea/storefront/modules/recommendations_placeholders
140
- workarea/storefront/modules/recent_views
141
131
  workarea/storefront/modules/workarea_analytics
142
132
  workarea/storefront/modules/mobile_nav_button
143
133
  workarea/storefront/modules/back_to_top_button
@@ -10,7 +10,6 @@
10
10
  * @property {object} breakPoints
11
11
  * @property {object} dialog
12
12
  * @property {object} loading
13
- * @property {object} searchFieldsAutocomplete
14
13
  * @property {object} popupButtons
15
14
  * @property {object} deletionForms
16
15
  * @property {object} creditCardNumberWhiteList
@@ -82,10 +81,6 @@
82
81
  }
83
82
  };
84
83
 
85
- WORKAREA.config.searchFieldsAutocomplete = {
86
- minLength: 2
87
- };
88
-
89
84
  WORKAREA.config.popupButtons = {
90
85
  width: 768,
91
86
  height: 480
@@ -251,6 +251,22 @@ WORKAREA.registerModule('analytics', (function () {
251
251
  }
252
252
  }),
253
253
 
254
+ checkForNewSession = _.once(function () {
255
+ var currentSessions;
256
+
257
+ if (!WORKAREA.cookie.read('analytics_session')) {
258
+ currentSessions = WORKAREA.cookie.read('sessions') || 0;
259
+ WORKAREA.cookie.create('sessions', parseInt(currentSessions) + 1);
260
+
261
+ WORKAREA.cookie.create(
262
+ 'analytics_session',
263
+ 'true',
264
+ <%= Workarea::Configuration::Session.ttl.to_f / 1.day %>
265
+ );
266
+ WORKAREA.analytics.fireCallback('newSession');
267
+ }
268
+ }),
269
+
254
270
  firePageView = _.once(function () {
255
271
  WORKAREA.analytics.fireCallback('pageView');
256
272
  }),
@@ -269,6 +285,7 @@ WORKAREA.registerModule('analytics', (function () {
269
285
  setupProductLists($scope);
270
286
 
271
287
  setupGenericCallbacks($scope);
288
+ checkForNewSession();
272
289
  firePageView();
273
290
  };
274
291
 
@@ -5,7 +5,7 @@ WORKAREA.registerModule('dialogButtons', (function () {
5
5
  'use strict';
6
6
 
7
7
  var isSrc = function (fileName) {
8
- var extension = WORKAREA.url.parse(fileName).path.split('.').pop();
8
+ var extension = fileName.split('.')[1];
9
9
 
10
10
  return _.includes(WORKAREA.config.imageFileExtensions, extension);
11
11
  },
@@ -23,6 +23,10 @@ WORKAREA.analytics.registerAdapter('workarea', function () {
23
23
  };
24
24
 
25
25
  return {
26
+ 'newSession': function () {
27
+ $.post(WORKAREA.routes.storefront.analyticsNewSessionPath());
28
+ },
29
+
26
30
  'categoryView': function (payload) {
27
31
  if (payload.id && _.isEmpty(payload.filters) && payload.page === 1) {
28
32
  $.ajax({
@@ -45,10 +45,8 @@
45
45
  <%= append_stylesheets('storefront.typography') %>
46
46
 
47
47
  @import 'avalanche';
48
- @import 'jquery_ui/storefront/ui_autocomplete';
49
48
  @import 'jquery_ui/storefront/ui_dialog';
50
49
  @import 'jquery_ui/storefront/ui_helper_hidden_accessible';
51
- @import 'jquery_ui/storefront/ui_menu';
52
50
  @import 'jquery_ui/storefront/ui_state_focus';
53
51
  @import 'jquery_ui/storefront/ui_widget_overlay';
54
52
  <%= append_stylesheets('storefront.dependencies') %>
@@ -1,8 +1,10 @@
1
1
  /*------------------------------------*\
2
2
  #BASE
3
3
  \*------------------------------------*/
4
+
4
5
  body {
5
6
  margin: 0;
7
+ padding: 0 !important;
6
8
  }
7
9
 
8
10
  body > center {
@@ -11,10 +13,16 @@ body > center {
11
13
 
12
14
  body > center,
13
15
  body > center > table {
14
- background: $email-background-color;
15
16
  text-align: left;
16
17
  }
17
18
 
19
+ // Required to ensure background is properly displayed across clients
20
+ body,
21
+ body > center,
22
+ .mso-wrapper {
23
+ background: $email-background-color;
24
+ }
25
+
18
26
  table {
19
27
  border: 0;
20
28
  -premailer-cellpadding: 0;
@@ -4,7 +4,7 @@
4
4
  $email-container-main-bg-color: $white !default;
5
5
 
6
6
  .email-container {
7
- margin: auto;
7
+ margin: 0 auto;
8
8
  text-align: center;
9
9
  }
10
10
 
@@ -10,6 +10,22 @@
10
10
  .align-right { text-align: right; }
11
11
 
12
12
 
13
+ /**
14
+ * Display helpers
15
+ */
16
+ .hidden {
17
+ display: none;
18
+ font-size: 1px;
19
+ line-height: 1px;
20
+ max-height: 0px;
21
+ max-width: 0px;
22
+ opacity: 0;
23
+ overflow: hidden;
24
+ mso-hide: all;
25
+ font-family: sans-serif;
26
+ }
27
+
28
+
13
29
  /**
14
30
  * Responsive helpers
15
31
  *
@@ -18,5 +18,5 @@ $font-size: 16px !default;
18
18
  * Email-specific variables are defined separately.
19
19
  */
20
20
 
21
- $email-max-width: 600px !default;
21
+ $email-max-width: <%= Workarea.config.storefront_email_width %>px !default;
22
22
  $email-background-color: $light-gray !default;
@@ -1,44 +1,59 @@
1
1
  module Workarea
2
2
  module Storefront
3
- class AnalyticsController < ActionController::Metal
4
- include ActionController::Instrumentation
3
+ class AnalyticsController < Storefront::ApplicationController
4
+ skip_before_action :verify_authenticity_token
5
+ before_action :ignore_bots
6
+
7
+ def new_session
8
+ Metrics::SalesByDay.inc(sessions: 1)
9
+
10
+ current_segments.each do |segment|
11
+ Metrics::SegmentByDay.inc(key: { segment_id: segment.id }, sessions: 1)
12
+ end
13
+ end
5
14
 
6
15
  def category_view
7
- unless robot?
16
+ if params[:category_id].present?
8
17
  Metrics::CategoryByDay.inc(key: { category_id: params[:category_id] }, views: 1)
18
+ Metrics::User.save_affinity(
19
+ id: current_metrics_id,
20
+ action: 'viewed',
21
+ category_ids: params[:category_id]
22
+ )
9
23
  end
10
24
  end
11
25
 
12
26
  def product_view
13
- unless robot?
27
+ if params[:product_id].present?
14
28
  Metrics::ProductByDay.inc(key: { product_id: params[:product_id] }, views: 1)
29
+ Metrics::User.save_affinity(
30
+ id: current_metrics_id,
31
+ action: 'viewed',
32
+ product_ids: params[:product_id]
33
+ )
15
34
  end
16
35
  end
17
36
 
18
37
  def search
19
- unless robot?
38
+ query_string = QueryString.new(params[:q])
39
+
40
+ if query_string.present? && !query_string.short?
20
41
  Metrics::SearchByDay.save_search(params[:q], params[:total_results])
42
+ Metrics::User.save_affinity(
43
+ id: current_metrics_id,
44
+ action: 'viewed',
45
+ search_ids: query_string.id
46
+ )
21
47
  end
22
48
  end
23
49
 
24
- def search_abandonment
25
- warn <<~eos
26
- DEPRECATION WARNING: Search abandonment tracking is deprecated and will be removed \
27
- in Workarea 3.5.
28
- eos
29
- end
30
-
31
- def filters
32
- warn <<~eos
33
- DEPRECATION WARNING: Filter analytics tracking is deprecated and will be removed \
34
- in Workarea 3.5.
35
- eos
36
- end
37
-
38
50
  private
39
51
 
40
- def robot?
41
- Robots.is_robot?(request.user_agent)
52
+ def ignore_bots
53
+ if browser.bot?
54
+ head(:forbidden)
55
+ return false
56
+ end
42
57
  end
43
58
  end
44
59
  end
@@ -1,13 +1,10 @@
1
1
  module Workarea
2
2
  module Storefront
3
3
  class ApplicationController < Workarea::ApplicationController
4
- include HttpCaching
5
4
  include Authentication
6
- include AdminGuestBrowsing
7
5
  include Impersonation
8
6
  include CurrentCheckout
9
7
  include CurrentRelease
10
- include UserActivity
11
8
  include OrderLookup
12
9
  include CurrentReferrer
13
10
 
@@ -16,12 +13,13 @@ module Workarea
16
13
  helper :all
17
14
  helper_method :layout_content
18
15
 
16
+ around_action :apply_segments
17
+
19
18
  def health_check
20
19
  render plain: 'ok'
21
20
  end
22
21
 
23
22
  def current_user_info
24
- touch_auth_cookie
25
23
  render 'workarea/storefront/users/current_user'
26
24
  end
27
25
 
@@ -11,14 +11,13 @@ module Workarea
11
11
  after_action :check_inventory, except: :create
12
12
 
13
13
  def create
14
- @cart = CartViewModel.new(current_order, view_model_options)
15
-
16
14
  # TODO: for v4, use AddItemToCart for this.
17
15
  if current_order.add_item(item_params.to_h.merge(item_details.to_h))
18
16
  check_inventory
19
17
 
20
18
  Pricing.perform(current_order, current_shippings)
21
19
 
20
+ @cart = CartViewModel.new(current_order, view_model_options)
22
21
  @item = OrderItemViewModel.wrap(
23
22
  current_order.items.find_existing(
24
23
  item_params[:sku],
@@ -46,8 +46,6 @@ module Workarea
46
46
  end
47
47
 
48
48
  def validate_shipping_options
49
- return unless current_order.requires_shipping?
50
-
51
49
  available_options = Workarea::Storefront::CartViewModel.new(current_order).shipping_options
52
50
 
53
51
  if available_options.empty?
@@ -37,12 +37,14 @@ module Workarea
37
37
 
38
38
  current_order.touch_checkout!(
39
39
  ip_address: request.remote_ip,
40
- user_activity_id: current_user_activity_id,
41
40
  checkout_by_id: current_admin.try(:id) || current_user.try(:id),
42
41
  source: current_admin.present? ? 'admin' : 'storefront',
43
42
  traffic_referrer: current_referrer,
44
- user_agent: request.user_agent
43
+ user_agent: request.user_agent,
44
+ segment_ids: current_segments.map(&:id)
45
45
  )
46
+
47
+ update_tracking!(email: current_order.email)
46
48
  end
47
49
 
48
50
  def with_order_lock
@@ -79,6 +81,7 @@ module Workarea
79
81
 
80
82
  def setup_view_models
81
83
  Pricing.perform(current_order, current_shippings)
84
+ current_checkout.adjust_tender_amounts!
82
85
 
83
86
  @cart = CartViewModel.new(current_order, view_model_options)
84
87
  @summary = Checkout::SummaryViewModel.new(
@@ -90,11 +93,10 @@ module Workarea
90
93
  def set_checkout_user
91
94
  return if current_order.checking_out?
92
95
 
93
- if current_user.present?
96
+ if logged_in?
94
97
  current_checkout.start_as(current_user)
95
98
  else
96
99
  current_checkout.start_as(:guest)
97
- logout
98
100
  end
99
101
  end
100
102
  end