13220 Fixes affiliate sales spec
13220 Use before_create to update product name
13220 Fixes rubocop warnings
13220 Update product_name in line_item in specs
13220 Fix before_create lint
13220 Add spec for checking product_name is not set in reports
13220 Fixes rubocop issue
13220 Add migrations for updating the existing line items
13220 Fixing lint issues
13220 Set product_name in line_item before doing validation
13220 Fix linter issues
13220 Fixes spec
13220 Fixes linter issues
13220 Review comments
13220 Review comments
13220 Add default product name
13220 Use product_name instead of variant product name when using line item
13220 Fix specs
13220 Revert change in affiliate_sales_data_spec
CL-13220 Store variant name in line_item
13220 Default variant name to original variant's full name for line_items
13220 Add missing frozen string literal
13220 Add spec for full_variant_name
13220 Remove UpdateProductNameInLineItems and AddNotNullToProductNameInLineItems migrations
13220 Remove presence validation for product_name
13220 Use full_product_name which defaults to variant product name if empty
This function got renamed in 01d5830480, but this call got missed.
I would like to add a spec to cover this, but am not sure exactly how to set it up right now.
I also notice that usage occurs after the preventDefault, and one before. I'm not sure if that matters. I have myself to blame for that inconsistency 🤦
I considered using the vine error message as the translation key (ie I18n.t(vine_voucher_validator_service.errors.#{message.parameterize.underscore}), but thought it might be more predictable to have keys explicitly defined and whitelisted like this.
These error message are still squashed by the controller, we'll deal with that next.
It seems that we have functionality that depends on the order the
scripts are executed. Using defer breaks that.
Using defer is better performance wise so we should try to address this
eventually, might need to wait till we get rid of angular.
This avoids any class reloading issues in dev, simplifies most of the
code path and opens up for refactoring.
The only reason we still load the class is to call `clean_name` on it
for the translation key. We can probably do better.
Rails renders an error when you try to supply an invalid value. Our code
is safe without an allow-list and the UX doesn't allow you to select an
invalid value.