Workarea 3.0.5

Adds VCR Configuration


Workarea Testing 3.0.5 provides a default configuration for the vcr library, including a custom cassette persister, Workarea::Testing::CassettePersister.

This configuration persists cassettes to test/vcr_cassettes/ within the current application or engine. When fetching a cassette, vcr will search within the current application and each installed Workarea engine for the given cassette.

If your application or engine has already configured vcr, remove or update your configuration to ensure compatibility with the defaults provided by Workarea Testing. Ensure all cassettes are persisted to test/vcr_cassettes/.

Fixes Display of Image Group Content Blocks


Workarea 3.0.5 modifies the Storefront partial for image group content blocks, workarea/storefront/content_blocks/_image_group.html.haml, to output only as many grid cells as there are images in the image group. Before 3.0.5, additional (empty) grid cells are output when images are cleared.

Additionally, the default presentation of image group content blocks is simplified, using a centered grid starting at the medium screen width.

image group content block in Storefront

The pull request also adds the Workarea::Content::Asset#image_placeholder? method and the workarea/storefront/style_guides/components/_image_group_content_block.html.haml style guide partial in the Storefront.

If your application is overriding the image group content block partial, you should update your copy to avoid empty grid cells in the Storefront.

Replaces Heading Elements within Content Blocks


Within all Storefront content block partials, Workarea 3.0.5 replaces h2 elements with span elements that extend the %heading--2 styles. The intention is to remove these elements from the document outline (because their placement is unpredictable) without affecting their appearance. The following list includes the affected selectors and the corresponding view and stylesheet for each.

If your application is overriding any of the above views or stylesheets, consider updating your copies for consistency.

Internationalizes Email Templates


Prior to 3.0.5, a few email templates contain untranslated text strings. Workarea 3.0.5 internationalizes the Admin email layout and one mailer in Storefront. The following views are affected.

And the following translations are added to the en locale.

Additionally, the following mailers are modified to remove unnecessary br elements.

If your application is overriding any of the above mailer views, you may want to apply the changes to your copies of the files.

Fixes Pagination Test Failures


Workarea 3.0.5 modifies the workarea/storefront/modules/pagination.js JavaScript module in the Storefront to fix a timing issue causing automated test failures.

The public API of the WORKAREA.pagination module is unaffected, however, if your application is overriding this module you'll need to apply the changes within your copy of the file to avoid intermittent test failures.

Fixes Async Replacement of Product Details


The WORKAREA.productDetailsSkuSelects module is responsible for the asynchronous replacement of product details when the sku select is changed, however, the functionality is broken prior to 3.0.5. Workarea 3.0.5 modifies workarea/storefront/modules/product_details_sku_selects.js to fix a DOM query within the implementation.

The change does not affect the API of WORKAREA.productDetailsSkuSelects, but if your application is overriding this module, you'll need to apply the fix manually.

Fixes File Extension of Taxonomy Content Block Partials


Workarea 3.0.5 renames the following files to change the file extension from .haml to .html.haml. The name change should cause no functional change—it simply corrects the file extension to avoid confusion when overriding.

The pull request also removes the vestigal and unused taxonomy-content-block__container--image class value from the above files.

These changes should have no effect on your application, but if you are overriding any of these partials, review the changes to be sure.

Fixes Position of Tooltips on Admin Imports Screens


Workarea 3.0.5 adds data attributes to the following Admin views to position tooltips correctly.

If your application is overriding these views, you should apply these changes to your copies of the files.

Skips Activity Headings if No Entries


Workarea 3.0.5 modifies workarea/admin/activities/show.html.haml to not output heading elements within activity for days that have no entires.

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

Displays Multiple Tenders in Order Admin


Workarea 3.0.5 modifies the workarea/admin/orders/_cards.html.haml partial in the Admin to display up to 3 payment tenders, rather than the first tender only. The payment for an order may contain multiple tenders, such as when a gift card and credit card are used as payment on the same order. That scenario is shown in the example below (requires the Workarea Gift Cards plugin).

orders show with multiple tenders

If your application is overriding this partial, update your copy to allow for the display of multiple tenders.

Adds Utility Nav Append Point to Storefront Application Layout


Workarea 3.0.5 adds the storefront.utility_nav append point to the Storefront application layout, layouts/workarea/storefront/application.html.haml.

If your application is overriding this layout, update your copy so that plugins may append to the new append point.

Fixes Status Facet for Releasables


Admin search models for releasables include a status facet. Prior to 3.0.5, the status method on these models is either missing or always returns 'active'. Workarea 3.0.5 moves this method to Workarea::Search::Admin::Releasable and returns either 'active' or 'inactive', depending on the status of the underlying model, as shown below.

# workarea-core/app/models/workarea/search/admin/releasable.rb

module Workarea
  module Search
    class Admin
      module Releasable
        # ...

        def status

        # ...

The following search models are affected.

In the unlikely case your application is decorating the status method on any of the above classes, update your decorators accordingly.

Removes Items from Order if Variants Are Inactive


Before each Workarea::Storefront::CartsController action, Workarea::CartCleaner#clean mutates the current order, removing items if the corresponding products are unpurchasable. Workarea 3.0.5 also removes items if the corresponding variants are inactive. The updated clean implementation is shown below.

# workarea-core/app/services/workarea/cart_cleaner.rb

module Workarea
  class CartCleaner
    # ...

    def clean
      items_to_remove = []

      cart.items.each do |item|
        product = products.detect { |p| == item.product_id }
        variant = product && product.variants.detect { |v| v.sku == item.sku }
        # ...

        unless product.purchasable? && variant.try(:active?) #

No action is required when upgrading, but be aware of this change in application behavior.

Adds Missing Style Guide Partials for Content Blocks


Workarea 3.0.5 adds the following style guide partials in the Storefront, which are missing prior to this release.

Additionally, the workarea/storefront/content_blocks/_navigation.haml partial is removed because it is not used.

Now on GitHub