Workarea 3.0.9

Internationalizes Currency Symbol in Admin

#2637, 00e83b32fc1

Workarea 3.0.9 internationalizes the currency symbol in the Admin by replacing instances of the static string $ with calls to Money::Currency#symbol (docs) and MoneyRails::ActionViewExtension#currency_symbol (docs) from the Money (docs) and MoneyRails (docs) libraries, respectively.

The following Admin views are affected.

And the following Admin tests are affected.

Furthermore, Workarea 3.0.9 extends Rails' number_to_currency helper method to ensure the correct currency symbol (from Money::Currency#symbol) is used in the output. Rails uses locale to determine the currency symbol, but Workarea uses the Money library to manage currency.

The change adds workarea-core/lib/workarea/ext/freedom_patches/action_view_number_helper.rb, which extends ActionView::Helpers::NumberHelper#number_to_currency.

Internationalizes Category & Search System Tests in Storefront


Workarea 3.0.9 modifies the following Storefront tests to internationalize static text strings within each.


- test_filtering_products_and_sorting


Fixes UI Persistence Issues in Product Bulk Edit Flow


Workarea 3.0.9 fixes the UI for the product bulk edit flow in the Admin, where some changes were incorrectly persisting and not persisting across the steps of the flow.

The change modifies the Core model Workarea::BulkAction, adding reset_to_default!, and the Admin view model Workarea::Admin::BulkActionProductEditViewModel, adding pricing_prices.

The change also modifies the Admin controller method Workarea::Admin::BulkActionProductEditsController#update and the Admin view workarea/admin/bulk_action_product_edits/edit.html.haml.

Finally, the change adds the Core model test Workarea::BulkActionTest#test_reset_to_default and modifies the Admin system test Workarea::Admin::BulkActionsSystemTest#test_bulk_editing.

Restores Whitespace Under Admin Browsing Controls


Workarea 3.0.9 restores negative space removed from the browsing controls component in Workarea 3.0.7 after further testing revealed the need for the space in some views. The change modifies .browsing-controls {} within the Admin stylesheet workarea/admin/components/_browsing_controls.scss.

Prevents Linking to Nonexistent Products in Admin Auxiliary Nav


Workarea 3.0.9 prevents linking to nonexistent products from the Admin auxiliary navigation for inventory skus and pricing skus. The change affects the following Admin partials.

Hides Inactive Blocks on Admin Content Cards


Workarea 3.0.9 modifies the Admin content card partial, workarea/admin/content/_card.html.haml, filtering the enumerated blocks to only those that are active.

Prevents Sorting Taxons in Taxonomy Content Block Admin


Workarea 3.0.9 prevents sorting taxons in the taxonomy content block Admin, which was previously possible since code for the feature is shared with the menu editor (where taxon sorting is allowed). The change modifies the Admin JavaScript module workarea/admin/modules/menu_editor_menu_list_sortables.js, causing WORKAREA.menuEditorMenuListSortables.init() to return early if the elements to be manipulated are within the content editor UI.

Adds Delete Confirmation to Prices Index in Admin


Workarea 3.0.9 modifies the workarea/admin/prices/index.html.haml Admin view, adding a delete confirmation prompt to the delete button for each price.

Fixes Paths to SVGs in Admin Import Views

#2623, #2656

Workarea 3.0.9 fixes paths to SVG files within the following Admin views.

Fixes Password Reset Exception in Storefront when User is Not Found


Workarea 3.0.9 modifies Workarea::Storefront::Users::PasswordsController#create to prevent raising an exception when no user is found with the given email. This change provides increased privacy for all users and an improved user experience for users who enter their email incorrectly while requesting a password reset.

The change also modifies the workarea.storefront.flash_messages.password_reset_email_sent translation in the Storefront's en.yml locale file. Furthermore, the PR modifies the Workarea::Storefront::PasswordsSystemTest#test_customer_resetting_a_password system test in the Storefront, adding an assertion to test a bogus email.

Fixes Open Graph Metadata in Storefront

#2662, #2664

Workarea 3.0.9 fixes the values for the og:image and og:url Open Graph properties in the Storefront, ensuring each value is an absolute URL to an existing resource.

The following Storefront views are affected.

Fixes Shipping Rate Parent Association


Workarea 3.0.9 modifies the Core model Workarea::Shipping::Rate, changing the embedded_in :method association to embedded_in :service. The change correctly reflects the parent model, Workarea::Shipping::Service, renamed from Workarea::Shipping::Method in Workarea 3.0.0.

Fixes Content Block Data not Persisting after Typecasting


Workarea 3.0.9 changes some implementation details within Workarea::Content::Block#typecast and Workarea::Content::Blocktype#typecast! to ensure content block data persists after typecasting.

The change also modifies the following test, adding assertions to confirm the fix: Workarea::Content::BlockTest#test_valid_typecasts_the_values_in_the_data_block.

Fixes Undefined Method Errors in Sidekiq


Workarea 3.0.9 fixes the implementation of Sidekiq::CallbacksWorker.enqueue_on to resolve undefined method errors in Sidekiq.

Fixes Redis Config URL

d8e0745bdf9, d4fa747bc74

Workarea 3.0.9 modifies Workarea::Configuration::Redis#to_url to create consistent URL strings when Workarea::Configuration::Redis#port and Workarea::Configuration::Redis#db are nil.

Deletes Redis Data when Running Seeds


Workarea 3.0.9 modifies the Core library module Workarea::Seeds, adding Workarea::Seeds.delete_redis_data and modifying Workarea::Seeds.reset to call delete_redis_data. The change causes Redis to be flushed when running seeds (after deleting data from Elasticsearch and MongoDB).

Fixes Changelog Rake Task in Plugin Template


Workarea 3.0.9 modifies the plugin template script, workarea/docs/guides/source/plugin_template.rb, in order to fix the :changelog Rake task created within the Rakefile of new plugins.

If you created a plugin using an earlier version of the plugin template, you should update the plugin's Rakefile to fix the :changelog task.

Adds Teaspoon Configuration to Plugin Template


Workarea 3.0.9 modifies the plugin template script, workarea/docs/guides/source/plugin_template.rb, adding configuration for Teaspoon and two Rake tasks for use with Teaspoon: :teaspoon and :teaspoon_server.

Excludes Docs Directory from RDoc


Workarea 3.0.9 modifies workarea.gemspec to exclude the docs directory from RDoc generation. The change prevents a RDoc::Parser::Ruby failure when RDoc runs during gem installation.

Now on GitHub