Patch release notes for Workarea 3.4.5.
Fix Error When Viewing Release Show Page in Admin
When viewing a Release in admin, an error can occur if a
model becomes nil between the time the release is being viewed and when
it was originally created/planned. Workarea now ensures the release can
always be viewed in the admin by not rendering any changesets that can't
be drawn back to a releasable model currently in the database.
Disable Slug Input On Unreleased Pages
disabled: true on slug inputs when making changes within a
release, and add help text to explain why it cannot be edited. Since slugs
cannot be changed within a release, having this as a field a user can
type into created a confusing experience.
workarea:services:clean for Removing Services Data
This task runs
docker-compose down -v, which will remove volumes
associated with the application. It's useful when transitioning between
v3.3 and v3.4, so the Mongo data doesn't become corrupted, but should
only be used if you're OK with your data getting deleted.
Additionally, an environment variable called
$COMPOSE_ARGUMENTS has been introduced to provide a means of passing command-line arguments to the
docker-compose commands that are run using these tasks. For example:
COMPOSE_ARGUMENTS="--remove-orphans" rails workarea:services:up
Unable To Bulk Delete Shipping Services
Workarea.config.bulk_action_deletion_threshold is surpassed
in a query for shipping services to be bulk-deleted, the page that is
being redirected to expects the models being deleted to have
_summary.html.haml partials co-located in their respective views
directory for the controller. This isn't the case for shipping services,
which (along with other models we may wish to bulk-delete) doesn't have
much information other than the name of the model. For these items,
Workarea introduces a generic workarea/admin/shared/summary which links
to the model and provides its name (or BSON ID if no
#name method is defined)
as well as its type in the auxiliary summary info.
Use Batches For Admin Search Indexing Rake Task
When attempting to bulk-index a large collection without batching,
MongoDB can throw a sort uses too much memory error and cause the
bulk index to fail. This mainly happens in admin, which is a much larger
index than storefront. To resolve this, Workarea has introduced a new method,
Mongoid::Criteria#each_slice_of (which is similar to
#each_by in its
purpose of making iterations over large MongoDB collections a bit easier
for the database to handle), and uses it in the
workarea:search_index:admin Rake task.
Fix S3 Misconfiguration When Using IAM Profiles For Authentication
When updating CORS for direct uploads, the auto-configuration for S3 can
use_iam_profile: true and an AWS access/secret
keypair. To prevent this, make sure that either the keypair or
use_iam_profile is configured, but not both.
Validate Product Rule Lucene Query Syntax
When invalid Lucene queries are saved into product rules, an error would
occur when attempting to browse the category because the query was never
checked for valid syntax. As part of the validation process for product
rules, run a
Search::CategoryBrowse query for the rule being created
or edited, and add an error to the model if Elasticsearch responds with
a server error (5xx) HTTP status. This prevents the rule from being saved
on the product list in the first place.
Add MongoDB Indexes For Default Scopes Without Corresponding Indexes
noTableScan enforces that all queries to MongoDB need to have
corresponding indexes, it was previously possible to receive an error
when attempting query something seemingly simple, such as
User::AdminBookmark.all. Add indexes for any models who have a
default_scope, but no corresponding index for the query that scope
generates. This may not always be caught by the base test suite, but
can affect things like console usage, rake tasks, decorations, etc.
Disable Permissions Management When User is a Super-Admin
When a user has super-admin privileges in admin, it was previously
possible to attempt removing admin access as well as access to areas of
the admin, but these values would just get re-set after the form
completed anyway. Workarea now sets all checkboxes on the permissions
disabled, and renders a warning message above the form stating
that you cannot change permissions for users who are super-admins. It
also instructs the admin how to disable super-admin for a user in order
for this page to function normally.
Prevent VCR from Blocking the Webdrivers Download of Chrome
When web drivers has to download and install Chrome, it's being blocked by VCR. This is somewhat of a common problem with the Webdrivers gem, so Workarea has allowed the Chrome hosts described in that Wiki article to the project automatically so you won't have to.
Fix Intermittently Failing Product Rules Test
Create the products in
Admin::ProductRulesSystemTest one day in
advance in order to avoid issues with the products being created the
moment before the day changes. This causes the datepicker assertions to
fail some of the time. Using
#travel_to, Workarea simulates the server
time changing but keeps the client (browser) time consistent, so the
datepicker will always be initialized to use the current time that the
test is run at.
Fix Issue With Sale Price Creation
When adding/editing prices for a SKU in the admin interface, the
messaging underneath the field says
Sale Price (defaults to regular),
but when left blank the Sale Price will be saved as $0.00. This is
due to the use of a numeric field type on the
<input> tag. To resolve
this, Workarea now converts this value to
nil in the controller, so
that the price will be added into the backend with an empty value for
:sale field. When the sale field is blank, the pricing system will
default to using the regular price in all scenarios.
Solved by Jeremie Ges. Thanks Jeremie!
Fix Sidekiq Only Using Localhost Redis
Workarea now applies its own automatic Redis configuration before
looking up values for concurrency to apply to Sidekiq, otherwise Sidekiq will
always default to using the Redis server on
This fixes the inability to configure Sidekiq and its Redis client to
use a server on an alternate host.
Update Date/Time Formats To Not Use Blank-Padded Day Of Month
After converting from ChromeDriver to Webdrivers, Workarea tests began failing on May 1st because the new drivers are omitting extra whitespace in the text output (just like a real web browser would do). This caused an assertion comparing a date string with text generated by the browser to fail, which uncovered a more insidious issue: Workarea's time formatting was allowing an extra blank space on single-digit days, which makes the proper assertions much harder to nail down based on what day you're running the test. To resolve this, the time formats have been updated to omit the extra space in case of a single-digit date.
Clean Up Search Customization Previews
When building the preview for search customization results, ensure the
correct view model is used by calling
ProductRulesPreviewViewModel.wrap instead of
.new. This ensures the
correct UI is rendered for the given customization and product rules
preview you're attempting to view.