Workarea 3.0.6

Fixes Same-Day Date Filtering in Admin

#2523

Workarea 3.0.6 fixes search queries where the start and end dates are set to the same value by adding Workarea::Search::DateFilter and Workarea::Search::DateFilterTest and modifying the implementations of Workarea::Search::AdminIndexSearch#filters and Workarea::Search::AdminOrders#filters to use instances of the new DateFilter instead of RangeFilter.

The change also modifies the following integration test methods.

date filter same day

If your application is extending either of the above filters methods or the associated test methods, update your application code accordingly.

#2528

Workarea 3.0.6 fixes the link to Today's Signups on the Admin's People dashboard and fixes the links to Today's Orders and Yesterday's Orders on the Orders dashboard.

People dashboard links

Orders dashboard links

The change modifies the workarea/admin/dashboards/people.html.haml Admin view and the following helper methods.

If your applications is extending any of the above methods or overriding the above view, review the pull requests and update your application code accordingly.

Fix Empty Country & Region Fields in Storefront

#2522, #2530, #2531, #2513

Workarea 3.0.6 fixes country and region fields within Storefront address forms. Prior to this fix, the fields could appear empty on page load or after choosing a saved address, despite the data being present in the model. The change also removes client-side validation on the region field since some countries don't have regions.

The following sections summarize the changes to Core and Storefront.

Core

The changes modify Workarea::Address#region_name and add Workarea::AddressTest#test_region_name.

Also added are Workarea::Address#as_json and Workarea::AddressValidationTest#test_as_json. The following instance methods are also moved from Workarea::AddressTest to Workarea::AddressValidationTest due to a module name being corrected.

The changes modify the implementation of the following helper methods.

Storefront

Within the Storefront, the following JavaScript modules are modified.

The changes modify the workarea/storefront/shared/_address_fields.html.haml view and the Workarea::Storefront::LoggedInCheckoutSystemTest#test_preselecting_addresses_from_saved_addresses helper method. The following helper methods are added.

If your application is extending any of the above methods or overriding the above JavaScript modules or views, you'll need to to update your application code to ensure these patches are applied correctly.

Fixes Async Add to Cart

#2527

Async add to cart in the Storefront can fail due to an XHR race condition causing the cookie with the current order id to be replaced after the item is added to cart. Workarea 3.0.6 makes the following changes within the Storefront to mitigate this and similar problems.

If you are overriding this JavaScript module or extending cache_page, you should update your application code to ensure this patch is applied correctly.

Fixes Mobile Navigation Behavior

#2524

Prior to 3.0.6, clicking a menu within the Storefront's mobile navigation could reload the page instead of asynchronously loading the menu's content. Workarea 3.0.6 fixes this problem by modifying the workarea/storefront/menus/index.html.haml Storefront view, binding the behavior to the presence of the menu's content rather than the taxon's children (which is irrelevant in this context). The change also modifies the Workarea::Storefront::NavigationSystemTest#test_mobile_navigation_menus system test method.

If your application is overriding this view, you should apply this change in your copy of the file to apply the fix.

Fix Workarea Configuration within System Tests

bff1b44e3f6

Workarea 3.0.6 changes Workarea.config and Workarea.with_config to use instance variables rather than thread variables since Capybara runs its server in a separate thread.

If your application is extending these methods, update your application code accordingly to prevent unexpected behavior in the Test environment.

Fixes Fulfillment Quantities in Admin

#2508

Workarea 3.0.6 fixes incorrect fulfillment quantities in the Admin when multiple fulfillment events affect a fulfillment item (such as shipping an order, then canceling it).

The change renames Workarea::Fulfillment::Package#items to Workarea::Fulfillment::Package#events_by_item and modifies implementation details within the following methods.

If your application is decorating any of these APIs, review the pull request and update your application code accordingly.

Fixes Feature Test JavaScript

#2512, #2515

In the test environment, Workarea loads workarea/core/feature_spec_helper.js in the Storefront to explicitly fail various browser feature tests (such as animations and touch support) that are undesirable or incorrectly reported in the test environment (PhantomJS). Prior to 3.0.6, this file also removes from the html element several class values that represent successful browser feature tests. However, a race condition may occur, causing the class values to be added after the code to remove them has run. The inclusion of those classes can cause intermittent test failures.

Workarea 3.0.6 re-orders the contents of the Storefront's workarea/storefront/head.js.erb manifest to avoid this race condition. The change also removes code that is no longer needed after changing the load order.

If your application is overriding this manifest, you must update your copy of the file to avoid intermittent test failures.

Fixes Storefront Error Dialog

#2518

Workarea 3.0.6 fixes the Storefront error dialog by correcting the value of WORKAREA.config.dialog.errorTemplate.path, which changed in a previous release. The change modifies the Storefront JavaScript config file, workarea/storefront/config.js.erb.

If your application is overriding this file, you'll need to apply this change in your copy. However, overriding this file is not recommended. If you are doing so, consider creating a JavaScript config file for your application, which you can use to modify or replace configuration values as needed.

Allows Plugins to Extend Test Setup & Configuration

1e2fea5a65b

Workarea Testing 3.0.6 allows each Workarea plugin to provide additional test support files within its test/support/ directory. These files may be used to add or extend the test setup and configuration as needed for the plugin.

Applications will require these files from each installed plugin when running tests.

# workarea-testing/lib/workarea/test_help.rb

# ...

Workarea::Plugin.installed.each do |plugin|
  Dir[plugin.root.join('test', 'support', '**', '*.rb')].each do |support_file|
    require support_file
  end
end
Now on GitHub