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.
- checksums.yaml +4 -4
- data/LICENSE.txt +52 -0
- data/app/assets/javascripts/workarea/storefront/application.js.erb +2 -12
- data/app/assets/javascripts/workarea/storefront/config.js.erb +0 -5
- data/app/assets/javascripts/workarea/storefront/modules/{analytics.js → analytics.js.erb} +17 -0
- data/app/assets/javascripts/workarea/storefront/modules/dialog_buttons.js +1 -1
- data/app/assets/javascripts/workarea/storefront/modules/workarea_analytics.js +4 -0
- data/app/assets/stylesheets/workarea/storefront/application.scss.erb +0 -2
- data/app/assets/stylesheets/workarea/storefront/email/_base.scss +9 -1
- data/app/assets/stylesheets/workarea/storefront/email/_components.scss +1 -1
- data/app/assets/stylesheets/workarea/storefront/email/_helpers.scss +16 -0
- data/app/assets/stylesheets/workarea/storefront/email/{_settings.scss → _settings.scss.erb} +1 -1
- data/app/controllers/workarea/storefront/analytics_controller.rb +36 -21
- data/app/controllers/workarea/storefront/application_controller.rb +2 -4
- data/app/controllers/workarea/storefront/cart_items_controller.rb +1 -2
- data/app/controllers/workarea/storefront/checkout/addresses_controller.rb +0 -2
- data/app/controllers/workarea/storefront/checkouts_controller.rb +6 -4
- data/app/controllers/workarea/storefront/content_areas_controller.rb +1 -0
- data/app/controllers/workarea/storefront/content_blocks_controller.rb +1 -0
- data/app/controllers/workarea/storefront/current_checkout.rb +20 -14
- data/app/controllers/workarea/storefront/downloads_controller.rb +18 -0
- data/app/controllers/workarea/storefront/email_signups_controller.rb +1 -0
- data/app/controllers/workarea/storefront/errors_controller.rb +6 -0
- data/app/controllers/workarea/storefront/recent_views_controller.rb +2 -35
- data/app/controllers/workarea/storefront/recommendations_controller.rb +2 -2
- data/app/controllers/workarea/storefront/searches_controller.rb +0 -11
- data/app/controllers/workarea/storefront/users/accounts_controller.rb +2 -7
- data/app/controllers/workarea/storefront/users/credit_cards_controller.rb +5 -2
- data/app/controllers/workarea/storefront/users/passwords_controller.rb +1 -5
- data/app/helpers/workarea/storefront/application_helper.rb +19 -3
- data/app/helpers/workarea/storefront/content_helper.rb +1 -1
- data/app/helpers/workarea/storefront/favicons_helper.rb +6 -7
- data/app/helpers/workarea/storefront/navigation_helper.rb +10 -0
- data/app/helpers/workarea/storefront/schema_org_helper.rb +156 -0
- data/app/mailers/workarea/storefront/application_mailer.rb +1 -0
- data/app/view_models/workarea/storefront/category_view_model.rb +2 -2
- data/app/view_models/workarea/storefront/content_block_view_model.rb +41 -10
- data/app/view_models/workarea/storefront/content_blocks/product_insights_view_model.rb +1 -1
- data/app/view_models/workarea/storefront/display_content.rb +3 -1
- data/app/view_models/workarea/storefront/inquiry_view_model.rb +1 -7
- data/app/view_models/workarea/storefront/inventory_status_view_model.rb +10 -6
- data/app/view_models/workarea/storefront/order_item_view_model.rb +14 -0
- data/app/view_models/workarea/storefront/product_view_model.rb +22 -4
- data/app/view_models/workarea/storefront/recommendations_view_model.rb +8 -4
- data/app/view_models/workarea/storefront/search_view_model.rb +1 -1
- data/app/view_models/workarea/storefront/user_activity_view_model.rb +6 -17
- data/app/views/layouts/workarea/storefront/application.html.haml +13 -17
- data/app/views/layouts/workarea/storefront/checkout.html.haml +1 -1
- data/app/views/layouts/workarea/storefront/content_preview.html.haml +1 -0
- data/app/views/layouts/workarea/storefront/email.html.haml +33 -26
- data/app/views/layouts/workarea/storefront/empty.html.haml +1 -0
- data/app/views/layouts/workarea/storefront/navigation.html.haml +1 -1
- data/app/views/workarea/storefront/account_mailer/creation.html.haml +2 -0
- data/app/views/workarea/storefront/account_mailer/password_reset.html.haml +2 -0
- data/app/views/workarea/storefront/cart_items/create.html.haml +1 -1
- data/app/views/workarea/storefront/carts/show.html.haml +1 -1
- data/app/views/workarea/storefront/categories/show.html.haml +3 -2
- data/app/views/workarea/storefront/checkouts/confirmation.html.haml +1 -1
- data/app/views/workarea/storefront/contacts/show.html.haml +4 -2
- data/app/views/workarea/storefront/content_areas/show.html.haml +1 -0
- data/app/views/workarea/storefront/content_blocks/_category_summary.html.haml +2 -1
- data/app/views/workarea/storefront/content_blocks/_product_insights.html.haml +2 -1
- data/app/views/workarea/storefront/content_blocks/_product_list.html.haml +2 -1
- data/app/views/workarea/storefront/errors/show.html.haml +1 -0
- data/app/views/workarea/storefront/fulfillment_mailer/shipped.html.haml +3 -1
- data/app/views/workarea/storefront/order_mailer/_summary.html.haml +6 -0
- data/app/views/workarea/storefront/order_mailer/confirmation.html.haml +3 -0
- data/app/views/workarea/storefront/order_mailer/reminder.html.haml +3 -0
- data/app/views/workarea/storefront/orders/_summary.html.haml +3 -1
- data/app/views/workarea/storefront/orders/show.html.haml +3 -3
- data/app/views/workarea/storefront/pages/home_page.html.haml +4 -0
- data/app/views/workarea/storefront/pages/robots.text.erb +0 -1
- data/app/views/workarea/storefront/pages/show.html.haml +1 -0
- data/app/views/workarea/storefront/products/_price.html.haml +1 -2
- data/app/views/workarea/storefront/products/_pricing.html.haml +12 -6
- data/app/views/workarea/storefront/products/_summary.html.haml +3 -3
- data/app/views/workarea/storefront/products/show.html.haml +6 -4
- data/app/views/workarea/storefront/products/templates/_generic.html.haml +5 -5
- data/app/views/workarea/storefront/products/templates/_option_selects.html.haml +5 -7
- data/app/views/workarea/storefront/products/templates/_option_thumbnails.html.haml +5 -7
- data/app/views/workarea/storefront/recent_views/aside.html.haml +3 -10
- data/app/views/workarea/storefront/recent_views/narrow.html.haml +3 -10
- data/app/views/workarea/storefront/recent_views/show.html.haml +3 -10
- data/app/views/workarea/storefront/recommendations/show.html.haml +1 -1
- data/app/views/workarea/storefront/searches/show.html.haml +4 -5
- data/app/views/workarea/storefront/users/accounts/edit.html.haml +3 -3
- data/app/views/workarea/storefront/users/accounts/show.html.haml +3 -3
- data/app/views/workarea/storefront/users/addresses/edit.html.haml +3 -3
- data/app/views/workarea/storefront/users/addresses/new.html.haml +3 -3
- data/app/views/workarea/storefront/users/credit_cards/edit.html.haml +3 -3
- data/app/views/workarea/storefront/users/credit_cards/new.html.haml +3 -3
- data/app/views/workarea/storefront/users/orders/index.html.haml +3 -3
- data/app/views/workarea/storefront/users/orders/show.html.haml +4 -4
- data/app/views/workarea/storefront/users/passwords/new.html.haml +3 -3
- data/config/locales/en.yml +16 -3
- data/config/routes.rb +4 -2
- data/test/dummy/config/initializers/session_store.rb +1 -1
- data/test/helpers/workarea/storefront/content_helper_test.rb +1 -0
- data/test/helpers/workarea/storefront/navigation_helper_test.rb +4 -0
- data/test/helpers/workarea/storefront/schema_org_helper_test.rb +27 -0
- data/test/integration/workarea/storefront/analytics_integration_test.rb +44 -4
- data/test/integration/workarea/storefront/cart_items_integration_test.rb +0 -12
- data/test/integration/workarea/storefront/categories_integration_test.rb +0 -10
- data/test/integration/workarea/storefront/checkout_side_effects_integration_test.rb +15 -1
- data/test/integration/workarea/storefront/checkouts_integration_test.rb +68 -11
- data/test/integration/workarea/storefront/contact_form_integration_test.rb +18 -20
- data/test/integration/workarea/storefront/content_blocks_integration_test.rb +1 -4
- data/test/integration/workarea/storefront/current_checkout_integration_test.rb +53 -2
- data/test/integration/workarea/storefront/downloads_integration_test.rb +38 -0
- data/test/integration/workarea/storefront/email_signups_integration_test.rb +2 -0
- data/test/integration/workarea/storefront/guest_browsing_integration_test.rb +2 -2
- data/test/integration/workarea/storefront/impersonations_integration_test.rb +2 -2
- data/test/integration/workarea/storefront/login_integration_test.rb +3 -9
- data/test/integration/workarea/storefront/order_data_integration_test.rb +1 -9
- data/test/integration/workarea/storefront/place_order_integration_test.rb +5 -7
- data/test/integration/workarea/storefront/placing_order_integration_test.rb +1 -1
- data/test/integration/workarea/storefront/recent_views_integration_test.rb +29 -0
- data/test/integration/workarea/storefront/releases_integration_test.rb +132 -0
- data/test/integration/workarea/storefront/search_integration_test.rb +0 -46
- data/test/integration/workarea/storefront/segment_overrides_integration_test.rb +48 -0
- data/test/integration/workarea/storefront/segments_integration_test.rb +250 -0
- data/test/integration/workarea/storefront/store_credit_integration_test.rb +1 -1
- data/test/integration/workarea/storefront/users/credit_cards_integration_test.rb +2 -2
- data/test/integration/workarea/storefront/users/passwords_integration_test.rb +0 -19
- data/test/javascripts/traffic_referrer_spec.js +1 -1
- data/test/mailers/workarea/storefront/transactional_mailer_test.rb +9 -13
- data/test/system/workarea/storefront/analytics_system_test.rb +54 -40
- data/test/system/workarea/storefront/content_system_test.rb +10 -1
- data/test/system/workarea/storefront/digital_products_system_test.rb +2 -0
- data/test/system/workarea/storefront/download_system_test.rb +145 -0
- data/test/system/workarea/storefront/guest_checkout_system_test.rb +20 -0
- data/test/system/workarea/storefront/logged_in_checkout_system_test.rb +31 -32
- data/test/system/workarea/storefront/passwords_system_test.rb +35 -37
- data/test/system/workarea/storefront/pricing_overrides_system_test.rb +13 -2
- data/test/system/workarea/storefront/segment_overrides_system_test.rb +69 -0
- data/test/view_models/workarea/storefront/category_view_model_test.rb +20 -0
- data/test/view_models/workarea/storefront/content_block_view_model_test.rb +135 -3
- data/test/view_models/workarea/storefront/display_content_test.rb +4 -0
- data/test/view_models/workarea/storefront/product_view_model/option_set_test.rb +7 -8
- data/test/view_models/workarea/storefront/product_view_model_test.rb +17 -10
- data/test/view_models/workarea/storefront/search_view_model_test.rb +0 -6
- data/test/view_models/workarea/storefront/user_activity_view_model_test.rb +18 -20
- metadata +20 -22
- data/app/assets/javascripts/workarea/storefront/modules/recent_views.js +0 -25
- data/app/assets/javascripts/workarea/storefront/modules/search_fields.js +0 -59
- data/app/assets/javascripts/workarea/storefront/templates/ui_menu_heading.jst.ejs +0 -1
- data/app/assets/javascripts/workarea/storefront/templates/ui_menu_item.jst.ejs +0 -8
- data/app/assets/stylesheets/jquery_ui/storefront/_ui_autocomplete.scss +0 -17
- data/app/assets/stylesheets/jquery_ui/storefront/_ui_menu.scss +0 -40
- data/app/controllers/workarea/storefront/http_caching.rb +0 -33
- data/app/controllers/workarea/storefront/user_activity.rb +0 -19
- data/app/view_models/workarea/storefront/search_suggestion_view_model.rb +0 -87
- data/app/views/workarea/storefront/searches/index.json.jbuilder +0 -1
- data/app/views/workarea/storefront/style_guides/components/_ui_autocomplete.html.haml +0 -11
- data/test/dummy/tmp/screenshots/.keep +0 -0
- 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0fc7579774a32bc9746b0213537251f654ade0cb5cfa5764b7a80e211cc457d2
|
4
|
+
data.tar.gz: 640c178f253dc782cf057823ed1ca695b8fc80d17d1fb2fca58f512c6381b4dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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 =
|
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;
|
@@ -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
|
*
|
@@ -1,44 +1,59 @@
|
|
1
1
|
module Workarea
|
2
2
|
module Storefront
|
3
|
-
class AnalyticsController <
|
4
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
41
|
-
|
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],
|
@@ -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
|
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
|