The log:clear task seems to take quite a bit of time. At least we can speed up a bit by only booting up Rails once.
I'm more likely to run the script if it's quick ;)
bundle install always shows a very long list of all gems. But we really only want to know about the new gems being installed. Thankfully there's an option for that.
When the invoices feature is enabled, for every order, we check if
1. a new invoice must be generated
2. or, the latest invoice needs to be updated
the invoice rendrer input depends on the invoices flag.
if the feature is enabled, the input is supposed to be an invoice presenter
the invoices feature is enabled:
1. we filter non-invoiceable order
2. for each invoiceable order, we check if we need to generate a new invoice or update the latest invoice
We improved the email address validation to check the domain for
existing DNS entries. But our default user has the example.com domain
which is not resolved by my internet service provider.
I couldn't find a better way to deactivate this one check than
overriding the method in the validator. The code does not affect other
parts of the app unless you run multiple rake tasks in the same command
line with the database setup.
There were all sorts of dependencies hiding in there, and it was overwriting some of the admin variables. Better to keep things separate and simple.
I discovered that there was one legitimate reason for importing them though: for styling the trix editor. I can't think of a good way to safely import them without affecting the other variables, so I just hardcoded the colours for now.
Errors and required fields now use the colour from the palette. The error messages in the old design are a bit darker now, but I think it's clearer. And it makes the new design look way better.
Also snuck in a tiny padding tweak.
Inspecting 1481 files
...........................................................................................................................................................................................................................................................C..C.CC........................................................................C...C..........C..C..................CC........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Offenses:
app/models/customer.rb:32:3: C: [Corrected] Rails/ActiveRecordCallbacksOrder: before_validation is supposed to appear before before_destroy.
before_validation :downcase_email
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/customer.rb:33:3: C: [Corrected] Rails/ActiveRecordCallbacksOrder: before_validation is supposed to appear before before_destroy.
before_validation :empty_code
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/customer.rb:34:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected.
app/models/customer.rb:49:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected.
app/models/customer.rb:49:3: C: [Corrected] Rails/ActiveRecordCallbacksOrder: before_create is supposed to appear before before_destroy.
before_create :associate_user
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/enterprise.rb:129:3: C: [Corrected] Rails/ActiveRecordCallbacksOrder: after_create is supposed to appear before after_touch.
after_create :set_default_contact
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/enterprise.rb:130:3: C: [Corrected] Rails/ActiveRecordCallbacksOrder: after_create is supposed to appear before after_touch.
after_create :relate_to_owners_enterprises
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/enterprise.rb:133:3: C: [Corrected] Rails/ActiveRecordCallbacksOrder: after_rollback is supposed to appear before after_touch.
after_rollback :restore_permalink
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/enterprise.rb:134:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected.
app/models/enterprise_group.rb:18:3: C: [Corrected] Rails/ActiveRecordCallbacksOrder: after_save is supposed to appear before after_find.
after_save :unset_undefined_address_fields
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/enterprise_group.rb:18:3: C: [Corrected] Rails/ActiveRecordCallbacksOrder: before_validation is supposed to appear before after_save.
before_validation :sanitize_permalink
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/enterprise_group.rb:19:3: C: [Corrected] Rails/ActiveRecordCallbacksOrder: before_validation is supposed to appear before after_find.
before_validation :sanitize_permalink
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/enterprise_group.rb:23:3: C: [Corrected] Rails/ActiveRecordCallbacksOrder: before_validation is supposed to appear before after_save.
before_validation :sanitize_permalink
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/enterprise_relationship.rb:15:3: C: [Corrected] Rails/ActiveRecordCallbacksOrder: before_destroy is supposed to appear before after_save.
before_destroy :revoke_all_child_variant_overrides
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/enterprise_relationship.rb:16:3: C: [Corrected] Rails/ActiveRecordCallbacksOrder: before_destroy is supposed to appear before after_save.
before_destroy :destroy_related_exchanges
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/spree/order.rb:108:5: C: [Corrected] Rails/ActiveRecordCallbacksOrder: before_save is supposed to appear before before_create.
before_save :update_shipping_fees!, if: :complete?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/spree/order.rb:109:5: C: [Corrected] Rails/ActiveRecordCallbacksOrder: before_save is supposed to appear before before_create.
before_save :update_payment_fees!, if: :complete?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/spree/payment.rb:30:5: C: [Corrected] Rails/ActiveRecordCallbacksOrder: after_initialize is supposed to appear before before_create.
after_initialize :build_source
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/spree/payment.rb:32:5: C: [Corrected] Rails/ActiveRecordCallbacksOrder: after_initialize is supposed to appear before after_create.
after_initialize :build_source
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/spree/payment.rb:33:5: C: [Corrected] Rails/ActiveRecordCallbacksOrder: after_create is supposed to appear before after_save.
after_create :invalidate_old_payments
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/spree/payment.rb:34:5: C: [Corrected] Rails/ActiveRecordCallbacksOrder: after_initialize is supposed to appear before after_save.
after_initialize :build_source
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/spree/payment.rb:35:5: C: [Corrected] Rails/ActiveRecordCallbacksOrder: after_create is supposed to appear before after_save.
after_create :invalidate_old_payments
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/spree/payment.rb:36:5: C: [Corrected] Rails/ActiveRecordCallbacksOrder: after_initialize is supposed to appear before after_save.
after_initialize :build_source
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/spree/payment.rb:46:5: C: [Corrected] Rails/ActiveRecordCallbacksOrder: after_initialize is supposed to appear before after_create.
after_initialize :build_source
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/spree/payment.rb:47:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected.
app/models/spree/product.rb:87:5: C: [Corrected] Rails/ActiveRecordCallbacksOrder: after_create is supposed to appear before after_save.
after_create :ensure_standard_variant
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/spree/return_authorization.rb:12:5: C: [Corrected] Rails/ActiveRecordCallbacksOrder: before_save is supposed to appear before before_create.
before_save :force_positive_amount
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/spree/user.rb:49:5: C: [Corrected] Rails/ActiveRecordCallbacksOrder: after_create is supposed to appear before before_destroy.
after_create :associate_customers, :associate_orders
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/spree/user.rb:50:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected.
app/models/spree/variant.rb:88:5: C: [Corrected] Rails/ActiveRecordCallbacksOrder: after_create is supposed to appear before after_save.
after_create :create_stock_items
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/spree/variant.rb:89:5: C: [Corrected] Rails/ActiveRecordCallbacksOrder: after_create is supposed to appear before after_save.
after_create :set_position
^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/spree/variant.rb:90:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected.
app/models/spree/variant.rb:91:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected.
app/models/spree/variant.rb:91:5: C: [Corrected] Rails/ActiveRecordCallbacksOrder: around_destroy is supposed to appear before after_save.
around_destroy :destruction
^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/spree/variant.rb:92:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected.
1481 files inspected, 35 offenses detected, 35 offenses corrected
Inspecting 1481 files
.........................................C.................C.........................................................CC........C..........C.C.........C..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Offenses:
app/controllers/admin/resource_controller.rb:39:5: C: [Corrected] Layout/EmptyLineBetweenDefs: Expected 1 empty line between method definitions; found 0.
def update
^^^^^^^^^^
app/controllers/admin/resource_controller.rb:39:5: C: [Corrected] Rails/ActionOrder: Action create should appear before update.
def create ...
^^^^^^^^^^
app/controllers/admin/resource_controller.rb:51:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected.
app/controllers/admin/resource_controller.rb:52:5: C: [Corrected] Layout/EmptyLineBetweenDefs: Expected 1 empty line between method definitions; found 2.
def update_positions
^^^^^^^^^^^^^^^^^^^^
app/controllers/api/v0/orders_controller.rb:13:7: C: [Corrected] Rails/ActionOrder: Action index should appear before show.
def index ...
^^^^^^^^^
app/controllers/api/v0/orders_controller.rb:23:7: C: [Corrected] Layout/EmptyLineBetweenDefs: Expected 1 empty line between method definitions; found 0.
def show
^^^^^^^^
app/controllers/api/v0/orders_controller.rb:28:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected.
app/controllers/api/v0/orders_controller.rb:29:7: C: [Corrected] Layout/EmptyLineBetweenDefs: Expected 1 empty line between method definitions; found 2.
def update
^^^^^^^^^^
app/controllers/spree/admin/images_controller.rb:26:7: C: [Corrected] Layout/EmptyLineBetweenDefs: Expected 1 empty line between method definitions; found 0.
def create
^^^^^^^^^^
app/controllers/spree/admin/images_controller.rb:37:7: C: [Corrected] Rails/ActionOrder: Action edit should appear before create.
def edit ...
^^^^^^^^
app/controllers/spree/admin/images_controller.rb:40:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected.
app/controllers/spree/admin/images_controller.rb:41:7: C: [Corrected] Layout/EmptyLineBetweenDefs: Expected 1 empty line between method definitions; found 2.
def update
^^^^^^^^^^
app/controllers/spree/admin/invoices_controller.rb:19:7: C: [Corrected] Layout/EmptyLineBetweenDefs: Expected 1 empty line between method definitions; found 0.
def create
^^^^^^^^^^
app/controllers/spree/admin/invoices_controller.rb:43:7: C: [Corrected] Rails/ActionOrder: Action show should appear before create.
def show ...
^^^^^^^^
app/controllers/spree/admin/invoices_controller.rb:49:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected.
app/controllers/spree/admin/invoices_controller.rb:50:7: C: [Corrected] Layout/EmptyLineBetweenDefs: Expected 1 empty line between method definitions; found 2.
def poll
^^^^^^^^
app/controllers/spree/admin/products_controller.rb:23:7: C: [Corrected] Layout/EmptyLineBetweenDefs: Expected 1 empty line between method definitions; found 0.
def new
^^^^^^^
app/controllers/spree/admin/products_controller.rb:23:7: C: [Corrected] Rails/ActionOrder: Action show should appear before new.
def show ...
^^^^^^^^
app/controllers/spree/admin/products_controller.rb:24:7: C: [Corrected] Rails/ActionOrder: Action index should appear before show.
def index ...
^^^^^^^^^
app/controllers/spree/admin/products_controller.rb:27:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected.
app/controllers/spree/admin/products_controller.rb:27:7: C: [Corrected] Layout/EmptyLineBetweenDefs: Expected 1 empty line between method definitions; found 0.
def create
^^^^^^^^^^
app/controllers/spree/admin/products_controller.rb:28:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected.
app/controllers/spree/admin/products_controller.rb:28:7: C: [Corrected] Layout/EmptyLineBetweenDefs: Expected 1 empty line between method definitions; found 0.
def new
^^^^^^^
app/controllers/spree/admin/products_controller.rb:28:7: C: [Corrected] Layout/EmptyLineBetweenDefs: Expected 1 empty line between method definitions; found 2.
def index
^^^^^^^^^
app/controllers/spree/admin/products_controller.rb:28:7: C: [Corrected] Rails/ActionOrder: Action index should appear before new.
def index ...
^^^^^^^^^
app/controllers/spree/admin/products_controller.rb:29:7: C: [Corrected] Layout/EmptyLineBetweenDefs: Expected 1 empty line between method definitions; found 2.
def new
^^^^^^^
app/controllers/spree/admin/products_controller.rb:32:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected.
app/controllers/spree/admin/products_controller.rb:32:7: C: [Corrected] Layout/EmptyLineBetweenDefs: Expected 1 empty line between method definitions; found 0.
def create
^^^^^^^^^^
app/controllers/spree/admin/products_controller.rb:33:7: C: [Corrected] Layout/EmptyLineBetweenDefs: Expected 1 empty line between method definitions; found 2.
def edit
^^^^^^^^
app/controllers/spree/admin/products_controller.rb:36:7: C: [Corrected] Layout/EmptyLineBetweenDefs: Expected 1 empty line between method definitions; found 0.
def create
^^^^^^^^^^
app/controllers/spree/admin/products_controller.rb:38:7: C: [Corrected] Rails/ActionOrder: Action show should appear before create.
def show ...
^^^^^^^^
app/controllers/spree/admin/products_controller.rb:42:7: C: [Corrected] Rails/ActionOrder: Action index should appear before create.
def index ...
^^^^^^^^^
app/controllers/spree/admin/products_controller.rb:43:7: C: [Corrected] Rails/ActionOrder: Action index should appear before create.
def index ...
^^^^^^^^^
app/controllers/spree/admin/products_controller.rb:43:7: C: [Corrected] Rails/ActionOrder: Action index should appear before show.
def index ...
^^^^^^^^^
app/controllers/spree/admin/products_controller.rb:47:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected.
app/controllers/spree/admin/products_controller.rb:48:7: C: [Corrected] Layout/EmptyLineBetweenDefs: Expected 1 empty line between method definitions; found 2.
def edit
^^^^^^^^
app/controllers/spree/admin/products_controller.rb:48:7: C: [Corrected] Rails/ActionOrder: Action edit should appear before create.
def edit ...
^^^^^^^^
app/controllers/spree/admin/products_controller.rb:51:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected.
app/controllers/spree/admin/products_controller.rb:52:7: C: [Corrected] Layout/EmptyLineBetweenDefs: Expected 1 empty line between method definitions; found 2.
def update
^^^^^^^^^^
app/controllers/spree/admin/taxons_controller.rb:13:7: C: [Corrected] Layout/EmptyLineBetweenDefs: Expected 1 empty line between method definitions; found 0.
def create
^^^^^^^^^^
app/controllers/spree/admin/taxons_controller.rb:29:7: C: [Corrected] Rails/ActionOrder: Action edit should appear before create.
def edit ...
^^^^^^^^
app/controllers/spree/admin/taxons_controller.rb:34:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected.
app/controllers/spree/admin/taxons_controller.rb:35:7: C: [Corrected] Layout/EmptyLineBetweenDefs: Expected 1 empty line between method definitions; found 2.
def update
^^^^^^^^^^
app/controllers/spree/admin/variants_controller.rb:17:7: C: [Corrected] Layout/EmptyLineBetweenDefs: Expected 1 empty line between method definitions; found 0.
def edit
^^^^^^^^
app/controllers/spree/admin/variants_controller.rb:18:7: C: [Corrected] Rails/ActionOrder: Action new should appear before edit.
def new ...
^^^^^^^
app/controllers/spree/admin/variants_controller.rb:21:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected.
app/controllers/spree/admin/variants_controller.rb:21:7: C: [Corrected] Layout/EmptyLineBetweenDefs: Expected 1 empty line between method definitions; found 0.
def update
^^^^^^^^^^
app/controllers/spree/admin/variants_controller.rb:22:7: C: [Corrected] Layout/EmptyLineBetweenDefs: Expected 1 empty line between method definitions; found 2.
def create
^^^^^^^^^^
app/controllers/spree/admin/variants_controller.rb:31:7: C: [Corrected] Rails/ActionOrder: Action new should appear before update.
def new ...
^^^^^^^
app/controllers/spree/admin/variants_controller.rb:34:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected.
app/controllers/spree/admin/variants_controller.rb:35:7: C: [Corrected] Layout/EmptyLineBetweenDefs: Expected 1 empty line between method definitions; found 2.
def create
^^^^^^^^^^
app/controllers/spree/admin/variants_controller.rb:35:7: C: [Corrected] Rails/ActionOrder: Action create should appear before update.
def create ...
^^^^^^^^^^
app/controllers/spree/admin/variants_controller.rb:42:7: C: [Corrected] Layout/EmptyLineBetweenDefs: Expected 1 empty line between method definitions; found 0.
def update
^^^^^^^^^^
app/controllers/spree/admin/variants_controller.rb:55:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected.
app/controllers/spree/admin/variants_controller.rb:56:7: C: [Corrected] Layout/EmptyLineBetweenDefs: Expected 1 empty line between method definitions; found 2.
def search
^^^^^^^^^^
app/controllers/user_confirmations_controller.rb:14:3: C: [Corrected] Rails/ActionOrder: Action show should appear before new.
def show ...
^^^^^^^^
app/controllers/user_confirmations_controller.rb:15:3: C: [Corrected] Layout/EmptyLineBetweenDefs: Expected 1 empty line between method definitions; found 0.
def new
^^^^^^^
app/controllers/user_confirmations_controller.rb:19:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected.
app/controllers/user_confirmations_controller.rb:20:3: C: [Corrected] Layout/EmptyLineBetweenDefs: Expected 1 empty line between method definitions; found 0.
def create
^^^^^^^^^^
app/controllers/user_confirmations_controller.rb:21:3: C: [Corrected] Layout/EmptyLineBetweenDefs: Expected 1 empty line between method definitions; found 2.
def create
^^^^^^^^^^
app/controllers/user_confirmations_controller.rb:37:3: C: [Corrected] Rails/ActionOrder: Action show should appear before create.
def show ...
^^^^^^^^
app/controllers/user_confirmations_controller.rb:42:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected.
app/controllers/user_confirmations_controller.rb:43:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected.
1481 files inspected, 63 offenses detected, 63 offenses corrected
If a user come back to checkout step 2 from step 3, the order
will have payment and possibly payment fee existing. This can
interfere with voucher calculation, so we clear them.
The user can then select a payment method again if needed
Inspecting 1480 files
........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................W...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Offenses:
lib/reporting/queries/query_interface.rb:18:30: W: [Corrected] Lint/UnusedMethodArgument: Unused method argument - default. If it's necessary, use _ or _default as an argument name to indicate that it won't be used. If it's unnecessary, remove it.
def sum_grouped(field, default = 0)
^^^^^^^
lib/reporting/queries/query_interface.rb:22:26: W: [Corrected] Lint/UnusedMethodArgument: Unused method argument - default. If it's necessary, use _ or _default as an argument name to indicate that it won't be used. If it's unnecessary, remove it.
def sum_new(field, default = 0)
^^^^^^^
1480 files inspected, 2 offenses detected, 2 offenses corrected
Apparently some versions of Safari have issues with Websockets if the CSP doesn't explicitly define the `connect_src` in a certain way (including specifying the host). This issue is fixed in later versions of Safari and doesn't affect other browsers, for which the `default_src` with `:self` is sufficient.
While it's quite common to version APIs it's not possible with current
DFC tools. The architecture also uses URLs as identifiers for objects
like products. Having the id of an object change just because the format
of its description changes doesn't make sense. The DFC may solve this by
adding a version number in a different way.
By removing the version from our API URL, all object ids (URIs) should
be stable from now on.
The new DFC Connector is based on the new DFC context which changed all
URLs of all data types.
There's also a better way to access semantic properties now.
This protects us from the DFC website going down or the DFC updating
the context with breaking changes. We are in control of updating the
context now (opt-in to newer versions).
Inspecting 1479 files
...........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C.....C.....................................................................
Offenses:
spec/system/admin/orders_spec.rb:485:80: C: [Corrected] Layout/MultilineMethodCallBraceLayout: Closing method call brace must be on the line after the last argument when opening brace is on a separate line from the first argument.
"#listing_orders tbody tr td:first-child input[type=checkbox]")
^
spec/system/admin/orders_spec.rb:486:1: C: [Corrected] Layout/ClosingParenthesisIndentation: Indent ) to column 15 (not 0)
)).to be_checked
^
spec/system/admin/orders_spec.rb:486:15: C: [Corrected] Layout/MultilineMethodCallBraceLayout: Closing method call brace must be on the same line as the last argument when opening brace is on the same line as the first argument.
).to be_checked
^
spec/system/admin/orders_spec.rb:493:80: C: [Corrected] Layout/MultilineMethodCallBraceLayout: Closing method call brace must be on the line after the last argument when opening brace is on a separate line from the first argument.
"#listing_orders tbody tr td:first-child input[type=checkbox]")
^
spec/system/admin/orders_spec.rb:494:1: C: [Corrected] Layout/ClosingParenthesisIndentation: Indent ) to column 15 (not 0)
)).to_not be_checked
^
spec/system/admin/orders_spec.rb:494:15: C: [Corrected] Layout/MultilineMethodCallBraceLayout: Closing method call brace must be on the same line as the last argument when opening brace is on the same line as the first argument.
).to_not be_checked
^
spec/system/admin/products_spec.rb:346:54: C: [Corrected] Layout/MultilineMethodCallBraceLayout: Closing method call brace must be on the line after the last argument when opening brace is on a separate line from the first argument.
product.id, filter)))
^
spec/system/admin/products_spec.rb:347:1: C: [Corrected] Layout/ClosingParenthesisIndentation: Indent ) to column 33 (not 0)
)))
^
spec/system/admin/products_spec.rb:352:54: C: [Corrected] Layout/MultilineMethodCallBraceLayout: Closing method call brace must be on the line after the last argument when opening brace is on a separate line from the first argument.
product.id, filter)))
^
spec/system/admin/products_spec.rb:354:1: C: [Corrected] Layout/ClosingParenthesisIndentation: Indent ) to column 33 (not 0)
)))
^
1479 files inspected, 10 offenses detected, 10 offenses corrected
Default size is 217*44. On mobile, we used to use 75*26, but with a different image.
With the white label, using the same image, we should have the same ratio between default and mobile ; that's why I've updated the width of the variant to 128.
Sets example to xit
pending is not suitable for flaky specs, as we'll get a red build anyway, each time the spec passes; commenting out should be the right approach till we fix this one
Inspecting 1478 files
.......C............................C..............................................................................................................C.......................................................................................................C............................................................................C................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C.................C......................................C...................................................................................................................C...........................................................C........................C...C.....C..C..C..........C..................C...............C.....................C...................................................................................C......................................................C........C..C...........C....................C.CC....C....................................C......C..........................
Offenses:
app/components/confirm_modal_component.rb:4:88: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
def initialize(id:, confirm_actions: nil, reflex: nil, controller: nil, message: nil,
^
app/components/confirm_modal_component.rb:4:101: C: [Corrected] Layout/LineLength: Line is too long. [110/100]
def initialize(id:, confirm_actions: nil, reflex: nil, controller: nil, message: nil, confirm_reflexes: nil)
^^^^^^^^^^
app/components/confirm_modal_component.rb:5:1: C: [Corrected] Layout/ParameterAlignment: Align the parameters of a method definition if they span more than one line.
confirm_reflexes: nil)
^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/product_import_controller.rb:142:43: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
redirect_to '/admin/product_import',
^
app/controllers/admin/product_import_controller.rb:142:101: C: [Corrected] Layout/LineLength: Line is too long. [104/100]
redirect_to '/admin/product_import', notice: I18n.t(:product_import_no_data_in_spreadsheet_notice)
^^^^
app/controllers/admin/product_import_controller.rb:143:1: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
notice: I18n.t(:product_import_no_data_in_spreadsheet_notice)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/spree/users_controller.rb:53:101: C: Layout/LineLength: Line is too long. [107/100]
message: t('devise.user_registrations.spree_user.signed_up_but_unconfirmed') })
^^^^^^^
app/models/customer.rb:43:101: C: [Corrected] Layout/LineLength: Line is too long. [113/100]
scope :managed_by, ->(user) { user&.persisted? ? where(user: user).or(of(Enterprise.managed_by(user))) : none }
^^^^^^^^^^^^^
app/models/customer.rb:44:1: C: [Corrected] Layout/IndentationWidth: Use 2 (not 1) spaces for indentation.
user&.persisted? ? where(user: user).or(of(Enterprise.managed_by(user))) : none
^
app/models/customer.rb:44:3: C: [Corrected] Layout/IndentationWidth: Use 2 (not -19) spaces for indentation.
user&.persisted? ? where(user: user).or(of(Enterprise.managed_by(user))) : none
^^^^^^^^^^^^^^^^^^^
app/models/customer.rb:44:82: C: [Corrected] Layout/BlockEndNewline: Expression at 44, 82 should be on its own line.
user&.persisted? ? where(user: user).or(of(Enterprise.managed_by(user))) : none }
^
app/models/customer.rb:44:101: C: Layout/LineLength: Line is too long. [102/100]
user&.persisted? ? where(user: user).or(of(Enterprise.managed_by(user))) : none
^^
app/models/customer.rb:45:1: C: [Corrected] Layout/BlockAlignment: } at 45, 0 is not aligned with ->(user) { at 43, 21 or scope :managed_by, ->(user) { at 43, 2.
}
^
app/models/spree/line_item.rb:53:101: C: Layout/LineLength: Line is too long. [110/100]
attr_accessor :skip_stock_check, :target_shipment # Allows manual skipping of Stock::AvailabilityValidator
^^^^^^^^^^
spec/controllers/admin/order_cycles_controller_spec.rb:38:101: C: Layout/LineLength: Line is too long. [108/100]
it "loads order cycles that closed within the past month, and orders without a close_at date" do
^^^^^^^^
spec/controllers/admin/order_cycles_controller_spec.rb:48:101: C: Layout/LineLength: Line is too long. [111/100]
it "loads order cycles that closed after the specified date, and orders without a close_at date" do
^^^^^^^^^^^
spec/controllers/admin/order_cycles_controller_spec.rb:100:101: C: Layout/LineLength: Line is too long. [125/100]
expect(flash[:error]).to eq "You don't have permission to create an order cycle coordinated by that enterprise"
^^^^^^^^^^^^^^^^^^^^^^^^^
spec/controllers/admin/order_cycles_controller_spec.rb:125:101: C: Layout/LineLength: Line is too long. [101/100]
order_cycle.exchanges.create! sender: distributor, receiver: distributor, incoming: true,
^
spec/controllers/admin/order_cycles_controller_spec.rb:127:101: C: Layout/LineLength: Line is too long. [102/100]
order_cycle.exchanges.create! sender: distributor, receiver: distributor, incoming: false,
^^
spec/controllers/admin/order_cycles_controller_spec.rb:284:101: C: Layout/LineLength: Line is too long. [101/100]
merge(order_cycle: { preferred_product_selection_from_coordinator_inventory_only: true })
^
spec/controllers/admin/order_cycles_controller_spec.rb:311:101: C: Layout/LineLength: Line is too long. [104/100]
create(:exchange, order_cycle: order_cycle, sender: coordinator, receiver: hub, incoming: false,
^^^^
spec/controllers/admin/order_cycles_controller_spec.rb:374:101: C: Layout/LineLength: Line is too long. [102/100]
expect(json_response['errors']).to eq 'Hm, something went wrong. No order cycle data found.'
^^
spec/controllers/admin/order_cycles_controller_spec.rb:460:101: C: Layout/LineLength: Line is too long. [176/100]
expect(flash[:error]).to eq 'That order cycle has been selected by a customer and cannot be deleted. To prevent customers from accessing it, please close it instead.'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/controllers/admin/order_cycles_controller_spec.rb:470:101: C: Layout/LineLength: Line is too long. [147/100]
expect(flash[:error]).to eq 'That order cycle is linked to a schedule and cannot be deleted. Please unlink or delete the schedule first.'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/controllers/api/v0/order_cycles_controller_spec.rb:16:101: C: [Corrected] Layout/LineLength: Line is too long. [106/100]
let!(:product1) { create(:product, name: "Kangaroo", primary_taxon: taxon1, properties: [property1]) }
^^^^^^
spec/controllers/api/v0/order_cycles_controller_spec.rb:17:1: C: [Corrected] Layout/IndentationWidth: Use 2 (not 1) spaces for indentation.
create(:product, name: "Kangaroo", primary_taxon: taxon1, properties: [property1])
^
spec/controllers/api/v0/order_cycles_controller_spec.rb:17:3: C: [Corrected] Layout/IndentationWidth: Use 2 (not -2) spaces for indentation.
create(:product, name: "Kangaroo", primary_taxon: taxon1, properties: [property1])
^^
spec/controllers/api/v0/order_cycles_controller_spec.rb:17:85: C: [Corrected] Layout/BlockEndNewline: Expression at 17, 85 should be on its own line.
create(:product, name: "Kangaroo", primary_taxon: taxon1, properties: [property1]) }
^
spec/controllers/api/v0/order_cycles_controller_spec.rb:17:101: C: [Corrected] Layout/LineLength: Line is too long. [106/100]
let!(:product2) { create(:product, name: "Parsnips", primary_taxon: taxon2, properties: [property2]) }
^^^^^^
spec/controllers/api/v0/order_cycles_controller_spec.rb:18:1: C: [Corrected] Layout/BlockAlignment: } at 18, 0 is not aligned with let!(:product1) { at 16, 4.
}
^
spec/controllers/api/v0/order_cycles_controller_spec.rb:19:85: C: [Corrected] Layout/BlockEndNewline: Expression at 19, 85 should be on its own line.
create(:product, name: "Parsnips", primary_taxon: taxon2, properties: [property2]) }
^
spec/controllers/api/v0/order_cycles_controller_spec.rb:20:1: C: [Corrected] Layout/IndentationWidth: Use 2 (not 1) spaces for indentation.
create(:product, name: "Parsnips", primary_taxon: taxon2, properties: [property2])
^
spec/controllers/api/v0/order_cycles_controller_spec.rb:20:3: C: [Corrected] Layout/IndentationWidth: Use 2 (not -2) spaces for indentation.
create(:product, name: "Parsnips", primary_taxon: taxon2, properties: [property2])
^^
spec/controllers/api/v0/order_cycles_controller_spec.rb:21:1: C: [Corrected] Layout/BlockAlignment: } at 21, 0 is not aligned with let!(:product2) { at 19, 4.
}
^
spec/controllers/spree/admin/orders_controller_spec.rb:232:101: C: [Corrected] Layout/LineLength: Line is too long. [117/100]
let!(:order_cycle){ create(:simple_order_cycle, distributors: [distributor], variants: [line_item.variant]) }
^^^^^^^^^^^^^^^^^
spec/controllers/spree/admin/orders_controller_spec.rb:233:1: C: [Corrected] Layout/IndentationWidth: Use 2 (not 1) spaces for indentation.
create(:simple_order_cycle, distributors: [distributor], variants: [line_item.variant])
^
spec/controllers/spree/admin/orders_controller_spec.rb:233:3: C: [Corrected] Layout/IndentationWidth: Use 2 (not -6) spaces for indentation.
create(:simple_order_cycle, distributors: [distributor], variants: [line_item.variant])
^^^^^^
spec/controllers/spree/admin/orders_controller_spec.rb:233:90: C: [Corrected] Layout/BlockEndNewline: Expression at 233, 90 should be on its own line.
create(:simple_order_cycle, distributors: [distributor], variants: [line_item.variant]) }
^
spec/controllers/spree/admin/orders_controller_spec.rb:234:1: C: [Corrected] Layout/BlockAlignment: } at 234, 0 is not aligned with let!(:order_cycle){ at 232, 8.
}
^
spec/controllers/spree/admin/orders_controller_spec.rb:252:101: C: Layout/LineLength: Line is too long. [109/100]
allow_any_instance_of(Spree::Order).to receive(:ensure_available_shipping_rates).and_return(true)
^^^^^^^^^
spec/lib/reports/customers_report_spec.rb:93:88: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
create(:order_with_totals_and_distribution, :completed, distributor: d,
^
spec/lib/reports/customers_report_spec.rb:93:101: C: [Corrected] Layout/LineLength: Line is too long. [125/100]
create(:order_with_totals_and_distribution, :completed, distributor: d, bill_address: a, shipping_method: sm)
^^^^^^^^^^^^^^^^^^^^^^^^^
spec/lib/reports/customers_report_spec.rb:94:1: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
bill_address: a, shipping_method: sm)
^^^^^^^^^^^^^^^
spec/lib/reports/customers_report_spec.rb:94:101: C: Layout/LineLength: Line is too long. [109/100]
bill_address: a, shipping_method: sm)
^^^^^^^^^
spec/lib/reports/customers_report_spec.rb:96:101: C: [Corrected] Layout/LineLength: Line is too long. [125/100]
create(:order_with_totals_and_distribution, :completed, distributor: d, bill_address: a, shipping_method: sm)
^^^^^^^^^^^^^^^^^^^^^^^^^
spec/lib/reports/customers_report_spec.rb:97:88: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
create(:order_with_totals_and_distribution, :completed, distributor: d,
^
spec/lib/reports/customers_report_spec.rb:98:1: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
bill_address: a, shipping_method: sm)
^^^^^^^^^^^^^^^
spec/lib/reports/customers_report_spec.rb:98:101: C: Layout/LineLength: Line is too long. [109/100]
bill_address: a, shipping_method: sm)
^^^^^^^^^
spec/lib/reports/customers_report_spec.rb:113:101: C: Layout/LineLength: Line is too long. [118/100]
[d.address.address1, d.address.address2, d.address.city].join(" "),
^^^^^^^^^^^^^^^^^^
spec/lib/reports/customers_report_spec.rb:120:101: C: [Corrected] Layout/LineLength: Line is too long. [129/100]
create(:order_with_totals_and_distribution, :completed, distributor: d2, bill_address: a, shipping_method: sm2)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/lib/reports/customers_report_spec.rb:122:91: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
create(:order_with_totals_and_distribution, :completed, distributor: d2,
^
spec/lib/reports/customers_report_spec.rb:123:1: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
bill_address: a, shipping_method: sm2)
^^^^^^^^^^^^^^^
spec/lib/reports/customers_report_spec.rb:123:101: C: Layout/LineLength: Line is too long. [112/100]
bill_address: a, shipping_method: sm2)
^^^^^^^^^^^^
spec/lib/reports/customers_report_spec.rb:133:101: C: Layout/LineLength: Line is too long. [120/100]
[d.address.address1, d.address.address2, d.address.city].join(" "),
^^^^^^^^^^^^^^^^^^^^
spec/lib/reports/customers_report_spec.rb:139:101: C: Layout/LineLength: Line is too long. [123/100]
[d2.address.address1, d2.address.address2, d2.address.city].join(" "),
^^^^^^^^^^^^^^^^^^^^^^^
spec/lib/reports/customers_report_spec.rb:145:101: C: [Corrected] Layout/LineLength: Line is too long. [128/100]
create(:order_with_totals_and_distribution, :completed, distributor: d, bill_address: a, shipping_method: sm2)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/lib/reports/customers_report_spec.rb:148:90: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
create(:order_with_totals_and_distribution, :completed, distributor: d,
^
spec/lib/reports/customers_report_spec.rb:149:1: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
bill_address: a, shipping_method: sm2)
^^^^^^^^^^^^^^^
spec/lib/reports/customers_report_spec.rb:149:101: C: Layout/LineLength: Line is too long. [112/100]
bill_address: a, shipping_method: sm2)
^^^^^^^^^^^^
spec/migrations/migrate_customer_names_spec.rb:16:101: C: Layout/LineLength: Line is too long. [122/100]
value_type: "boolean", key: "/enterprise/show_customer_names_to_suppliers/#{enterprise1.id}")
^^^^^^^^^^^^^^^^^^^^^^
spec/migrations/migrate_customer_names_spec.rb:18:101: C: Layout/LineLength: Line is too long. [122/100]
value_type: "boolean", key: "/enterprise/show_customer_names_to_suppliers/#{enterprise2.id}")
^^^^^^^^^^^^^^^^^^^^^^
spec/migrations/migrate_customer_names_spec.rb:20:101: C: Layout/LineLength: Line is too long. [122/100]
value_type: "boolean", key: "/enterprise/show_customer_names_to_suppliers/#{enterprise4.id}")
^^^^^^^^^^^^^^^^^^^^^^
spec/models/enterprise_spec.rb:521:101: C: [Corrected] Layout/LineLength: Line is too long. [111/100]
expect(Enterprise.supplying_variant_in([p1.variants.first, p2.variants.first])).to match_array [s1, s2]
^^^^^^^^^^^
spec/models/enterprise_spec.rb:522:1: C: [Corrected] Layout/ArrayAlignment: Align the elements of an array literal if they span more than one line.
p2.variants.first])).to match_array [s1, s2]
^^^^^^^^^^^^^^^^^
spec/models/order_cycle_spec.rb:207:101: C: Layout/LineLength: Line is too long. [118/100]
expect(oc.variants).to match_array [p0.variants.first, p1.variants.first, p2.variants.first, p2_v, p1_v_visible,
^^^^^^^^^^^^^^^^^^
spec/models/order_cycle_spec.rb:220:101: C: Layout/LineLength: Line is too long. [111/100]
expect(oc.distributed_variants).to match_array [p1.variants.first, p2.variants.first, p2_v, p1_v_visible,
^^^^^^^^^^^
spec/models/product_importer_spec.rb:782:101: C: Layout/LineLength: Line is too long. [101/100]
csv << [" Oats ", "\nPorridge Oats\n", "\r#{enterprise2.name}\r", "\t#{enterprise.name}\t",
^
spec/models/spree/ability_spec.rb:340:69: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
[:admin, :index, :read, :edit, :update, :search, :destroy,
^
spec/models/spree/ability_spec.rb:340:101: C: [Corrected] Layout/LineLength: Line is too long. [101/100]
[:admin, :index, :read, :edit, :update, :search, :destroy, :delete], for: p1.variants.first
^
spec/models/spree/ability_spec.rb:341:1: C: [Corrected] Layout/ArrayAlignment: Align the elements of an array literal if they span more than one line.
:delete], for: p1.variants.first
^^^^^^^
spec/models/spree/ability_spec.rb:350:101: C: [Corrected] Layout/LineLength: Line is too long. [108/100]
[:admin, :index, :read, :edit, :update, :search, :destroy, :delete], for: p_related.variants.first
^^^^^^^^
spec/models/spree/ability_spec.rb:351:69: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
[:admin, :index, :read, :edit, :update, :search, :destroy,
^
spec/models/spree/ability_spec.rb:352:1: C: [Corrected] Layout/ArrayAlignment: Align the elements of an array literal if they span more than one line.
:delete], for: p_related.variants.first
^^^^^^^
spec/models/spree/ability_spec.rb:379:101: C: [Corrected] Layout/LineLength: Line is too long. [101/100]
[:admin, :index, :read, :create, :edit, :search, :update, :destroy], for: p2.variants.first
^
spec/models/spree/ability_spec.rb:381:68: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
[:admin, :index, :read, :create, :edit, :search, :update,
^
spec/models/spree/ability_spec.rb:382:1: C: [Corrected] Layout/ArrayAlignment: Align the elements of an array literal if they span more than one line.
:destroy], for: p2.variants.first
^^^^^^^^
spec/models/spree/adjustment_spec.rb:339:101: C: Layout/LineLength: Line is too long. [106/100]
create(:tax_rate, included_in_price: true, calculator: ::Calculator::DefaultTax.new, zone: zone,
^^^^^^
spec/models/spree/adjustment_spec.rb:367:101: C: Layout/LineLength: Line is too long. [101/100]
calculator: ::Calculator::FlatRate.new(preferred_amount: 50.0))
^
spec/models/spree/adjustment_spec.rb:428:101: C: Layout/LineLength: Line is too long. [105/100]
context "when enterprise fees inherit their tax_category from the product they are applied to" do
^^^^^
spec/models/spree/adjustment_spec.rb:443:101: C: Layout/LineLength: Line is too long. [101/100]
calculator: ::Calculator::FlatRate.new(preferred_amount: 50.0))
^
spec/models/spree/line_item_spec.rb:208:101: C: Layout/LineLength: Line is too long. [107/100]
expect(LineItem.from_order_cycle(oc_order.order_cycle).first.id).to eq oc_order.line_items.first.id
^^^^^^^
spec/models/spree/line_item_spec.rb:342:101: C: Layout/LineLength: Line is too long. [102/100]
Spree::Variant.find(variant.id).on_hand
^^
spec/models/spree/product_spec.rb:409:74: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
create(:simple_order_cycle, suppliers: [s], distributors: [d1],
^
spec/models/spree/product_spec.rb:409:101: C: [Corrected] Layout/LineLength: Line is too long. [104/100]
create(:simple_order_cycle, suppliers: [s], distributors: [d1], variants: [p1.variants.first])
^^^^
spec/models/spree/product_spec.rb:410:1: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
variants: [p1.variants.first])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/models/spree/product_spec.rb:410:101: C: [Corrected] Layout/LineLength: Line is too long. [104/100]
create(:simple_order_cycle, suppliers: [s], distributors: [d2], variants: [p2.variants.first])
^^^^
spec/models/spree/product_spec.rb:411:74: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
create(:simple_order_cycle, suppliers: [s], distributors: [d2],
^
spec/models/spree/product_spec.rb:412:1: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
variants: [p2.variants.first])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/models/spree/product_spec.rb:486:101: C: [Corrected] Layout/LineLength: Line is too long. [104/100]
create(:simple_order_cycle, suppliers: [s], distributors: [d1], variants: [p1.variants.first])
^^^^
spec/models/spree/product_spec.rb:487:101: C: [Corrected] Layout/LineLength: Line is too long. [104/100]
create(:simple_order_cycle, suppliers: [s], distributors: [d2], variants: [p2.variants.first])
^^^^
spec/models/spree/product_spec.rb:488:74: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
create(:simple_order_cycle, suppliers: [s], distributors: [d1],
^
spec/models/spree/product_spec.rb:489:1: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
variants: [p1.variants.first])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/models/spree/product_spec.rb:490:74: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
create(:simple_order_cycle, suppliers: [s], distributors: [d2],
^
spec/models/spree/product_spec.rb:491:1: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
variants: [p2.variants.first])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/models/spree/product_spec.rb:495:101: C: [Corrected] Layout/LineLength: Line is too long. [102/100]
create(:simple_order_cycle, suppliers: [s], distributors: [d], variants: [p.variants.first])
^^
spec/models/spree/product_spec.rb:499:73: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
create(:simple_order_cycle, suppliers: [s], distributors: [d],
^
spec/models/spree/product_spec.rb:500:1: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
variants: [p.variants.first])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/models/spree/variant_spec.rb:356:101: C: Layout/LineLength: Line is too long. [108/100]
it "lists any variants that are not listed as visible=false only for the relevant enterprise" do
^^^^^^^^
spec/models/spree/variant_spec.rb:479:101: C: Layout/LineLength: Line is too long. [108/100]
expect_any_instance_of(OpenFoodNetwork::EnterpriseFeeCalculator).to receive(:fees_for).with(variant) {
^^^^^^^^
spec/models/spree/variant_spec.rb:494:101: C: Layout/LineLength: Line is too long. [116/100]
expect_any_instance_of(OpenFoodNetwork::EnterpriseFeeCalculator).to receive(:fees_by_type_for).with(variant) {
^^^^^^^^^^^^^^^^
spec/models/spree/variant_spec.rb:704:101: C: Layout/LineLength: Line is too long. [115/100]
expect_any_instance_of(VariantUnits::OptionValueNamer).to receive(:name).exactly(1).times.and_call_original
^^^^^^^^^^^^^^^
spec/requests/api/orders_spec.rb:167:88: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
create(:order_with_line_items, line_items_count: 1, bill_address_id: nil,
^
spec/requests/api/orders_spec.rb:167:101: C: [Corrected] Layout/LineLength: Line is too long. [109/100]
create(:order_with_line_items, line_items_count: 1, bill_address_id: nil, ship_address_id: nil)
^^^^^^^^^
spec/requests/api/orders_spec.rb:168:1: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
ship_address_id: nil)
^^^^^^^^^^^^^^^^^^^^
spec/services/products_renderer_spec.rb:91:101: C: Layout/LineLength: Line is too long. [101/100]
{ q: { with_properties: [property_organic.id] } })
^
spec/services/products_renderer_spec.rb:100:101: C: Layout/LineLength: Line is too long. [101/100]
{ q: { with_properties: [property_organic.id] } })
^
spec/services/products_renderer_spec.rb:118:101: C: Layout/LineLength: Line is too long. [101/100]
{ q: { with_properties: [property_organic.id] } })
^
spec/support/request/web_helper.rb:96:84: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
tomselect_wrapper.find(:css, '.ts-dropdown.multi .ts-dropdown-content .option',
^
spec/support/request/web_helper.rb:96:101: C: [Corrected] Layout/LineLength: Line is too long. [102/100]
tomselect_wrapper.find(:css, '.ts-dropdown.multi .ts-dropdown-content .option', text: value).click
^^
spec/support/request/web_helper.rb:97:1: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
text: value).click
^^^^^^^^^^^
spec/system/admin/adjustments_spec.rb:29:101: C: [Corrected] Layout/LineLength: Line is too long. [197/100]
let!(:tax_rate2) { create(:tax_rate, name: "TVA 20%", amount: 0.2, zone: default_tax_zone, included_in_price: true, tax_category: tax_category_included, calculator: Calculator::DefaultTax.new ) }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/adjustments_spec.rb:30:1: C: [Corrected] Layout/IndentationWidth: Use 2 (not 1) spaces for indentation.
create(:tax_rate, name: "TVA 20%", amount: 0.2, zone: default_tax_zone, included_in_price: true,
^
spec/system/admin/adjustments_spec.rb:30:3: C: [Corrected] Layout/IndentationWidth: Use 2 (not 0) spaces for indentation.
create(:tax_rate, name: "TVA 20%", amount: 0.2, zone: default_tax_zone, included_in_price: true,
spec/system/admin/adjustments_spec.rb:30:98: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
create(:tax_rate, name: "TVA 20%", amount: 0.2, zone: default_tax_zone, included_in_price: true,
^
spec/system/admin/adjustments_spec.rb:30:101: C: [Corrected] Layout/LineLength: Line is too long. [177/100]
create(:tax_rate, name: "TVA 20%", amount: 0.2, zone: default_tax_zone, included_in_price: true, tax_category: tax_category_included, calculator: Calculator::DefaultTax.new ) }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/adjustments_spec.rb:30:177: C: [Corrected] Layout/BlockEndNewline: Expression at 30, 177 should be on its own line.
create(:tax_rate, name: "TVA 20%", amount: 0.2, zone: default_tax_zone, included_in_price: true, tax_category: tax_category_included, calculator: Calculator::DefaultTax.new ) }
^
spec/system/admin/adjustments_spec.rb:31:1: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
tax_category: tax_category_included, calculator: Calculator::DefaultTax.new )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/adjustments_spec.rb:32:1: C: [Corrected] Layout/BlockAlignment: } at 32, 0 is not aligned with let!(:tax_rate2) { at 29, 2.
}
^
spec/system/admin/adjustments_spec.rb:41:101: C: Layout/LineLength: Line is too long. [134/100]
shared_examples "when the enable_localized_number preference" do |adjustment_label, adjustment_amount, tax_category, tax, tax_total|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/adjustments_spec.rb:67:101: C: [Corrected] Layout/LineLength: Line is too long. [117/100]
it_behaves_like "when the enable_localized_number preference", "Discount", "-2", "TVA 20%", "$0.33", "$-1.67"
^^^^^^^^^^^^^^^^^
spec/system/admin/adjustments_spec.rb:68:100: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
it_behaves_like "when the enable_localized_number preference", "Discount", "-2", "TVA 20%",
^
spec/system/admin/adjustments_spec.rb:69:1: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
"$0.33", "$-1.67"
^^^^^^^
spec/system/admin/adjustments_spec.rb:71:101: C: [Corrected] Layout/LineLength: Line is too long. [120/100]
it_behaves_like "when the enable_localized_number preference", "Late fee", "100", "TVA 20%", "$-16.67", "$83.33"
^^^^^^^^^^^^^^^^^^^^
spec/system/admin/adjustments_spec.rb:73:90: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
it_behaves_like "when the enable_localized_number preference", "Late fee", "100",
^
spec/system/admin/adjustments_spec.rb:74:1: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
"TVA 20%", "$-16.67", "$83.33"
^^^^^^^^^
spec/system/admin/adjustments_spec.rb:77:101: C: [Corrected] Layout/LineLength: Line is too long. [113/100]
it_behaves_like "when the enable_localized_number preference", "Discount", "-2", "GST", "$10.00", "$8.00"
^^^^^^^^^^^^^
spec/system/admin/adjustments_spec.rb:80:96: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
it_behaves_like "when the enable_localized_number preference", "Discount", "-2", "GST",
^
spec/system/admin/adjustments_spec.rb:81:1: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
"$10.00", "$8.00"
^^^^^^^^
spec/system/admin/adjustments_spec.rb:81:101: C: [Corrected] Layout/LineLength: Line is too long. [113/100]
it_behaves_like "when the enable_localized_number preference", "Late fee", "110", "GST", "$10.00", "$120"
^^^^^^^^^^^^^
spec/system/admin/adjustments_spec.rb:85:97: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
it_behaves_like "when the enable_localized_number preference", "Late fee", "110", "GST",
^
spec/system/admin/adjustments_spec.rb:86:1: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
"$10.00", "$120"
^^^^^^^^
spec/system/admin/adjustments_spec.rb:93:101: C: [Corrected] Layout/LineLength: Line is too long. [117/100]
it_behaves_like "when the enable_localized_number preference", "Discount", "-2", "TVA 20%", "$0.33", "$-1.67"
^^^^^^^^^^^^^^^^^
spec/system/admin/adjustments_spec.rb:97:101: C: [Corrected] Layout/LineLength: Line is too long. [120/100]
it_behaves_like "when the enable_localized_number preference", "Late fee", "100", "TVA 20%", "$-16.67", "$83.33"
^^^^^^^^^^^^^^^^^^^^
spec/system/admin/adjustments_spec.rb:98:100: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
it_behaves_like "when the enable_localized_number preference", "Discount", "-2", "TVA 20%",
^
spec/system/admin/adjustments_spec.rb:99:1: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
"$0.33", "$-1.67"
^^^^^^^
spec/system/admin/adjustments_spec.rb:103:90: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
it_behaves_like "when the enable_localized_number preference", "Late fee", "100",
^
spec/system/admin/adjustments_spec.rb:103:101: C: [Corrected] Layout/LineLength: Line is too long. [113/100]
it_behaves_like "when the enable_localized_number preference", "Discount", "-2", "GST", "$10.00", "$8.00"
^^^^^^^^^^^^^
spec/system/admin/adjustments_spec.rb:104:1: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
"TVA 20%", "$-16.67", "$83.33"
^^^^^^^^^
spec/system/admin/adjustments_spec.rb:107:101: C: [Corrected] Layout/LineLength: Line is too long. [113/100]
it_behaves_like "when the enable_localized_number preference", "Late fee", "110", "GST", "$10.00", "$120"
^^^^^^^^^^^^^
spec/system/admin/adjustments_spec.rb:110:96: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
it_behaves_like "when the enable_localized_number preference", "Discount", "-2", "GST",
^
spec/system/admin/adjustments_spec.rb:111:1: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
"$10.00", "$8.00"
^^^^^^^^
spec/system/admin/adjustments_spec.rb:115:97: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
it_behaves_like "when the enable_localized_number preference", "Late fee", "110", "GST",
^
spec/system/admin/adjustments_spec.rb:116:1: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
"$10.00", "$120"
^^^^^^^^
spec/system/admin/bulk_order_management_spec.rb:268:101: C: Layout/LineLength: Line is too long. [105/100]
text: "#{o1.bill_address.last_name}, #{o1.bill_address.first_name}"
^^^^^
spec/system/admin/bulk_order_management_spec.rb:1036:101: C: Layout/LineLength: Line is too long. [147/100]
expect(page).to have_content "This operation will result in one or more empty orders, which will be cancelled. Do you wish to proceed?"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/bulk_order_management_spec.rb:1060:101: C: Layout/LineLength: Line is too long. [138/100]
it "the user can confirm + wants to send email confirmation : line item is then deleted, order is canceled and email is sent" do
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/bulk_order_management_spec.rb:1072:101: C: Layout/LineLength: Line is too long. [134/100]
it "the user can confirm + uncheck the restock option: line item is then deleted and order is canceled without retocking" do
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/customers_spec.rb:40:101: C: Layout/LineLength: Line is too long. [126/100]
managed_distributor2.name], without_options: [unmanaged_distributor.name]
^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/order_cycles/simple_spec.rb:346:101: C: Layout/LineLength: Line is too long. [101/100]
with_options: [schedule_of_other_managed_distributor.name]
^
spec/system/admin/order_cycles/simple_spec.rb:623:101: C: Layout/LineLength: Line is too long. [121/100]
value: Time.zone.local(2040, 10, 17, 0o6, 0o0, 0o0).strftime("%F %T %z"), visible: false
^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/order_cycles/simple_spec.rb:625:101: C: Layout/LineLength: Line is too long. [120/100]
value: Time.zone.local(2040, 10, 24, 17, 0o0, 0o0).strftime("%F %T %z"), visible: false
^^^^^^^^^^^^^^^^^^^^
spec/system/admin/order_cycles/simple_spec.rb:733:101: C: Layout/LineLength: Line is too long. [121/100]
value: Time.zone.local(2040, 10, 17, 0o6, 0o0, 0o0).strftime("%F %T %z"), visible: false
^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/order_cycles/simple_spec.rb:735:101: C: Layout/LineLength: Line is too long. [120/100]
value: Time.zone.local(2040, 10, 24, 17, 0o0, 0o0).strftime("%F %T %z"), visible: false
^^^^^^^^^^^^^^^^^^^^
spec/system/admin/order_spec.rb:598:101: C: [Corrected] Layout/LineLength: Line is too long. [101/100]
expect(page).to have_link "Resend Confirmation", href: spree.resend_admin_order_path(order)
^
spec/system/admin/order_spec.rb:599:1: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
href: spree.resend_admin_order_path(order)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/order_spec.rb:616:101: C: [Corrected] Layout/LineLength: Line is too long. [105/100]
expect(page).to have_link "Cancel Order", href: spree.fire_admin_order_path(order, e: 'cancel')
^^^^^
spec/system/admin/order_spec.rb:618:1: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
href: spree.fire_admin_order_path(order, e: 'cancel')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/orders_spec.rb:259:101: C: Layout/LineLength: Line is too long. [109/100]
distributor: distributor2, bill_address_id: nil, ship_address_id: nil)
^^^^^^^^^
spec/system/admin/product_import_spec.rb:573:101: C: Layout/LineLength: Line is too long. [106/100]
expect(page).to have_content "line 4: Cabbage - On_hand incorrect value - On_demand incorrect value"
^^^^^^
spec/system/admin/product_import_spec.rb:574:101: C: Layout/LineLength: Line is too long. [108/100]
expect(page).to have_content "line 5: Aubergine - On_hand incorrect value - On_demand incorrect value"
^^^^^^^^
spec/system/admin/product_import_spec.rb:583:101: C: Layout/LineLength: Line is too long. [102/100]
csv << ["name", "producer", "category", "on_hand", "price", "on_demand", "units", "unit_type",
^^
spec/system/admin/product_import_spec.rb:585:101: C: Layout/LineLength: Line is too long. [106/100]
csv << ["Beans", "User Enterprise", "Vegetables", "invalid", "3.50", "1", "0.5", "g", "Small Bag",
^^^^^^
spec/system/admin/product_import_spec.rb:587:101: C: Layout/LineLength: Line is too long. [103/100]
csv << ["Potatoes", "User Enterprise", "Vegetables", "6", "6", "invalid", "5", "kg", "Big Bag",
^^^
spec/system/admin/product_import_spec.rb:589:101: C: Layout/LineLength: Line is too long. [106/100]
csv << ["Cabbage", "User Enterprise", "Vegetables", "invalid", "1.5", "invalid", "1", "kg", "Bag",
^^^^^^
spec/system/admin/product_import_spec.rb:591:101: C: Layout/LineLength: Line is too long. [102/100]
csv << ["Aubergine", "User Enterprise", "Vegetables", nil, "1.5", "invalid", "1", "kg", "Bag",
^^
spec/system/admin/product_import_spec.rb:607:101: C: Layout/LineLength: Line is too long. [114/100]
expect(page).to have_content "line 4: Cabbage ( Bag ) - On_hand incorrect value - On_demand incorrect value"
^^^^^^^^^^^^^^
spec/system/admin/product_import_spec.rb:608:101: C: Layout/LineLength: Line is too long. [116/100]
expect(page).to have_content "line 5: Aubergine ( Bag ) - On_hand incorrect value - On_demand incorrect value"
^^^^^^^^^^^^^^^^
spec/system/admin/product_import_spec.rb:617:101: C: Layout/LineLength: Line is too long. [102/100]
csv << ["name", "producer", "category", "on_hand", "price", "on_demand", "units", "unit_type",
^^
spec/system/admin/product_import_spec.rb:619:101: C: Layout/LineLength: Line is too long. [101/100]
csv << ["Beans", "User Enterprise", "Vegetables", "-1", "3.50", "1", "500", "g", "Small Bag",
^
spec/system/admin/product_import_spec.rb:641:101: C: Layout/LineLength: Line is too long. [114/100]
expect(page).to have_content "line 4: Cabbage ( Bag ) - On_hand incorrect value - On_demand incorrect value"
^^^^^^^^^^^^^^
spec/system/admin/product_import_spec.rb:642:101: C: Layout/LineLength: Line is too long. [116/100]
expect(page).to have_content "line 5: Aubergine ( Bag ) - On_hand incorrect value - On_demand incorrect value"
^^^^^^^^^^^^^^^^
spec/system/consumer/shopping/cart_spec.rb:147:101: C: Layout/LineLength: Line is too long. [101/100]
preferred_unit_from_list: "kg"),
^
spec/system/consumer/shopping/products_spec.rb:98:101: C: Layout/LineLength: Line is too long. [113/100]
"<script>alert('Dangerous!');</script>", truncate: false)
^^^^^^^^^^^^^
1478 files inspected, 173 offenses detected, 106 offenses corrected
Inspecting 1478 files
...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C.....................C............................................................................
Offenses:
spec/system/admin/enterprise_fees_spec.rb:52:46: C: [Corrected] Layout/LineContinuationSpacing: Use one space in front of backslash.
fill_in "#{prefix}_calculator_attributes"\
^
spec/system/admin/enterprise_fees_spec.rb:57:58: C: [Corrected] Layout/LineContinuationSpacing: Use one space in front of backslash.
expect(page).to have_selector("##{prefix}_calculator"\
^
spec/system/admin/enterprise_fees_spec.rb:142:43: C: [Corrected] Layout/LineContinuationSpacing: Use one space in front of backslash.
"#{prefix}_calculator_attributes_"\
^
spec/system/admin/order_spec.rb:646:84: C: [Corrected] Layout/LineContinuationSpacing: Use one space in front of backslash.
accept_alert "An invoice for this order will be sent to the customer. "\
^
1478 files inspected, 4 offenses detected, 4 offenses corrected
Inspecting 1478 files
............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C.........................................................................................
Offenses:
spec/system/admin/enterprises_spec.rb:204:5: C: [Corrected] Layout/LeadingCommentSpace: Missing space after #.
#using "find" as fields outside of the screen and are not visible
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1478 files inspected, 1 offense detected, 1 offense corrected
Inspecting 1478 files
...................................................................................................................................................C.......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C......................................................................................................................................................................................................................................................C......................CC....................C......................................................
Offenses:
app/controllers/spree/users_controller.rb:53:19: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
message: t('devise.user_registrations.spree_user.signed_up_but_unconfirmed') })
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/spree/users_controller.rb:53:101: C: Layout/LineLength: Line is too long. [107/100]
message: t('devise.user_registrations.spree_user.signed_up_but_unconfirmed') })
^^^^^^^
spec/models/enterprise_spec.rb:906:1: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
permissions: [permission])
^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/customers_spec.rb:19:1: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
code: nil, created_manually: true)
^^^^^^^^^
spec/system/admin/order_spec.rb:708:1: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
distributors: [distributor1])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/orders_spec.rb:45:4: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
distributors: [distributor4, distributor5])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/orders_spec.rb:249:9: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
line_items_count: 0)
^^^^^^^^^^^^^^^^^^^
spec/system/admin/orders_spec.rb:254:9: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
line_items_count: 1)
^^^^^^^^^^^^^^^^^^^
spec/system/admin/orders_spec.rb:259:9: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
distributor: distributor2, bill_address_id: nil, ship_address_id: nil)
^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/orders_spec.rb:259:101: C: Layout/LineLength: Line is too long. [109/100]
distributor: distributor2, bill_address_id: nil, ship_address_id: nil)
^^^^^^^^^
spec/system/admin/tag_rules_spec.rb:145:37: C: [Corrected] Layout/HashAlignment: Align the keys of a hash literal if they span more than one line.
count: 4
^^^^^^^^
1478 files inspected, 11 offenses detected, 9 offenses corrected
Inspecting 1478 files
...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C..................................................................................................................................................................................
Offenses:
spec/services/products_renderer_spec.rb:73:11: C: [Corrected] Layout/FirstHashElementIndentation: Use 2 spaces for indentation in a hash, relative to the first position after the preceding left parenthesis.
"#{[:name, :meta_keywords, :variants_display_as, ...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/services/products_renderer_spec.rb:76:9: C: [Corrected] Layout/FirstHashElementIndentation: Indent the right brace the same as the first position after the preceding left parenthesis.
} })
^
1478 files inspected, 2 offenses detected, 2 offenses corrected
Inspecting 1478 files
..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C......................CC.........................................C.................................
Offenses:
spec/system/admin/customers_spec.rb:40:13: C: [Corrected] Layout/ArrayAlignment: Align the elements of an array literal if they span more than one line.
managed_distributor2.name], without_options: [unmanaged_distributor.name]
^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/customers_spec.rb:40:101: C: Layout/LineLength: Line is too long. [126/100]
managed_distributor2.name], without_options: [unmanaged_distributor.name]
^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/order_spec.rb:742:1: C: [Corrected] Layout/ArrayAlignment: Align the elements of an array literal if they span more than one line.
different_shipping_method_for_distributor1]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/orders_spec.rb:48:33: C: [Corrected] Layout/ArrayAlignment: Align the elements of an array literal if they span more than one line.
distributor3, distributor4],
^^^^^^^^^^^^
spec/system/consumer/shopping/cart_spec.rb:21:37: C: [Corrected] Layout/ArrayAlignment: Align the elements of an array literal if they span more than one line.
product_with_fee.variants.first])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1478 files inspected, 5 offenses detected, 4 offenses corrected
Inspecting 1478 files
...................................................................................................................................................C..C.......................................................................................................C........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C..........................................C................................................................................................................................................................................................C..................................................................C............C..................CC............................................C......C..........................
Offenses:
app/controllers/spree/users_controller.rb:37:15: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
locals: { type: "alert", message: t('devise.failure.already_registered') })
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/spree/users_controller.rb:52:13: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
locals: { type: "success", ...
^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/user_confirmations_controller.rb:28:11: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
locals: { type: "success", message: t("devise.confirmations.send_instructions") })
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/enterprise.rb:54:5: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
inverse_of: :distributor, foreign_key: :distributor_id
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/enterprise.rb:56:5: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
inverse_of: :distributor, foreign_key: :distributor_id
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/enterprise.rb:118:5: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
format: { ...
^^^^^^^^^
spec/lib/reports/packing/packing_report_spec.rb:60:11: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
product: create(:simple_product, name: "visible", supplier: supplier1))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/lib/reports/packing/packing_report_spec.rb:64:11: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
product: create(:simple_product, name: "not visible", supplier: supplier2))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/migrations/migrate_customer_names_spec.rb:16:7: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
value_type: "boolean", key: "/enterprise/show_customer_names_to_suppliers/#{enterprise1.id}")
^^^^^^^^^^^^^^^^^^^^^
spec/migrations/migrate_customer_names_spec.rb:16:101: C: Layout/LineLength: Line is too long. [122/100]
value_type: "boolean", key: "/enterprise/show_customer_names_to_suppliers/#{enterprise1.id}")
^^^^^^^^^^^^^^^^^^^^^^
spec/migrations/migrate_customer_names_spec.rb:18:7: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
value_type: "boolean", key: "/enterprise/show_customer_names_to_suppliers/#{enterprise2.id}")
^^^^^^^^^^^^^^^^^^^^^
spec/migrations/migrate_customer_names_spec.rb:18:101: C: Layout/LineLength: Line is too long. [122/100]
value_type: "boolean", key: "/enterprise/show_customer_names_to_suppliers/#{enterprise2.id}")
^^^^^^^^^^^^^^^^^^^^^^
spec/migrations/migrate_customer_names_spec.rb:20:7: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
value_type: "boolean", key: "/enterprise/show_customer_names_to_suppliers/#{enterprise4.id}")
^^^^^^^^^^^^^^^^^^^^^
spec/migrations/migrate_customer_names_spec.rb:20:101: C: Layout/LineLength: Line is too long. [122/100]
value_type: "boolean", key: "/enterprise/show_customer_names_to_suppliers/#{enterprise4.id}")
^^^^^^^^^^^^^^^^^^^^^^
spec/services/products_renderer_spec.rb:91:13: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
{ q: { with_properties: [property_organic.id] } })
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/services/products_renderer_spec.rb:91:101: C: Layout/LineLength: Line is too long. [101/100]
{ q: { with_properties: [property_organic.id] } })
^
spec/services/products_renderer_spec.rb:100:13: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
{ q: { with_properties: [property_organic.id] } })
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/services/products_renderer_spec.rb:100:101: C: Layout/LineLength: Line is too long. [101/100]
{ q: { with_properties: [property_organic.id] } })
^
spec/services/products_renderer_spec.rb:118:13: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
{ q: { with_properties: [property_organic.id] } })
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/services/products_renderer_spec.rb:118:101: C: Layout/LineLength: Line is too long. [101/100]
{ q: { with_properties: [property_organic.id] } })
^
spec/system/admin/bulk_order_management_spec.rb:268:11: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
text: "#{o1.bill_address.last_name}, #{o1.bill_address.first_name}"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/bulk_order_management_spec.rb:793:9: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
retry: 3 do
^^^^^^^^
spec/system/admin/enterprise_fees_spec.rb:103:9: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
from: "#{prefix}_tax_category_id"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/enterprise_fees_spec.rb:129:9: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
from: "#{prefix}_calculator_type"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/enterprise_fees_spec.rb:133:9: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
from: "#{prefix}_calculator_type"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/enterprise_fees_spec.rb:160:9: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
from: "#{prefix}_calculator_type"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/enterprise_fees_spec.rb:221:13: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
selected: 'Second Distributor'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/enterprise_fees_spec.rb:232:43: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
'Flat Rate (per order)', message, 0
^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/order_cycles/list_spec.rb:148:1: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
match: :first).value).to start_with oc_open_at.strftime("%Y-%m-%d %H:%M")
^^^^^^^^^^^^^
spec/system/admin/order_cycles/list_spec.rb:161:1: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
match: :first).value).to eq oc_open_at.strftime("%Y-%m-13 %H:%M")
^^^^^^^^^^^^^
spec/system/admin/order_cycles/list_spec.rb:189:1: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
match: :first).value).to eq test_value.to_datetime.strftime("%Y-%m-%d %H:%M")
^^^^^^^^^^^^^
spec/system/admin/order_cycles/simple_spec.rb:346:13: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
with_options: [schedule_of_other_managed_distributor.name]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/order_cycles/simple_spec.rb:346:101: C: Layout/LineLength: Line is too long. [101/100]
with_options: [schedule_of_other_managed_distributor.name]
^
spec/system/admin/order_cycles/simple_spec.rb:623:9: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
value: Time.zone.local(2040, 10, 17, 0o6, 0o0, 0o0).strftime("%F %T %z"), visible: false
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/order_cycles/simple_spec.rb:623:101: C: Layout/LineLength: Line is too long. [121/100]
value: Time.zone.local(2040, 10, 17, 0o6, 0o0, 0o0).strftime("%F %T %z"), visible: false
^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/order_cycles/simple_spec.rb:625:9: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
value: Time.zone.local(2040, 10, 24, 17, 0o0, 0o0).strftime("%F %T %z"), visible: false
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/order_cycles/simple_spec.rb:625:101: C: Layout/LineLength: Line is too long. [120/100]
value: Time.zone.local(2040, 10, 24, 17, 0o0, 0o0).strftime("%F %T %z"), visible: false
^^^^^^^^^^^^^^^^^^^^
spec/system/admin/order_cycles/simple_spec.rb:733:9: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
value: Time.zone.local(2040, 10, 17, 0o6, 0o0, 0o0).strftime("%F %T %z"), visible: false
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/order_cycles/simple_spec.rb:733:101: C: Layout/LineLength: Line is too long. [121/100]
value: Time.zone.local(2040, 10, 17, 0o6, 0o0, 0o0).strftime("%F %T %z"), visible: false
^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/order_cycles/simple_spec.rb:735:9: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
value: Time.zone.local(2040, 10, 24, 17, 0o0, 0o0).strftime("%F %T %z"), visible: false
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/order_cycles/simple_spec.rb:735:101: C: Layout/LineLength: Line is too long. [120/100]
value: Time.zone.local(2040, 10, 24, 17, 0o0, 0o0).strftime("%F %T %z"), visible: false
^^^^^^^^^^^^^^^^^^^^
spec/system/consumer/shopping/cart_spec.rb:147:35: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
preferred_unit_from_list: "kg"),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/consumer/shopping/cart_spec.rb:147:101: C: Layout/LineLength: Line is too long. [101/100]
preferred_unit_from_list: "kg"),
^
spec/system/consumer/shopping/products_spec.rb:98:11: C: [Corrected] Layout/ArgumentAlignment: Align the arguments of a method call if they span more than one line.
"<script>alert('Dangerous!');</script>", truncate: false)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/consumer/shopping/products_spec.rb:98:101: C: Layout/LineLength: Line is too long. [113/100]
"<script>alert('Dangerous!');</script>", truncate: false)
^^^^^^^^^^^^^
1478 files inspected, 45 offenses detected, 32 offenses corrected
Not sur the request nor the `producers` in the reflex should be like this. This is a proof of concept, and should probably be reviewed
Fix linter issues
Use the reflex itself
+ Don't need to create a method that will be called only in the connect
+ Simply code by adding only two lifecycle methods
Actually it seems that all reflex related to products controller should show/hide loading
+ Move outside `Admin` module the reflex
Therefore, this reflex should be _equivalent_ to its javascript controller: `ProductsV3` (relation is made through names)
Remove unwanted line
Actually call StimulusJS controller instead of calling the reflex itself
In order to have this "showLoading", "hideLoading" behavior.
It seems to be possible to directly use the Reflex itself (use `data-reflex` instead of `data-action`) but I can't make it work: the `stimulus-controller:after` event is never broadcasted/catched (but `stimulus-controller:before` yes...)
Documentation:
https://docs.stimulusreflex.com/guide/reflexes.html#understanding-stimulusreflex-controllers
https://docs.stimulusreflex.com/guide/lifecycle.html#generic-life-cycle-methods
Maybe @dacook if you want to have a look...
For `admin_style_v3` use `<` and `>` for next and previous link
instead of `next` and `previous` string
Extract a mixin for a default box-shadow
Maybe this needs to be redefined. Let's see how next things goes.
When a table is followed by a pagination, remove its margin-bottom + border
Finally, design the pagination component
Add sorting/pagination module, on top of table
We use `cablea_ready.replace`, so need to add `#products-content` id
Use a `pagy` partial with reflex action, instead of the legacy one
- revert the legacy one to its previous state
- in reflex, fetch product with page attribute, 1 by default
Move `pagy` into `admin/shared/v3/` to be reusable
+ use fontawesome icons for next and previous page
Remove useless line
It is important that the calculated voucher adjustments don't change
if they are recalculated and it is equally important that they are
updated if the order has changed
It now uses `order.pre_discount_total` to make any calculation, that
means you can call it multiple time and you will still get the same
adjustment amount, included_tax and tax adjustment when needed. This
is assuming nothing changed on the order.
The `params` and the user are created before the request. But, for
example, the enterprise user doesn't need creating when testing
permissions of the normal user.
The DFC Prototype does include the context while the output of the DFC
Connector refers to the URL of the published context. While that's more
efficient, it's also brittle because the context is updated from time to
time. That happened three days ago and working with the newly published
context breaks our integration until we get an updated version of the
DFC Connector containing the new URLs for datatypes.
This allows us to run the specs separately to generate the
documentation. It's more efficient this way and the separate swagger doc
file is easier to read.
The engine-specific swagger helper also allows us to simplify the spec
files.
Added an exception to our styleguide because it's intended and useful to
have a complete (lengthy) description of the API in one block.
This `number_to_currency` method seems to display an extra space, not necessary when unit is `''`
Strip it.
Update specs as well. Thanks @filipefurtad0 for specs!!!
In other API specs, you provide example values in the schema. So the
specs contain examples which can be used for the documentation. But
instead of defining example data separately, we can use the generated
data by the specs. This way we document real output and don't have to
double up on documentation.
Note that we don't have schema definitions for the DFC API yet. And it
wouldn't make sense to replicate the DFC Ontology manually in JSON
Schema for this purpose. The DFC Connector ensures already that we
comply with the ontology. But I hope that we can use a tool at some
point to generate JSON Schema from the DFC Ontology which would add more
detail to the Swagger docs, I think.
We were hiding that before because the API is not officially released
yet but that's actually quite annoying. It's very conenient to have the
UI on production and be able to try out endpoints.
I chose the simplest spec first to demonstrate how it works. The UI at
/api-docs now shows this endpoint with two possible responses.
The docs are missing an example response which I hope to add later.
We need to declare in each spec file for which endpoint the spec is
because it was just choosing the first declared one by default. The
first one was v1 and now it's dfc-v1.7.
Rswag doesn't look for specs in engines by default. We haven't added any
Rswag specs in the dfc_provider engine yet but that will come.
The generated API schema has some superfluous whitespace removed due to
a fix in the rswag gems.
The .content div provides overall page margins and a max width, and is already nested inside the nav menus (this allows the nav background to fill the full width of the page.
The main content area should be structured the same way, so we can have flexibility needed to allow some screens to use the full page.
This doesn't seem to change the layout of any screens in the admin interface.
Now the table content can stretch full width
The line item sorting by id has been replaced by sorting by completed_at
time: ccb183d60b
While that's a good idea, the query param to order was only defined in
the client Javascript and there was no default ordering. Line items also
get their completed_at date from the order. So it's the same for all
items of the same order and the ordering with that group of line items
was random.
Now we are adding an order in addition. Items are first sorted by date
and then by id if there's any ambiguity.
I could have split this into several commits:
* DRY direct linking to images.
* Check S3 config before direct linking.
* Just check if service is public instead of relying on name.
Developers may copy a staging or production database or experiment with
S3 storage. But when the S3 config is missing then calling `service`
raises an ArgumentError due to a missing name.
Now we only try to call `service` if the S3 config is present.
Line items which reference a master variant is a scenario that in theory shouldn't have been valid or even possible for at least 5-6 years, and these old bits of data in theory should have been cleaned up at the time those changes were made. But a couple of servers have some really old data that's not in a nice state.
Here we can just flip the is_master flag to false for those specific (legacy data) cases before deleting any other master variants, to keep the legacy line item data intact.
This reverts commit 21b80db0ee.
This fix was needed for an old version of the JSON module with a newer
version of Ruby. But we updated the json gem since and don't need this
any more.
These shouldn't technically exist, but apparently they can be present if the dataset is old enough. They can trigger a foreign key violation if they are present when a master variant is deleted, so they need to be dropped if present.
These shouldn't technically exist, but apparently they can be present if the dataset is old enough. They can trigger a foreign key violation if they are present when a master variant is deleted, so they need to be dropped if present.
OFN products and variants need more data like a price but the DFC
stores that in a different object. We may get a larger graph containing
that information but we don't have any test data yet.
The Connector exports to a String but Rails' `request.body` is an IO
object. Since the used JSON-LD parser needs an IO object anyway and it
can lower the memory usage we take IO objects as well and handle
in-memory Strings only when given.
There are three main components:
1. The invoice model
2. order serializers: serialize the order for the invoice
3. data presenters: the object that will be use to access the order's serialize data
This was effectively being done before for the product's sku (stored on the master variant) via the #duplicate_variant method, but now it needs to be done explicitly on the product in #duplicate_product
With generic link to the releases page. We could provide a link to latest tag with `git describe --tags --abbrev=0`. But I thought it better to keep things simple.
It should only be true or false. This was flagged by Rubocop. I also
added another Rubocop suggestion and combined two migrations because
they are related.
This reduces the migration run time from 9.6 seconds to 0.16 seconds on
a production database.
* Simplify model naming.
* Remove unnecessary model code.
* Use Rails `missing` scope for efficient simplicity.
* Add `down` method for rollback instead of running `change` again.
Update app/models/customer.rb
Co-authored-by: Maikel <maikel@email.org.au>
Update spec/models/customer_spec.rb
Co-authored-by: Maikel <maikel@email.org.au>
Update spec/models/customer_spec.rb
Co-authored-by: Maikel <maikel@email.org.au>
authorize created_manually field to be set on APIv1
So it turns out all images uploaded before the ActiveStorage migration are internally set to "public-read", and all images uploaded after the migration are internally set to "private". This migration switches all images in S3 buckets back to "public-read".
Defining an alternate s3 configuration set to `public: true` means we can use it selectively. It sets the objects to `acl: "public-read"` by default (read-only) and means any image tags for those assets can use direct public links in the src attribute (without hitting the ActiveStorage::Representation endpoint). The default non-public service will still be used by default for any other files on instances using s3.
We had a race condition that could first display the report and then
replace it again with the "loading" spinner. That doesn't seem to happen
now that we changed the order of cable events.
Newer version of Rails have this option as default. We can slowly
transition to opt in gradually, model by model. Once all models are
covered, we can change the default and remove the setting from the
models again.
The style violation was added to the todo file because it's temporary.
We have 60 models using `belongs_to`. And changing them all at once
breaks some specs. So let's do it gradually.
This ends up sending a request to the orders endpoint with no filters and no search params, which then tries to load every order in the entire database if the user is superadmin, which blows up.
And provide a basic hover state for most other buttons.
The pagination button hover and active states will need updating.
The darker background colour sometimes wraps a whole table (eg products table).
There is more to do, for example the dropshadows.
I've continued with the unopinionated colour naming (eg color-7), but would like to consider giving them more meaningfule names..
The current value is 13px already, but I'd like to experiment changing this.
I'm not sure if we even need the reset, but am not delving into that right now.
There seems to be some contexts (jobs for subscriptions) where the Payment class loads but LocalizedNumber is an undefined constant. It lives in the /lib directory so it's not auto-loaded.
I'm hiding a real bug here. There's a race condition when the cable event of
the finished report is sent before the loading spinner rendered. The
spinner then overwrites the report again. I added a spec for that but
don't have a solution yet.
I also noticed that the loading spinner is not displayed in testing but
we can assert on the CSS class of the container.
Rubocop was complaining about too many arguments. But
`ApplicationJob#perform` needs all arguments handled in one call. While
we could allow the `perform` method generally to have more arguments,
there could be other methods called `perform` which should still be
scrutinised. Instead, it seems acceptable to me to have more arguments
as long as they are clearly named as keyword arguments. Rails uses this
a lot to document all options including their default values, for
example in Active Storage. It's better then bundling several arguments
in an undocumented hash just to reduce the number of given arguments.
And once we upgraded to Ruby 3.1, we can clean the method calls up as
well. `call(user: user)` becomes `call(user:)` without repetition.
This is not a normal pattern for setting up ActionCable channels, so it might need some notes. It ensures the broadcasts from the ReportJob are unique not just to the user session but also to the specific tab in the user's browser. Otherwise if the user has two different report pages open in separate tabs with the same session, the broadcast would overwrite the #report-table element in both of them.
- buttons background are transparent (instead of blue)
- buttons background on hovering are transparent (instead of green)
- disabled buttons cursor is default (instead of pointer)
This action gets called from the order edit page when adding line items and it's one of the places that needs to advance the order *before* redirecting back to the order edit action
This request came from the current DFC prototype. The changes are
probably implementing DFC v1.7.
I observed by including `$request_body` in the nginx log on the staging
server.
Individual files may be copied in order to replace the old files.
NOTE: these may need manually re-syncing. If any of the copied files have changed on master in the meantime, we'll need to manaully review to consider bringing those changes to the new design.
Once the user accept the cookie, we should not show the cookie banner element. This is handled via `app/helpers/footer_links_helper.rb#cookies_policy_link` and boolean:
```
!Web::CookiesConsent.new(cookies, request.host).exists? && Spree::Config.cookies_consent_banner_toggle
```
Add context when click Create Subscription button on third page after click next button previously on second page.
It has selector for price, input for quantity and selector for total price.
It was bad UX to show a link that doesn't work straight away. At the
time, it was the only way to download the report but now we send an
email which is a much better way to go.
I leave the rest of the code because we want to implement a reflex which
shows the download link once it's ready.
I added a system spec to verify that the download link can be generated
within the mailer in a background job. ActiveStorage is a bit particular
when it comes to genererating URLs and depending on the situation it may
generate a redirect URL, a proxy URL or link directly to the storage.
But we want a redirect URL here.
I wrongly assumed that `voucher.create_adjustment` would return nil
if failing to create an adjustment. I will in fact return an
adjustment object with errors.
It turns out the "tax_rate" association isn't used and wasn't working.
Same for the "voucher" one, which I added to be consistent with existing
code.
Both of these weren't caught by the specs because you can't test associations
with a custome relation with 'shouda-matchers' see: https://github.com/thoughtbot/shoulda-matchers/issues/981
The voucher apply button is inside form that has another a submit button,
it leads to a weird situation where either one will submit the whole
payments page form. Adding a named parameter on the voucher apply button
means we can distinguish between the two by checking for the presence
of params[:apply_voucher].
As per review comment, use data-disable-with="false" do prevent Rails
from automatically enabling the "Apply" button. We can then remove
the timeout hack.
The "apply" button is disabled by default. If left enabled, a customer
could try to apply an empty voucher, which results in system trying
to move to the order summary step, an unexpected behaviour!
We only enable the button when something is entered in the input.
Voucher adjustment have complicated calculation that prevent us from
using Spree::Calculator, and we need to override CalculatedAdjustments
method, so no point using it.
We still keep the same methods to stay as consitent as possible in
regards to adjustments
Refactor split checkout to use the new controller. But unfortunately
we can't have nested form, so adding a voucher is still handled by
SplitCheckoutController.
The split checkout page uses `mrujs` and `CableCar` to set the form as
a remote one and perform `CableCar` operation if any : https://mrujs.com/how-tos/integrate-cablecar
The previous solution broke the cart handled by angularJS, it looks like
`morpdom` (https://mrujs.com/references/remote-forms-and-links Navigation Adapter section )
was doing something that angularJS didn't like when redirecting to
the current page.
With the power of `CableCar`, we now replace the #voucher-section on the
split checkout page instead of doing a redirect.
Add missing, "inverse_of" and "dependent" options. Use :nullify as
for "dependent" because we would want to keep the adjustments on order
even if the voucher is deleted.
At the time when we can apply a voucher to an order (payment step) we
don't have any data on possible taxes and payment fees. These are
calculated when we move to the summary step. So voucher are applied in
two step:
- create an "open" voucher adjustment on the order when a customer enters
a voucher code.
- when we move to the summary step, recalulate the amount and
possible tax for the voucher adjustment, once taxes and payment fees
have been included in the order. And then close the original and update
order to reflect the changes
The checkout payment step will also show a warning.
The amount used is stored in the adjustment created, so we will be able
to track how much has been used down the line.
As part of this PR https://github.com/openfoodfoundation/openfoodnetwork/pull/10329
LocalisedNumber validation was tightened, but that means negative number
were not valid anymore.
This commit has been cherry-picked after this fix has already been
applied. Now we just change the order of characters in the regex because
humans are used to reading the minus at the beginning of the number. But
this change doesn't change the logic at all.
An ExchangeVariant is a simple representation of a join table between Exchange and Variant. Previously this code was triggering an additional INSERT query for every variant added to the newly cloned exchange. Some exchanges have ~3000 variants! The code now creates them in bulk in a single INSERT statement. When cloning large order cycles this can improve performance by ~1000% or so.
I changed the text to focus on the resolution: the user needs to choose
a tax category or a different calculator.
I associated the error to the model to prevent the attribute name from
being included in the error message. Alternatively, we could have
changed the name of the attribute to match the UI. But this error
affects the combination of two attributes, none of them is invalid on
its own.
I'm using Rails' default lazy lookup for error messages which results in
shorter code and a standard structure.
I also added a simple spec.
This is work in progress. The DFC Connector uses a more recent DFC
version and other endpoints still use the old serializers. We need to
update those endpoints as well and update the version number in the API
URL.
It looks like the resolution of a merge conflict introduced the wrong
ordering of schema statements. Rails wants to sort tables alphabetically
and running `./bin/rails db:migrate` on a fresh database altered the
schema.rb file. This should be fixed here.
Rails also omits the default setting of `precision: 6` since Rails 7.
The vouchers feature was developed during the upgrade to Rails 7.
For some reason eager-loaded data isn't passed to nested serializers when using associations. Defining the association as a method and passing in some optional paramaters resolves the issue.
This reduces queries run by the controller action by around 75%, as well as the response times.
This change looks innocuous but the result of converting this into a nice relation instead of two queries stuck together with the pipe operator (|) can make a huge difference when chaining this into subqueries. The result set is ultimately the same, but the queries can be built without first returning all the ids and then sticking those ids in an array.
This is a new feature in Rails 7. Whenever a query is triggered it not only show you the query (as before), but also tells you (directly in the logs) exactly which line of code was responsible for triggering the query. It's unbelievably useful for debugging and performance work.
This was a transitional bit of code to allow us to rename our session cookies without killing active sessions and logging users out. It's done it's job, the transition is finished, and it isn't doing anything useful now. It can be removed from the middleware stack.
`webpack-cli` is a dependency of `@rails/webpacker` but needs to be at version 3.x, we can just cut it from the explicit dependecy list and the correct version will be installed.
`webpack-dev-server` version 3.x corresponds (unhelpfully) to `webpacker` 4.x, and needs to be left that way. Dependabot tries to change it occasionally, but it should not be updated to 4.x
We're now handling these values on the frontend, so can keep this simple.
fixes up:
Add numericality validation for *
Add translation for Active Record error message
The browser is now responsible for dealing with the decimal separator, for all numeric preferences (as input[type=number]; see Spree::Admin::BaseHelper::preference_field_tag). Calculators are the only place that numeric preferences are used.
It will enforce that only one comma or dot (depending on user's locale) is entered, thus avoiding any ambiguity, and mis-interpretation (eg 100,001 could be interpreted as more than 100 thousand or 100 with a decimal place).
This option came from Spree and we never used it. The config input field
is disabled in the admin interface and I checked our managed databases.
I don't think that we will want this feature in the future either.
Staging sends unmodified emails which is more realistic and we haven't
had a use case to intercept those emails. There's still the BCC option
if we need additional access.
```
Modal window with text `An invoice for this order will be sent to the customer. Are you sure you want to continue?` has been opened, but you didn't wrap your code into (`accept_prompt` | `dismiss_prompt` | `accept_confirm` | `dismiss_confirm` | `accept_alert`), accepting by default
```
Seting "env" under "jobs" doesn't work it gets picked up as a job. I moved
runs_on to the top level env. but I couldn't fine a way to get it to work.
I tried all syntax I could think of: $runs_on, ${{ runs_on }} env.runs_on,
${{ env.runs_on }} and their capitalized versions.
The typical use case is to create a small number of commits for a pull
request to ease the review. And you can still run it for all cops with
`-n 999` or `-n -0`.
Inspecting 1404 files
.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................W.....................W....................................W...........................W.......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Offenses:
engines/catalog/catalog.gemspec:14:3: W: [Corrected] Gemspec/DeprecatedAttributeAssignment: Do not set test_files in gemspec.
s.test_files = Dir["test/**/*"]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
engines/dfc_provider/dfc_provider.gemspec:17:3: W: [Corrected] Gemspec/DeprecatedAttributeAssignment: Do not set test_files in gemspec.
spec.test_files = Dir['spec/**/*']
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
engines/order_management/order_management.gemspec:14:3: W: [Corrected] Gemspec/DeprecatedAttributeAssignment: Do not set test_files in gemspec.
s.test_files = Dir["spec/**/*"]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
engines/web/web.gemspec:14:3: W: [Corrected] Gemspec/DeprecatedAttributeAssignment: Do not set test_files in gemspec.
s.test_files = Dir["test/**/*"]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1404 files inspected, 4 offenses detected, 4 offenses corrected
Inspecting 1404 files
.C..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Offenses:
Gemfile:18:1: C: [Corrected] Bundler/OrderedGems: Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem angular-rails-templates should appear before rexml.
gem 'angular-rails-templates', '>= 0.3.0'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Gemfile:19:1: C: [Corrected] Bundler/OrderedGems: Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem awesome_nested_set should appear before rexml.
gem 'awesome_nested_set'
^^^^^^^^^^^^^^^^^^^^^^^^
Gemfile:20:1: C: [Corrected] Bundler/OrderedGems: Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem ransack should appear before rexml.
gem 'ransack', '~> 2.6.0'
^^^^^^^^^^^^^^^^^^^^^^^^^
Gemfile:21:1: C: [Corrected] Bundler/OrderedGems: Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem responders should appear before rexml.
gem 'responders'
^^^^^^^^^^^^^^^^
Gemfile:74:1: C: [Corrected] Bundler/OrderedGems: Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem omniauth-rails_csrf_protection should appear before openid_connect.
gem 'omniauth-rails_csrf_protection'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Gemfile:154:3: C: [Corrected] Bundler/OrderedGems: Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem debug should appear before factory_bot_rails.
gem 'debug', '>= 1.0.0'
^^^^^^^^^^^^^^^^^^^^^^^
Gemfile:155:3: C: [Corrected] Bundler/OrderedGems: Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem debug should appear before fuubar.
gem 'debug', '>= 1.0.0'
^^^^^^^^^^^^^^^^^^^^^^^
Gemfile:156:3: C: [Corrected] Bundler/OrderedGems: Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem debug should appear before json_spec.
gem 'debug', '>= 1.0.0'
^^^^^^^^^^^^^^^^^^^^^^^
Gemfile:157:3: C: [Corrected] Bundler/OrderedGems: Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem debug should appear before knapsack_pro.
gem 'debug', '>= 1.0.0'
^^^^^^^^^^^^^^^^^^^^^^^
Gemfile:158:3: C: [Corrected] Bundler/OrderedGems: Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem debug should appear before letter_opener.
gem 'debug', '>= 1.0.0'
^^^^^^^^^^^^^^^^^^^^^^^
Gemfile:159:3: C: [Corrected] Bundler/OrderedGems: Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem debug should appear before rspec-rails.
gem 'debug', '>= 1.0.0'
^^^^^^^^^^^^^^^^^^^^^^^
Gemfile:160:3: C: [Corrected] Bundler/OrderedGems: Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem debug should appear before rspec-retry.
gem 'debug', '>= 1.0.0'
^^^^^^^^^^^^^^^^^^^^^^^
Gemfile:161:3: C: [Corrected] Bundler/OrderedGems: Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem debug should appear before rswag-specs.
gem 'debug', '>= 1.0.0'
^^^^^^^^^^^^^^^^^^^^^^^
Gemfile:162:3: C: [Corrected] Bundler/OrderedGems: Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem debug should appear before shoulda-matchers.
gem 'debug', '>= 1.0.0'
^^^^^^^^^^^^^^^^^^^^^^^
Gemfile:163:3: C: [Corrected] Bundler/OrderedGems: Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem debug should appear before timecop.
gem 'debug', '>= 1.0.0'
^^^^^^^^^^^^^^^^^^^^^^^
Gemfile:179:3: C: [Corrected] Bundler/OrderedGems: Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem foreman should appear before rails-erd.
gem 'foreman'
^^^^^^^^^^^^^
Gemfile:180:3: C: [Corrected] Bundler/OrderedGems: Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem listen should appear before rails-erd.
gem 'listen'
^^^^^^^^^^^^
Gemfile:181:3: C: [Corrected] Bundler/OrderedGems: Gems should be sorted in an alphabetical order within their section of the Gemfile. Gem pry should appear before rails-erd.
gem 'pry', '~> 0.13.0'
^^^^^^^^^^^^^^^^^^^^^^
1404 files inspected, 18 offenses detected, 18 offenses corrected
They're all numbers, so we can reliably validate in the browser, removing the need for additional validation logic.
They will still be validated server-side, and in the unlikely even that there is an error, the generic 'Calculator is invalid' message will appear, with the relevant fields highlighted red. I think that's fine.
But we still have the duplicate problem.
Wait a minute, it copies them in the same format that I am copying them. So.. I don't need to copy them at all!
Now I see that we just needed the right format in the translation file.
This is much simpler. Multiple messages get combined onto one line though, which is not perfect.
And.. it still seems to duplicate the errors. Weird, it's fine on my frontend though.
The Zeitwerk autoloader requires class names and file names to match. In
this case, the class had a Spree namespace without being in a spree
folder. The preview couldn't be displayed. Now it can be displayed.
The `login_as_admin_and_visit` helper was used a lot but isn't really
shorter than:
login_as_admin
visit path_visit
Calling those methods separately reduces line length. It also removes
the potential impression that it may be more efficient to use the
helper. Now we have less indirection if one of the calls fails and see
the failing spec line straight away.
It was often used with a `visit` statement after which resulted in
unnecessary page loads. There was only one case where a `visit` was
expected but it wasn't needed either.
https://sass-lang.com/documentation/breaking-changes/slash-div
> Sass currently treats / as a division operation in some contexts and a separator in others. This makes it difficult for Sass users to tell what any given / will mean, and makes it hard to work with new CSS features that use / as a separator.
There's a handy migrator:
npm install -g sass-migrator
sass-migrator division **/*.scss
And it cleverly avoids the need for the ugly division method in most cases.
This detects an additional 639 offenses which I added to the todo file.
From now on, when Dependabot bumps rubocop the build may fail due to new
cops. But that's a great opportunity to utilise those new cops and fix
violations straight away. Otherwise we'll never get to them and lose out
on useful autocorrection, for example for updating deprecated syntax.
The production code calls `perform_later` and it's better to do the same
in specs. Handy test helper allow us to control the execution.
Credit to https://github.com/cyrillefr.
It's worth noting that this page hasn't been updated by this PR.
I honestly don't know why it broke, but don't care anymore. It seems the extra `login_as_admin_and_visit` was causing a race condition on one spec. It's not necessary so I've removed this context.
Best viewed with whitespace ignored.
actions/checkout@v3 actually creates a merge commit into master, to ensure you're testing the latest as close to master as possible.
That's all well and good, but quite confusing when you see errors in CI that aren't present in the actual PR branch. Hopefully this will be a clue when such confusions arise.
The closer the test environment is to the production environment the
more realistic the tests will be, and the more code we test.
We are now able to test the app behaviour on timeouts which I want to do
for reports. We can also catch incompatibilities with the rack-timeout
gem during testing.
[Draft new release]: https://github.com/openfoodfoundation/openfoodnetwork/releases/new?tag=v&title=v+Code+Name&body=Congrats%0A%0ADescription%0A%0A%23%23+User+facing+changes+:eyes:%0A%0A%0A%0A%23%23+Technical+changes+:wrench:%0A%0A
[Draft new release]: https://github.com/openfoodfoundation/openfoodnetwork/releases/new?tag=v&title=v+Code+Name&body=Congrats%0A%0ADescription%0A%0A%23%23+User+facing+changes+:eyes:%0A%0A%0A%23%23%23+Experimental+features+for+testing+:sunglasses:%0A%0A%0A%23%23+Technical+changes+:wrench:%0A%0A
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.