Compare commits

...

272 Commits

Author SHA1 Message Date
Maikel
c8ad6d7d1c Merge pull request #11300 from macanudo527/fix_rubocop_layout_3
Fix rubocop layout 4
2023-07-31 11:26:53 +10:00
Neal Chambers
60cd84d565 Safely autocorrect Naming/BlockForwarding
Inspecting 1480 files
...................................................................................................................................................................C.......C..........C...............................................................................................................................................................................................................C...........................................................................................................C.........C...............................................................................................................................................................................................................................................................C........................................CC...C............................................................................................................................................................................................................................................................................................................................C.....................................................................................................................................................................................................C..............C.........C..CC.......C.....................................................................................................C...............

Offenses:

app/helpers/application_helper.rb:41:32: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
  def ng_form_for(name, *args, &block)
                               ^^^^^^
app/helpers/application_helper.rb:44:75: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
    form_for(name, *(args << options.merge(builder: AngularFormBuilder)), &block)
                                                                          ^^^^^^
app/helpers/application_helper.rb:49:37: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
  def method_missing(method, *args, &block)
                                    ^^^^^^
app/helpers/link_helper.rb:4:57: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
  def link_to_service(baseurl, name, html_options = {}, &block)
                                                        ^^^^^^
app/helpers/link_helper.rb:8:51: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
    link_to ext_url(baseurl, name), html_options, &block
                                                  ^^^^^^
app/helpers/spree/admin/base_helper.rb:6:56: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
      def field_container(model, method, options = {}, &block)
                                                       ^^^^^^
app/helpers/spree/admin/base_helper.rb:13:29: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
                    capture(&block),
                            ^^^^^^
app/reflexes/application_reflex.rb:29:19: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
  def with_locale(&block)
                  ^^^^^^
app/reflexes/application_reflex.rb:30:43: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
    I18n.with_locale(current_user.locale, &block)
                                          ^^^^^^
app/services/cache_service.rb:8:43: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
  def self.cache(cache_key, options = {}, &block)
                                          ^^^^^^
app/services/cache_service.rb:9:48: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
    Rails.cache.fetch cache_key.to_s, options, &block
                                               ^^^^^^
app/services/cache_service.rb:14:58: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
  def self.cached_data_by_class(cache_key, cached_class, &block)
                                                         ^^^^^^
app/services/cache_service.rb:16:23: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
                      &block
                      ^^^^^^
app/services/cache_service.rb:25:34: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
  def self.home_stats(statistic, &block)
                                 ^^^^^^
app/services/cache_service.rb:28:47: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
                      race_condition_ttl: 10, &block)
                                              ^^^^^^
app/services/current_order_locker.rb:12:31: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
  def self.around(controller, &block)
                              ^^^^^^
app/services/current_order_locker.rb:13:55: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
    lock_order_and_variants(controller.current_order, &block)
                                                      ^^^^^^
lib/reporting/reports/enterprise_fee_summary/scope.rb:392:28: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
        def chain_to_scope(&block)
                           ^^^^^^
lib/reporting/reports/enterprise_fee_summary/scope.rb:393:41: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
          @scope = @scope.instance_eval(&block)
                                        ^^^^^^
lib/spree/core/controller_helpers/respond_with.rb:7:34: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
    def respond_with(*resources, &block)
                                 ^^^^^^
lib/spree/core/controller_helpers/respond_with.rb:13:64: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
      return unless (collector = retrieve_collector_from_mimes(&block))
                                                               ^^^^^^
lib/spree/core/delegate_belongs_to.rb:80:39: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
    def class_def(name, method = nil, &blk)
                                      ^^^^
lib/spree/core/delegate_belongs_to.rb:81:54: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
      class_eval { method.nil? ? define_method(name, &blk) : define_method(name, method) }
                                                     ^^^^
lib/spree/core/environment_extension.rb:22:31: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
      def create_method(name, &block)
                              ^^^^^^
lib/spree/core/environment_extension.rb:23:51: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
        self.class.__send__(:define_method, name, &block)
                                                  ^^^^^^
spec/models/enterprise_caching_spec.rb:144:13: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
  def later(&block)
            ^^^^^^
spec/models/enterprise_caching_spec.rb:145:36: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
    Timecop.travel(1.day.from_now, &block)
                                   ^^^^^^
spec/support/embedded_pages_helper.rb:5:26: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
    def on_embedded_page(&block)
                         ^^^^^^
spec/support/embedded_pages_helper.rb:6:28: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
      within_frame :frame, &block
                           ^^^^^^
spec/support/preferences_helper.rb:11:31: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
  def reset_spree_preferences(&config_block)
                              ^^^^^^^^^^^^^
spec/support/preferences_helper.rb:16:33: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
    configure_spree_preferences(&config_block) if block_given?
                                ^^^^^^^^^^^^^
spec/support/request/shop_workflow.rb:87:37: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
  def within_variant(variant = nil, &block)
                                    ^^^^^^
spec/support/request/shop_workflow.rb:90:22: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
    within(selector, &block)
                     ^^^^^^
spec/support/request/ui_component_helper.rb:4:23: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
  def browse_as_small(&block)
                      ^^^^^^
spec/support/request/ui_component_helper.rb:5:39: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
    browse_with_window_size(640, 480, &block)
                                      ^^^^^^
spec/support/request/ui_component_helper.rb:8:24: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
  def browse_as_medium(&block)
                       ^^^^^^
spec/support/request/ui_component_helper.rb:9:40: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
    browse_with_window_size(1024, 768, &block)
                                       ^^^^^^
spec/support/request/web_helper.rb:52:23: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
  def within_row(num, &block)
                      ^^^^^^
spec/support/request/web_helper.rb:53:54: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
    within("table.index tbody tr:nth-child(#{num})", &block)
                                                     ^^^^^^
spec/swagger_helper.rb:77:19: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
  def param(args, &block)
                  ^^^^^^
spec/swagger_helper.rb:78:45: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
    public_send(:let, args) { instance_eval(&block) }
                                            ^^^^^^
spec/system/support/capybara_setup.rb:20:27: C: [Corrected] Naming/BlockForwarding: Use anonymous block forwarding.
  def using_session(name, &block)
                          ^^^^^^

1480 files inspected, 42 offenses detected, 42 offenses corrected
2023-07-30 21:29:19 +09:00
Neal Chambers
ae8a5b7f93 Safely autocorrect Lint/UnusedMethodArgument
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
2023-07-30 21:29:19 +09:00
Neal Chambers
2a76b1972f Safely autocorrect Lint/SafeNavigationChain
Inspecting 1480 files
........................................................................................................................................................................................................................................................................................................................................W............................W..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Offenses:

app/models/spree/line_item.rb:283:55: W: [Corrected] Lint/SafeNavigationChain: Do not chain ordinary method call after safe navigation operator.
        self.final_weight_volume = variant&.unit_value * quantity
                                                      ^^^^^^^^^^^
app/models/spree/line_item.rb:283:57: C: [Corrected] Layout/SpaceAroundMethodCallOperator: Avoid using spaces around a method call operator.
        self.final_weight_volume = variant&.unit_value&. * quantity
                                                        ^
app/models/spree/stock/availability_validator.rb:31:77: W: [Corrected] Lint/SafeNavigationChain: Do not chain ordinary method call after safe navigation operator.
        return line_item.order.shipments.first if line_item.order&.shipments.any?
                                                                            ^^^^^

1480 files inspected, 3 offenses detected, 3 offenses corrected
2023-07-30 21:29:19 +09:00
Neal Chambers
e7d53753e4 Safely autocorrect Lint/RedundantCopDisableDirective
Inspecting 1480 files
..............W.........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Offenses:

app/components/product_component.rb:23:51: W: [Corrected] Lint/RedundantCopDisableDirective: Unnecessary disabling of Metrics/MethodLength.
  # rubocop:disable Metrics/CyclomaticComplexity, Metrics/MethodLength
                                                  ^^^^^^^^^^^^^^^^^^^^
app/components/product_component.rb:50:50: W: [Corrected] Lint/RedundantCopEnableDirective: Unnecessary enabling of Metrics/MethodLength.
  # rubocop:enable Metrics/CyclomaticComplexity, Metrics/MethodLength
                                                 ^^^^^^^^^^^^^^^^^^^^

1480 files inspected, 2 offenses detected, 2 offenses corrected
2023-07-30 21:29:19 +09:00
Neal Chambers
e9f448fad9 Safely autocorrect Lint/AmbiguousOperatorPrecedence
Inspecting 1480 files
...................................................................................................................................................................................................................................W..........................W........................................................W................W..............W................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Offenses:

app/models/calculator/flexi_rate.rb:38:7: W: [Corrected] Lint/AmbiguousOperatorPrecedence: Wrap expressions with varying precedence with parentheses to avoid ambiguity.
      count * preferred_additional_item.to_f + preferred_first_item.to_f
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/enterprise.rb:362:12: W: [Corrected] Lint/AmbiguousOperatorPrecedence: Wrap expressions with varying precedence with parentheses to avoid ambiguity.
    cat << "sells_" + sells
           ^^^^^^^^^^^^^^^^
app/models/enterprise.rb:496:21: W: [Corrected] Lint/AmbiguousOperatorPrecedence: Wrap expressions with varying precedence with parentheses to avoid ambiguity.
    phone_number && "https://wa.me/" + phone_number.tr('+ ', '')
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/spree/ability.rb:27:33: W: [Corrected] Lint/AmbiguousOperatorPrecedence: Wrap expressions with varying precedence with parentheses to avoid ambiguity.
          order.user == user || order.token && token == order.token
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/spree/ability.rb:30:33: W: [Corrected] Lint/AmbiguousOperatorPrecedence: Wrap expressions with varying precedence with parentheses to avoid ambiguity.
          order.user == user || order.token && token == order.token
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/spree/line_item.rb:205:16: W: [Corrected] Lint/AmbiguousOperatorPrecedence: Wrap expressions with varying precedence with parentheses to avoid ambiguity.
      (price + fees / quantity).round(2)
               ^^^^^^^^^^^^^^^
app/models/spree/preferences/store.rb:28:11: W: [Corrected] Lint/AmbiguousOperatorPrecedence: Wrap expressions with varying precedence with parentheses to avoid ambiguity.
          should_persist? && Spree::Preference.where(key: key).exists?
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1480 files inspected, 7 offenses detected, 7 offenses corrected
2023-07-30 21:29:19 +09:00
filipefurtad0
0bcde2dbda Update all locales with the latest Transifex translations 2023-07-28 16:33:49 +01:00
Filipe
5d624ef4be Merge pull request #11278 from mkllnk/swagger-fix
Fix swagger-api integration after last update
2023-07-28 16:27:32 +01:00
Filipe
1ddbb1c4e1 Merge pull request #11294 from Matt-Yorkley/connect-src
Update CSP configuration for Safari
2023-07-28 16:16:02 +01:00
Filipe
a975e2bd93 Merge pull request #11247 from jibees/9123-inconsistent-default-visibility-setting-for-newly-created-enterprises
Admin, Enterprise creation : set visibility to "Hidden" by default
2023-07-28 12:15:32 +01:00
Filipe
ef947f8749 Merge pull request #11282 from jibees/11025-white-label-trix-quotes-code-and-links-cant-be-identified-in-the-editor
White label: Customize rendering inside the trix-editor, to match the shopfront rendering
2023-07-28 11:23:50 +01:00
Filipe
21690670f5 Merge pull request #11292 from jibees/11108-dashboard-supplier-profile-inconsistent-indentation-on-deployed-version
Admin: improve platform version displaying on admin homepage
2023-07-28 11:01:07 +01:00
Maikel
774bb7a607 Merge pull request #11238 from filipefurtad0/legal_invoices_spec
Adds coverage to Invoices (system specs)
2023-07-28 08:41:01 +10:00
filipefurtad0
98f29dcd9b Adds coverage on invoices section/table 2023-07-27 17:27:41 +01:00
Matt-Yorkley
dd9b28787c Update CSP configuration for Safari
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.
2023-07-27 16:20:42 +01:00
filipefurtad0
35dfdc8bdc Adds coverage on Invoice tab
which should be visible as a function of the order state

Corrects cancelled case
2023-07-27 15:47:40 +01:00
Jean-Baptiste Bellet
8b4de3ddc7 Add version into its own .row .columns with centered text 2023-07-27 15:41:54 +02:00
jibees
55fbab4c0d Merge pull request #11287 from openfoodfoundation/dependabot/bundler/rexml-3.2.6
chore(deps): bump rexml from 3.2.5 to 3.2.6
2023-07-27 12:00:28 +02:00
Jean-Baptiste Bellet
a179c006fc Default design for ul and ol into the custom tab
`ul` and `old` default design already been reset, reactivate default design only for `.custom-tab`
2023-07-27 11:53:47 +02:00
Jean-Baptiste Bellet
4485490b0b Customize rendering inside the trix-editor, to match the shopfront rendering 2023-07-27 11:53:47 +02:00
jibees
b3949965fc Merge pull request #11288 from openfoodfoundation/dependabot/bundler/knapsack_pro-5.3.4
chore(deps-dev): bump knapsack_pro from 5.3.3 to 5.3.4
2023-07-27 11:34:37 +02:00
dependabot[bot]
79d0728fdd chore(deps-dev): bump knapsack_pro from 5.3.3 to 5.3.4
Bumps [knapsack_pro](https://github.com/KnapsackPro/knapsack_pro-ruby) from 5.3.3 to 5.3.4.
- [Changelog](https://github.com/KnapsackPro/knapsack_pro-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v5.3.3...v5.3.4)

---
updated-dependencies:
- dependency-name: knapsack_pro
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-27 09:25:02 +00:00
dependabot[bot]
4e9dae6817 chore(deps): bump rexml from 3.2.5 to 3.2.6
Bumps [rexml](https://github.com/ruby/rexml) from 3.2.5 to 3.2.6.
- [Release notes](https://github.com/ruby/rexml/releases)
- [Changelog](https://github.com/ruby/rexml/blob/master/NEWS.md)
- [Commits](https://github.com/ruby/rexml/compare/v3.2.5...v3.2.6)

---
updated-dependencies:
- dependency-name: rexml
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-27 09:21:38 +00:00
jibees
96418dcde6 Merge pull request #11284 from mkllnk/caching-spec
Compile JS before testing caching
2023-07-27 09:41:22 +02:00
David Cook
fdb80fe87c Merge pull request #11283 from macanudo527/fix_rubocop_layout_2
Fix rubocop layout 3
2023-07-27 10:29:29 +10:00
Neal Chambers
e923defd55 Safely autocorrect Layout/TrailingWhitespace
Inspecting 1479 files
...................................................................................................................................................C..C.......................................................................................................C.................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C.....C..................C.............................................................................................C...................................................................C.......................................................................................................................................................................C....................................................C.............C...........CC.........C......C.CC.C....................C........................................................

Offenses:

app/controllers/spree/users_controller.rb:36:37: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
            partial("layouts/alert",
                                    ^
app/controllers/spree/users_controller.rb:51:35: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
          partial("layouts/alert",
                                  ^
app/controllers/user_confirmations_controller.rb:27:33: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
        partial("layouts/alert",
                                ^
app/models/enterprise.rb:117:24: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
  validates :instagram,
                       ^
spec/controllers/spree/credit_cards_controller_spec.rb:250:64: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
                  create(:stored_credit_card, user_id: user.id,
                                                               ^
spec/controllers/user_confirmations_controller_spec.rb:45:44: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
        session[:confirmation_return_url] =
                                           ^
spec/factories/order_factory.rb:40:67: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
            order.payments << build(:payment, amount: order.total,
                                                                  ^
spec/lib/reports/packing/packing_report_spec.rb:59:40: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
        build(:line_item_with_shipment,
                                       ^
spec/lib/reports/packing/packing_report_spec.rb:63:40: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
        build(:line_item_with_shipment,
                                       ^
spec/models/enterprise_spec.rb:521:67: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
        expect(Enterprise.supplying_variant_in([p1.variants.first,
                                                                  ^
spec/models/enterprise_spec.rb:906:77: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
      create(:enterprise_relationship, parent: distributor, child: supplier,
                                                                            ^
spec/services/products_renderer_spec.rb:22:73: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
      create(:product, name: "banana bread", primary_taxon_id: cakes.id,
                                                                        ^
spec/services/products_renderer_spec.rb:88:88: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
          product_apples.product_properties.create!({ property_id: property_organic.id,
                                                                                       ^
spec/services/products_renderer_spec.rb:90:87: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
          products_renderer = ProductsRenderer.new(distributor, order_cycle, customer,
                                                                                      ^
spec/services/products_renderer_spec.rb:97:90: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
          fruits_supplier.producer_properties.create!({ property_id: property_organic.id,
                                                                                         ^
spec/services/products_renderer_spec.rb:99:87: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
          products_renderer = ProductsRenderer.new(distributor, order_cycle, customer,
                                                                                      ^
spec/services/products_renderer_spec.rb:109:93: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
          product_apples.product_properties.create!({ property_id: property_conventional.id,
                                                                                            ^
spec/services/products_renderer_spec.rb:111:94: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
          product_banana_bread.product_properties.create!({ property_id: property_organic.id,
                                                                                             ^
spec/services/products_renderer_spec.rb:113:90: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
          product_cherries.product_properties.create!({ property_id: property_organic.id,
                                                                                         ^
spec/services/products_renderer_spec.rb:115:91: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
          product_doughnuts.product_properties.create!({ property_id: property_organic.id,
                                                                                          ^
spec/services/products_renderer_spec.rb:117:87: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
          products_renderer = ProductsRenderer.new(distributor, order_cycle, customer,
                                                                                      ^
spec/support/request/stripe_stubs.rb:17:81: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
  def stub_payment_intent_get_request(response: {}, stripe_account_header: true,
                                                                                ^
spec/support/request/stripe_stubs.rb:172:6: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
    {
     ^
spec/support/request/stripe_stubs.rb:175:24: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
        object: "list",
                       ^
spec/support/request/stripe_stubs.rb:176:25: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
        has_more: false,
                        ^
spec/system/admin/bulk_order_management_spec.rb:792:99: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
      it "displays only line items whose orders meet the date restriction criteria, when changed",
                                                                                                  ^
spec/system/admin/bulk_order_management_spec.rb:1071:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
spec/system/admin/bulk_order_management_spec.rb:1121:82: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
      shared_examples "display only group by information for selected variant" do
                                                                                 ^^^^^^^^^^
spec/system/admin/bulk_order_management_spec.rb:1143:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
spec/system/admin/bulk_order_management_spec.rb:1166:12: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
        end
           ^
spec/system/admin/customers_spec.rb:18:98: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
        create(:customer, first_name: 'John', last_name: 'Doe', enterprise: managed_distributor1,
                                                                                                 ^
spec/system/admin/enterprise_fees_spec.rb:102:37: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
      select 'Inherit From Product',
                                    ^
spec/system/admin/enterprise_fees_spec.rb:128:38: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
      select 'Weight (per kg or lb)',
                                     ^
spec/system/admin/enterprise_fees_spec.rb:132:37: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
      select 'Flat Rate (per item)',
                                    ^
spec/system/admin/enterprise_fees_spec.rb:153:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body beginning.
spec/system/admin/enterprise_fees_spec.rb:153:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
spec/system/admin/enterprise_fees_spec.rb:157:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
spec/system/admin/enterprise_fees_spec.rb:159:38: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
      select 'Flat Rate (per order)',
                                     ^
spec/system/admin/enterprise_fees_spec.rb:222:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
spec/system/admin/flatpickr_spec.rb:22:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
spec/system/admin/flatpickr_spec.rb:27:32: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
      find("#admin-menu").click
                               ^^^^^^^
spec/system/admin/flatpickr_spec.rb:32:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
spec/system/admin/flatpickr_spec.rb:34:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
spec/system/admin/flatpickr_spec.rb:41:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
spec/system/admin/order_cycles/complex_editing_spec.rb:74:33: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
    expect(page).to have_select(
                                ^
spec/system/admin/order_cycles/complex_editing_spec.rb:110:33: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
    expect(page).to have_select(
                                ^
spec/system/admin/order_cycles/list_spec.rb:147:46: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
          expect(find('input.datetimepicker',
                                             ^
spec/system/admin/order_cycles/list_spec.rb:160:46: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
          expect(find('input.datetimepicker',
                                             ^
spec/system/admin/order_cycles/list_spec.rb:188:46: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
          expect(find('input.datetimepicker',
                                             ^
spec/system/admin/order_cycles/simple_spec.rb:447:43: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
        expect(page).not_to have_selector(
                                          ^
spec/system/admin/order_spec.rb:92:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
spec/system/admin/order_spec.rb:207:30: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
          within(".modal") do
                             ^
spec/system/admin/order_spec.rb:235:21: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
      login_as_admin
                    ^^
spec/system/admin/order_spec.rb:240:16: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
      before do
               ^
spec/system/admin/order_spec.rb:247:62: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
    context "when using the cancel option in the dropdown" do
                                                             ^^
spec/system/admin/order_spec.rb:248:16: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
      before do
               ^
spec/system/admin/order_spec.rb:299:53: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
        expect(page).to have_content "Are you sure?"
                                                    ^^^^^^^^
spec/system/admin/order_spec.rb:327:36: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
        find("a.delete-item").click
                                   ^
spec/system/admin/order_spec.rb:401:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
spec/system/admin/order_spec.rb:405:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
spec/system/admin/order_spec.rb:598:59: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
          expect(page).to have_link "Resend Confirmation",
                                                          ^
spec/system/admin/order_spec.rb:617:52: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
          expect(page).to have_link "Cancel Order",
                                                   ^
spec/system/admin/order_spec.rb:633:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
spec/system/admin/order_spec.rb:635:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body beginning.
spec/system/admin/order_spec.rb:635:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
spec/system/admin/order_spec.rb:674:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
spec/system/admin/order_spec.rb:735:35: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
          within "#order-total" do
                                  ^
spec/system/admin/order_spec.rb:762:39: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
              within "#order-total" do
                                      ^
spec/system/admin/order_spec.rb:778:41: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
                within "#order-total" do
                                        ^
spec/system/admin/order_spec.rb:780:20: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
                end
                   ^^
spec/system/admin/order_spec.rb:796:39: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
              within "#order-total" do
                                      ^
spec/system/admin/order_spec.rb:807:88: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
                # Since the order is completed, the price is not supposed to be updated
                                                                                       ^
spec/system/admin/order_spec.rb:813:41: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
                within "#order-total" do
                                        ^
spec/system/admin/order_spec.rb:815:20: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
                end
                   ^^
spec/system/admin/order_spec.rb:924:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
spec/system/admin/order_spec.rb:959:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
spec/system/admin/order_spec.rb:981:16: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
      before do
               ^^
spec/system/admin/order_spec.rb:992:8: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
    end
       ^^
spec/system/admin/order_spec.rb:1002:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
spec/system/admin/shipping_methods_spec.rb:50:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
spec/system/admin/shipping_methods_spec.rb:92:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.

1479 files inspected, 81 offenses detected, 81 offenses corrected
2023-07-27 09:58:33 +10:00
Neal Chambers
e0206a0be6 Safely autocorrect Layout/TrailingEmptyLines
Inspecting 1479 files
..C....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Offenses:

Rakefile:10:1: C: [Corrected] Layout/TrailingEmptyLines: 1 trailing blank lines detected.

1479 files inspected, 1 offense detected, 1 offense corrected
2023-07-27 09:58:33 +10:00
Neal Chambers
2dbaa7f89d Safely autocorrect Layout/MultilineMethodCallIndentation
Inspecting 1479 files
............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C.......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C.......CC......................C..................................................

Offenses:

spec/controllers/api/v0/orders_controller_spec.rb:150:13: C: [Corrected] Layout/MultilineMethodCallIndentation: Use 2 (not 0) spaces for indenting an expression spanning multiple lines.
            .map{ |o| o["id"] }
            ^^^^
spec/system/admin/order_cycles/complex_editing_spec.rb:30:9: C: [Corrected] Layout/MultilineMethodCallIndentation: Use 2 (not 4) spaces for indenting an expression spanning multiple lines.
        .to eq(oc.orders_open_at.strftime("%Y-%m-%d %H:%M"))
        ^^^
spec/system/admin/order_cycles/complex_editing_spec.rb:32:9: C: [Corrected] Layout/MultilineMethodCallIndentation: Use 2 (not 4) spaces for indenting an expression spanning multiple lines.
        .to eq(oc.orders_close_at.strftime("%Y-%m-%d %H:%M"))
        ^^^
spec/system/admin/overview_spec.rb:16:62: C: [Corrected] Layout/MultilineMethodCallIndentation: Use 2 (not 55) spaces for indenting an expression spanning multiple lines.
                                                             .and_return @enterprise_user
                                                             ^^^^^^^^^^^
spec/system/admin/payment_method_spec.rb:62:22: C: [Corrected] Layout/MultilineMethodCallIndentation: Use 2 (not 13) spaces for indenting an expression spanning multiple lines.
                     .to_return(body: JSON.generate(stripe_account_mock))
                     ^^^^^^^^^^
spec/system/admin/variant_overrides_spec.rb:214:64: C: [Corrected] Layout/MultilineMethodCallIndentation: Use 2 (not 51) spaces for indenting an expression spanning multiple lines.
                                                               .and_return(build(:user))
                                                               ^^^^^^^^^^^

1479 files inspected, 6 offenses detected, 6 offenses corrected
2023-07-27 09:58:33 +10:00
Neal Chambers
164385ad13 Safely autocorrect Layout/MultilineMethodCallBraceLayout
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
2023-07-27 09:58:33 +10:00
Neal Chambers
a97e208881 Safely autocorrect Layout/MultilineBlockLayout
Inspecting 1479 files
....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Offenses:

engines/order_management/app/services/order_management/subscriptions/validator.rb:101:9: C: [Corrected] Layout/IndentationWidth: Use 2 (not 12) spaces for indentation.
                    sli.quantity > 0 && !sli.marked_for_destruction?
        ^^^^^^^^^^^^
engines/order_management/app/services/order_management/subscriptions/validator.rb:101:11: C: [Corrected] Layout/MultilineBlockLayout: Block argument expression is not on the same line as the block start.
          |sli| sli.quantity > 0 && !sli.marked_for_destruction?
          ^^^^^

1479 files inspected, 2 offenses detected, 2 offenses corrected
2023-07-27 09:58:05 +10:00
Maikel Linke
f7d5217ef6 Compile JS before testing caching
That avoids flakiness.
2023-07-27 09:40:08 +10:00
Neal Chambers
ffda639629 Regenerate Rubocop's TODO file 2023-07-27 08:35:27 +09:00
Maikel
f9589b8b23 Merge pull request #11280 from filipefurtad0/fix_flaky_caching_spec
Comments out flaky caching example
2023-07-27 08:50:06 +10:00
Maikel
5e94c038dc Merge pull request #11227 from filipefurtad0/update_several_enterprise_fees
Updates spec to cover #11150 (regression spec)
2023-07-27 08:45:27 +10:00
Maikel
16d28ab797 Merge pull request #11277 from mkllnk/greek
Add greek locale
2023-07-27 08:38:51 +10:00
filipefurtad0
5ed9583048 Rubocop fixes - not seen locally
Not sure why these were triggered remotly, but not locally - even after making sure I'm up-to-date with master?
2023-07-26 18:35:12 +01:00
filipefurtad0
f7301b72aa Adds test case for updating multiple fees
Adds values, updates and asserts these are saved correctly
2023-07-26 18:35:09 +01:00
filipefurtad0
83f1266b8a Comments out flaky example
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
2023-07-26 12:05:06 +01:00
jibees
f5564a5947 Merge pull request #11279 from openfoodfoundation/dependabot/bundler/rubocop-1.55.0
chore(deps-dev): bump rubocop from 1.54.2 to 1.55.0
2023-07-26 12:56:01 +02:00
filipefurtad0
d4d8941117 Reverts #11019
As discussed here (https://github.com/openfoodfoundation/openfoodnetwork/issues/11010#issuecomment-1594153860), reset_spree_preferences already does Rails.cache.clear
2023-07-26 11:49:41 +01:00
dependabot[bot]
45edda9bf6 chore(deps-dev): bump rubocop from 1.54.2 to 1.55.0
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.54.2 to 1.55.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.54.2...v1.55.0)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-26 08:43:15 +00:00
jibees
ad7ec1e6d0 Merge pull request #11271 from openfoodfoundation/dependabot/bundler/aws-sdk-s3-1.132.0
chore(deps): bump aws-sdk-s3 from 1.131.0 to 1.132.0
2023-07-26 10:41:38 +02:00
jibees
b9871933e3 Merge pull request #11272 from openfoodfoundation/dependabot/bundler/view_component-3.5.0
chore(deps): bump view_component from 3.4.0 to 3.5.0
2023-07-26 10:40:55 +02:00
Maikel Linke
627e689757 Fix swagger-api integration after last update
See also:

* https://github.com/rswag/rswag/pull/668
2023-07-26 15:52:48 +10:00
Maikel Linke
cea44c1a78 Add greek locale 2023-07-26 14:45:35 +10:00
jibees
a832562d1f Merge pull request #11198 from dacook/admin_v3-table-tweaks
🚧 Products v3: table and menu tweaks
2023-07-25 16:00:24 +02:00
David Cook
8ef73906db Show products_v3 in the submenu
It's not translated, but that doesn't matter, it's just a shortcut while we're developing it.
2023-07-25 15:31:57 +02:00
David Cook
439c0a8e18 Remove unnecessary match_path options
Spree::Tab already knows when to highlight these, based on the controller name. It even handles sub-paths like '/admin/products/garlic/edit'.
2023-07-25 15:31:57 +02:00
David Cook
ea93800ee6 [table] Tax category: display None instead of blank 2023-07-25 15:31:57 +02:00
David Cook
51189a3138 [table] Hide properties for variant row
These were a duplicate of the product.
2023-07-25 15:31:57 +02:00
jibees
605cb730f7 Merge pull request #11163 from jibees/productsV3-searching-filtering-pagination
🚧 Products v3: viewing, searching,  filtering & pagination
2023-07-25 15:22:42 +02:00
Jean-Baptiste Bellet
352cf2ff71 Import typography.scss for admin_v3
And do not apply `a` style to `.button` element.

ie.
```
a:not(.button)
```
2023-07-25 14:29:00 +02:00
dependabot[bot]
e816629038 chore(deps): bump view_component from 3.4.0 to 3.5.0
Bumps [view_component](https://github.com/viewcomponent/view_component) from 3.4.0 to 3.5.0.
- [Release notes](https://github.com/viewcomponent/view_component/releases)
- [Changelog](https://github.com/ViewComponent/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/viewcomponent/view_component/compare/v3.4.0...v3.5.0)

---
updated-dependencies:
- dependency-name: view_component
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-25 10:10:33 +00:00
dependabot[bot]
789fde3c89 chore(deps): bump aws-sdk-s3 from 1.131.0 to 1.132.0
Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.131.0 to 1.132.0.
- [Release notes](https://github.com/aws/aws-sdk-ruby/releases)
- [Changelog](https://github.com/aws/aws-sdk-ruby/blob/version-3/gems/aws-sdk-s3/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-ruby/commits)

---
updated-dependencies:
- dependency-name: aws-sdk-s3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-25 10:03:30 +00:00
filipefurtad0
04f83fbcce Finally, update system test for an end-to-end testing 2023-07-25 10:57:27 +02:00
Jean-Baptiste Bellet
d22566aa50 Set visible to only_through_links on enterprise creation 2023-07-25 10:57:27 +02:00
Jean-Baptiste Bellet
5a0d4d2a93 Set visible to only_through_links on enterprise registration 2023-07-25 10:57:26 +02:00
Jean-Baptiste Bellet
7aed068bb7 Enterprises.visible attribute is set to only_through_links by default
+ update enterprise_factory.rb to create "public" enterprise through specs via its factory
2023-07-25 10:57:26 +02:00
Jean-Baptiste Bellet
2a81a9acfb Add ability for non super-admin user to see products_v3 page 2023-07-25 09:20:25 +02:00
jibees
6f83d5b316 Merge pull request #11264 from openfoodfoundation/dependabot/bundler/knapsack_pro-5.3.3
chore(deps-dev): bump knapsack_pro from 5.3.2 to 5.3.3
2023-07-24 15:19:57 +02:00
jibees
af086253de Merge pull request #11265 from openfoodfoundation/dependabot/npm_and_yarn/jasmine-core-5.1.0
chore(deps-dev): bump jasmine-core from 5.0.1 to 5.1.0
2023-07-24 15:11:45 +02:00
Filipe
8ff877b865 Merge pull request #11258 from openfoodfoundation/dependabot/bundler/aws-sdk-s3-1.131.0
chore(deps): bump aws-sdk-s3 from 1.126.0 to 1.131.0
2023-07-24 13:30:42 +01:00
Filipe
1e2fb077cd Merge pull request #11261 from macanudo527/fix_rubocop_layout_1
Fix Rubocop Layout violations - 2
2023-07-24 13:05:46 +01:00
dependabot[bot]
f5c326f1b0 chore(deps-dev): bump jasmine-core from 5.0.1 to 5.1.0
Bumps [jasmine-core](https://github.com/jasmine/jasmine) from 5.0.1 to 5.1.0.
- [Release notes](https://github.com/jasmine/jasmine/releases)
- [Changelog](https://github.com/jasmine/jasmine/blob/main/RELEASE.md)
- [Commits](https://github.com/jasmine/jasmine/compare/v5.0.1...v5.1.0)

---
updated-dependencies:
- dependency-name: jasmine-core
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-24 09:36:51 +00:00
dependabot[bot]
bf010d273a chore(deps-dev): bump knapsack_pro from 5.3.2 to 5.3.3
Bumps [knapsack_pro](https://github.com/KnapsackPro/knapsack_pro-ruby) from 5.3.2 to 5.3.3.
- [Changelog](https://github.com/KnapsackPro/knapsack_pro-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v5.3.2...v5.3.3)

---
updated-dependencies:
- dependency-name: knapsack_pro
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-24 09:17:36 +00:00
Maikel Linke
f36ca77f5f Ease reading with related spec values on one line 2023-07-24 13:31:09 +10:00
Maikel Linke
a677444a97 Fix specs with missign parenthesis 2023-07-24 13:23:54 +10:00
Neal Chambers
bede52bdae Safely autocorrect Layout/LineLength
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
2023-07-24 09:14:13 +09:00
Neal Chambers
e546a6b583 Safely autocorrect Layout/LineContinuationSpacing
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
2023-07-24 09:14:13 +09:00
Neal Chambers
948b287fd6 Safely autocorrect Layout/LeadingCommentSpace
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
2023-07-24 09:14:13 +09:00
Neal Chambers
9155614501 Safely autocorrect Layout/IndentationConsistency
Inspecting 1478 files
.....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C.C.......C......................................................................

Offenses:

spec/system/admin/order_cycles/complex_updating_specific_time_spec.rb:84:7: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
      "#order_cycle_incoming_exchange_1_variants_#{initial_variants.last.id}"
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/order_cycles/simple_spec.rb:784:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
        "order_cycle_selected_distributor_payment_method_ids_#{distributor_payment_method_id}"
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/order_cycles/simple_spec.rb:791:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
        "order_cycle_selected_distributor_shipping_method_ids_#{distributor_shipping_method_id}"
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/product_import_spec.rb:818:15: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
              I18n.t("admin.product_import.product_headings.#{heading}").upcase
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1478 files inspected, 4 offenses detected, 4 offenses corrected
2023-07-24 09:14:13 +09:00
Neal Chambers
dce02160d4 Safely autocorrect Layout/HashAlignment
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
2023-07-24 09:14:13 +09:00
Filipe
8bd25f9711 Merge pull request #11251 from jibees/11207-update-all-products-report-to-include-stock
Admin, Products & Inventory reports: add `on_hand` and `on_demand?` columns by default ; mark `Inventory (on hand)` report as deprecated
2023-07-21 17:07:00 +01:00
Filipe
0d0beda887 Merge pull request #11084 from abdellani/update_invoice_status_automatically
set invoice status automatically after creation
2023-07-21 16:21:05 +01:00
jibees
5142efc86e Merge pull request #11257 from openfoodfoundation/dependabot/bundler/knapsack_pro-5.3.2
chore(deps-dev): bump knapsack_pro from 5.3.1 to 5.3.2
2023-07-21 14:36:46 +02:00
dependabot[bot]
df633f7855 chore(deps): bump aws-sdk-s3 from 1.126.0 to 1.131.0
Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.126.0 to 1.131.0.
- [Release notes](https://github.com/aws/aws-sdk-ruby/releases)
- [Changelog](https://github.com/aws/aws-sdk-ruby/blob/version-3/gems/aws-sdk-s3/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-ruby/commits)

---
updated-dependencies:
- dependency-name: aws-sdk-s3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-21 09:17:05 +00:00
dependabot[bot]
44551766c5 chore(deps-dev): bump knapsack_pro from 5.3.1 to 5.3.2
Bumps [knapsack_pro](https://github.com/KnapsackPro/knapsack_pro-ruby) from 5.3.1 to 5.3.2.
- [Changelog](https://github.com/KnapsackPro/knapsack_pro-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v5.3.1...v5.3.2)

---
updated-dependencies:
- dependency-name: knapsack_pro
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-21 09:15:41 +00:00
jibees
6ddb3cd644 Merge pull request #11252 from filipefurtad0/invoices_missing_translations
Adds missing key
2023-07-21 10:42:35 +02:00
Jean-Baptiste Bellet
a094a89c09 Mark "Inventory (on hand)" report as deprecated
Co-Authored-By: Maikel <maikel@email.org.au>, @dacook
2023-07-21 09:27:07 +02:00
Jean-Baptiste Bellet
28fe479f53 Unhide on_demand & on_hand columns by default
+ update specs as well
2023-07-21 09:27:07 +02:00
David Cook
b464e51ba4 Merge pull request #11246 from mkllnk/engine-ruby-version
Add Ruby version to engines for Rubocop
2023-07-21 15:03:01 +10:00
Maikel Linke
54f39668ba Remove unused, outdated dependency declarations
The Gemfile of the main app is used.
2023-07-21 14:13:27 +10:00
Maikel Linke
a01aa8849c Add Ruby version to engines for Rubocop
> This ensures that RuboCop is using the same Ruby version as the gem.

https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Gemspec/RequiredRubyVersion
2023-07-21 14:13:26 +10:00
Maikel
022225581f Merge pull request #11249 from openfoodfoundation/dependabot/bundler/bugsnag-6.26.0
chore(deps): bump bugsnag from 6.25.2 to 6.26.0
2023-07-21 09:58:56 +10:00
Maikel
5c8939fb69 Merge pull request #11248 from openfoodfoundation/dependabot/bundler/knapsack_pro-5.3.1
chore(deps-dev): bump knapsack_pro from 5.3.0 to 5.3.1
2023-07-21 09:58:07 +10:00
Maikel
9ba9519622 Merge pull request #11241 from dacook/rubocop-layout-1
Fix Rubocop Layout violations - 1
2023-07-21 09:57:12 +10:00
filipefurtad0
4b64b9085c Adds missing keys 2023-07-20 19:18:27 +01:00
Filipe
6199d2c957 Merge pull request #11218 from openfoodfoundation/dependabot/bundler/stripe-8.6.0
chore(deps): bump stripe from 8.5.0 to 8.6.0
2023-07-20 12:56:42 +01:00
dependabot[bot]
a0cc07dc35 chore(deps): bump bugsnag from 6.25.2 to 6.26.0
Bumps [bugsnag](https://github.com/bugsnag/bugsnag-ruby) from 6.25.2 to 6.26.0.
- [Release notes](https://github.com/bugsnag/bugsnag-ruby/releases)
- [Changelog](https://github.com/bugsnag/bugsnag-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bugsnag/bugsnag-ruby/commits)

---
updated-dependencies:
- dependency-name: bugsnag
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-20 09:41:23 +00:00
dependabot[bot]
afd854d32a chore(deps-dev): bump knapsack_pro from 5.3.0 to 5.3.1
Bumps [knapsack_pro](https://github.com/KnapsackPro/knapsack_pro-ruby) from 5.3.0 to 5.3.1.
- [Changelog](https://github.com/KnapsackPro/knapsack_pro-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v5.3.0...v5.3.1)

---
updated-dependencies:
- dependency-name: knapsack_pro
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-20 09:39:40 +00:00
David Cook
c112fad4b2 Update all locales with the latest Transifex translations 2023-07-20 14:11:16 +10:00
David Cook
19ee2b50c2 Safely autocorrect Layout/FirstHashElementIndentation
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
2023-07-20 14:05:16 +10:00
David Cook
aa124511de Safely autocorrect Layout/FirstArgumentIndentation
Inspecting 1478 files
..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C...........................................................................

Offenses:

spec/system/admin/orders_spec.rb:485:11: C: [Corrected] Layout/FirstArgumentIndentation: Indent the first argument one step more than page.find(.
          "#listing_orders tbody tr td:first-child input[type=checkbox]")
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/orders_spec.rb:493:11: C: [Corrected] Layout/FirstArgumentIndentation: Indent the first argument one step more than page.find(.
          "#listing_orders tbody tr td:first-child input[type=checkbox]")
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1478 files inspected, 2 offenses detected, 2 offenses corrected
2023-07-20 14:03:31 +10:00
David Cook
6859200339 Safely autocorrect Layout/ExtraSpacing
Inspecting 1478 files
................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C.......................................................................................................................................................................................................................C......................................................................................................................................................................................................C......................

Offenses:

spec/lib/open_food_network/property_merge_spec.rb:22:57: C: [Corrected] Layout/ExtraSpacing: Unnecessary spacing detected.
      let(:product_property) { create(:product_property,  property: property) }
                                                        ^
spec/services/cart_service_spec.rb:276:58: C: [Corrected] Layout/ExtraSpacing: Unnecessary spacing detected.
        cart_service.instance_variable_set :@order_cycle,  double(:order_cycle)
                                                         ^
spec/system/consumer/shops_spec.rb:78:46: C: [Corrected] Layout/ExtraSpacing: Unnecessary spacing detected.
      expect(page).to have_no_selector 'hub',   text: d2.name
                                             ^^

1478 files inspected, 3 offenses detected, 3 offenses corrected
2023-07-20 14:01:44 +10:00
David Cook
bc330b69a5 Safely autocorrect Layout/EmptyLinesAroundBlockBody
Inspecting 1478 files
......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C...............................................................................

Offenses:

spec/system/admin/order_cycles/list_spec.rb:191:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body end.

1478 files inspected, 1 offense detected, 1 offense corrected
2023-07-20 13:59:53 +10:00
David Cook
6fa9165cc2 Safely autocorrect Layout/EmptyLines
Inspecting 1478 files
..............................................................................................................................................................................................................................................................................................................................................C.......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

Offenses:

app/models/spree/payment.rb:100:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected.

1478 files inspected, 1 offense detected, 1 offense corrected
2023-07-20 13:58:00 +10:00
David Cook
159a0d391c Safely autocorrect Layout/ClosingParenthesisIndentation
Inspecting 1478 files
..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C...........................................................................

Offenses:

spec/system/admin/orders_spec.rb:486:9: C: [Corrected] Layout/ClosingParenthesisIndentation: Align ) with (.
        ).to be_checked
        ^
spec/system/admin/orders_spec.rb:494:9: C: [Corrected] Layout/ClosingParenthesisIndentation: Align ) with (.
        ).to_not be_checked
        ^

1478 files inspected, 2 offenses detected, 2 offenses corrected
2023-07-20 13:56:13 +10:00
David Cook
0030343897 Safely autocorrect Layout/BlockEndNewline
Inspecting 1478 files
......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C...................................................................................................................................................................................................................................................................................................................................................................................C...........................................................................

Offenses:

spec/lib/open_food_network/enterprise_fee_calculator_spec.rb:127:1: C: [Corrected] Layout/IndentationWidth: Use 2 (not 10) spaces for indentation.
          create(:enterprise_fee, fee_type: 'packing', amount: 7.89, name: "Packing")
^^^^^^^^^^
spec/lib/open_food_network/enterprise_fee_calculator_spec.rb:127:3: C: [Corrected] Layout/IndentationWidth: Use 2 (not -6) spaces for indentation.
  create(:enterprise_fee, fee_type: 'packing', amount: 7.89, name: "Packing")
  ^^^^^^
spec/lib/open_food_network/enterprise_fee_calculator_spec.rb:127:87: C: [Corrected] Layout/BlockEndNewline: Expression at 127, 87 should be on its own line.
          create(:enterprise_fee, fee_type: 'packing', amount: 7.89, name: "Packing") }
                                                                                      ^
spec/lib/open_food_network/enterprise_fee_calculator_spec.rb:128:1: C: [Corrected] Layout/BlockAlignment: } at 128, 0 is not aligned with let!(:ef_packing) { at 126, 8.
}
^
spec/lib/open_food_network/enterprise_fee_calculator_spec.rb:129:91: C: [Corrected] Layout/BlockEndNewline: Expression at 129, 91 should be on its own line.
          create(:enterprise_fee, fee_type: 'transport', amount: 0.12, name: "Transport") }
                                                                                          ^
spec/lib/open_food_network/enterprise_fee_calculator_spec.rb:130:1: C: [Corrected] Layout/IndentationWidth: Use 2 (not 10) spaces for indentation.
          create(:enterprise_fee, fee_type: 'transport', amount: 0.12, name: "Transport")
^^^^^^^^^^
spec/lib/open_food_network/enterprise_fee_calculator_spec.rb:130:3: C: [Corrected] Layout/IndentationWidth: Use 2 (not -6) spaces for indentation.
  create(:enterprise_fee, fee_type: 'transport', amount: 0.12, name: "Transport")
  ^^^^^^
spec/lib/open_food_network/enterprise_fee_calculator_spec.rb:131:1: C: [Corrected] Layout/BlockAlignment: } at 131, 0 is not aligned with let!(:ef_transport) { at 129, 8.
}
^
spec/lib/open_food_network/enterprise_fee_calculator_spec.rb:131:95: C: [Corrected] Layout/BlockEndNewline: Expression at 131, 95 should be on its own line.
          create(:enterprise_fee, fee_type: 'fundraising', amount: 3.45, name: "Fundraising") }
                                                                                              ^
spec/lib/open_food_network/enterprise_fee_calculator_spec.rb:133:1: C: [Corrected] Layout/IndentationWidth: Use 2 (not 10) spaces for indentation.
          create(:enterprise_fee, fee_type: 'fundraising', amount: 3.45, name: "Fundraising")
^^^^^^^^^^
spec/lib/open_food_network/enterprise_fee_calculator_spec.rb:133:3: C: [Corrected] Layout/IndentationWidth: Use 2 (not -6) spaces for indentation.
  create(:enterprise_fee, fee_type: 'fundraising', amount: 3.45, name: "Fundraising")
  ^^^^^^
spec/lib/open_food_network/enterprise_fee_calculator_spec.rb:134:1: C: [Corrected] Layout/BlockAlignment: } at 134, 0 is not aligned with let!(:ef_fundraising) { at 132, 8.
}
^
spec/system/admin/orders_spec.rb:44:1: C: [Corrected] Layout/IndentationWidth: Use 2 (not 1) spaces for indentation.
 create(:shipping_method_with, :pickup, name: "delivery",
^
spec/system/admin/orders_spec.rb:44:3: C: [Corrected] Layout/IndentationWidth: Use 2 (not 0) spaces for indentation.
  create(:shipping_method_with, :pickup, name: "delivery",

spec/system/admin/orders_spec.rb:45:45: C: [Corrected] Layout/BlockEndNewline: Expression at 45, 45 should be on its own line.
distributors: [distributor4, distributor5]) }
                                            ^
spec/system/admin/orders_spec.rb:46:1: C: [Corrected] Layout/BlockAlignment: } at 46, 0 is not aligned with let!(:shipping_method2) { at 43, 2.
}
^

1478 files inspected, 16 offenses detected, 16 offenses corrected
2023-07-20 13:54:30 +10:00
David Cook
7cbe1d94ad Safely autocorrect Layout/BlockAlignment
Inspecting 1478 files
...................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C..................................................................................................................................................................................

Offenses:

spec/services/products_renderer_spec.rb:28:7: C: [Corrected] Layout/BlockAlignment: } at 28, 6 is not aligned with let!(:product_cherries) { at 25, 4.
      }
      ^

1478 files inspected, 1 offense detected, 1 offense corrected
2023-07-20 13:52:44 +10:00
David Cook
5a3a4a041f Safely autocorrect Layout/ArrayAlignment
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
2023-07-20 13:50:55 +10:00
David Cook
bcfa70af4e Safely autocorrect Layout/ArgumentAlignment
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
2023-07-20 13:48:51 +10:00
David Cook
bb728d97fd Regenerate Rubocop's TODO file 2023-07-20 13:46:52 +10:00
Maikel
fd05f41349 Merge pull request #11236 from filipefurtad0/BO_out_of_stock_warning
Adds assertion on the Out of Stock message
2023-07-20 10:19:41 +10:00
David Cook
cdffeea5cb Merge pull request #10966 from macanudo527/fix_linelength_bundle3
Fix Layout/LineLength - Bundle 3
2023-07-20 10:04:24 +10:00
Maikel
f82222d97c Merge pull request #11239 from filipefurtad0/missing_translation_on_invoices_tab
Fixes missing translation on Invoices tab
2023-07-20 08:42:36 +10:00
filipefurtad0
8f8e28f816 Fixes missing translation on Invoices tab
Adds invoices to en.yml, fixing #11237
2023-07-19 18:11:45 +01:00
filipefurtad0
537e225c84 Adds assertion on the Out of Stock message 2023-07-19 16:28:06 +01:00
jibees
49a192eacc Merge pull request #11231 from openfoodfoundation/dependabot/bundler/mini_portile2-2.8.4
chore(deps): bump mini_portile2 from 2.8.2 to 2.8.4
2023-07-19 15:13:50 +02:00
jibees
821e5226fa Merge pull request #11232 from openfoodfoundation/dependabot/bundler/knapsack_pro-5.3.0
chore(deps-dev): bump knapsack_pro from 5.2.0 to 5.3.0
2023-07-19 15:11:27 +02:00
Jean-Baptiste Bellet
5d4ef5b52c To test the search by category, we need to use set primary_taxon attr 2023-07-19 14:58:40 +02:00
Jean-Baptiste Bellet
bada2ef4a7 Remove useless spec (will be tested right after) 2023-07-19 14:58:40 +02:00
Jean-Baptiste Bellet
62eaf4a1a9 This spec is not flaky anymore 2023-07-19 14:58:40 +02:00
Jean-Baptiste Bellet
55cad3659f Simplify products creation 2023-07-19 14:58:40 +02:00
Jean-Baptiste Bellet
6f6de00919 Better naming of argument to not override existing variable... 2023-07-19 14:58:40 +02:00
Jean-Baptiste Bellet
3fab9714f5 Use a constant as the search_key 2023-07-19 14:58:40 +02:00
Jean-Baptiste Bellet
79421f2265 Expect to found the product 2023-07-19 14:58:40 +02:00
Jean-Baptiste Bellet
2697a637a9 Use the OpenFoodNetwork::Permissions helper
To retrieve only primary producers
2023-07-19 14:58:40 +02:00
jibees
3245f7ff99 Update app/reflexes/products_reflex.rb
Co-authored-by: David Cook <david@redcliffs.net>
2023-07-19 14:58:40 +02:00
Jean-Baptiste Bellet
b42dfb574b Delete already imported (and modified) file 2023-07-19 14:58:40 +02:00
Jean-Baptiste Bellet
90c6398197 Simplify and call methods directly via before_reflex 2023-07-19 14:58:40 +02:00
Jean-Baptiste Bellet
b3bdba3a9b Better use merge! instead of q = q.merge 2023-07-19 14:58:40 +02:00
Jean-Baptiste Bellet
755a1842c2 Simplify to save execution time 2023-07-19 14:58:40 +02:00
Jean-Baptiste Bellet
037589ecda Add columns translation 2023-07-19 14:58:40 +02:00
Jean-Baptiste Bellet
dec779a357 available_on column has been deleted
https://github.com/openfoodfoundation/openfoodnetwork/pull/11136
2023-07-19 14:58:39 +02:00
Jean-Baptiste Bellet
fac02c794c Search through more attributes than only name
Copy/paste from `app/assets/javascripts/darkswarm/controllers/products_controller.js.coffee`
2023-07-19 14:58:39 +02:00
Jean-Baptiste Bellet
010f19cb83 Create a medium height button, and adjust #sort row 2023-07-19 14:58:39 +02:00
Jean-Baptiste Bellet
c378ad1d88 Add "no results found" container 2023-07-19 14:58:39 +02:00
Jean-Baptiste Bellet
5a8a187f54 Add clear search button and action 2023-07-19 14:58:39 +02:00
Jean-Baptiste Bellet
904c7bfacf Buttons design
Remove already defined `$border-radius`

Defined `app/webpacker/css/admin/globals/variables.scss`

Adjust height
2023-07-19 14:58:39 +02:00
Jean-Baptiste Bellet
7b56cbf3d4 Add labels to selectors, and adjust css
+ Adjusting filter elements with flex-grow properties
2023-07-19 14:58:39 +02:00
Jean-Baptiste Bellet
333dc11fc1 Manage form params vs. URL params. And replace state with params.
"One needs to understand what the source of the params in a reflex is. And there are two sources:

the closest form
the url of the currently displayed page"

Source: https://github.com/stimulusreflex/stimulus_reflex/issues/290#issuecomment-683334963
2023-07-19 14:58:39 +02:00
Jean-Baptiste Bellet
bfe1884ab5 Can filter by categories 2023-07-19 14:58:39 +02:00
Jean-Baptiste Bellet
ef1702188f Extract filters from 'no products found' logic
We still want to display filters if no products found
2023-07-19 14:58:39 +02:00
Jean-Baptiste Bellet
f58cf2d3b2 Can filter by producer
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
2023-07-19 14:58:39 +02:00
Jean-Baptiste Bellet
ddfc60c85e Don't use events, but call the loading controller itself 2023-07-19 14:58:39 +02:00
Jean-Baptiste Bellet
762b777995 Design of the search button 2023-07-19 14:58:39 +02:00
Jean-Baptiste Bellet
51e139b6f1 Create first spec for the new products page
Modify comment, and contextualize search (inside search term)

Extract creation of products outside a before block
2023-07-19 14:58:39 +02:00
Jean-Baptiste Bellet
38d0af8ec0 Simplify: don't need to pass through the js controller
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
2023-07-19 14:58:39 +02:00
Jean-Baptiste Bellet
9d52f0b20a Loading spinner should be above content (filters, sort, ...) 2023-07-19 14:58:39 +02:00
Jean-Baptiste Bellet
643897abb2 Add search functionnality 2023-07-19 14:58:39 +02:00
Jean-Baptiste Bellet
c786f300ca Have a tiny url state management by using replace_state of cable_ready 2023-07-19 14:58:39 +02:00
Jean-Baptiste Bellet
0fd4d892d9 This is now unused: through the js controller only at startup 2023-07-19 14:58:39 +02:00
Jean-Baptiste Bellet
3da6e02192 Call pagination via perPage param: no state to manage, use param 2023-07-19 14:58:39 +02:00
Jean-Baptiste Bellet
61d1f30e04 Rename productsV3 to products: avoid upper|lower case issues
This is causing some issues, misunderstandings around case.

Therefore, directly use the Reflex, and lifecycle methods `beforeFetch` and `afterFetch` are called, even if we use the Reflex (and not the js controller methods). This is pretty handy.

+ adds some id to pagination element (https://docs.stimulusreflex.com/guide/reflexes.html#declaring-a-reflex-in-html-with-data-attributes)

Global documentation: https://docs.stimulusreflex.com/guide/reflexes.html
2023-07-19 14:58:39 +02:00
Jean-Baptiste Bellet
574adb88d2 Add a per page component
This is still a WIP.
2023-07-19 14:58:39 +02:00
Jean-Baptiste Bellet
0b83dc088d Separation of concerns: use a loading controller
Two different events can be used: `show-loading` and `hide-loading`.

I'm not 100% sure this is the right way to go, but let's try!
2023-07-19 14:58:39 +02:00
Jean-Baptiste Bellet
5aebbe4102 use beforeFetch and afterFetch lifecycle methods
+ 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...
2023-07-19 14:58:39 +02:00
Jean-Baptiste Bellet
3b61508652 Be more specific to only apply to the first container, ie. the root one
+ Override default position (relative) in order to have loading above
2023-07-19 14:58:39 +02:00
Jean-Baptiste Bellet
47f21cb59e Add pagination with pagy
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
2023-07-19 14:58:39 +02:00
Jean-Baptiste Bellet
69cff85577 Change color to EFF1F2 2023-07-19 14:58:39 +02:00
Jean-Baptiste Bellet
9b92c25879 Add a section for specific rules for both admin-menu and sub-menu
+ change height for border bottom on selected/hovered menu
2023-07-19 14:58:39 +02:00
Jean-Baptiste Bellet
9762819aa8 Use the right color 2023-07-19 14:58:39 +02:00
Jean-Baptiste Bellet
1f3d41972f Add same padding than #admin-menu,#sub-menu li a in order to align
content (header, navigation, content) on both left and right
2023-07-19 14:58:39 +02:00
Jean-Baptiste Bellet
2892301336 Factorize menu and submenu into same definition
as they are the same, expect the font-size
2023-07-19 14:58:39 +02:00
Jean-Baptiste Bellet
24c045a09c Reduce padding 2023-07-19 14:58:39 +02:00
Jean-Baptiste Bellet
a8088ae231 Create a pseudo element to add a line under the menu item
- Increase top menu underline height to 3px
 - reduce underline width to same width of label
2023-07-19 14:58:39 +02:00
Konrad
d99ac35824 Merge pull request #11105 from jibees/11098-summary-step-order-details-line-break-on-currency-symbol-and-lettering
Checkout summary: avoid carriage return on price
2023-07-19 13:00:08 +02:00
Filipe
91e2e447c0 Merge pull request #11175 from jibees/11171-checkout-step-3-delivery-details-are-showing-bill-address-instead-of-delivery-address
Checkout, Summary step: Display the ship/delivery address (instead of the billing one)
2023-07-19 11:36:19 +01:00
Filipe
843bcaa500 Merge pull request #11184 from rioug/11183-fix-delete-voucher-tax-excl-price
[vouchers] fix delete voucher when tax excluded from price
2023-07-19 11:24:25 +01:00
dependabot[bot]
314c02a92b chore(deps-dev): bump knapsack_pro from 5.2.0 to 5.3.0
Bumps [knapsack_pro](https://github.com/KnapsackPro/knapsack_pro-ruby) from 5.2.0 to 5.3.0.
- [Changelog](https://github.com/KnapsackPro/knapsack_pro-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v5.2.0...v5.3.0)

---
updated-dependencies:
- dependency-name: knapsack_pro
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-19 09:31:24 +00:00
dependabot[bot]
6c323c82d5 chore(deps): bump mini_portile2 from 2.8.2 to 2.8.4
Bumps [mini_portile2](https://github.com/flavorjones/mini_portile) from 2.8.2 to 2.8.4.
- [Release notes](https://github.com/flavorjones/mini_portile/releases)
- [Changelog](https://github.com/flavorjones/mini_portile/blob/main/CHANGELOG.md)
- [Commits](https://github.com/flavorjones/mini_portile/compare/v2.8.2...v2.8.4)

---
updated-dependencies:
- dependency-name: mini_portile2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-19 09:27:32 +00:00
jibees
8475a31ebb Merge pull request #11228 from openfoodfoundation/dependabot/npm_and_yarn/word-wrap-1.2.4
chore(deps): bump word-wrap from 1.2.3 to 1.2.4
2023-07-19 08:51:34 +02:00
dependabot[bot]
dd7e6d1a19 chore(deps): bump word-wrap from 1.2.3 to 1.2.4
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-19 02:14:43 +00:00
Neal Chambers
c1095c3616 Update .rubocop_todo.yml 2023-07-19 08:43:36 +09:00
Neal Chambers
728926cc9a Fix Layout/LineLength 2023-07-19 08:39:26 +09:00
Filipe
40db81f056 Merge pull request #11150 from macanudo527/fix_admin_class_size
Fix Metrics/ClassSize
2023-07-18 19:10:03 +01:00
Filipe
15282f9738 Merge pull request #11115 from abdellani/fix-enterprise-users-should-have-access-to-invoices
authorize enterprise users to access invoices page
2023-07-18 16:42:00 +01:00
jibees
11b2d911d2 Merge pull request #11217 from openfoodfoundation/dependabot/bundler/rubocop-1.54.2
chore(deps-dev): bump rubocop from 1.54.1 to 1.54.2
2023-07-18 17:31:17 +02:00
jibees
bbdeb0c9ab Merge pull request #11213 from openfoodfoundation/dependabot/bundler/rswag-specs-2.10.1
chore(deps-dev): bump rswag-specs from 2.9.0 to 2.10.1
2023-07-18 17:29:37 +02:00
jibees
4e29fcba64 Merge pull request #11210 from openfoodfoundation/dependabot/npm_and_yarn/floating-ui/dom-1.4.5
chore(deps): bump @floating-ui/dom from 1.4.4 to 1.4.5
2023-07-18 17:14:41 +02:00
dependabot[bot]
a975b78816 chore(deps-dev): bump rubocop from 1.54.1 to 1.54.2
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.54.1 to 1.54.2.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.54.1...v1.54.2)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-18 15:08:00 +00:00
dependabot[bot]
02b1c6dd2d chore(deps-dev): bump rswag-specs from 2.9.0 to 2.10.1
Bumps [rswag-specs](https://github.com/rswag/rswag) from 2.9.0 to 2.10.1.
- [Release notes](https://github.com/rswag/rswag/releases)
- [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rswag/rswag/compare/2.9.0...2.10.1)

---
updated-dependencies:
- dependency-name: rswag-specs
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-18 15:07:21 +00:00
jibees
af365c6b79 Merge pull request #11215 from openfoodfoundation/dependabot/bundler/rswag-api-2.10.1
chore(deps): bump rswag-api from 2.9.0 to 2.10.1
2023-07-18 17:06:07 +02:00
jibees
f054b74c7d Merge pull request #11216 from openfoodfoundation/dependabot/bundler/rswag-ui-2.10.1
chore(deps): bump rswag-ui from 2.9.0 to 2.10.1
2023-07-18 17:05:15 +02:00
Filipe
adc5692bc5 Merge pull request #11182 from filipefurtad0/profile_change_spec
Adds spec for profile change
2023-07-18 16:02:39 +01:00
jibees
1d03f7a009 Merge pull request #11224 from openfoodfoundation/dependabot/bundler/knapsack_pro-5.2.0
chore(deps-dev): bump knapsack_pro from 5.1.2 to 5.2.0
2023-07-18 16:30:45 +02:00
dependabot[bot]
74f8f9dd52 chore(deps): bump rswag-api from 2.9.0 to 2.10.1
Bumps [rswag-api](https://github.com/rswag/rswag) from 2.9.0 to 2.10.1.
- [Release notes](https://github.com/rswag/rswag/releases)
- [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rswag/rswag/compare/2.9.0...2.10.1)

---
updated-dependencies:
- dependency-name: rswag-api
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-18 14:28:58 +00:00
dependabot[bot]
dae690ae5c chore(deps): bump rswag-ui from 2.9.0 to 2.10.1
Bumps [rswag-ui](https://github.com/rswag/rswag) from 2.9.0 to 2.10.1.
- [Release notes](https://github.com/rswag/rswag/releases)
- [Changelog](https://github.com/rswag/rswag/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rswag/rswag/compare/2.9.0...2.10.1)

---
updated-dependencies:
- dependency-name: rswag-ui
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-18 14:28:55 +00:00
dependabot[bot]
53b1188a43 chore(deps): bump @floating-ui/dom from 1.4.4 to 1.4.5
Bumps [@floating-ui/dom](https://github.com/floating-ui/floating-ui/tree/HEAD/packages/dom) from 1.4.4 to 1.4.5.
- [Release notes](https://github.com/floating-ui/floating-ui/releases)
- [Commits](https://github.com/floating-ui/floating-ui/commits/@floating-ui/dom@1.4.5/packages/dom)

---
updated-dependencies:
- dependency-name: "@floating-ui/dom"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-18 14:28:47 +00:00
dependabot[bot]
6c02e1c05d chore(deps-dev): bump knapsack_pro from 5.1.2 to 5.2.0
Bumps [knapsack_pro](https://github.com/KnapsackPro/knapsack_pro-ruby) from 5.1.2 to 5.2.0.
- [Changelog](https://github.com/KnapsackPro/knapsack_pro-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v5.1.2...v5.2.0)

---
updated-dependencies:
- dependency-name: knapsack_pro
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-18 09:18:55 +00:00
David Cook
46b27b2d9d Number release steps
There are three distinct parts to the process, so I thought it worth giving them an identifying number.
2023-07-18 09:34:28 +10:00
Neal Chambers
8fc0a20249 Add Additional Test for Model Creation 2023-07-18 08:17:34 +09:00
Neal Chambers
ba862bc4b7 Add tests for Enterprise Fees Bulk Update 2023-07-18 08:17:34 +09:00
Neal Chambers
186d7a2f54 Move and Rename BulkUpdateForm 2023-07-18 08:17:34 +09:00
David Cook
9b16c1171f Remove redundant returns
The return value of active record validations doesn't actually do anything. A record is 'valid?' if @errors is empty.
2023-07-18 08:17:34 +09:00
Neal Chambers
521af70959 Add Strong Params to Enterprise Fees Form 2023-07-18 08:17:34 +09:00
Neal Chambers
9e17b80ea9 Update .rubocop_todo.yml 2023-07-18 08:17:34 +09:00
Neal Chambers
fb1ae855c2 Fix Metrics/ClassLength 2023-07-18 08:17:34 +09:00
filipefurtad0
e14bc5e642 Adds comments on producer_profile_only attribute
Fixing typo
2023-07-17 15:06:02 +01:00
filipefurtad0
16477cad51 Adds spec for profile change (2)
via enterprises path
2023-07-17 15:06:02 +01:00
filipefurtad0
e0be25f927 Adds spec for profile change
via admin path
2023-07-17 15:06:02 +01:00
Jean-Baptiste Bellet
1cf647e04b Avoid line-break by wrapping into nowrap element 2023-07-17 14:00:48 +02:00
Jean-Baptiste Bellet
776b9adc72 Display shipping address in summary step, instead of the billing one
+ update specs accordingly
2023-07-17 09:37:05 +02:00
Jean-Baptiste Bellet
f177258444 Randomize also city and zipcode for randomized address 2023-07-17 09:33:29 +02:00
filipefurtad0
bfb2fc528e Update all locales with the latest Transifex translations 2023-07-14 17:37:22 +01:00
dependabot[bot]
654601f4b2 chore(deps): bump stripe from 8.5.0 to 8.6.0
Bumps [stripe](https://github.com/stripe/stripe-ruby) from 8.5.0 to 8.6.0.
- [Release notes](https://github.com/stripe/stripe-ruby/releases)
- [Changelog](https://github.com/stripe/stripe-ruby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/stripe/stripe-ruby/compare/v8.5.0...v8.6.0)

---
updated-dependencies:
- dependency-name: stripe
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-14 09:09:19 +00:00
Gaetan Craig-Riou
dc711bde78 Fix voucher adjustment delete
When using a voucher with tax not incluced in price, we need to delete
both the voucher adjustment and the tax adjustment
2023-07-14 13:37:45 +10:00
Konrad
bddc10626b Merge pull request #11148 from cillian/fix-duplicate-rows-in-customer-addresses-report
Don't return duplicate rows in the customer addresses report
2023-07-13 20:32:01 +02:00
Filipe
9e0aa1854f Merge pull request #11159 from abdellani/remove-split-checkout-from-feature_toggle
Remove split checkout from feature toggle
2023-07-13 17:20:18 +01:00
Filipe
308ce9263d Merge pull request #11170 from jibees/11160-bulk-actions-function-not-working-on-safari-mac-browser
Admin, Orders: Make bulk actions dropdown re-enabled for Safari browser
2023-07-13 17:17:18 +01:00
Filipe
2f8a056bee Merge pull request #11187 from jibees/10975-white-label-remember-custom-tab-activation-after-error-message
Admin, White Label: check the custom tab checkbox if any errors on custom tab (ie. title is blank)
2023-07-13 16:43:18 +01:00
Filipe
60c75097d3 Merge pull request #11145 from mkllnk/dfc-create-response
DFC API return SuppliedProduct after creation
2023-07-13 16:15:22 +01:00
Filipe
448d5ea017 Merge pull request #11135 from Matt-Yorkley/vouchers
Vouchers part 2
2023-07-13 12:50:32 +01:00
jibees
9f86218a83 Merge pull request #11202 from openfoodfoundation/dependabot/bundler/view_component-3.4.0
chore(deps): bump view_component from 3.3.0 to 3.4.0
2023-07-12 16:00:48 +02:00
dependabot[bot]
e03ffa0405 chore(deps): bump view_component from 3.3.0 to 3.4.0
Bumps [view_component](https://github.com/viewcomponent/view_component) from 3.3.0 to 3.4.0.
- [Release notes](https://github.com/viewcomponent/view_component/releases)
- [Changelog](https://github.com/ViewComponent/view_component/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/viewcomponent/view_component/compare/v3.3.0...v3.4.0)

---
updated-dependencies:
- dependency-name: view_component
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-12 09:25:11 +00:00
jibees
f22b8db462 Merge pull request #11191 from openfoodfoundation/dependabot/npm_and_yarn/semver-5.7.2
chore(deps): bump semver from 5.7.1 to 5.7.2
2023-07-11 17:38:28 +02:00
dependabot[bot]
90ad6ce19d chore(deps): bump semver from 5.7.1 to 5.7.2
Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v5.7.1...v5.7.2)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-11 09:43:07 +00:00
Matt-Yorkley
4884a8c368 Merge pull request #11179 from openfoodfoundation/dependabot/npm_and_yarn/cable_ready-5.0.1
chore(deps): bump cable_ready from 5.0.0 to 5.0.1
2023-07-11 10:42:37 +01:00
David Cook
d03b88cf83 Rename variables
To make it clear they are arrays
2023-07-11 10:48:52 +02:00
Jean-Baptiste Bellet
0fdf7876a6 Instanciate instance variable + use spread operator to be more concise
and efficient ;)
2023-07-11 10:48:52 +02:00
Jean-Baptiste Bellet
4bcba86fc8 Avoid error when testing through jest about removing event listenner
Avoid:
```
  TypeError: Cannot read properties of null (reading 'removeEventListener')
        at extended.disconnect (/home/runner/work/openfoodnetwork/openfoodnetwork/app/webpacker/controllers/dropdown_controller.js:32:14)
        at Context.disconnect (/home/runner/work/openfoodnetwork/openfoodnetwork/node_modules/stimulus/dist/stimulus.umd.js:1441:25)
```
2023-07-11 10:48:52 +02:00
Jean-Baptiste Bellet
6143f4ce6f Use dropdown controller to manager actions dropdown in orders page 2023-07-11 10:48:52 +02:00
Jean-Baptiste Bellet
7084c53f38 Do not display menu is the dropdown is 'disabled'
ie. classList contains `disabled`
2023-07-11 10:48:52 +02:00
Jean-Baptiste Bellet
02aea989be Add on_click_outside behavior on dropdown_controller
"It's a Surprise Tool That Will Help Us Later"
2023-07-11 10:48:52 +02:00
Jean-Baptiste Bellet
d78af187e0 Allow dropdown controller to toggle more than one class
"It's a Surprise Tool That Will Help Us Later"
2023-07-11 10:48:51 +02:00
Mohamed ABDELLANI
4b003aa08b replace status:status with cancelled:boolean on invoice model 2023-07-11 09:15:25 +01:00
David Cook
bb1d053825 Merge pull request #11162 from dacook/DropSpreePromotionTables
Drop unused Spree Promotion Tables
2023-07-11 10:16:45 +10:00
Jean-Baptiste Bellet
a8b9d9d8af Check the custom tab checkbox if any errors (ie. title is blank) 2023-07-10 16:31:33 +02:00
Gaetan Craig-Riou
9f1b4f56c0 Merge pull request #11181 from openfoodfoundation/dependabot/npm_and_yarn/tough-cookie-4.1.3
chore(deps): bump tough-cookie from 4.0.0 to 4.1.3
2023-07-10 12:03:02 +10:00
David Cook
b6d10df332 DropSpreePromotionTables 2023-07-10 10:51:44 +10:00
dependabot[bot]
c299f891e0 chore(deps): bump tough-cookie from 4.0.0 to 4.1.3
Bumps [tough-cookie](https://github.com/salesforce/tough-cookie) from 4.0.0 to 4.1.3.
- [Release notes](https://github.com/salesforce/tough-cookie/releases)
- [Changelog](https://github.com/salesforce/tough-cookie/blob/master/CHANGELOG.md)
- [Commits](https://github.com/salesforce/tough-cookie/compare/v4.0.0...v4.1.3)

---
updated-dependencies:
- dependency-name: tough-cookie
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-09 11:11:55 +00:00
dependabot[bot]
2310c665c3 chore(deps): bump cable_ready from 5.0.0 to 5.0.1
Bumps [cable_ready](https://github.com/stimulusreflex/cable_ready) from 5.0.0 to 5.0.1.
- [Release notes](https://github.com/stimulusreflex/cable_ready/releases)
- [Changelog](https://github.com/stimulusreflex/cable_ready/blob/main/CHANGELOG.md)
- [Commits](https://github.com/stimulusreflex/cable_ready/compare/v5.0.0...v5.0.1)

---
updated-dependencies:
- dependency-name: cable_ready
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-07 09:35:52 +00:00
David Cook
17da66b72a Update contents of variable directly
Also, it makes the line shorter, allowing us to use one-line if syntax :)
2023-07-07 14:22:36 +10:00
Mohamed ABDELLANI
f68064480a authorize distributor manager to generate invoices 2023-07-06 17:36:13 +01:00
Maikel Linke
11a4cd8613 Protect invoicing against unauthorized use
This could be optimised for performance but this was the simplest way
and we can work on it if performance becomes a problem.
2023-07-06 17:36:13 +01:00
Maikel Linke
15c30246a5 Allow to see only invoices of managed enterprises 2023-07-06 17:36:13 +01:00
Maikel Linke
46410b5be2 Test the right invoices controller
I was wondering why the spec didn't work and then I noticed that it was
testing the wrong controller and passing the wrong parameter.
2023-07-06 17:36:13 +01:00
Maikel Linke
85002d3804 Spec bug allowing any enterprise to view invoices 2023-07-06 17:36:13 +01:00
Maikel Linke
145696aa7f Create only used test data
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.
2023-07-06 17:36:13 +01:00
Mohamed ABDELLANI
3a9a023dea authorize enterprise users to access invoices page 2023-07-06 17:36:13 +01:00
Matt-Yorkley
652beac73f Drop valid? check from zero_priced_order? method 2023-07-05 15:31:05 +01:00
Mohamed ABDELLANI
17b71b0f8d remove split checkout context from customer spec
We don't need to enable split checkout, as this is default and unique mode.
2023-07-05 14:54:07 +01:00
Mohamed ABDELLANI
a89451e667 remove splitcheckout from feature toggle list 2023-07-05 14:53:40 +01:00
David Cook
7e0042ea1d Apply code suggestion
Co-authored-by: Gaetan Craig-Riou <gaetan.riou@gmail.com>

Co-authored-by: Gaetan Craig-Riou <40413322+rioug@users.noreply.github.com>
2023-07-05 11:27:03 +10:00
Cillian O'Ruanaidh
a80ff6097a Improve formatting in spec/lib/reports/customers_report_spec.rb 2023-07-04 18:27:57 +01:00
Matt-Yorkley
671dfc7082 Don't flush errors when checking zero priced order validity 2023-07-04 14:42:31 +01:00
Matt-Yorkley
66a546027f Add test coverage for handling zero priced orders 2023-07-04 13:13:05 +01:00
Gaetan Craig-Riou
74073946e6 Move VoucherAdjustmentsController to request specs 2023-07-04 13:13:05 +01:00
Matt-Yorkley
55cc57cf87 Use pre_discount_total when comparing to voucher amount 2023-07-04 13:13:05 +01:00
Matt-Yorkley
ad6d0c1c73 Add nil safety in reports for zero priced orders with no payment method 2023-07-04 13:13:05 +01:00
Matt-Yorkley
2aa3f8eb89 Fix flaky test 2023-07-04 13:13:05 +01:00
Matt-Yorkley
f7912a2240 Fix CSS/layout issues 2023-07-04 13:13:05 +01:00
Matt-Yorkley
672400192f Update use of params 2023-07-04 13:13:05 +01:00
Matt-Yorkley
37a4c73a12 Fix rubocop complaint 2023-07-04 13:13:05 +01:00
Matt-Yorkley
9b45b71696 Improve feature toggling 2023-07-04 13:13:05 +01:00
Matt-Yorkley
2f0f3e0820 Re-enable voucher test 2023-07-04 13:13:05 +01:00
Matt-Yorkley
28795effc3 Clarify named vouchers in UI 2023-07-04 13:13:05 +01:00
Matt-Yorkley
de97e69e7d Show/hide payment methods if voucher changes order total to zero 2023-07-04 13:13:05 +01:00
Matt-Yorkley
55bce9f1b2 Remove @voucher_adjustment instance variable 2023-07-04 13:13:05 +01:00
Matt-Yorkley
7a0b83076b Move loading of saved cards out of checkout concern 2023-07-04 13:13:05 +01:00
Matt-Yorkley
1cd38c957d Introduce "zero priced orders" in admin order payments UI and helper 2023-07-04 13:13:05 +01:00
Matt-Yorkley
bd29a9acde Introduce "zero priced orders" to checkout UI and order state flow 2023-07-04 13:13:05 +01:00
Matt-Yorkley
a65b3b8b60 Extract voucher tests to separate controller spec 2023-07-04 13:13:05 +01:00
Matt-Yorkley
d7950617ec Drop superfluous method 2023-07-04 13:13:05 +01:00
Matt-Yorkley
47b5a3fb1d Don't apply tax calculations if there's no tax 2023-07-04 13:13:05 +01:00
Matt-Yorkley
9e5061fc31 Move voucher processing out of checkout controller 2023-07-04 13:13:05 +01:00
Matt-Yorkley
91004588f6 Add separate voucher form 2023-07-03 11:03:05 +01:00
Matt-Yorkley
3f83da9928 Move voucher section out of main checkout form 2023-07-03 11:03:05 +01:00
Matt-Yorkley
e04a3f6b4d Move form definition down into each checkout step 2023-07-03 11:03:05 +01:00
Matt-Yorkley
75e6ccd580 Simplify voucher controller 2023-07-03 11:03:05 +01:00
Matt-Yorkley
3d44f4bc98 Introduce "zero priced order" concept with no required payment
This applies to cases where an order contains items with zero price or where applied vouchers have reduced the order's total to zero.
2023-07-03 11:03:05 +01:00
Maikel Linke
4a562d0e7f Add workaround for updated DFC v1.8 URLs
Once the DFC Connector was updated we can all use the new URLs. But for
now we have the old ones and add some compatibility to the old ones.
2023-07-03 16:05:18 +10:00
Maikel Linke
fc46dbacdc Spec DFC Connector import behaviour around context
The DFC updated the URLs in their context, basically changing the ids of
all data types. I'll add a hacky workaround in the next commit.
2023-07-03 16:05:18 +10:00
Maikel Linke
9183c8acdd Deal with bad SuppliedProduct data 2023-07-03 14:17:18 +10:00
Maikel Linke
18bcc179ef Clarify request body required to create product
We have to work around an Rswag limitation here. But I think that this
version is clearer on the spec.
2023-07-03 14:17:18 +10:00
Maikel Linke
d5c41980d6 Document example for updating SuppliedProduct 2023-07-03 13:44:57 +10:00
Maikel Linke
7dc6cb151d Include DFC context in spec example
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.
2023-07-03 13:27:24 +10:00
Maikel Linke
7b9e4f6914 Move test files to own directory 2023-07-03 13:25:55 +10:00
Maikel Linke
811740c361 Correct OFN session cookie name
And improve the documentation in general.
2023-07-03 13:25:55 +10:00
Maikel Linke
7a51995aeb Respond with SuppliedProduct data when creating 2023-07-03 12:37:23 +10:00
Maikel Linke
5a4efdbce3 Separate DFC API swagger config
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.
2023-07-03 12:37:23 +10:00
Cillian O'Ruanaidh
bf44284237 Don't return duplicate rows in the customer addresses report 2023-06-30 17:10:44 +01:00
276 changed files with 8521 additions and 1950 deletions

View File

@@ -7,21 +7,21 @@ assignees: ''
---
## Preparation on Thursday
## 1. Preparation on Thursday
- [ ] Merge pull requests in the [Ready To Go] column
- [ ] Include translations: `tx pull --force`
- [ ] [Draft new release]. Look at previous [releases] for inspiration.
- [ ] Notify [#instance-managers] of user-facing changes.
## Testing
## 2. Testing
- [ ] [Find build] of the release commit and copy it below.
- [ ] Move this issue to Test Ready.
- [ ] Notify `@testers` in [#testing].
- [ ] Test build: <!-- paste build link here, e.g. https://semaphore...builds/1234 -->
## Finish on Tuesday
## 3. Finish on Tuesday
- [ ] Publish and notify [#global-community] (this is automatically posted with a plugin)
- [ ] Deploy the new release to all managed instances.

View File

@@ -25,6 +25,7 @@ Metrics/BlockLength:
AllowedMethods: [
"class_eval",
"collection",
"configure",
"context",
"delete",
"describe",
@@ -92,6 +93,8 @@ Naming/VariableNumber:
AllowedIdentifiers:
- street_address_1
- street_address_2
AllowedPatterns:
- _v[\d]+
Bundler/DuplicatedGem:
Enabled: false

View File

@@ -1,318 +1,38 @@
# This configuration was generated by
# `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 1400 --no-auto-gen-timestamp`
# using RuboCop version 1.52.1.
# using RuboCop version 1.55.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
# Offense count: 4
# Configuration parameters: Severity, Include.
# Include: **/*.gemspec
Gemspec/RequiredRubyVersion:
Exclude:
- 'engines/catalog/catalog.gemspec'
- 'engines/dfc_provider/dfc_provider.gemspec'
- 'engines/order_management/order_management.gemspec'
- 'engines/web/web.gemspec'
# Offense count: 31
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, IndentationWidth.
# SupportedStyles: with_first_argument, with_fixed_indentation
Layout/ArgumentAlignment:
Exclude:
- 'app/controllers/spree/users_controller.rb'
- 'app/controllers/user_confirmations_controller.rb'
- 'app/models/enterprise.rb'
- 'spec/lib/reports/packing/packing_report_spec.rb'
- 'spec/migrations/migrate_customer_names_spec.rb'
- 'spec/services/products_renderer_spec.rb'
- 'spec/system/admin/bulk_order_management_spec.rb'
- 'spec/system/admin/enterprise_fees_spec.rb'
- 'spec/system/admin/order_cycles/list_spec.rb'
- 'spec/system/admin/order_cycles/simple_spec.rb'
- 'spec/system/consumer/shopping/cart_spec.rb'
- 'spec/system/consumer/shopping/products_spec.rb'
# Offense count: 4
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, IndentationWidth.
# SupportedStyles: with_first_element, with_fixed_indentation
Layout/ArrayAlignment:
Exclude:
- 'spec/system/admin/customers_spec.rb'
- 'spec/system/admin/order_spec.rb'
- 'spec/system/admin/orders_spec.rb'
- 'spec/system/consumer/shopping/cart_spec.rb'
# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyleAlignWith.
# SupportedStylesAlignWith: either, start_of_block, start_of_line
Layout/BlockAlignment:
Exclude:
- 'spec/services/products_renderer_spec.rb'
# Offense count: 4
# This cop supports safe autocorrection (--autocorrect).
Layout/BlockEndNewline:
Exclude:
- 'spec/lib/open_food_network/enterprise_fee_calculator_spec.rb'
- 'spec/system/admin/orders_spec.rb'
# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
Layout/ClosingParenthesisIndentation:
Exclude:
- 'spec/system/admin/orders_spec.rb'
# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Layout/EmptyLines:
Exclude:
- 'app/models/spree/payment.rb'
# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: empty_lines, no_empty_lines
Layout/EmptyLinesAroundBlockBody:
Exclude:
- 'spec/system/admin/order_cycles/list_spec.rb'
# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, IndentationWidth.
# SupportedStyles: consistent, consistent_relative_to_receiver, special_for_inner_method_call, special_for_inner_method_call_in_parentheses
Layout/FirstArgumentIndentation:
Exclude:
- 'spec/system/admin/orders_spec.rb'
# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, IndentationWidth.
# SupportedStyles: special_inside_parentheses, consistent, align_braces
Layout/FirstHashElementIndentation:
Exclude:
- 'spec/services/products_renderer_spec.rb'
# Offense count: 10
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
# SupportedHashRocketStyles: key, separator, table
# SupportedColonStyles: key, separator, table
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
Layout/HashAlignment:
Exclude:
- 'app/controllers/spree/users_controller.rb'
- 'spec/migrations/migrate_customer_names_spec.rb'
- 'spec/models/enterprise_spec.rb'
- 'spec/system/admin/customers_spec.rb'
- 'spec/system/admin/order_spec.rb'
- 'spec/system/admin/orders_spec.rb'
- 'spec/system/admin/tag_rules_spec.rb'
- 'spec/system/consumer/shopping/cart_spec.rb'
# Offense count: 4
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: normal, indented_internal_methods
Layout/IndentationConsistency:
Exclude:
- 'spec/system/admin/order_cycles/complex_updating_specific_time_spec.rb'
- 'spec/system/admin/order_cycles/simple_spec.rb'
- 'spec/system/admin/product_import_spec.rb'
# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: Width, AllowedPatterns.
Layout/IndentationWidth:
Exclude:
- 'spec/services/products_renderer_spec.rb'
# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment.
Layout/LeadingCommentSpace:
Exclude:
- 'spec/system/admin/enterprises_spec.rb'
# Offense count: 105
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: space, no_space
Layout/LineContinuationSpacing:
Exclude:
- 'spec/system/admin/bulk_order_management_spec.rb'
- 'spec/system/admin/configuration/content_spec.rb'
- 'spec/system/admin/customers_spec.rb'
- 'spec/system/admin/enterprise_fees_spec.rb'
- 'spec/system/admin/enterprises/index_spec.rb'
- 'spec/system/admin/enterprises_spec.rb'
- 'spec/system/admin/order_cycles/list_spec.rb'
- 'spec/system/admin/order_cycles/simple_spec.rb'
- 'spec/system/admin/order_spec.rb'
- 'spec/system/admin/orders_spec.rb'
- 'spec/system/admin/overview_spec.rb'
- 'spec/system/admin/payment_method_spec.rb'
- 'spec/system/admin/product_import_spec.rb'
- 'spec/system/admin/subscriptions_spec.rb'
- 'spec/system/admin/tag_rules_spec.rb'
- 'spec/system/admin/users_spec.rb'
- 'spec/system/admin/variant_overrides_spec.rb'
- 'spec/system/consumer/authentication_spec.rb'
- 'spec/system/consumer/caching/shops_caching_spec.rb'
- 'spec/system/consumer/cookies_spec.rb'
- 'spec/system/consumer/shopping/cart_spec.rb'
- 'spec/system/consumer/shopping/checkout_spec.rb'
- 'spec/system/consumer/shopping/products_spec.rb'
- 'spec/system/consumer/shopping/shopping_spec.rb'
- 'spec/system/consumer/shopping/unit_price_spec.rb'
- 'spec/system/consumer/split_checkout_spec.rb'
# Offense count: 13
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, IndentationWidth.
# SupportedStyles: aligned, indented
Layout/LineEndStringConcatenationIndentation:
Exclude:
- 'spec/system/admin/configuration/content_spec.rb'
- 'spec/system/admin/customers_spec.rb'
- 'spec/system/admin/overview_spec.rb'
- 'spec/system/admin/payment_method_spec.rb'
- 'spec/system/admin/subscriptions_spec.rb'
- 'spec/system/admin/tag_rules_spec.rb'
- 'spec/system/consumer/caching/shops_caching_spec.rb'
- 'spec/system/consumer/cookies_spec.rb'
- 'spec/system/consumer/shopping/cart_spec.rb'
# Offense count: 213
# Offense count: 67
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
# URISchemes: http, https
Layout/LineLength:
Exclude:
- 'app/components/confirm_modal_component.rb'
- 'app/controllers/admin/product_import_controller.rb'
- 'app/controllers/spree/users_controller.rb'
- 'app/models/customer.rb'
- 'app/models/spree/line_item.rb'
- 'spec/controllers/admin/order_cycles_controller_spec.rb'
- 'spec/controllers/api/v0/order_cycles_controller_spec.rb'
- 'spec/controllers/spree/admin/orders_controller_spec.rb'
- 'spec/lib/reports/customers_report_spec.rb'
- 'spec/models/enterprise_spec.rb'
- 'spec/migrations/migrate_customer_names_spec.rb'
- 'spec/models/order_cycle_spec.rb'
- 'spec/models/product_importer_spec.rb'
- 'spec/models/spree/ability_spec.rb'
- 'spec/models/spree/adjustment_spec.rb'
- 'spec/models/spree/line_item_spec.rb'
- 'spec/models/spree/product_spec.rb'
- 'spec/models/spree/tax_rate_spec.rb'
- 'spec/models/spree/user_spec.rb'
- 'spec/models/spree/variant_spec.rb'
- 'spec/models/tag_rule/filter_order_cycles_spec.rb'
- 'spec/models/tag_rule/filter_payment_methods_spec.rb'
- 'spec/models/tag_rule/filter_products_spec.rb'
- 'spec/models/tag_rule/filter_shipping_methods_spec.rb'
- 'spec/models/variant_override_spec.rb'
- 'spec/requests/api/orders_spec.rb'
- 'spec/requests/checkout/failed_checkout_spec.rb'
- 'spec/serializers/api/admin/exchange_serializer_spec.rb'
- 'spec/serializers/api/admin/order_cycle_serializer_spec.rb'
- 'spec/services/address_geocoder_spec.rb'
- 'spec/services/cart_service_spec.rb'
- 'spec/services/checkout/post_checkout_actions_spec.rb'
- 'spec/services/content_sanitizer_spec.rb'
- 'spec/services/embedded_page_service_spec.rb'
- 'spec/services/exchange_products_renderer_spec.rb'
- 'spec/services/order_cycle_distributed_variants_spec.rb'
- 'spec/services/order_syncer_spec.rb'
- 'spec/services/paypal_items_builder_spec.rb'
- 'spec/services/permissions/order_spec.rb'
- 'spec/services/permitted_attributes/order_cycle_spec.rb'
- 'spec/services/product_tag_rules_filterer_spec.rb'
- 'spec/services/products_renderer_spec.rb'
- 'spec/support/cancan_helper.rb'
- 'spec/support/features/datepicker_helper.rb'
- 'spec/support/matchers/select2_matchers.rb'
- 'spec/support/request/web_helper.rb'
- 'spec/system/admin/adjustments_spec.rb'
- 'spec/system/admin/bulk_order_management_spec.rb'
- 'spec/system/admin/bulk_product_update_spec.rb'
- 'spec/system/admin/order_spec.rb'
- 'spec/system/admin/product_import_spec.rb'
# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Layout/MultilineBlockLayout:
Exclude:
- 'engines/order_management/app/services/order_management/subscriptions/validator.rb'
# Offense count: 6
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: symmetrical, new_line, same_line
Layout/MultilineMethodCallBraceLayout:
Exclude:
- 'spec/system/admin/orders_spec.rb'
- 'spec/system/admin/products_spec.rb'
# Offense count: 6
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, IndentationWidth.
# SupportedStyles: aligned, indented, indented_relative_to_receiver
Layout/MultilineMethodCallIndentation:
Exclude:
- 'spec/controllers/api/v0/orders_controller_spec.rb'
- 'spec/system/admin/order_cycles/complex_editing_spec.rb'
- 'spec/system/admin/overview_spec.rb'
- 'spec/system/admin/payment_method_spec.rb'
- 'spec/system/admin/variant_overrides_spec.rb'
# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: final_newline, final_blank_line
Layout/TrailingEmptyLines:
Exclude:
- 'Rakefile'
# Offense count: 76
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowInHeredoc.
Layout/TrailingWhitespace:
Exclude:
- 'app/controllers/spree/users_controller.rb'
- 'app/controllers/user_confirmations_controller.rb'
- 'app/models/enterprise.rb'
- 'spec/controllers/spree/credit_cards_controller_spec.rb'
- 'spec/controllers/user_confirmations_controller_spec.rb'
- 'spec/factories/order_factory.rb'
- 'spec/lib/reports/packing/packing_report_spec.rb'
- 'spec/models/enterprise_spec.rb'
- 'spec/services/products_renderer_spec.rb'
- 'spec/support/request/stripe_stubs.rb'
- 'spec/system/admin/bulk_order_management_spec.rb'
- 'spec/system/admin/customers_spec.rb'
- 'spec/system/admin/enterprise_fees_spec.rb'
- 'spec/system/admin/flatpickr_spec.rb'
- 'spec/system/admin/order_cycles/complex_editing_spec.rb'
- 'spec/system/admin/order_cycles/list_spec.rb'
- 'spec/system/admin/order_cycles/simple_spec.rb'
- 'spec/system/admin/order_spec.rb'
- 'spec/system/admin/orders_spec.rb'
- 'spec/system/admin/product_import_spec.rb'
- 'spec/system/admin/shipping_methods_spec.rb'
# Offense count: 7
# This cop supports safe autocorrection (--autocorrect).
Lint/AmbiguousOperatorPrecedence:
Exclude:
- 'app/models/calculator/flexi_rate.rb'
- 'app/models/enterprise.rb'
- 'app/models/spree/ability.rb'
- 'app/models/spree/line_item.rb'
- 'app/models/spree/preferences/store.rb'
- 'spec/system/consumer/shopping/cart_spec.rb'
- 'spec/system/consumer/shopping/products_spec.rb'
# Offense count: 17
# Configuration parameters: AllowedMethods.
@@ -421,36 +141,12 @@ Lint/RedundantSafeNavigation:
Exclude:
- 'app/models/spree/payment.rb'
# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowedMethods.
# AllowedMethods: present?, blank?, presence, try, try!, in?
Lint/SafeNavigationChain:
Exclude:
- 'app/models/spree/line_item.rb'
- 'app/models/spree/stock/availability_validator.rb'
# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods.
Lint/UnusedMethodArgument:
Exclude:
- 'lib/reporting/queries/query_interface.rb'
# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Lint/UselessMethodDefinition:
Exclude:
- 'app/models/spree/gateway.rb'
# Offense count: 3
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: CheckForMethodsWithNoSideEffects.
Lint/Void:
Exclude:
- 'spec/system/admin/order_cycles/complex_updating_specific_time_spec.rb'
- 'spec/system/admin/order_cycles/simple_spec.rb'
# Offense count: 26
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
Metrics/AbcSize:
@@ -477,7 +173,7 @@ Metrics/AbcSize:
- 'lib/tasks/enterprises.rake'
- 'spec/services/order_checkout_restart_spec.rb'
# Offense count: 48
# Offense count: 46
# Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns.
# AllowedMethods: refine
Metrics/BlockLength:
@@ -488,7 +184,6 @@ Metrics/BlockLength:
- 'app/models/spree/shipment.rb'
- 'lib/spree/core/controller_helpers/common.rb'
- 'lib/tasks/data.rake'
- 'spec/base_spec_helper.rb'
- 'spec/factories.rb'
- 'spec/factories/address_factory.rb'
- 'spec/factories/enterprise_factory.rb'
@@ -507,11 +202,9 @@ Metrics/BlockLength:
- 'spec/support/cancan_helper.rb'
- 'spec/support/matchers/select2_matchers.rb'
- 'spec/support/matchers/table_matchers.rb'
- 'spec/swagger_helper.rb'
- 'spec/system/consumer/shopping/checkout_spec.rb'
- 'spec/system/consumer/shopping/checkout_stripe_spec.rb'
- 'spec/system/consumer/shopping/variant_overrides_spec.rb'
- 'spec/system/consumer/split_checkout_tax_not_incl_spec.rb'
# Offense count: 1
# Configuration parameters: CountBlocks, Max.
@@ -519,12 +212,11 @@ Metrics/BlockNesting:
Exclude:
- 'app/models/spree/payment/processing.rb'
# Offense count: 49
# Offense count: 48
# Configuration parameters: CountComments, Max, CountAsOne.
Metrics/ClassLength:
Exclude:
- 'app/components/products_table_component.rb'
- 'app/controllers/admin/enterprise_fees_controller.rb'
- 'app/controllers/admin/enterprises_controller.rb'
- 'app/controllers/admin/order_cycles_controller.rb'
- 'app/controllers/admin/product_import_controller.rb'
@@ -711,31 +403,6 @@ Naming/AccessorMethodName:
- 'spec/support/request/shop_workflow.rb'
- 'spec/support/request/web_helper.rb'
# Offense count: 42
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, BlockForwardingName.
# SupportedStyles: anonymous, explicit
Naming/BlockForwarding:
Exclude:
- 'app/helpers/application_helper.rb'
- 'app/helpers/link_helper.rb'
- 'app/helpers/spree/admin/base_helper.rb'
- 'app/reflexes/application_reflex.rb'
- 'app/services/cache_service.rb'
- 'app/services/current_order_locker.rb'
- 'lib/reporting/reports/enterprise_fee_summary/scope.rb'
- 'lib/spree/core/controller_helpers/respond_with.rb'
- 'lib/spree/core/delegate_belongs_to.rb'
- 'lib/spree/core/environment_extension.rb'
- 'spec/models/enterprise_caching_spec.rb'
- 'spec/support/embedded_pages_helper.rb'
- 'spec/support/preferences_helper.rb'
- 'spec/support/request/shop_workflow.rb'
- 'spec/support/request/ui_component_helper.rb'
- 'spec/support/request/web_helper.rb'
- 'spec/swagger_helper.rb'
- 'spec/system/support/capybara_setup.rb'
# Offense count: 1
# Configuration parameters: ForbiddenDelimiters.
# ForbiddenDelimiters: (?i-mx:(^|\s)(EO[A-Z]{1}|END)(\s|$))
@@ -1200,7 +867,7 @@ Rails/UnknownEnv:
Exclude:
- 'app/models/spree/app_configuration.rb'
# Offense count: 55
# Offense count: 56
# This cop supports unsafe autocorrection (--autocorrect-all).
Rails/WhereEquals:
Exclude:
@@ -1420,7 +1087,7 @@ Style/HashAsLastArrayItem:
- 'app/components/products_table_component.rb'
# Offense count: 12
# This cop supports safe autocorrection (--autocorrect).
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowSplatArgument.
Style/HashConversion:
Exclude:
@@ -1441,7 +1108,7 @@ Style/HashLikeCase:
Exclude:
- 'app/models/enterprise.rb'
# Offense count: 1778
# Offense count: 1781
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
@@ -1698,7 +1365,6 @@ Style/HashSyntax:
- 'spec/models/enterprise_relationship_spec.rb'
- 'spec/models/enterprise_spec.rb'
- 'spec/models/exchange_spec.rb'
- 'spec/models/invoice_spec.rb'
- 'spec/models/order_cycle_spec.rb'
- 'spec/models/product_import/entry_validator_spec.rb'
- 'spec/models/product_import/inventory_reset_strategy_spec.rb'
@@ -1815,7 +1481,6 @@ Style/HashSyntax:
- 'spec/system/admin/subscriptions_spec.rb'
- 'spec/system/admin/tag_rules_spec.rb'
- 'spec/system/admin/variant_overrides_spec.rb'
- 'spec/system/admin/variants_spec.rb'
- 'spec/system/admin/vouchers_spec.rb'
- 'spec/system/consumer/account/cards_spec.rb'
- 'spec/system/consumer/account/developer_settings_spec.rb'
@@ -1886,7 +1551,7 @@ Style/NestedModifier:
- 'spec/system/admin/payments_stripe_spec.rb'
- 'spec/system/admin/reports_spec.rb'
# Offense count: 36
# Offense count: 38
Style/OpenStructUse:
Exclude:
- 'app/helpers/injection_helper.rb'
@@ -1980,11 +1645,12 @@ Style/RedundantInitialize:
Exclude:
- 'spec/models/spree/gateway_spec.rb'
# Offense count: 1
# Offense count: 2
# This cop supports safe autocorrection (--autocorrect).
Style/RedundantRegexpEscape:
Style/RedundantRegexpArgument:
Exclude:
- 'app/models/spree/order.rb'
- 'app/models/spree/shipping_method.rb'
- 'lib/spree/i18n.rb'
# Offense count: 4
# This cop supports safe autocorrection (--autocorrect).
@@ -1994,6 +1660,15 @@ Style/RedundantStringEscape:
- 'spec/controllers/spree/admin/shipping_methods_controller_spec.rb'
- 'spec/system/admin/enterprise_fees_spec.rb'
# Offense count: 19
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowedMethods, AllowedPatterns.
Style/ReturnNilInPredicateMethodDefinition:
Exclude:
- 'app/models/order_cycle.rb'
- 'app/serializers/api/admin/customer_serializer.rb'
- 'engines/order_management/app/services/order_management/subscriptions/validator.rb'
# Offense count: 205
Style/Send:
Exclude:

View File

@@ -26,9 +26,6 @@ PATH
remote: engines/dfc_provider
specs:
dfc_provider (0.0.1)
active_model_serializers (~> 0.8.4)
jwt (~> 2.2)
rspec (~> 3.9)
PATH
remote: engines/order_management
@@ -157,20 +154,20 @@ GEM
awesome_nested_set (3.5.0)
activerecord (>= 4.0.0, < 7.1)
aws-eventstream (1.2.0)
aws-partitions (1.780.0)
aws-sdk-core (3.175.0)
aws-partitions (1.792.0)
aws-sdk-core (3.179.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.5)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.67.0)
aws-sdk-core (~> 3, >= 3.174.0)
aws-sdk-kms (1.71.0)
aws-sdk-core (~> 3, >= 3.177.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.126.0)
aws-sdk-core (~> 3, >= 3.174.0)
aws-sdk-s3 (1.132.0)
aws-sdk-core (~> 3, >= 3.179.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.4)
aws-sigv4 (1.5.2)
aws-sigv4 (~> 1.6)
aws-sigv4 (1.6.0)
aws-eventstream (~> 1, >= 1.0.2)
bcrypt (3.1.18)
bigdecimal (3.0.2)
@@ -178,7 +175,7 @@ GEM
bindex (0.8.1)
bootsnap (1.16.0)
msgpack (~> 1.2)
bugsnag (6.25.2)
bugsnag (6.26.0)
concurrent-ruby (~> 1.0)
builder (3.2.4)
bullet (7.0.7)
@@ -377,7 +374,7 @@ GEM
jsonapi-serializer (2.2.0)
activesupport (>= 4.2)
jwt (2.7.1)
knapsack_pro (5.1.2)
knapsack_pro (5.3.4)
rake
language_server-protocol (3.17.0.3)
launchy (2.5.0)
@@ -407,7 +404,7 @@ GEM
rake
mini_magick (4.11.0)
mini_mime (1.1.2)
mini_portile2 (2.8.2)
mini_portile2 (2.8.4)
minitest (5.18.1)
monetize (1.12.0)
money (~> 6.12)
@@ -484,7 +481,7 @@ GEM
pry (0.13.1)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (5.0.1)
public_suffix (5.0.3)
puma (6.3.0)
nio4r (~> 2.0)
query_count (1.1.1)
@@ -573,7 +570,7 @@ GEM
responders (3.1.0)
actionpack (>= 5.2)
railties (>= 5.2)
rexml (3.2.5)
rexml (3.2.6)
roadie (5.0.1)
css_parser (~> 1.4)
nokogiri (~> 1.8)
@@ -608,18 +605,18 @@ GEM
rspec-support (~> 3.12)
rspec-retry (0.6.2)
rspec-core (> 3.3)
rspec-support (3.12.0)
rswag-api (2.9.0)
rspec-support (3.12.1)
rswag-api (2.10.1)
railties (>= 3.1, < 7.1)
rswag-specs (2.9.0)
rswag-specs (2.10.1)
activesupport (>= 3.1, < 7.1)
json-schema (>= 2.2, < 4.0)
railties (>= 3.1, < 7.1)
rspec-core (>= 2.14)
rswag-ui (2.9.0)
rswag-ui (2.10.1)
actionpack (>= 3.1, < 7.1)
railties (>= 3.1, < 7.1)
rubocop (1.54.1)
rubocop (1.55.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
@@ -627,7 +624,7 @@ GEM
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.0, < 2.0)
rubocop-ast (>= 1.28.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.29.0)
@@ -706,7 +703,7 @@ GEM
railties (>= 5.2, < 8)
redis (>= 4.0, < 6.0)
stringex (2.8.6)
stripe (8.5.0)
stripe (8.6.0)
swd (1.3.0)
activesupport (>= 3)
attr_required (>= 0.0.5)
@@ -732,7 +729,7 @@ GEM
activemodel (>= 3.0.0)
public_suffix
vcr (6.2.0)
view_component (3.3.0)
view_component (3.5.0)
activesupport (>= 5.2.0, < 8.0)
concurrent-ruby (~> 1.0)
method_source (~> 1.0)

View File

@@ -7,4 +7,3 @@
require_relative 'config/application'
Openfoodnetwork::Application.load_tasks

View File

@@ -1,7 +1,8 @@
# frozen_string_literal: true
class ConfirmModalComponent < ModalComponent
def initialize(id:, confirm_actions: nil, reflex: nil, controller: nil, message: nil, confirm_reflexes: nil)
def initialize(id:, confirm_actions: nil, reflex: nil, controller: nil, message: nil,
confirm_reflexes: nil)
super(id: id, close_button: true)
@confirm_actions = confirm_actions
@reflex = reflex

View File

@@ -20,7 +20,7 @@ class ProductComponent < ViewComponentReflex::Component
@product.id
end
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/MethodLength
# rubocop:disable Metrics/CyclomaticComplexity
def column_value(column)
case column
when 'name'
@@ -47,7 +47,7 @@ class ProductComponent < ViewComponentReflex::Component
format_date(@product.import_date)
end
end
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/MethodLength
# rubocop:enable Metrics/CyclomaticComplexity
private

View File

@@ -6,8 +6,6 @@ module Admin
class EnterpriseFeesController < Admin::ResourceController
before_action :load_enterprise_fee_set, only: :index
before_action :load_data
before_action :check_enterprise_fee_input, only: [:bulk_update]
before_action :check_calculators_compatibility_with_taxes, only: [:bulk_update]
def index
@include_calculators = params[:include_calculators].present?
@@ -36,7 +34,8 @@ module Admin
end
def bulk_update
@enterprise_fee_set = Sets::EnterpriseFeeSet.new(enterprise_fee_bulk_params)
# Forms has strong parameters, so we don't need to validate them in controller
@enterprise_fee_set = EnterpriseFeesBulkUpdate.new(params)
if @enterprise_fee_set.save
redirect_to redirect_path, notice: I18n.t(:enterprise_fees_update_notice)
@@ -89,47 +88,5 @@ module Admin
main_app.admin_enterprise_fees_path
end
def enterprise_fee_bulk_params
params.require(:sets_enterprise_fee_set).permit(
collection_attributes: [
:id, :enterprise_id, :fee_type, :name, :tax_category_id,
:inherits_tax_category, :calculator_type,
{ calculator_attributes: PermittedAttributes::Calculator.attributes }
]
)
end
def check_enterprise_fee_input
enterprise_fee_bulk_params['collection_attributes'].each do |_, fee_row|
enterprise_fees = fee_row['calculator_attributes']&.slice(
:preferred_flat_percent, :preferred_amount,
:preferred_first_item, :preferred_additional_item,
:preferred_minimal_amount, :preferred_normal_amount,
:preferred_discount_amount, :preferred_per_unit
)
next unless enterprise_fees
enterprise_fees.each do |_, enterprise_amount|
unless enterprise_amount.nil? || Float(enterprise_amount, exception: false)
flash[:error] = I18n.t(:calculator_preferred_value_error)
return redirect_to redirect_path
end
end
end
end
def check_calculators_compatibility_with_taxes
enterprise_fee_bulk_params['collection_attributes'].each do |_, enterprise_fee|
next unless enterprise_fee['inherits_tax_category'] == "true"
next unless EnterpriseFee::PER_ORDER_CALCULATORS.include?(enterprise_fee['calculator_type'])
flash[:error] = I18n.t(
'activerecord.errors.models.enterprise_fee.inherit_tax_requires_per_item_calculator'
)
return redirect_to redirect_path
end
end
end
end

View File

@@ -92,7 +92,7 @@ module Admin
return render :welcome, layout: "spree/layouts/bare_admin"
end
attributes = { sells: register_params[:sells], visible: true }
attributes = { sells: register_params[:sells], visible: "only_through_links" }
if @enterprise.update(attributes)
flash[:success] = I18n.t(:enterprise_register_success_notice, enterprise: @enterprise.name)

View File

@@ -139,7 +139,8 @@ module Admin
end
def raise_invalid_file_path
redirect_to '/admin/product_import', notice: I18n.t(:product_import_no_data_in_spreadsheet_notice)
redirect_to '/admin/product_import',
notice: I18n.t(:product_import_no_data_in_spreadsheet_notice)
raise 'Invalid File Path'
end
TEMP_FILE_PATH_REGEX = %r{^/tmp/product_import[A-Za-z0-9-]*/import\.csv$}

View File

@@ -9,14 +9,11 @@ module Admin
end
def create
voucher_params = permitted_resource_params.merge(enterprise: @enterprise)
@voucher = Voucher.create(voucher_params)
@voucher = Voucher.create(permitted_resource_params.merge(enterprise: @enterprise))
if @voucher.save
redirect_to(
"#{edit_admin_enterprise_path(@enterprise)}#vouchers_panel",
flash: { success: flash_message_for(@voucher, :successfully_created) }
)
flash[:success] = flash_message_for(@voucher, :successfully_created)
redirect_to edit_admin_enterprise_path(@enterprise, anchor: :vouchers_panel)
else
flash[:error] = @voucher.errors.full_messages.to_sentence
render :new

View File

@@ -74,7 +74,7 @@ module Api
end
def override_visible
enterprise_params[:visible] = false
enterprise_params[:visible] = "only_through_links"
end
def enterprise_params

View File

@@ -14,7 +14,7 @@ module CheckoutCallbacks
prepend_before_action :require_order_cycle
prepend_before_action :require_distributor_chosen
before_action :load_order, :associate_user, :load_saved_addresses, :load_saved_credit_cards
before_action :load_order, :associate_user, :load_saved_addresses
before_action :load_shipping_methods, if: -> { params[:step] == "details" }
before_action :ensure_order_not_completed
@@ -30,8 +30,6 @@ module CheckoutCallbacks
@order.manual_shipping_selection = true
@order.checkout_processing = true
@voucher_adjustment = @order.voucher_adjustments.first
redirect_to(main_app.shop_path) && return if redirect_to_shop?
redirect_to_cart_path && return unless valid_order_line_items?
end
@@ -43,11 +41,6 @@ module CheckoutCallbacks
@order.ship_address ||= finder.ship_address
end
def load_saved_credit_cards
@saved_credit_cards = spree_current_user&.credit_cards&.with_payment_profile.to_a
@selected_card = nil
end
def load_shipping_methods
@shipping_methods = available_shipping_methods.sort { |a, b| a.name.casecmp(b.name) }
end

View File

@@ -25,12 +25,12 @@ class SplitCheckoutController < ::BaseController
redirect_to_step_based_on_order unless params[:step]
check_step if params[:step]
flash_error_when_no_shipping_method_available if available_shipping_methods.none?
return if available_shipping_methods.any?
flash[:error] = I18n.t('split_checkout.errors.no_shipping_methods_available')
end
def update
return process_voucher if params[:apply_voucher].present?
if confirm_order || update_order
return if performed?
@@ -60,27 +60,6 @@ class SplitCheckoutController < ::BaseController
replace("#flashes", partial("shared/flashes", locals: { flashes: flash }))
end
def render_voucher_section_or_redirect
respond_to do |format|
format.cable_ready { render_voucher_section }
format.html { redirect_to checkout_step_path(:payment) }
end
end
# Using the power of cable_car we replace only the #voucher_section instead of reloading the page
def render_voucher_section
render(
status: :ok,
cable_ready: cable_car.replace(
"#voucher-section",
partial(
"split_checkout/voucher_section",
locals: { order: @order, voucher_adjustment: @order.voucher_adjustments.first }
)
)
)
end
def order_error_messages
# Remove ship_address.* errors if no shipping method is not selected
remove_ship_address_errors if no_ship_address_needed?
@@ -125,10 +104,6 @@ class SplitCheckoutController < ::BaseController
end
end
def flash_error_when_no_shipping_method_available
flash[:error] = I18n.t('split_checkout.errors.no_shipping_methods_available')
end
def check_payments_adjustments
@order.payments.each(&:ensure_correct_adjustment)
end
@@ -201,40 +176,6 @@ class SplitCheckoutController < ::BaseController
selected_shipping_method.first.require_ship_address == false
end
def process_voucher
if add_voucher
VoucherAdjustmentsService.calculate(@order)
render_voucher_section_or_redirect
elsif @order.errors.present?
render_error
end
end
def add_voucher
if params.dig(:order, :voucher_code).blank?
@order.errors.add(:voucher, I18n.t('split_checkout.errors.voucher_not_found'))
return false
end
# Fetch Voucher
voucher = Voucher.find_by(code: params[:order][:voucher_code], enterprise: @order.distributor)
if voucher.nil?
@order.errors.add(:voucher, I18n.t('split_checkout.errors.voucher_not_found'))
return false
end
adjustment = voucher.create_adjustment(voucher.code, @order)
unless adjustment.valid?
@order.errors.add(:voucher, I18n.t('split_checkout.errors.add_voucher_error'))
adjustment.errors.each { |error| @order.errors.import(error) }
return false
end
true
end
def summary_step?
params[:step] == "summary"
end
@@ -262,6 +203,7 @@ class SplitCheckoutController < ::BaseController
def validate_payment!
return true if params.dig(:order, :payments_attributes, 0, :payment_method_id).present?
return true if @order.zero_priced_order?
@order.errors.add :payment_method, I18n.t('split_checkout.errors.select_a_payment_method')
end

View File

@@ -4,13 +4,16 @@ module Spree
module Admin
class InvoicesController < Spree::Admin::BaseController
respond_to :json
authorize_resource class: false
def index
@order = Spree::Order.find_by(number: params[:order_id])
authorize! :invoice, @order
end
def create
Spree::Order.where(id: params[:order_ids]).find_each do |order|
authorize! :invoice, order
end
invoice_service = BulkInvoiceService.new
invoice_service.start_pdf_job(params[:order_ids])
@@ -19,6 +22,8 @@ module Spree
def generate
@order = Order.find_by(number: params[:order_id])
authorize! :invoice, @order
@comparator = OrderInvoiceComparator.new(@order)
if @comparator.can_generate_new_invoice?
@order.invoices.create!(

View File

@@ -33,8 +33,8 @@ module Spree
render status: :ok, cable_ready: cable_car.
inner_html(
"#login-feedback",
partial("layouts/alert",
locals: { type: "alert", message: t('devise.failure.already_registered') })
partial("layouts/alert",
locals: { type: "alert", message: t('devise.failure.already_registered') })
).
dispatch_event(name: "login:modal:open")
else
@@ -48,9 +48,9 @@ module Spree
if @user.save
render cable_ready: cable_car.inner_html(
"#signup-feedback",
partial("layouts/alert",
locals: { type: "success",
message: t('devise.user_registrations.spree_user.signed_up_but_unconfirmed') })
partial("layouts/alert",
locals: { type: "success",
message: t('devise.user_registrations.spree_user.signed_up_but_unconfirmed') })
)
else
render status: :unprocessable_entity, cable_ready: cable_car.morph(

View File

@@ -24,8 +24,8 @@ class UserConfirmationsController < DeviseController
else
render cable_ready: cable_car.inner_html(
"##{params[:tab] || 'forgot'}-feedback",
partial("layouts/alert",
locals: { type: "success", message: t("devise.confirmations.send_instructions") })
partial("layouts/alert",
locals: { type: "success", message: t("devise.confirmations.send_instructions") })
)
return
end

View File

@@ -1,32 +1,81 @@
# frozen_string_literal: true
class VoucherAdjustmentsController < BaseController
include CablecarResponses
before_action :set_order
def create
if add_voucher
VoucherAdjustmentsService.calculate(@order)
@order.update_totals_and_states
update_payment_section
elsif @order.errors.present?
render_error
end
end
def destroy
@order = current_order
@order.voucher_adjustments.find_by(id: params[:id])&.destroy
respond_to do |format|
format.cable_ready { render_voucher_section }
format.html { redirect_to checkout_step_path(:payment) }
# An order can have more than one adjustment linked to one voucher
adjustment = @order.voucher_adjustments.find_by(id: params[:id])
if adjustment.present?
@order.voucher_adjustments.where(originator_id: adjustment.originator_id)&.destroy_all
end
update_payment_section
end
private
# Using the power of cable_car we replace only the #voucher_section instead of reloading the page
def render_voucher_section
render(
status: :ok,
cable_ready: cable_car.replace(
def set_order
@order = current_order
end
def add_voucher
if voucher_params[:voucher_code].blank?
@order.errors.add(:voucher_code, I18n.t('split_checkout.errors.voucher_not_found'))
return false
end
voucher = Voucher.find_by(code: voucher_params[:voucher_code], enterprise: @order.distributor)
if voucher.nil?
@order.errors.add(:voucher_code, I18n.t('split_checkout.errors.voucher_not_found'))
return false
end
adjustment = voucher.create_adjustment(voucher.code, @order)
unless adjustment.valid?
@order.errors.add(:voucher_code, I18n.t('split_checkout.errors.add_voucher_error'))
adjustment.errors.each { |error| @order.errors.import(error) }
return false
end
true
end
def update_payment_section
render cable_ready: cable_car.replace(
selector: "#checkout-payment-methods",
html: render_to_string(partial: "split_checkout/payment", locals: { step: "payment" })
)
end
def render_error
flash.now[:error] = @order.errors.full_messages.to_sentence
render status: :unprocessable_entity, cable_ready: cable_car.
replace("#flashes", partial("shared/flashes", locals: { flashes: flash })).
replace(
"#voucher-section",
partial(
"split_checkout/voucher_section",
locals: { order: @order, voucher_adjustment: @order.voucher_adjustments.first }
)
)
)
end
def voucher_params
params.require(:order).permit(:voucher_code)
end
end

View File

@@ -0,0 +1,74 @@
# frozen_string_literal: true
class EnterpriseFeesBulkUpdate
include ActiveModel::Model
attr_reader :errors
validate :check_enterprise_fee_input
validate :check_calculators_compatibility_with_taxes
def initialize(params)
@errors = ActiveModel::Errors.new self
@params = params
end
def save
return false unless valid?
@enterprise_fee_set = Sets::EnterpriseFeeSet.new(enterprise_fee_bulk_params)
unless @enterprise_fee_set.save
@enterprise_fee_set.errors.each do |error|
@errors.add(error.attribute, error.type)
end
return false
end
true
end
private
def check_enterprise_fee_input
enterprise_fee_bulk_params['collection_attributes'].each do |_, fee_row|
enterprise_fees = fee_row['calculator_attributes']&.slice(
:preferred_flat_percent, :preferred_amount,
:preferred_first_item, :preferred_additional_item,
:preferred_minimal_amount, :preferred_normal_amount,
:preferred_discount_amount, :preferred_per_unit
)
next unless enterprise_fees
enterprise_fees.each do |_, enterprise_amount|
unless enterprise_amount.nil? || Float(enterprise_amount, exception: false)
@errors.add(:base, I18n.t(:calculator_preferred_value_error))
end
end
end
end
def check_calculators_compatibility_with_taxes
enterprise_fee_bulk_params['collection_attributes'].each do |_, enterprise_fee|
next unless enterprise_fee['inherits_tax_category'] == "true"
next unless EnterpriseFee::PER_ORDER_CALCULATORS.include?(enterprise_fee['calculator_type'])
@errors.add(
:base,
I18n.t(
'activerecord.errors.models.enterprise_fee.inherit_tax_requires_per_item_calculator'
)
)
end
end
def enterprise_fee_bulk_params
@params.require(:sets_enterprise_fee_set).permit(
collection_attributes: [
:id, :enterprise_id, :fee_type, :name, :tax_category_id,
:inherits_tax_category, :calculator_type,
{ calculator_attributes: PermittedAttributes::Calculator.attributes }
]
)
end
end

View File

@@ -38,15 +38,15 @@ module ApplicationHelper
end.join("\n").html_safe
end
def ng_form_for(name, *args, &block)
def ng_form_for(name, *args, &)
options = args.extract_options!
form_for(name, *(args << options.merge(builder: AngularFormBuilder)), &block)
form_for(name, *(args << options.merge(builder: AngularFormBuilder)), &)
end
# Pass URL helper calls on to spree where applicable so that we don't need to use
# spree.foo_path in any view rendered from non-spree-namespaced controllers.
def method_missing(method, *args, &block)
def method_missing(method, *args, &)
if method.to_s.end_with?('_path', '_url') && spree.respond_to?(method)
spree.public_send(method, *args)
else

View File

@@ -120,6 +120,8 @@ module CheckoutHelper
end
def payment_or_shipping_price(method, order)
return unless method
price = method.compute_amount(order)
if price.zero?
t('checkout_method_free')

View File

@@ -1,11 +1,11 @@
# frozen_string_literal: true
module LinkHelper
def link_to_service(baseurl, name, html_options = {}, &block)
def link_to_service(baseurl, name, html_options = {}, &)
return if name.blank?
html_options = html_options.merge target: '_blank'
link_to ext_url(baseurl, name), html_options, &block
link_to(ext_url(baseurl, name), html_options, &)
end
def ext_url(prefix, url)

View File

@@ -3,14 +3,14 @@
module Spree
module Admin
module BaseHelper
def field_container(model, method, options = {}, &block)
def field_container(model, method, options = {}, &)
css_classes = options[:class].to_a
css_classes << 'field'
if error_message_on(model, method).present?
css_classes << 'withError'
end
content_tag(:div,
capture(&block),
capture(&),
class: css_classes.join(' '),
id: "#{model}_#{method}_field")
end

View File

@@ -5,11 +5,13 @@ module Spree
def payment_method(payment)
# hack to allow us to retrieve the name of a "deleted" payment method
id = payment.payment_method_id
return if id.nil?
Spree::PaymentMethod.find_with_destroyed(id)
end
def payment_method_name(payment)
payment_method(payment).name
payment_method(payment)&.name
end
end
end

View File

@@ -35,7 +35,7 @@ module Calculator
private
def compute_for(count)
count * preferred_additional_item.to_f + preferred_first_item.to_f
(count * preferred_additional_item.to_f) + preferred_first_item.to_f
end
end
end

View File

@@ -40,7 +40,9 @@ class Customer < ApplicationRecord
}
scope :of, ->(enterprise) { where(enterprise_id: enterprise) }
scope :managed_by, ->(user) { user&.persisted? ? where(user: user).or(of(Enterprise.managed_by(user))) : none }
scope :managed_by, ->(user) {
user&.persisted? ? where(user: user).or(of(Enterprise.managed_by(user))) : none
}
scope :created_manually, -> { where(created_manually: true) }
scope :visible, -> { where(id: Spree::Order.complete.select(:customer_id)).or(created_manually) }

View File

@@ -51,9 +51,9 @@ class Enterprise < ApplicationRecord
belongs_to :owner, class_name: 'Spree::User',
inverse_of: :owned_enterprises
has_many :distributor_payment_methods,
inverse_of: :distributor, foreign_key: :distributor_id
inverse_of: :distributor, foreign_key: :distributor_id
has_many :distributor_shipping_methods,
inverse_of: :distributor, foreign_key: :distributor_id
inverse_of: :distributor, foreign_key: :distributor_id
has_many :payment_methods, through: :distributor_payment_methods
has_many :shipping_methods, through: :distributor_shipping_methods
has_many :customers
@@ -114,11 +114,11 @@ class Enterprise < ApplicationRecord
validate :shopfront_taxons
validate :shopfront_producers
validate :enforce_ownership_limit, if: lambda { owner_id_changed? && !owner_id.nil? }
validates :instagram,
format: {
with: VALID_INSTAGRAM_REGEX,
message: Spree.t('errors.messages.invalid_instagram_url')
}, allow_blank: true
validates :instagram,
format: {
with: VALID_INSTAGRAM_REGEX,
message: Spree.t('errors.messages.invalid_instagram_url')
}, allow_blank: true
validate :validate_white_label_logo_link
before_validation :initialize_permalink, if: lambda { permalink.nil? }
@@ -359,7 +359,7 @@ class Enterprise < ApplicationRecord
def category
# Make this crazy logic human readable so we can argue about it sanely.
cat = is_primary_producer ? "producer_" : "non_producer_"
cat << "sells_" + sells
cat << ("sells_" + sells)
# Map backend cases to front end cases.
case cat
@@ -493,7 +493,7 @@ class Enterprise < ApplicationRecord
end
def correct_whatsapp_url(phone_number)
phone_number && "https://wa.me/" + phone_number.tr('+ ', '')
phone_number && ("https://wa.me/" + phone_number.tr('+ ', ''))
end
def correct_instagram_url(url)

View File

@@ -4,6 +4,7 @@ class Invoice < ApplicationRecord
belongs_to :order, class_name: 'Spree::Order'
serialize :data, Hash
before_validation :serialize_order
after_create :cancel_previous_invoices
def presenter
@presenter ||= Invoice::DataPresenter.new(self)
@@ -14,4 +15,8 @@ class Invoice < ApplicationRecord
self.data = Invoice::OrderSerializer.new(order).serializable_hash
end
def cancel_previous_invoices
order.invoices.where.not(id:).update_all(cancelled: true)
end
end

View File

@@ -24,10 +24,10 @@ module Spree
can [:index, :read], Country
can :create, Order
can :read, Order do |order, token|
order.user == user || order.token && token == order.token
order.user == user || (order.token && token == order.token)
end
can :update, Order do |order, token|
order.user == user || order.token && token == order.token
order.user == user || (order.token && token == order.token)
end
can [:index, :read], Product
can [:index, :read], ProductProperty
@@ -191,6 +191,8 @@ module Spree
OpenFoodNetwork::Permissions.new(user).managed_product_enterprises.include? product.supplier
end
can [:admin, :index], :products_v3
can [:create], Spree::Variant
can [:admin, :index, :read, :edit,
:update, :search, :delete, :destroy], Spree::Variant do |variant|
@@ -275,7 +277,7 @@ module Spree
can [:admin, :bulk_management, :managed, :distribution], Spree::Order do
user.admin? || user.enterprises.any?(&:is_distributor)
end
can [:admin, :create, :show, :poll], :invoice
can [:admin, :index, :create, :show, :poll, :generate], :invoice
can [:admin, :visible], Enterprise
can [:admin, :index, :create, :update, :destroy], :line_item
can [:admin, :index, :create], Spree::LineItem

View File

@@ -202,7 +202,7 @@ module Spree
fees = adjustments.enterprise_fee.sum(:amount)
(price + fees / quantity).round(2)
(price + (fees / quantity)).round(2)
end
def single_display_amount_with_adjustments
@@ -280,7 +280,7 @@ module Spree
if final_weight_volume.present? && quantity_was > 0
self.final_weight_volume = final_weight_volume * quantity / quantity_was
elsif variant&.unit_value.present?
self.final_weight_volume = variant&.unit_value * quantity
self.final_weight_volume = variant&.unit_value&.* quantity
end
end
end

View File

@@ -23,7 +23,7 @@ module Spree
go_to_state :delivery
go_to_state :payment, if: ->(order) {
order.update_totals
order.payment_required?
order.payment_required? || order.zero_priced_order?
}
go_to_state :confirmation
go_to_state :complete
@@ -219,6 +219,12 @@ module Spree
total.to_f > 0.0 && !skip_payment_for_subscription?
end
# There are items present in the order, but either the items have zero price,
# or the order's total has been modified (maybe discounted) to zero.
def zero_priced_order?
line_items.count.positive? && total.zero?
end
# Returns the relevant zone (if any) to be used for taxation purposes.
# Uses default tax zone unless there is a specific match
def tax_zone
@@ -615,6 +621,10 @@ module Spree
raise Core::GatewayError, Spree.t(:no_pending_payments) if pending_payments.empty?
pending_payments.each do |payment|
if payment.amount.zero? && zero_priced_order?
payment.update_columns(state: "completed", captured_at: Time.zone.now)
end
break if payment_total >= total
yield payment

View File

@@ -97,7 +97,6 @@ module Spree
transition from: [:void], to: :checkout
end
after_transition to: :completed, do: :set_captured_at
end

View File

@@ -25,7 +25,7 @@ module Spree
def exist?(key)
@cache.exist?(key) ||
should_persist? && Spree::Preference.where(key: key).exists?
(should_persist? && Spree::Preference.where(key: key).exists?)
end
def get(key, fallback = nil)

View File

@@ -28,7 +28,7 @@ module Spree
def line_item_shipment(line_item)
return line_item.target_shipment if line_item.target_shipment
return line_item.order.shipments.first if line_item.order&.shipments.any?
return line_item.order.shipments.first if line_item.order&.shipments&.any?
end
# Overrides Spree v2.0.4 validate method version to:

View File

@@ -21,6 +21,12 @@ module Spree
NAME_FIELDS = ["display_name", "display_as", "weight", "unit_value", "unit_description"].freeze
SEARCH_KEY = "#{%w(name
meta_keywords
variants_display_as
variants_display_name
supplier_name).join('_or_')}_cont".freeze
belongs_to :product, -> { with_deleted }, touch: true, class_name: 'Spree::Product'
delegate_belongs_to :product, :name, :description, :tax_category_id, :shipping_category_id,

View File

@@ -1,48 +0,0 @@
# frozen_string_literal: true
module Admin
class ProductsV3Reflex < ApplicationReflex
before_reflex :fetch_products, only: [:fetch]
def fetch
cable_ready.replace(
selector: "#products-content",
html: render(partial: "admin/products_v3/content", locals: { products: @products })
).broadcast
morph :nothing
end
private
# copied from ProductsTableComponent
def fetch_products
product_query = OpenFoodNetwork::Permissions.new(current_user)
.editable_products.merge(product_scope)
@products = product_query.order(:name).limit(50)
end
def product_scope
scope = if current_user.has_spree_role?("admin") || current_user.enterprises.present?
Spree::Product
else
Spree::Product.active
end
scope.includes(product_query_includes)
end
# Optimise by pre-loading required columns
def product_query_includes
# TODO: add other fields used in columns? (eg supplier: [:name])
[
# variants: [
# :default_price,
# :stock_locations,
# :stock_items,
# :variant_overrides
# ]
]
end
end
end

View File

@@ -26,8 +26,8 @@ class ApplicationReflex < StimulusReflex::Reflex
Spree::Ability.new(current_user)
end
def with_locale(&block)
I18n.with_locale(current_user.locale, &block)
def with_locale(&)
I18n.with_locale(current_user.locale, &)
end
def morph_admin_flashes

View File

@@ -0,0 +1,133 @@
# frozen_string_literal: true
class ProductsReflex < ApplicationReflex
include Pagy::Backend
before_reflex :init_filters_params, :init_pagination_params
def fetch
fetch_and_render_products
end
def change_per_page
@per_page = element.value.to_i
@page = 1
fetch_and_render_products
end
def filter
@page = 1
fetch_and_render_products
end
def clear_search
@search_term = nil
@producer_id = nil
@category_id = nil
@page = 1
fetch_and_render_products
end
private
def init_filters_params
# params comes from the form
# _params comes from the url
# priority is given to params from the form (if present) over url params
@search_term = params[:search_term] || params[:_search_term]
@producer_id = params[:producer_id] || params[:_producer_id]
@category_id = params[:category_id] || params[:_category_id]
end
def init_pagination_params
# prority is given to element dataset (if present) over url params
@page = element.dataset.page || params[:_page] || 1
@per_page = element.dataset.perpage || params[:_per_page] || 15
end
def fetch_and_render_products
fetch_products
render_products
end
def render_products
cable_ready.replace(
selector: "#products-content",
html: render(partial: "admin/products_v3/content",
locals: { products: @products, pagy: @pagy, search_term: @search_term,
producer_options: producers, producer_id: @producer_id,
category_options: categories, category_id: @category_id })
).broadcast
cable_ready.replace_state(
url: current_url,
).broadcast_later
morph :nothing
end
def producers
producers = OpenFoodNetwork::Permissions.new(current_user)
.managed_product_enterprises.is_primary_producer.by_name
producers.map { |p| [p.name, p.id] }
end
def categories
Spree::Taxon.order(:name).map { |c| [c.name, c.id] }
end
# copied from ProductsTableComponent
def fetch_products
product_query = OpenFoodNetwork::Permissions.new(current_user)
.editable_products.merge(product_scope).ransack(ransack_query).result
@pagy, @products = pagy(product_query.order(:name), items: @per_page, page: @page)
end
def product_scope
scope = if current_user.has_spree_role?("admin") || current_user.enterprises.present?
Spree::Product
else
Spree::Product.active
end
scope.includes(product_query_includes)
end
def ransack_query
query = { s: "name desc" }
query.merge!(supplier_id_in: @producer_id) if @producer_id.present?
if @search_term.present?
query.merge!(Spree::Variant::SEARCH_KEY => @search_term)
end
query.merge!(primary_taxon_id_in: @category_id) if @category_id.present?
query
end
# Optimise by pre-loading required columns
def product_query_includes
# TODO: add other fields used in columns? (eg supplier: [:name])
[
# variants: [
# :default_price,
# :stock_locations,
# :stock_items,
# :variant_overrides
# ]
]
end
def current_url
url = URI(request.original_url)
url.query = url.query.present? ? "#{url.query}&" : ""
# add params with _ to avoid conflicts with params from the form
url.query += "_page=#{@page}"
url.query += "&_per_page=#{@per_page}"
url.query += "&_search_term=#{@search_term}" if @search_term.present?
url.query += "&_producer_id=#{@producer_id}" if @producer_id.present?
url.query += "&_category_id=#{@category_id}" if @category_id.present?
url.to_s
end
end

View File

@@ -5,15 +5,15 @@ class CacheService
FILTERS_EXPIRY = 30.seconds.freeze
SHOPS_EXPIRY = 15.seconds.freeze
def self.cache(cache_key, options = {}, &block)
Rails.cache.fetch cache_key.to_s, options, &block
def self.cache(cache_key, options = {}, &)
Rails.cache.fetch(cache_key.to_s, options, &)
end
# Yields a cached query, expired by the most recently updated record for a given class.
# E.g: if *any* Spree::Taxon record is updated, all keys based on Spree::Taxon will auto-expire.
def self.cached_data_by_class(cache_key, cached_class, &block)
Rails.cache.fetch "#{cache_key}-#{cached_class}-#{latest_timestamp_by_class(cached_class)}",
&block
def self.cached_data_by_class(cache_key, cached_class, &)
Rails.cache.fetch("#{cache_key}-#{cached_class}-#{latest_timestamp_by_class(cached_class)}",
&)
end
# Gets the :updated_at value of the most recently updated record for a given class, and returns
@@ -22,10 +22,10 @@ class CacheService
cached_class.maximum(:updated_at).to_f
end
def self.home_stats(statistic, &block)
def self.home_stats(statistic, &)
Rails.cache.fetch("home_stats_count_#{statistic}",
expires_in: HOME_STATS_EXPIRY,
race_condition_ttl: 10, &block)
race_condition_ttl: 10, &)
end
module FragmentCaching

View File

@@ -9,8 +9,8 @@ class CurrentOrderLocker
#
# https://guides.rubyonrails.org/action_controller_overview.html#filters
#
def self.around(controller, &block)
lock_order_and_variants(controller.current_order, &block)
def self.around(controller, &)
lock_order_and_variants(controller.current_order, &)
end
# Locking will not prevent all access to these rows. Other processes are

View File

@@ -19,8 +19,10 @@ class VoucherAdjustmentsService
# For now we just assume it is either all tax included in price or all tax excluded from price.
if order.additional_tax_total.positive?
handle_tax_excluded_from_price(order, amount)
else
elsif order.included_tax_total.positive?
handle_tax_included_in_price(order, amount)
else
adjustment.amount = amount
end
# Move to closed state

View File

@@ -46,7 +46,8 @@
= label_tag :custom_tab, t('.create_custom_tab')
.thirteen.columns
= hidden_field_tag :custom_tab, "false" # submit `true` if checkbox is checked, `false` otherwise
= check_box_tag :custom_tab, "true", @object.custom_tab&.title.present?, { "data-controller": "checkbox-display", "data-checkbox-display-target-id-value": "custom_tab_form" }
- checked = @object.custom_tab&.title.present? || @object.errors["custom_tab.title"].present?
= check_box_tag :custom_tab, "true", checked, { "data-controller": "checkbox-display", "data-checkbox-display-target-id-value": "custom_tab_form" }
%div{id: "custom_tab_form"}
= f.fields_for :custom_tab, @object.custom_tab do |custom_tab_form|

View File

@@ -1,10 +1,17 @@
- if products.any?
= render partial: 'table', locals: { products: products }
- else
#no-products
= t('.no_products_found')
#no-products-actions
%a{ href: "/admin/products/new", class: "button icon-plus", icon: "icon-plus" }
= t(:new_product)
%a{ href: "/admin/products/import", class: "button icon-upload secondary", icon: "icon-upload" }
= t(".import_products")
#products-content
.container
.sixteen.columns
= render partial: 'filters', locals: { search_term: search_term,
producer_id: producer_id,
producer_options: producer_options,
category_options: category_options,
category_id: category_id }
- if products.any?
.container
.sixteen.columns
= render partial: 'sort', locals: { pagy: pagy, search_term: search_term, producer_id: producer_id, category_id: category_id }
= render partial: 'table', locals: { products: products }
= render partial: 'admin/shared/v3/pagy', locals: { pagy: pagy, reflex: "click->Products#fetch" }
- else
#no-products
= render partial: "no_products", locals: { search_term: search_term, producer_id: producer_id, category_id: category_id }

View File

@@ -0,0 +1,13 @@
%form{ id: "filters", 'data-reflex-serialize-form': true, 'data-reflex': 'submit->products#filter' }
.query
.search-input
= text_field_tag :search_term, search_term, placeholder: t('.search_products')
.producers
.label= t('.producers.label')
= select_tag :producer_id, options_for_select(producer_options, producer_id), include_blank: t('.all_producers')
.categories
.label= t('.categories.label')
= select_tag :category_id, options_for_select(category_options, category_id), include_blank: t('.all_categories')
.submit
.search-button
= button_tag t(".search"), class: "secondary icon-search"

View File

@@ -0,0 +1,11 @@
- if search_term.present? || producer_id.present? || category_id.present?
= t('.no_products_found_for_search')
%a{ href: "#", class: "button disruptive", data: { reflex: "click->products#clear_search" } }
= t("admin.products_v3.sort.pagination.clear_search")
- else
= t('.no_products_found')
#no-products-actions
%a{ href: "/admin/products/new", class: "button icon-plus", icon: "icon-plus" }
= t(:new_product)
%a{ href: "/admin/products/import", class: "button icon-upload secondary", icon: "icon-upload" }
= t(".import_products")

View File

@@ -0,0 +1,9 @@
#sort
%div
= t(".pagination.total_html", total: pagy.count, from: pagy.from, to: pagy.to)
- if search_term.present? || producer_id.present? || category_id.present?
%a{ href: "#", class: "button disruptive medium", data: { reflex: "click->products#clear_search" } }
= t(".pagination.clear_search")
%div.with-dropdown
= t(".pagination.per_page.show")
= select_tag :per_page, options_for_select([15, 25, 50, 100].collect{|i| [t('.pagination.per_page.per_page', num: i), i]}, pagy.items), data: { reflex: "change->products#change_per_page" }

View File

@@ -8,19 +8,17 @@
%col{ width:"10%" }
%col{ width:"5%" }
%col{ width:"5%", style: "max-width:5em" }
%col{ width:"8%", style: "max-width:8em" }
%thead
%tr
%th.align-left= t('admin.product.name')
%th.align-right= t('admin.sku')
%th.align-right= t('admin.unit')
%th.align-right= t('admin.price')
%th.align-right= t('admin.on_hand')
%th.align-left= t('admin.producer')
%th.align-left= t('admin.category')
%th.align-left= t('admin.tax_category')
%th.align-left= t('admin.inherits_properties')
%th.align-right= t('admin.available_on')
%th.align-left= t('admin.products_page.columns.name')
%th.align-right= t('admin.products_page.columns.sku')
%th.align-right= t('admin.products_page.columns.unit')
%th.align-right= t('admin.products_page.columns.price')
%th.align-right= t('admin.products_page.columns.on_hand')
%th.align-left= t('admin.products_page.columns.producer')
%th.align-left= t('admin.products_page.columns.category')
%th.align-left= t('admin.products_page.columns.tax_category')
%th.align-left= t('admin.products_page.columns.inherits_properties')
- products.each do |product|
%tbody.relaxed
%tr
@@ -43,11 +41,9 @@
%td.align-left
.line-clamp-1= product.taxons.map(&:name).join(', ')
%td.align-left
.line-clamp-1= product.tax_category&.name
.line-clamp-1= product.tax_category&.name || "None" # TODO: convert to dropdown, else translate hardcoded string.
%td.align-left
.line-clamp-1= product.inherits_properties ? 'YES' : 'NO' #TODO: consider using https://github.com/RST-J/human_attribute_values, else use I18n.t (also below)
%td.align-right
.line-clamp-1= product.available_on&.strftime('%F')
- product.variants.each do |variant|
%tr.condensed
%td.align-left
@@ -63,11 +59,9 @@
%td.align-left
.line-clamp-1= variant.product.supplier.name # same as product
%td.align-left
.line-clamp-1= variant.product.taxons.map(&:name).join(', ') # same as product
-# empty
%td.align-left
.line-clamp-1= variant.tax_category&.name
-# empty
%td.align-left
.line-clamp-1= variant.product.inherits_properties ? 'YES' : 'NO' # same as product
%td.align-right
.line-clamp-1= variant.available_on&.strftime('%F')
-# empty

View File

@@ -10,8 +10,8 @@
= render partial: 'spree/admin/shared/product_sub_menu'
#products_v3_page{"data-controller": "productsV3"}
#loading-spinner.spinner-container{"data-productsV3-target": "loading"}
#products_v3_page{ "data-controller": "products" }
#loading-spinner.spinner-container{ "data-controller": "loading", "data-products-target": "loading" }
.spinner
= t('.loading')
#products-content

View File

@@ -2,4 +2,7 @@
- report_subtypes.each do |report_subtype|
%li
- url = main_app.admin_report_path(report_type: report_type, report_subtype: report_subtype[1])
= link_to report_subtype[0], url
- if report_subtype.dig(2, :deprecated)
%strike= link_to report_subtype[0], url, title: t('admin.reports.deprecated')
- else
= link_to report_subtype[0], url

View File

@@ -0,0 +1,21 @@
%nav.pagy_nav.pagination{"aria-label" => "pager", :role => "navigation"}
- if pagy.prev
%a.page.prev{ href: "#", id: "pagy-prev", "data-reflex": reflex, "data-perPage": pagy.items, "data-page": pagy.prev || 1, "aria-label": "previous"}
%i.icon-chevron-left
- else
%span.page.prev.disabled
%i.icon-chevron-left
- pagy.series.each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36]
- if item.is_a?(Integer) # page link
%a.page{ href: "#", id:"pagy-#{item}", "data-reflex": reflex, "data-perPage": pagy.items, "data-page": item, "aria-label": "page #{item}"}
= item
- elsif item.is_a?(String) # current page
%span.page.current= item
- elsif item == :gap # page gap
%span.page.gap &hellip;
- if pagy.next
%a.page.next{ href: "#", id:"pagy-next", "data-reflex": reflex, "data-perPage": pagy.items, "data-page": pagy.next || pagy.last, "aria-label": "next"}
%i.icon-chevron-right
- else
%span.page.next.disabled
%i.icon-chevron-right

View File

@@ -1,4 +1,4 @@
.content
.row
.columns
.columns.custom-tab
= sanitize(@distributor.custom_tab&.content, scrubber: TrixScrubber.new)

View File

@@ -1,155 +1,156 @@
.medium-6
= f.fields :bill_address, model: @order.bill_address do |bill_address|
%div.checkout-substep
-# YOUR DETAILS
%div.checkout-title
= t("split_checkout.step1.contact_information.title")
= form_with url: checkout_update_path(checkout_step), model: @order, method: :put, data: { remote: "true" } do |f|
.medium-6
= f.fields :bill_address, model: @order.bill_address do |bill_address|
%div.checkout-substep
-# YOUR DETAILS
%div.checkout-title
= t("split_checkout.step1.contact_information.title")
.two-columns-inputs
%div.checkout-input.with-floating-label{ "data-controller": "floating-label" }
= f.label :email, t("split_checkout.step1.contact_information.email.label")
= f.text_field :email, { placeholder: " " }
= f.error_message_on :email
.two-columns-inputs
%div.checkout-input.with-floating-label{ "data-controller": "floating-label" }
= f.label :email, t("split_checkout.step1.contact_information.email.label")
= f.text_field :email, { placeholder: " " }
= f.error_message_on :email
%div.checkout-input.with-floating-label{ "data-controller": "floating-label" }
= bill_address.label :phone, t("split_checkout.step1.contact_information.phone.label")
= bill_address.text_field :phone, { placeholder: " " }
= f.error_message_on "bill_address.phone"
%div.checkout-input.with-floating-label{ "data-controller": "floating-label" }
= bill_address.label :phone, t("split_checkout.step1.contact_information.phone.label")
= bill_address.text_field :phone, { placeholder: " " }
= f.error_message_on "bill_address.phone"
%div.checkout-substep
-# BILLING ADDRESS
%div.checkout-title
= t("split_checkout.step1.billing_address.title")
%div.checkout-substep
-# BILLING ADDRESS
%div.checkout-title
= t("split_checkout.step1.billing_address.title")
.two-columns-inputs
%div.checkout-input.with-floating-label{ "data-controller": "floating-label" }
= bill_address.label :firstname, t("split_checkout.step1.billing_address.first_name.label")
= bill_address.text_field :firstname, { placeholder: " " }
= f.error_message_on "bill_address.firstname"
.two-columns-inputs
%div.checkout-input.with-floating-label{ "data-controller": "floating-label" }
= bill_address.label :firstname, t("split_checkout.step1.billing_address.first_name.label")
= bill_address.text_field :firstname, { placeholder: " " }
= f.error_message_on "bill_address.firstname"
%div.checkout-input.with-floating-label{ "data-controller": "floating-label" }
= bill_address.label :lastname, t("split_checkout.step1.billing_address.last_name.label")
= bill_address.text_field :lastname, { placeholder: " " }
= f.error_message_on "bill_address.lastname"
%div.checkout-input.with-floating-label{ "data-controller": "floating-label"}
= bill_address.label :address1, t("split_checkout.step1.address.address1.label")
= bill_address.text_field :address1, { placeholder: " " }
= f.error_message_on "bill_address.address1"
%div.checkout-input.with-floating-label{ "data-controller": "floating-label"}
= bill_address.label :address2, t("split_checkout.step1.address.address2.label")
= bill_address.text_field :address2, { placeholder: " " }
= f.error_message_on "bill_address.address2"
%div.checkout-input.with-floating-label{ "data-controller": "floating-label"}
= bill_address.label :city, t("split_checkout.step1.address.city.label")
= bill_address.text_field :city, { placeholder: " " }
= f.error_message_on "bill_address.city"
%div.checkout-input.with-floating-label{ "data-controller": "floating-label"}
= bill_address.label :zipcode, t("split_checkout.step1.address.zipcode.label")
= bill_address.text_field :zipcode, { placeholder: " " }
= f.error_message_on "bill_address.zipcode"
%div{ "data-controller": "dependent-select", "data-dependent-select-options-value": countries_with_states }
- bill_address_country = @order.bill_address.country || DefaultCountry.country
%div.checkout-input
= bill_address.label :country_id, t("split_checkout.step1.address.country_id.label")
= bill_address.select :country_id, countries, { selected: bill_address_country.id }, { "data-dependent-select-target": "source", "data-action": "dependent-select#handleSelectChange" }
%div.checkout-input
= bill_address.label :state_id, t("split_checkout.step1.address.state_id.label")
= bill_address.select :state_id, states_for_country(bill_address_country), { selected: @order.bill_address&.state_id }, { "data-dependent-select-target": "select" }
- if spree_current_user
%div.checkout-input
= f.check_box :save_bill_address
= f.label :save_bill_address, t(:checkout_default_bill_address)
%div.checkout-substep{ "data-controller": "toggle shippingmethod" }
- selected_shipping_method = @order.shipping_method&.id || params[:shipping_method_id]
%div.checkout-title
= t("split_checkout.step1.shipping_info.title")
- display_ship_address = false
- ship_method_description = nil
- selected_shipping_method ||= @shipping_methods[0].id if @shipping_methods.length == 1
- @shipping_methods.each do |shipping_method|
- ship_method_is_selected = shipping_method.id == selected_shipping_method.to_i
%div.checkout-input.checkout-input-radio
= fields_for shipping_method do |shipping_method_form|
= shipping_method_form.radio_button :name, shipping_method.id,
id: "shipping_method_#{shipping_method.id}",
checked: ship_method_is_selected,
name: "shipping_method_id",
"data-requireAddress": shipping_method.require_ship_address,
"data-action": "toggle#toggle shippingmethod#selectShippingMethod",
"data-toggle-show": shipping_method.require_ship_address
= shipping_method_form.label shipping_method.id, shipping_method.name, {for: "shipping_method_" + shipping_method.id.to_s }
%em.fees= payment_or_shipping_price(shipping_method, @order)
- display_ship_address = display_ship_address || (ship_method_is_selected && shipping_method.require_ship_address)
%div.checkout-input{"data-shippingmethod-target": "shippingMethodDescription", "data-shippingmethodid": shipping_method.id , style: "display: #{ship_method_is_selected ? 'block' : 'none'}" }
#distributor_address.panel
- if shipping_method.description.present?
%span #{shipping_method.description}
%br/
%br/
- if @order.order_cycle.pickup_time_for(@order.distributor)
= t :checkout_ready_for
= @order.order_cycle.pickup_time_for(@order.distributor)
= f.error_message_on :shipping_method, standalone: true
%div.checkout-input{ "data-toggle-target": "content", style: "display: #{display_ship_address ? 'block' : 'none'}" }
= f.check_box :ship_address_same_as_billing, { id: "ship_address_same_as_billing", name: "ship_address_same_as_billing", "data-action": "shippingmethod#showHideShippingAddress", "data-shippingmethod-target": "shippingAddressCheckbox", checked: shipping_and_billing_match?(@order) }, 1, nil
= f.label :ship_address_same_as_billing, t(:checkout_address_same), { for: "ship_address_same_as_billing" }
%div{"data-shippingmethod-target": "shippingMethodAddress", style: "display: #{!display_ship_address || shipping_and_billing_match?(@order) ? 'none' : 'block'}" }
= f.fields :ship_address, model: @order.ship_address do |ship_address|
%div.checkout-input.with-floating-label{ "data-controller": "floating-label"}
= ship_address.label :address1, t("split_checkout.step1.address.address1.label")
= ship_address.text_field :address1, { placeholder: " " }
= f.error_message_on "ship_address.address1"
%div.checkout-input.with-floating-label{ "data-controller": "floating-label" }
= bill_address.label :lastname, t("split_checkout.step1.billing_address.last_name.label")
= bill_address.text_field :lastname, { placeholder: " " }
= f.error_message_on "bill_address.lastname"
%div.checkout-input.with-floating-label{ "data-controller": "floating-label"}
= ship_address.label :address2, t("split_checkout.step1.address.address2.label")
= ship_address.text_field :address2, { placeholder: " " }
= f.error_message_on "ship_address.address2"
= bill_address.label :address1, t("split_checkout.step1.address.address1.label")
= bill_address.text_field :address1, { placeholder: " " }
= f.error_message_on "bill_address.address1"
%div.checkout-input.with-floating-label{ "data-controller": "floating-label"}
= ship_address.label :city, t("split_checkout.step1.address.city.label")
= ship_address.text_field :city, { placeholder: " " }
= f.error_message_on "ship_address.city"
= bill_address.label :address2, t("split_checkout.step1.address.address2.label")
= bill_address.text_field :address2, { placeholder: " " }
= f.error_message_on "bill_address.address2"
%div.checkout-input.with-floating-label{ "data-controller": "floating-label"}
= ship_address.label :zipcode, t("split_checkout.step1.address.zipcode.label")
= ship_address.text_field :zipcode, { placeholder: " " }
= f.error_message_on "ship_address.zipcode"
= bill_address.label :city, t("split_checkout.step1.address.city.label")
= bill_address.text_field :city, { placeholder: " " }
= f.error_message_on "bill_address.city"
%div.checkout-input.with-floating-label{ "data-controller": "floating-label"}
= bill_address.label :zipcode, t("split_checkout.step1.address.zipcode.label")
= bill_address.text_field :zipcode, { placeholder: " " }
= f.error_message_on "bill_address.zipcode"
%div{ "data-controller": "dependent-select", "data-dependent-select-options-value": countries_with_states }
- ship_address_country = @order.ship_address.country || DefaultCountry.country
- bill_address_country = @order.bill_address.country || DefaultCountry.country
%div.checkout-input
= ship_address.label :country_id, t("split_checkout.step1.address.country_id.label")
= ship_address.select :country_id, countries, { selected: ship_address_country.id }, { "data-dependent-select-target": "source", "data-action": "dependent-select#handleSelectChange" }
= bill_address.label :country_id, t("split_checkout.step1.address.country_id.label")
= bill_address.select :country_id, countries, { selected: bill_address_country.id }, { "data-dependent-select-target": "source", "data-action": "dependent-select#handleSelectChange" }
%div.checkout-input
= ship_address.label :state_id, t("split_checkout.step1.address.state_id.label")
= ship_address.select :state_id, states_for_country(ship_address_country), { selected: @order.ship_address&.state_id }, { "data-dependent-select-target": "select" }
= bill_address.label :state_id, t("split_checkout.step1.address.state_id.label")
= bill_address.select :state_id, states_for_country(bill_address_country), { selected: @order.bill_address&.state_id }, { "data-dependent-select-target": "select" }
- if spree_current_user
%div.checkout-input
= f.check_box :save_bill_address
= f.label :save_bill_address, t(:checkout_default_bill_address)
%div.checkout-substep{ "data-controller": "toggle shippingmethod" }
- selected_shipping_method = @order.shipping_method&.id || params[:shipping_method_id]
%div.checkout-title
= t("split_checkout.step1.shipping_info.title")
- display_ship_address = false
- ship_method_description = nil
- selected_shipping_method ||= @shipping_methods[0].id if @shipping_methods.length == 1
- @shipping_methods.each do |shipping_method|
- ship_method_is_selected = shipping_method.id == selected_shipping_method.to_i
%div.checkout-input.checkout-input-radio
= fields_for shipping_method do |shipping_method_form|
= shipping_method_form.radio_button :name, shipping_method.id,
id: "shipping_method_#{shipping_method.id}",
checked: ship_method_is_selected,
name: "shipping_method_id",
"data-requireAddress": shipping_method.require_ship_address,
"data-action": "toggle#toggle shippingmethod#selectShippingMethod",
"data-toggle-show": shipping_method.require_ship_address
= shipping_method_form.label shipping_method.id, shipping_method.name, {for: "shipping_method_" + shipping_method.id.to_s }
%em.fees= payment_or_shipping_price(shipping_method, @order)
- display_ship_address = display_ship_address || (ship_method_is_selected && shipping_method.require_ship_address)
%div.checkout-input{"data-shippingmethod-target": "shippingMethodDescription", "data-shippingmethodid": shipping_method.id , style: "display: #{ship_method_is_selected ? 'block' : 'none'}" }
#distributor_address.panel
- if shipping_method.description.present?
%span #{shipping_method.description}
%br/
%br/
- if @order.order_cycle.pickup_time_for(@order.distributor)
= t :checkout_ready_for
= @order.order_cycle.pickup_time_for(@order.distributor)
= f.error_message_on :shipping_method, standalone: true
- if spree_current_user
%div.checkout-input{ "data-toggle-target": "content", style: "display: #{display_ship_address ? 'block' : 'none'}" }
= f.check_box :save_ship_address
= f.label :save_ship_address, t(:checkout_default_ship_address)
= f.check_box :ship_address_same_as_billing, { id: "ship_address_same_as_billing", name: "ship_address_same_as_billing", "data-action": "shippingmethod#showHideShippingAddress", "data-shippingmethod-target": "shippingAddressCheckbox", checked: shipping_and_billing_match?(@order) }, 1, nil
= f.label :ship_address_same_as_billing, t(:checkout_address_same), { for: "ship_address_same_as_billing" }
.div.checkout-input
= f.label :special_instructions, t(:checkout_instructions)
= f.text_area :special_instructions, size: "60x4"
%div{"data-shippingmethod-target": "shippingMethodAddress", style: "display: #{!display_ship_address || shipping_and_billing_match?(@order) ? 'none' : 'block'}" }
= f.fields :ship_address, model: @order.ship_address do |ship_address|
%div.checkout-input.with-floating-label{ "data-controller": "floating-label"}
= ship_address.label :address1, t("split_checkout.step1.address.address1.label")
= ship_address.text_field :address1, { placeholder: " " }
= f.error_message_on "ship_address.address1"
%div.checkout-submit
= f.submit t("split_checkout.step1.submit"), class: "button primary", disabled: @terms_and_conditions_accepted == false || @platform_tos_accepted == false
%a.button.cancel{href: main_app.cart_path}
= t("split_checkout.step1.cancel")
%div.checkout-input.with-floating-label{ "data-controller": "floating-label"}
= ship_address.label :address2, t("split_checkout.step1.address.address2.label")
= ship_address.text_field :address2, { placeholder: " " }
= f.error_message_on "ship_address.address2"
%div.checkout-input.with-floating-label{ "data-controller": "floating-label"}
= ship_address.label :city, t("split_checkout.step1.address.city.label")
= ship_address.text_field :city, { placeholder: " " }
= f.error_message_on "ship_address.city"
%div.checkout-input.with-floating-label{ "data-controller": "floating-label"}
= ship_address.label :zipcode, t("split_checkout.step1.address.zipcode.label")
= ship_address.text_field :zipcode, { placeholder: " " }
= f.error_message_on "ship_address.zipcode"
%div{ "data-controller": "dependent-select", "data-dependent-select-options-value": countries_with_states }
- ship_address_country = @order.ship_address.country || DefaultCountry.country
%div.checkout-input
= ship_address.label :country_id, t("split_checkout.step1.address.country_id.label")
= ship_address.select :country_id, countries, { selected: ship_address_country.id }, { "data-dependent-select-target": "source", "data-action": "dependent-select#handleSelectChange" }
%div.checkout-input
= ship_address.label :state_id, t("split_checkout.step1.address.state_id.label")
= ship_address.select :state_id, states_for_country(ship_address_country), { selected: @order.ship_address&.state_id }, { "data-dependent-select-target": "select" }
- if spree_current_user
%div.checkout-input{ "data-toggle-target": "content", style: "display: #{display_ship_address ? 'block' : 'none'}" }
= f.check_box :save_ship_address
= f.label :save_ship_address, t(:checkout_default_ship_address)
.div.checkout-input
= f.label :special_instructions, t(:checkout_instructions)
= f.text_area :special_instructions, size: "60x4"
%div.checkout-submit
= f.submit t("split_checkout.step1.submit"), class: "button primary", disabled: @terms_and_conditions_accepted == false || @platform_tos_accepted == false
%a.button.cancel{href: main_app.cart_path}
= t("split_checkout.step1.cancel")

View File

@@ -1,8 +1,5 @@
- content_for :injection_data do
= inject_saved_credit_cards
%div.checkout-step{"class": if checkout_step?(:summary) then "checkout-summary" end}
= form_with url: checkout_update_path(checkout_step), model: @order, method: :put,
data: { remote: "true" } do |form|
= render "split_checkout/#{checkout_step}", f: form
%div.checkout-step{ class: "#{'checkout-summary' if checkout_step?(:summary)}" }
= render "split_checkout/#{checkout_step}"

View File

@@ -1,37 +1,44 @@
.medium-6
%div.checkout-substep{"data-controller": "paymentmethod"}
= render partial: "split_checkout/voucher_section", formats: [:cable_ready], locals: { order: @order, voucher_adjustment: @voucher_adjustment }
%div.checkout-title
= t("split_checkout.step2.payment_method.title")
.medium-6#checkout-payment-methods
- if feature?(:vouchers, spree_current_user) && @order.distributor.vouchers.present?
%div.checkout-substep
= render partial: "split_checkout/voucher_section", locals: { order: @order, voucher_adjustment: @order.voucher_adjustments.first }
- selected_payment_method = @order.payments&.with_state(:checkout)&.first&.payment_method_id
- selected_payment_method ||= available_payment_methods[0].id if available_payment_methods.length == 1
- available_payment_methods.each do |payment_method|
%div.checkout-input.checkout-input-radio
= f.radio_button :payment_method_id, payment_method.id,
id: "payment_method_#{payment_method.id}",
name: "order[payments_attributes][][payment_method_id]",
checked: (payment_method.id == selected_payment_method),
"data-action": "paymentmethod#selectPaymentMethod",
"data-paymentmethod-id": "#{payment_method.id}",
"data-paymentmethod-target": "input"
= f.label :payment_method_id, "#{payment_method.name}", for: "payment_method_#{payment_method.id}"
%em.fees=payment_or_shipping_price(payment_method, @order)
= form_with url: checkout_update_path(local_assigns[:step] || checkout_step), model: @order, method: :put, data: { remote: "true" } do |f|
%div.checkout-substep{"data-controller": "paymentmethod"}
%div.checkout-title
= t("split_checkout.step2.payment_method.title")
.paymentmethod-container{"data-paymentmethod-id": "#{payment_method.id}", style: "display: #{payment_method.id == selected_payment_method ? "block" : "none"}"}
- if payment_method.description && !payment_method.description.empty?
.paymentmethod-description.panel
#{payment_method.description}
.paymentmethod-form
= render partial: "split_checkout/payment/#{payment_method.method_type}", locals: { payment_method: payment_method, f: f }
- if @order.zero_priced_order?
%h3= t(:no_payment_required)
= hidden_field_tag "order[payments_attributes][][amount]", 0
- else
- selected_payment_method = @order.payments&.with_state(:checkout)&.first&.payment_method_id
- selected_payment_method ||= available_payment_methods[0].id if available_payment_methods.length == 1
- available_payment_methods.each do |payment_method|
%div.checkout-input.checkout-input-radio
= f.radio_button :payment_method_id, payment_method.id,
id: "payment_method_#{payment_method.id}",
name: "order[payments_attributes][][payment_method_id]",
checked: (payment_method.id == selected_payment_method),
"data-action": "paymentmethod#selectPaymentMethod",
"data-paymentmethod-id": "#{payment_method.id}",
"data-paymentmethod-target": "input"
= f.label :payment_method_id, "#{payment_method.name}", for: "payment_method_#{payment_method.id}"
%em.fees=payment_or_shipping_price(payment_method, @order)
= f.error_message_on :payment_method, standalone: true
%div.checkout-substep
= t("split_checkout.step2.explaination")
.paymentmethod-container{"data-paymentmethod-id": "#{payment_method.id}", style: "display: #{payment_method.id == selected_payment_method ? "block" : "none"}"}
- if payment_method.description && !payment_method.description.empty?
.paymentmethod-description.panel
#{payment_method.description}
.paymentmethod-form
= render partial: "split_checkout/payment/#{payment_method.method_type}", locals: { payment_method: payment_method, f: f }
%div.checkout-submit
= f.submit t("split_checkout.step2.submit"), class: "button primary", disabled: @terms_and_conditions_accepted == false || @platform_tos_accepted == false
%a.button.cancel{href: main_app.checkout_step_path(:details)}
= t("split_checkout.step2.cancel")
= f.error_message_on :payment_method, standalone: true
%div.checkout-substep
= t("split_checkout.step2.explaination")
%div.checkout-submit
= f.submit t("split_checkout.step2.submit"), class: "button primary", disabled: @terms_and_conditions_accepted == false || @platform_tos_accepted == false
%a.button.cancel{href: main_app.checkout_step_path(:details)}
= t("split_checkout.step2.cancel")

View File

@@ -1,103 +1,111 @@
.summary-main
= render partial: "split_checkout/already_ordered" if show_bought_items? && checkout_step?(:summary)
.checkout-substep
.checkout-title
= t("split_checkout.step3.delivery_details.title")
%a.summary-edit{href: main_app.checkout_step_path(:details)}
= t("split_checkout.step3.delivery_details.edit")
= form_with url: checkout_update_path(checkout_step), model: @order, method: :put, data: { remote: "true" } do |f|
.summary-main
= render partial: "split_checkout/already_ordered" if show_bought_items? && checkout_step?(:summary)
.checkout-substep
.checkout-title
= t("split_checkout.step3.delivery_details.title")
%a.summary-edit{href: main_app.checkout_step_path(:details)}
= t("split_checkout.step3.delivery_details.edit")
.summary-subtitle
= @order.shipping_method.name
%em.fees= payment_or_shipping_price(@order.shipping_method, @order)
.two-columns
%div
.summary-subtitle
= t("split_checkout.step3.delivery_details.address")
%span
= @order.bill_address.firstname
= @order.bill_address.lastname
%div
= @order.bill_address.phone
.summary-subtitle
= @order.shipping_method.name
%em.fees= payment_or_shipping_price(@order.shipping_method, @order)
.two-columns
%div
= @order.user.email if @order.user
%br
%div
= @order.bill_address.address1
- unless @order.bill_address.address2.blank?
.summary-subtitle
= t("split_checkout.step3.delivery_details.address")
%span
= @order.ship_address.firstname
= @order.ship_address.lastname
%div
= @order.bill_address.address2
%div
= @order.bill_address.city
%div
= @order.bill_address.state
%div
= @order.bill_address.zipcode
%div
= @order.bill_address.country
- if @order.special_instructions.present?
= @order.ship_address.phone
%div
= @order.user.email if @order.user
%br
%em
= @order.special_instructions
- if @order.shipping_method.description.present?
%div
.summary-subtitle
= t("split_checkout.step3.delivery_details.instructions")
%div
= @order.shipping_method.description
%hr
= @order.ship_address.address1
- unless @order.ship_address.address2.blank?
%div
= @order.ship_address.address2
%div
= @order.ship_address.city
%div
= @order.ship_address.state
%div
= @order.ship_address.zipcode
%div
= @order.ship_address.country
- if @order.special_instructions.present?
%br
%em
= @order.special_instructions
- if @order.shipping_method.description.present?
%div
.summary-subtitle
= t("split_checkout.step3.delivery_details.instructions")
%div
= @order.shipping_method.description
.checkout-substep
.checkout-title
= t("split_checkout.step3.payment_method.title")
%a.summary-edit{href: main_app.checkout_step_path(:payment)}
= t("split_checkout.step3.payment_method.edit")
.two-columns
%div
%hr
.checkout-substep
.checkout-title
= t("split_checkout.step3.payment_method.title")
%a.summary-edit{href: main_app.checkout_step_path(:payment)}
= t("split_checkout.step3.payment_method.edit")
.two-columns
- payment_method = last_payment_method(@order)
= payment_method&.name
%em.fees=payment_or_shipping_price(payment_method, @order)
- if payment_method&.description.present?
%div
.summary-subtitle
= t("split_checkout.step3.payment_method.instructions")
- if payment_method
= payment_method.name
%em.fees
= payment_or_shipping_price(payment_method, @order)
- elsif @order.zero_priced_order?
%h4= t(:no_payment_required)
- if payment_method&.description.present?
%div
= last_payment_method(@order)&.description
.summary-subtitle
= t("split_checkout.step3.payment_method.instructions")
%div
= payment_method&.description
%div.checkout-substep
%div.checkout-title
= t("split_checkout.step3.order.title")
%a.summary-edit{href: main_app.cart_path}
= t("split_checkout.step3.order.edit")
= render 'spree/orders/summary', order: @order, display_footer: false
%div.checkout-substep
%div.checkout-title
= t("split_checkout.step3.order.title")
%a.summary-edit{href: main_app.cart_path}
= t("split_checkout.step3.order.edit")
= render 'spree/orders/summary', order: @order, display_footer: false
.summary-right{ "data-controller": "sticky", "data-sticky-target": "container" }
.summary-right-line.total
.summary-right-line-label= t :order_total_price
.summary-right-line-value#order_total= @order.display_total.to_html
.summary-right-line
.summary-right-line-label= t :order_produce
.summary-right-line-value= display_checkout_subtotal(@order)
.summary-right{ "data-controller": "sticky", "data-sticky-target": "container" }
.summary-right-line.total
.summary-right-line-label= t :order_total_price
.summary-right-line-value#order_total= @order.display_total.to_html
- checkout_adjustments_for(@order, exclude: [:line_item]).reverse_each do |adjustment|
.summary-right-line
-if adjustment.originator_type == 'Voucher'
.summary-right-line-label.voucher= adjustment.label
.summary-right-line-value.voucher= adjustment.display_amount.to_html
-else
.summary-right-line-label= adjustment.label
.summary-right-line-value= adjustment.display_amount.to_html
.summary-right-line-label= t :order_produce
.summary-right-line-value= display_checkout_subtotal(@order)
- if @order.total_tax > 0
.summary-right-line
.summary-right-line-label= t :order_includes_tax
.summary-right-line-value#tax-row= display_checkout_tax_total(@order)
.checkout-submit
- if any_terms_required?(@order.distributor)
= render partial: "terms_and_conditions", locals: { f: f }
= f.submit t("split_checkout.step3.submit"), name: "confirm_order", class: "button primary", disabled: @terms_and_conditions_accepted == false || @platform_tos_accepted == false
- checkout_adjustments_for(@order, exclude: [:line_item]).reverse_each do |adjustment|
.summary-right-line
- if adjustment.originator_type == 'Voucher'
.summary-right-line-label.voucher
= "#{t(:voucher)}:"
= adjustment.label
.summary-right-line-value.voucher= adjustment.display_amount.to_html
- else
.summary-right-line-label= adjustment.label
.summary-right-line-value= adjustment.display_amount.to_html
- if @order.total_tax > 0
.summary-right-line
.summary-right-line-label= t :order_includes_tax
.summary-right-line-value#tax-row= display_checkout_tax_total(@order)
.checkout-submit
- if any_terms_required?(@order.distributor)
= render partial: "terms_and_conditions", locals: { f: f }
= f.submit t("split_checkout.step3.submit"), name: "confirm_order", class: "button primary", disabled: @terms_and_conditions_accepted == false || @platform_tos_accepted == false

View File

@@ -1,19 +0,0 @@
%div#voucher-section
- if order.distributor.vouchers.present?
.checkout-title
= t("split_checkout.step2.voucher.apply_voucher")
.checkout-input
.two-columns-inputs.voucher{"data-controller": "toggle-button-disabled"}
- if voucher_adjustment.present?
%span.button.voucher-added
%i.ofn-i_051-check-big
= t("split_checkout.step2.voucher.voucher", voucher_amount: voucher_adjustment.originator.display_value)
= link_to t("split_checkout.step2.voucher.remove_code"), voucher_adjustment_path(id: voucher_adjustment.id), method: "delete", data: { confirm: t("split_checkout.step2.voucher.confirm_delete") }
- # This might not be true, ie payment method including a fee which wouldn't be covered by voucher or tax implication raising total to be bigger than the voucher amount ?
- if voucher_adjustment.originator.amount > order.total
.checkout-input
%span.formError.standalone
= t("split_checkout.step2.voucher.warning_forfeit_remaining_amount")
- else
= text_field_tag "[order][voucher_code]", params.dig(:order, :voucher_code), data: { action: "input->toggle-button-disabled#inputIsChanged", }, placeholder: t("split_checkout.step2.voucher.placeholder") , class: "voucher"
= submit_tag t("split_checkout.step2.voucher.apply"), name: "apply_voucher", disabled: true, class: "button cancel voucher", "data-disable-with": false, data: { "toggle-button-disabled-target": "button" }

View File

@@ -0,0 +1,25 @@
%div#voucher-section
.checkout-title
= t("split_checkout.step2.voucher.apply_voucher")
.checkout-input{"data-controller": "toggle-button-disabled"}
= form_with url: voucher_adjustments_path, model: @order, method: :post, data: { remote: true } do |form|
- if voucher_adjustment.present?
.two-columns-inputs.voucher
%span.button.voucher-added
%i.ofn-i_051-check-big
= t("split_checkout.step2.voucher.voucher", voucher_amount: voucher_adjustment.originator.display_value)
= link_to t("split_checkout.step2.voucher.remove_code"), voucher_adjustment_path(id: voucher_adjustment.id), method: "delete", data: { confirm: t("split_checkout.step2.voucher.confirm_delete") }
- # This might not be true, ie payment method including a fee which wouldn't be covered by voucher or tax implication raising total to be bigger than the voucher amount ?
- if voucher_adjustment.originator.amount > order.pre_discount_total
.checkout-input
%span.formError.standalone
= t("split_checkout.step2.voucher.warning_forfeit_remaining_amount")
- else
.two-columns-inputs
%div.checkout-input
= form.text_field :voucher_code, value: params.dig(:order, :voucher_code), data: { action: "input->toggle-button-disabled#inputIsChanged" }, placeholder: t("split_checkout.step2.voucher.placeholder"), class: "voucher"
= form.error_message_on :voucher_code
%div.checkout-input
= form.submit t("split_checkout.step2.voucher.apply"), disabled: true, class: "button cancel voucher-button", "data-disable-with": false, data: { "toggle-button-disabled-target": "button" }

View File

@@ -1,15 +1,17 @@
- saved_credit_cards = spree_current_user&.credit_cards&.with_payment_profile.to_a
%div{"data-controller": "stripe-cards", "data-paymentmethod-id": "#{payment_method.id}" }
- if @saved_credit_cards.any?
- if saved_credit_cards.any?
.checkout-input
%label
= t('split_checkout.step2.form.stripe.use_saved_card')
= select_tag :existing_card_id,
options_for_select(stripe_card_options(@saved_credit_cards) + [[t('split_checkout.step2.form.stripe.create_new_card'), ""]], @selected_card),
options_for_select(stripe_card_options(saved_credit_cards) + [[t('split_checkout.step2.form.stripe.create_new_card'), ""]], nil),
{ "data-action": "change->stripe-cards#onSelectCard", "data-stripe-cards-target": "select" }
%div{"data-stripe-cards-target": "stripeelements"}
.checkout-input
- if @saved_credit_cards.none?
- if saved_credit_cards.none?
%label
= t('split_checkout.step2.form.stripe.use_new_card')

View File

@@ -5,7 +5,7 @@
%th= t(:invoice_number)
%th= t(:amount)
%th= t(:status)
%th= t(:file)
%th= t(:invoice_file)
%tbody
- @order.invoices.each do |invoice|
- tr_class = cycle('odd', 'even')
@@ -18,7 +18,7 @@
%td.align-center.label
= invoice.presenter.total
%td.align-center.label
= t(invoice.status)
= t(invoice.cancelled ? :cancelled : :active)
%td.align-center.label
=link_to(t(:download),print_admin_order_path(@order,invoice_id: invoice.id),target: "_blank")

View File

@@ -3,13 +3,13 @@
%span{ "data-controller": "checked-feedback", "data-checked-feedback-translation-value": "spree.admin.orders.index.selected" }
= t("spree.admin.orders.index.selected", count: 0)
%button.plain.ofn-drop-down.disabled{ "data-checked-target": "disable" }
%div.plain.ofn-drop-down.disabled{ "data-checked-target": "disable", "data-controller": "dropdown", "data-action": "click->dropdown#toggle" }
%span{ class: 'icon-reorder' }
="#{t('admin.actions')}".html_safe
%span.toggle-off.icon-caret-up
%span.toggle-on.icon-caret-down
%span
%i{ "data-dropdown-target": "arrow", "data-expanded-class": "icon-caret-up", "data-collapsed-class": "icon-caret-down" }
%div.menu.dropdown-content
%div.menu{ "data-dropdown-target": "menu" }
%div.menu_item
%span.name{ "data-controller": "modal-link", "data-action": "click->modal-link#open", "data-modal-link-target-value": "resend_confirmation" }
= t('spree.admin.orders.index.resend_confirmation')

View File

@@ -1,3 +1,5 @@
%a{href:"https://github.com/openfoodfoundation/openfoodnetwork/releases", target: "_blank", title: t('.view_all_releases')}
=# Show the latest tag. If there are commits since the tag, show number of commits and an identifier. If the working tree is dirty, show 'modified'.
= Rails.application.config.x.git_version
.row
.sixteen.columns{ style: "text-align: center;" }
%a{href:"https://github.com/openfoodfoundation/openfoodnetwork/releases", target: "_blank", title: t('.view_all_releases')}
=# Show the latest tag. If there are commits since the tag, show number of commits and an identifier. If the working tree is dirty, show 'modified'.
= Rails.application.config.x.git_version

View File

@@ -11,7 +11,9 @@
%tr{class: "#{cycle('odd', 'even')}"}
%td= pretty_time(payment.created_at)
%td.align-center= payment.display_amount.to_html
%td.align-center= link_to payment_method_name(payment), spree.admin_order_payment_path(@order, payment)
%td.align-center
- if payment.payment_method_id
= link_to payment_method_name(payment), spree.admin_order_payment_path(@order, payment)
%td.align-center
%span{class: "state #{payment.state}"}= t(payment.state, scope: "spree.payment_states", default: payment.state.capitalize)
%td.actions

View File

@@ -1,8 +1,10 @@
- content_for :sub_menu do
%ul#sub_nav.inline-menu
= tab :products, match_path: '/products'
= tab :products
= tab :properties
= tab :variant_overrides, url: main_app.admin_inventory_path, match_path: '/inventory'
= tab :import, url: main_app.admin_product_import_path, match_path: '/product_import'
- if feature?(:new_products_page, spree_current_user)
= tab :new_products, url: main_app.admin_new_products_path, match_path: '/new_products'
= tab :new_products, url: main_app.admin_new_products_path
- if feature?(:admin_style_v3, spree_current_user)
= tab :products_v3, url: main_app.admin_products_v3_path

View File

@@ -12,6 +12,8 @@
%tr.total
%td.text-right{:colspan => "3"}
%strong
- if adjustment.originator_type == "Voucher"
= "#{t(:voucher)}:"
= adjustment.label
%td.text-right.total
%span= adjustment.display_amount.to_html

View File

@@ -11,11 +11,15 @@
%strong
= order.display_total.to_html
.pad
.text-big
= t :order_payment
%strong= last_payment_method(order)&.name
%p.text-small.text-skinny.pre-line.word-wrap
%em= last_payment_method(order)&.description
- if (order_payment_method = last_payment_method(order))
.text-big
= t :order_payment
%strong= order_payment_method&.name
%p.text-small.text-skinny.pre-line.word-wrap
%em= order_payment_method&.description
- else
.text-big
= t(:no_payment_required)
.order-summary.text-small
%strong

View File

@@ -4,10 +4,20 @@ export default class extends Controller {
static targets = ["arrow", "menu"];
connect() {
this.collapsedClasses = this.arrowTarget.dataset.collapsedClass.split(" ");
this.expandedClasses = this.arrowTarget.dataset.expandedClass.split(" ");
this.#hide();
document.addEventListener("click", this.#onBodyClick.bind(this));
}
disconnect() {
document.removeEventListener("click", this.#onBodyClick);
}
toggle() {
if (this.element.classList.contains("disabled")) {
return;
}
if (this.menuTarget.classList.contains("hidden")) {
this.#show();
} else {
@@ -15,14 +25,20 @@ export default class extends Controller {
}
}
#onBodyClick(event) {
if (!this.element.contains(event.target)) {
this.#hide();
}
}
#show() {
this.menuTarget.classList.remove("hidden");
this.arrowTarget.classList.remove(this.arrowTarget.dataset.collapsedClass);
this.arrowTarget.classList.add(this.arrowTarget.dataset.expandedClass);
this.arrowTarget.classList.remove(...this.collapsedClasses);
this.arrowTarget.classList.add(...this.expandedClasses);
}
#hide() {
this.menuTarget.classList.add("hidden");
this.arrowTarget.classList.remove(this.arrowTarget.dataset.expandedClass);
this.arrowTarget.classList.add(this.arrowTarget.dataset.collapsedClass);
this.arrowTarget.classList.remove(...this.expandedClasses);
this.arrowTarget.classList.add(...this.collapsedClasses);
}
}

View File

@@ -0,0 +1,15 @@
import ApplicationController from "./application_controller";
export default class extends ApplicationController {
connect() {
super.connect();
}
hideLoading = () => {
this.element.classList.add("hidden");
};
showLoading = () => {
this.element.classList.remove("hidden");
};
}

View File

@@ -1,24 +0,0 @@
import ApplicationController from "./application_controller";
export default class extends ApplicationController {
static targets = ["loading"];
connect() {
super.connect();
// Fetch the products on page load
this.load();
}
load = () => {
this.showLoading();
this.stimulate("Admin::ProductsV3#fetch").then(() => this.hideLoading());
};
hideLoading = () => {
this.loadingTarget.classList.add("hidden");
};
showLoading = () => {
this.loadingTarget.classList.remove("hidden");
};
}

View File

@@ -0,0 +1,38 @@
import ApplicationController from "./application_controller";
export default class extends ApplicationController {
static targets = ["loading"];
connect() {
super.connect();
// Fetch the products on page load
this.stimulate("Products#fetch");
}
beforeReflex() {
this.showLoading();
}
afterReflex() {
this.hideLoading();
}
showLoading = () => {
if (this.getLoadingController()) {
this.getLoadingController().showLoading();
}
};
hideLoading = () => {
if (this.getLoadingController()) {
this.getLoadingController().hideLoading();
}
};
getLoadingController = () => {
return (this.loadongController = this.application.getControllerForElementAndIdentifier(
this.loadingTarget,
"loading"
));
};
}

View File

@@ -20,14 +20,6 @@
.dropdown-content {
display: inline-block;
}
.toggle-off {
display: inline-block;
}
.toggle-on {
display: none;
}
}
}

View File

@@ -1,12 +1,16 @@
// Customisations for the new Bulk Edit Products page only
.products_v3_page {
#content .container {
#content > .row:first-child > .container:first-child {
// Allow table to extend to full width of available screen space
// TODO: move this to a generic rule, eg body.full-width{}. Then it can be included on any page.
// or even better, create a switch that allows you to yield the page content without the surrounding content class. then you still have control to add the .content div where needed.
max-width: none;
}
#products-content > .container:first-child {
position: static;
}
// Hopefully these rules will be moved to component(s).
table.products {
table-layout: fixed; // Column widths are based solely on col definitions (not content). This allows more efficient rendering.
@@ -78,4 +82,98 @@
gap: 20px;
}
}
#sort,
#filters {
margin-bottom: 1em;
display: flex;
justify-content: space-between;
align-items: center;
}
#sort {
line-height: $btn-medium-height;
height: $btn-medium-height;
.with-dropdown {
display: flex;
justify-content: space-between;
align-items: center;
gap: 10px;
}
}
#filters {
gap: 20px;
align-items: flex-end;
.producers,
.categories {
> .label {
margin-left: 3px;
margin-bottom: 2px;
}
}
.query {
flex-grow: 1;
}
.producers,
.categories {
flex-grow: 0;
}
.submit {
flex-grow: 0;
}
.query {
.search-input {
width: 100%;
position: relative;
background-color: $lighter-grey;
border: 1px solid $lighter-grey;
border-radius: 4px;
height: $btn-height;
line-height: $btn-height;
&:has(input:focus),
&:has(input:active) {
border: 1px solid $dark-blue;
}
> input {
background-color: $lighter-grey;
}
&:before {
font-family: FontAwesome;
content: "\f002";
color: $near-black;
font-size: 16px;
margin-left: 10px;
}
}
}
.producers,
.categories {
select {
width: 150px;
height: $btn-height;
}
}
.submit {
text-align: right;
.search-button {
position: relative;
> input {
padding-left: 30px;
}
}
}
}
}

View File

@@ -2,9 +2,25 @@ trix-toolbar [data-trix-button-group="file-tools"] {
display: none;
}
// Match the rendering into the shopfront
trix-editor {
color: $darker-grey;
ol,
ul {
margin-left: 1.5em;
}
a {
color: $ofn-brand;
}
// Copy/pasted from _type.scss
blockquote {
line-height: 1.6;
color: #6f6f6f;
margin: 0 0 1.25rem;
padding: 0.5625rem 1.25rem 0 1.1875rem;
border-left: 1px solid #dddddd;
}
}

View File

@@ -16,5 +16,3 @@ $admin-table-border: $pale-blue;
$modal-close-button-color: #de6060;
$modal-close-button-hover-color: #bf4545;
$disabled-button: $light-grey;
$border-radius: 3px;

View File

@@ -22,15 +22,16 @@
@import "globals/variables"; // admin_v3
@import "../admin/variables";
@import "../admin/globals/mixins";
@import "mixins"; // admin_v3
@import "../admin/plugins/font-awesome";
@import "../shared/variables/layout";
@import "../shared/variables/variables";
@import "../shared/utilities";
@import "../admin/shared/typography";
@import "shared/typography"; // admin_v3
@import "shared/tables"; // admin_v3
@import "../admin/shared/icons";
@import "shared/icons"; // admin_v3
@import "../admin/shared/forms";
@import "shared/layout"; // admin_v3
@import "../admin/shared/scroll_bar";
@@ -50,7 +51,7 @@
@import "../admin/components/actions";
@import "../admin/components/alert-box";
@import "../admin/components/alert_row";
@import "../admin/components/buttons";
@import "components/buttons"; // admin_v3
@import "../admin/components/date-picker";
@import "../admin/components/dialogs";
@import "../admin/components/input";

View File

@@ -0,0 +1,108 @@
input[type="submit"],
input[type="button"]:not(.trix-button),
button:not(.plain):not(.trix-button),
.button {
position: relative;
cursor: pointer;
font-size: 14px;
@include border-radius($border-radius);
display: inline-block;
padding: 0px 12px;
background-color: $color-btn-bg;
border: 1px solid $color-btn-bg;
color: $color-btn-text;
text-transform: uppercase;
line-height: 40px;
height: 40px;
font-weight: bold;
&:before {
font-weight: normal !important;
}
&:active,
&:focus {
outline: none;
border: 1px solid $color-btn-hover-border;
}
&:active:focus {
box-shadow: none;
}
&:hover {
background-color: $color-btn-hover-bg;
border: 1px solid $color-btn-hover-bg;
color: $color-btn-hover-text;
}
&.fullwidth {
width: 100%;
text-align: center;
}
&.secondary {
background-color: transparent;
border: 1px solid $color-btn-bg;
color: $color-btn-bg;
&:hover {
background-color: $color-11;
border: 1px solid $color-10;
color: $color-10;
}
&:active,
&:focus {
background-color: $color-11;
border: 1px solid $color-4;
color: $color-4;
}
}
&.disruptive {
background-color: transparent;
border: 1px solid $color-5;
color: $color-5;
&:hover {
background-color: $fair-pink;
border: 1px solid $color-5;
color: $color-5;
}
&:active,
&:focus {
background-color: $fair-pink;
border: 1px solid $roof-terracotta;
color: $roof-terracotta;
}
}
&.medium {
line-height: $btn-medium-height;
height: $btn-medium-height;
}
.badge {
position: absolute;
top: 0;
right: 0;
transform: translateY(-50%);
font-size: 10px;
text-transform: capitalize;
padding: 0px 5px;
border-radius: 3px;
&:before {
padding: 0;
}
&.danger {
background-color: $warning-red;
}
&.success {
background-color: $spree-green;
}
}
}

View File

@@ -61,46 +61,9 @@ nav.menu {
}
#admin-menu {
box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.05), 0px 2px 2px rgba(0, 0, 0, 0.07);
ul {
display: flex;
}
@include defaultBoxShadow;
li {
min-width: 90px;
flex-grow: 1;
padding-left: 2px;
padding-right: 2px;
a {
display: block;
padding: 25px 5px;
color: $dark-grey !important;
position: relative;
text-align: center;
font-weight: 600;
font-size: 16px;
i {
display: inline;
}
&:hover {
color: $red !important;
border-bottom: 2px solid $red;
}
span.text {
font-weight: 600;
}
}
a::before {
font-weight: normal;
padding-top: 0;
}
.dropdown {
width: 300px;
background-color: $teal;
@@ -115,31 +78,71 @@ nav.menu {
}
}
}
&.selected a {
@extend a, :hover;
}
}
}
#sub-menu {
padding-bottom: 0;
box-shadow: 0px 1px 0px $light-grey;
box-shadow: 0px 1px 0px $color-7;
}
li {
a {
display: block;
padding: 12px 20px;
color: $dark-grey;
text-align: center;
position: relative;
font-size: 14px;
// Factorized rules on menu item for admin menu and sub menu
#admin-menu,
#sub-menu {
.container {
padding-left: 10px;
padding-right: 10px;
}
ul {
display: flex;
li {
a {
display: inline-block;
padding: 16px 20px;
color: $color-9 !important;
text-align: center;
position: relative;
font-size: 14px;
font-weight: 600;
&:hover {
color: $red !important;
&:after {
content: "";
position: absolute;
bottom: 0;
left: 20px;
right: 20px;
height: 3px;
background: $red;
}
}
}
&.selected a {
@extend a, :hover;
}
}
}
}
&.selected a,
a:hover {
color: $red;
border-bottom: 2px solid $red;
// Specific rules on menu item for admin menu and sub menu
#admin-menu {
ul {
justify-content: space-between;
li a {
font-size: 16px;
}
}
}
#sub-menu {
ul li a:hover {
&:after {
height: 2px;
}
}
}
@@ -148,6 +151,11 @@ nav.menu {
margin: 0.25em 0;
}
#header .container {
padding-left: 30px;
padding-right: 30px;
}
#login-nav {
line-height: 1.75em;
}

View File

@@ -1,21 +1,37 @@
.pagination {
text-align: center;
margin: 2em 0 1em;
margin: 0 0 1em;
padding: 10px 0;
background-color: $light-grey;
background-color: $color-7;
.page {
padding: 5px 8px;
width: 40px;
line-height: 40px;
text-align: center;
display: inline-block;
text-align: center;
background-color: $color-1;
@include defaultBoxShadow;
border-radius: 4px;
color: $color-9;
&.current {
background-color: $green;
border-radius: 3px;
background-color: $color-5;
color: $white;
}
&.prev {
margin-right: 20px;
}
&.next {
margin-left: 20px;
}
&.disabled {
cursor: default;
}
}
button {

View File

@@ -10,6 +10,7 @@
gap: 40px;
font-size: 24px;
background: rgba(255, 255, 255, 0.8);
z-index: 2;
&.hidden {
display: none;

View File

@@ -2,12 +2,17 @@
$white: #ffffff !default; // White
$green: #9fc820 !default; // Green
$teal: #008397 !default; // Teal (Allports)
$orient: #006878 !default; // Orient (Cerulean)
$dark-blue: #004e5b !default; // Dark Blue (Sherpa)
$red: #c85136 !default; // Red/Orange (Mojo)
$yellow: #ff9300 !default; // Yellow
$mystic: #d9e8eb !default; // Mystic
$lighter-grey: #f8f9fa !default; // Lighter grey
$light-grey: #eff1f2 !default; // Light grey
$near-black: #191c1d !default; // Near-black
$dark-grey: #2e3132 !default; // Dark Grey
$fair-pink: #ffefeb !default; // Fair Pink
$roof-terracotta: #b83b1f !default; // Roof Terracotta
// Old colour variables for backwards compatibility
$color-1: $white;
@@ -19,3 +24,7 @@ $color-6: $yellow;
$color-7: $light-grey;
$color-8: $near-black;
$color-9: $dark-grey;
$color-10: $orient;
$color-11: $mystic;
$color-12: $fair-pink;
$color-13: $roof-terracotta;

View File

@@ -39,8 +39,9 @@ $padding-tbl-cell-relaxed: 16px 12px;
$color-btn-bg: $teal !default;
$color-btn-text: $white !default;
$color-btn-shadow: 0px 1px 0px rgba(0, 0, 0, 0.05), 0px 2px 2px rgba(0, 0, 0, 0.07) !default;
$color-btn-hover-bg: lighten($color-btn-bg, 2) !default;
$color-btn-hover-bg: $orient !default;
$color-btn-hover-text: $white !default;
$color-btn-hover-border: $dark-blue !default;
// Actions colors
$color-action-edit-bg: very-light($color-success, 5 ) !default;
@@ -142,7 +143,10 @@ $h3-size: $h4-size + 2 !default;
$h2-size: $h3-size + 2 !default;
$h1-size: $h2-size + 2 !default;
$border-radius: 3px !default;
$border-radius: 4px !default;
$font-weight-bold: 600 !default;
$font-weight-normal: 400 !default;
$btn-height: 40px !default;
$btn-medium-height: 32px !default;

View File

@@ -0,0 +1,3 @@
@mixin defaultBoxShadow {
box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.05), 0px 2px 2px rgba(0, 0, 0, 0.07);
}

View File

@@ -0,0 +1,42 @@
// Some fixes for fontwesome stylesheets
[class*="icon-"] {
&:before {
padding-right: 5px;
}
&.button,
&.icon_link {
&:before {
padding-right: 8px;
}
}
}
// for the button tagname as well
button[class*="icon-"] {
&:before {
padding-right: 8px;
}
}
.icon-email:before {
@extend .icon-envelope, :before;
}
.icon-resend_authorization_email:before {
@extend .icon-envelope, :before;
}
.icon-resume:before {
@extend .icon-refresh, :before;
}
.icon-cancel:before,
.icon-void:before {
@extend .icon-remove, :before;
}
.icon-capture {
@extend .icon-ok;
}
.icon-credit:before {
@extend .icon-ok, :before;
}

View File

@@ -205,3 +205,7 @@ table {
}
}
}
table + .pagination {
margin-top: -18px;
}

View File

@@ -0,0 +1,226 @@
// Base
//--------------------------------------------------------------
body,
div,
dl,
dt,
dd,
ul,
ol,
li,
h1,
h2,
h3,
h4,
h5,
h6,
pre,
form,
p,
blockquote,
th,
td {
margin: 0;
padding: 0;
font-size: $body-font-size;
}
body {
font-family: $base-font-family;
font-size: $body-font-size;
font-weight: 400;
color: $color-body-text;
text-rendering: optimizeLegibility;
}
hr {
border-top: 1px solid $color-border;
border-bottom: 1px solid white;
border-left: none;
}
strong,
b {
font-weight: 600;
}
// links
//--------------------------------------------------------------
a:not(.button) {
color: $color-link;
text-decoration: none;
line-height: inherit;
&,
&:hover,
&:active,
&:visited,
&:focus {
outline: none;
}
&:visited {
color: $color-link-visited;
}
&:focus {
color: $color-link-focus;
}
&:active {
color: $color-link-active;
}
&:hover {
color: $color-link-hover;
}
}
// Headings
//--------------------------------------------------------------
h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: 600;
color: $color-headers;
line-height: 1.1;
}
h1 {
font-size: $h1-size;
line-height: $h1-size + 6;
}
h2 {
font-size: $h2-size;
line-height: $h1-size + 4;
}
h3 {
font-size: $h3-size;
line-height: $h1-size + 2;
}
h4 {
font-size: $h4-size;
line-height: $h1-size;
}
h5 {
font-size: $h5-size;
line-height: $h1-size;
}
h6 {
font-size: $h6-size;
line-height: $h1-size;
}
// Lists
//--------------------------------------------------------------
ul {
&.inline-menu {
li {
display: inline-block;
}
}
&.fields {
list-style: none;
padding: 0;
margin: 0;
}
}
dl {
width: 100%;
overflow: hidden;
margin: 5px 0;
color: lighten($color-body-text, 15);
dt,
dd {
float: left;
line-height: 16px;
padding: 5px;
text-align: justify;
}
dt {
width: 40%;
font-weight: 600;
padding-left: 0;
text-transform: uppercase;
font-size: 85%;
}
dd {
width: 60%;
padding-right: 0;
}
dd:after {
content: "";
clear: both;
}
}
// Helpers
.align-center {
text-align: center;
}
.align-right {
text-align: right;
}
.align-left {
text-align: left;
}
.align-justify {
text-align: justify;
}
.uppercase {
text-transform: uppercase;
}
.green {
color: $color-2;
}
.blue {
color: $color-3;
}
.red {
color: $color-5;
}
.yellow {
color: $color-6;
}
.no-objects-found {
text-align: center;
font-size: 120%;
text-transform: uppercase;
padding: 40px 0px;
color: lighten($color-body-text, 15);
}
.text-normal {
font-size: 1rem;
font-weight: 300;
}
.text-big {
font-size: 1.2rem;
font-weight: 300;
}
.text-red {
color: $warning-red;
}
input.text-big {
font-size: 1.1rem;
}
.pad-top {
padding-top: 1em;
}
.white-space-nowrap {
white-space: nowrap;
}

View File

@@ -119,6 +119,20 @@
margin-top: 0.75rem;
margin-bottom: 2px;
}
.custom-tab {
ol, ul {
margin-left: 1.5em;
}
ol {
list-style-type: decimal;
}
ul {
list-style-type: disc;
}
}
}
&.with-darker-background {

View File

@@ -412,22 +412,18 @@
justify-content: normal;
align-items: center;
input {
width: 50%;
}
a {
color: inherit;
}
}
.button {
&.cancel {
width: 30%;
border-radius: 0.5em;
padding:0;
height: 2.5em;
background-color: $teal-400
}
.voucher-button {
&.cancel {
width: 30%;
border-radius: 0.35em;
padding:0;
height: 2.5em;
background-color: $teal-400
}
}

View File

@@ -14,7 +14,12 @@ Rails.application.config.content_security_policy do |policy|
policy.script_src :self, :https, :unsafe_inline, :unsafe_eval, "*.stripe.com", "openfoodnetwork.innocraft.cloud",
"maps.googleapis.com", "maps.gstatic.com", "d2wy8f7a9ursnm.cloudfront.net"
policy.style_src :self, :https, :unsafe_inline, "fonts.googleapis.com", "cdnjs.cloudflare.com"
policy.connect_src :self, :https, "http://localhost:3035", "ws://localhost:3035" if Rails.env.development?
if Rails.env.development?
policy.connect_src :self, :https, "http://localhost:3035", "ws://localhost:3035", "ws://localhost:3000"
else
policy.connect_src :self, :https, "https://#{ENV["SITE_URL"]}", "wss://#{ENV["SITE_URL"]}"
end
# Specify URI for violation reports
# policy.report_uri "/csp-violation-report-endpoint"

View File

@@ -5,7 +5,7 @@ Rswag::Api.configure do |config|
# This is used by the Swagger middleware to serve requests for API descriptions
# NOTE: If you're using rswag-specs to generate Swagger, you'll need to ensure
# that it's configured to generate files in the same folder
config.swagger_root = Rails.root.join("swagger")
config.swagger_root = Rails.root.join("swagger").to_s
# Inject a lamda function to alter the returned Swagger prior to serialization
# The function will have access to the rack env for the current request

View File

@@ -324,6 +324,8 @@ ar:
confirm_resend_order_confirmation: "هل أنت متأكد من أنك تريد إعادة إرسال رسالة تأكيد الطلب؟"
must_have_valid_business_number: "يجب أن يكون %{enterprise_name} على ABN صالح قبل إرسال الفواتير."
invoice: "فاتورة"
active: "نشط"
cancelled: "ألغيت"
more: "أكثر"
say_no: "لا"
say_yes: "نعم"
@@ -667,6 +669,15 @@ ar:
index:
header:
title: تحرير المنتجات بالجملة
sort:
pagination:
clear_search: مسح البحث
filters:
producers:
label: المنتجين
categories:
label: التصنيفات
search: بحث
product_import:
title: استيراد المنتج
file_not_found: لم يتم العثور على الملف أو تعذر فتحه
@@ -4077,7 +4088,6 @@ ar:
category: الفئة
tax_category: الفئة الضريبية
inherits_properties?: الخصائص الموروثة؟
available_on: متاح على
av_on: "المتوسط. على"
import_date: "تاريخ الاستيراد"
products_variant:

View File

@@ -311,6 +311,8 @@ ca:
confirm_resend_order_confirmation: "Segur que vol reenviar el correu de confirmació de la comanda?"
must_have_valid_business_number: "%{enterprise_name} ha de tenir un NIF vàlid abans de poder enviar les factures."
invoice: "Factura"
active: "Actiu"
cancelled: "Cancel·lada"
more: "Més"
say_no: "No"
say_yes: "Sí"
@@ -651,6 +653,15 @@ ca:
index:
header:
title: Edició de productes en bloc
sort:
pagination:
clear_search: Esborra la cerca
filters:
producers:
label: Productors
categories:
label: Categories
search: Cerca
product_import:
title: Importació de productes
file_not_found: No s'ha trobat el fitxer o no s'ha pogut obrir
@@ -3800,7 +3811,6 @@ ca:
category: Categoria
tax_category: Categoria d'impostos
inherits_properties?: Hereda propietats?
available_on: Disponible el
av_on: "Disp. via"
import_date: "Data d'importació"
products_variant:

View File

@@ -344,6 +344,8 @@ cy:
confirm_resend_order_confirmation: "Ydych chi'n siŵr eich bod chi eisiau ail-anfon e-bost cadarnhau archeb?"
must_have_valid_business_number: "Noder rhif eich cwmni yma."
invoice: "Anfoneb"
active: "Gweithredol"
cancelled: "Canslwyd"
more: "Mwy"
say_no: "Na"
say_yes: "Ie"
@@ -687,6 +689,15 @@ cy:
index:
header:
title: Cynhyrchion Golygu Swmp
sort:
pagination:
clear_search: Clirio'r chwiliad
filters:
producers:
label: Prynu bwyd
categories:
label: Categorïau
search: Chwilio
product_import:
title: Mewnforio Cynnyrch
file_not_found: Ni ddaethpwyd o hyd i ffeil neu ni ellid ei hagor
@@ -4075,7 +4086,6 @@ cy:
category: Categori
tax_category: Categori Treth
inherits_properties?: Yn etifeddu manylion cynnyrch?
available_on: Ar gael ar
av_on: "Cyfartaledd ar"
import_date: "Dyddiad Mewnforio"
products_variant:

View File

@@ -306,6 +306,8 @@ de_CH:
confirm_resend_order_confirmation: "Sind Sie sicher, dass Sie die E-Mail-Bestätigung erneut senden wollen?"
must_have_valid_business_number: "%{enterprise_name} sollte eine gültige Steuer-ID-Nummer haben, bevor die Rechnung gesendet wird."
invoice: "Rechnung"
active: "Aktiv"
cancelled: "Storniert"
more: "Mehr"
say_no: "Nein"
say_yes: "Ja"
@@ -641,6 +643,15 @@ de_CH:
index:
header:
title: Produkte verwalten
sort:
pagination:
clear_search: Suche zurücksetzen
filters:
producers:
label: Unsere Produzenten
categories:
label: Lieferkategorien
search: Suche
product_import:
title: Produkte importieren
file_not_found: Die Datei konnte nicht gefunden oder nicht geöffnet werden.
@@ -3576,7 +3587,7 @@ de_CH:
admin:
login_nav:
header:
store: openfoodnetwork.de
store: Laden
validation:
must_be_int: "muss eine ganze Zahl sein"
admin:
@@ -3847,7 +3858,6 @@ de_CH:
category: Kategorie
tax_category: Steuerkategorie
inherits_properties?: Übernimmt Eigenschaften des Ladens?
available_on: Verfügbar am
av_on: "Verfüg. am"
import_date: "Importdatum"
products_variant:

View File

@@ -344,6 +344,8 @@ de_DE:
confirm_resend_order_confirmation: "Sind Sie sicher, dass Sie die E-Mail-Bestätigung erneut senden wollen?"
must_have_valid_business_number: "%{enterprise_name} muss eine gültige Umsatzsteueridentifikationsnummer (USt-IdNr.) haben, bevor Rechnungen gesendet werden können."
invoice: "Rechnung"
active: "Aktiv"
cancelled: "Storniert"
more: "Mehr"
say_no: "Nein"
say_yes: "Ja"
@@ -687,6 +689,15 @@ de_DE:
index:
header:
title: Produkte verwalten
sort:
pagination:
clear_search: Suche zurücksetzen
filters:
producers:
label: Unsere Produzenten
categories:
label: Lieferkategorien
search: Suche
product_import:
title: Produkte importieren
file_not_found: Die Datei konnte nicht gefunden oder nicht geöffnet werden.
@@ -4044,7 +4055,6 @@ de_DE:
category: Kategorie
tax_category: Steuerkategorie
inherits_properties?: Übernimmt Eigenschaften des Ladens?
available_on: Verfügbar am
av_on: "Verfüg. am"
import_date: "Importdatum"
products_variant:

3878
config/locales/el.yml Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -394,6 +394,11 @@ en:
confirm_resend_order_confirmation: "Are you sure you want to resend the order confirmation email?"
must_have_valid_business_number: "%{enterprise_name} must have a valid ABN before invoices can be sent."
invoice: "Invoice"
invoices: "Invoices"
file: "File"
active: "Active"
download: "Download"
cancelled: "Cancelled"
more: "More"
say_no: "No"
say_yes: "Yes"
@@ -450,6 +455,7 @@ en:
none: None
notes: Notes
error: Error
voucher: Voucher
processing_payment: "Processing payment..."
no_pending_payments: "No pending payments"
invalid_payment_state: "Invalid payment state: %{state}"
@@ -766,9 +772,27 @@ en:
header:
title: Bulk Edit Products
loading: Loading your products
sort:
pagination:
total_html: "<strong>%{total} products</strong> in your catalogue. Showing %{from} to %{to}."
per_page:
show: Show
per_page: "%{num} per page"
clear_search: Clear search
filters:
search_products: Search for products
all_producers: All producers
all_categories: All categories
producers:
label: Producers
categories:
label: Categories
search: Search
content:
no_products:
no_products_found: No products found
import_products: Import multiple products
no_products_found_for_search: No products found for your search criteria
product_import:
title: Product Import
file_not_found: File not found or could not be opened
@@ -1452,6 +1476,7 @@ en:
email_confirmation: "Email confirmation is pending. We've sent a confirmation email to %{email}."
not_visible: "%{enterprise} is not visible and so cannot be found on the map or in searches"
reports:
deprecated: "This report is deprecated and will be removed in a future release."
hidden: HIDDEN
unitsize: UNITSIZE
total: TOTAL
@@ -2124,6 +2149,7 @@ en:
order_not_paid: NOT PAID
order_total: Total order
order_payment: "Paying via:"
no_payment_required: "No payment required"
order_billing_address: Billing address
order_delivery_on: Delivery on
order_delivery_address: Delivery address
@@ -3136,6 +3162,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
date_completed: "Date Completed"
amount: "Amount"
invoice_number: "Invoice Number"
invoice_file: "File"
state_names:
ready: Ready
pending: Pending
@@ -3640,6 +3667,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
customer_details: "Customer Details"
adjustments: "Adjustments"
payments: "Payments"
invoices: "Invoices"
return_authorizations: "Return Authorizations"
credit_owed: "Credit Owed"
new_adjustment: "New Adjustment"
@@ -4238,7 +4266,6 @@ See the %{link} to find out more about %{sitename}'s features and to start using
category: Category
tax_category: Tax Category
inherits_properties?: Inherits Properties?
available_on: Available On
av_on: "Av. On"
import_date: "Import Date"
products_variant:

View File

@@ -211,6 +211,8 @@ en_AU:
confirm_resend_order_confirmation: "Are you sure you want to resend the order confirmation email?"
must_have_valid_business_number: "%{enterprise_name} must have a valid ABN before invoices can be sent."
invoice: "Invoice"
active: "Active"
cancelled: "Cancelled"
more: "More"
say_no: "No"
say_yes: "Yes"
@@ -527,6 +529,15 @@ en_AU:
index:
header:
title: Bulk Edit Products
sort:
pagination:
clear_search: Clear search
filters:
producers:
label: Producers
categories:
label: Categories
search: Search
product_import:
title: Product Import
file_not_found: File not found or could not be opened
@@ -3521,7 +3532,6 @@ en_AU:
category: Category
tax_category: Tax Category
inherits_properties?: Inherits Properties?
available_on: Available On
av_on: "Av. On"
import_date: "Import Date"
products_variant:

View File

@@ -197,6 +197,8 @@ en_BE:
confirm_resend_order_confirmation: "Are you sure you want to resend the order confirmation email?"
must_have_valid_business_number: "%{enterprise_name} must have a valid ABN before invoices can be sent."
invoice: "Invoice"
active: "Active"
cancelled: "Cancelled"
more: "More"
say_no: "No"
say_yes: "Yes"
@@ -491,6 +493,12 @@ en_BE:
index:
header:
title: Bulk Edit Products
filters:
producers:
label: Producers
categories:
label: Categories
search: Search
product_import:
title: Product Import
file_not_found: File not found or could not be opened
@@ -3196,7 +3204,6 @@ en_BE:
category: Category
tax_category: Tax Category
inherits_properties?: Inherits Properties?
available_on: Available On
av_on: "Av. On"
import_date: "Import Date"
products_variant:

View File

@@ -58,8 +58,21 @@ en_CA:
orders_close_at: Close date
variant_override:
count_on_hand: "On Hand"
spree/payment_method/calculator:
preferred_flat_percent: "Calculator Flat Percent:"
preferred_amount: "Calculator Amount:"
preferred_first_item: "Calculator First Item:"
preferred_additional_item: "Calculator Additional Item Cost:"
preferred_max_items: "Calculator Max Items:"
preferred_minimal_amount: "Calculator Minimal Amount"
preferred_normal_amount: "Calculator Normal Amount:"
preferred_discount_amount: "Calculator Discount Amount:"
preferred_unit_from_list: "Calculator Unit From List:"
preferred_per_unit: "Calculator Per Unit:"
errors:
models:
enterprise_fee:
inherit_tax_requires_per_item_calculator: "Inheriting the tax category requires a per-item calculator"
spree/user:
attributes:
email:
@@ -259,6 +272,13 @@ en_CA:
order_cycle:
subject: "Order cycle report for %{producer}"
provider_settings: "Provider settings"
report_mailer:
report_ready:
subject: "Report ready"
heading: "Report ready for download"
intro: |
The link below will expire after one week.
link_label: "%{name}"
shipment_mailer:
shipped_email:
dear_customer: "Dear Customer, "
@@ -324,6 +344,8 @@ en_CA:
confirm_resend_order_confirmation: "Are you sure you want to resend the order confirmation email?"
must_have_valid_business_number: "%{enterprise_name} must have a Business Number before invoices can be sent."
invoice: "Invoice"
active: "Active"
cancelled: "Cancelled"
more: "More"
say_no: "No"
say_yes: "Yes"
@@ -377,6 +399,7 @@ en_CA:
allow_cookies: "Allow Cookies"
notes: Notes
error: Error
voucher: Voucher
processing_payment: "Processing payment..."
no_pending_payments: "No pending payments"
invalid_payment_state: "Invalid payment state: %{state}"
@@ -667,6 +690,19 @@ en_CA:
index:
header:
title: Bulk Edit Products
loading: Loading your products
sort:
pagination:
clear_search: Clear search
filters:
producers:
label: Producers
categories:
label: Categories
search: Search
no_products:
no_products_found: No products found
import_products: Import multiple products
product_import:
title: Product Import
file_not_found: File not found or could not be opened
@@ -856,6 +892,7 @@ en_CA:
legend: "Address"
business_details:
legend: "Business Details"
upload: 'upload'
abn: Business Number
abn_placeholder: eg. 80781 2466
acn: Busines Number
@@ -1069,8 +1106,29 @@ en_CA:
email_confirmed: "Email confirmed"
email_not_confirmed: "Email not confirmed"
vouchers:
legend: Vouchers
voucher_code: Voucher Code
rate: Rate
label: Label
purpose: Purpose
expiry: Expiry
use_limit: Use/Limit
customers: Customer
net_value: Net Value
add_new: Add New
no_voucher_yet: No Vouchers yet
white_label:
legend: "White Label"
hide_ofn_navigation: "Hide OFN navigation"
upload_logo: "Logo used in shopfront"
remove_logo: "Remove logo"
remove_logo_confirm: "Are you sure you want to remove this logo?"
remove_logo_success: "Logo removed"
white_label_logo_link_label: "Link for the logo used in shopfront"
hide_groups_tab: "Hide groups/networks tab in shopfront"
create_custom_tab: "Create custom tab in shopfront"
custom_tab_title: "Title for custom tab"
custom_tab_content: "Content for custom tab"
actions:
edit_profile: Settings
properties: Properties
@@ -1281,6 +1339,10 @@ en_CA:
could_not_cancel_the_order: Could not cancel the order
resume:
could_not_resume_the_order: Could not resume the order
select2:
minimal_search_length: Please enter %{count} or more characters
searching: Searching....
no_matches: No matches found
shared:
user_guide_link:
user_guide: User Guide
@@ -1306,6 +1368,8 @@ en_CA:
tag_rules: "Tag Rules"
shop_preferences: "Shop Preferences"
users: "Users"
vouchers: Vouchers
white_label: "White Label"
enterprise_group:
primary_details: "Primary Details"
users: "Users"
@@ -1346,6 +1410,17 @@ en_CA:
pack_by_customer: Pack By Customer
pack_by_supplier: Pack By Supplier
pack_by_product: Pack By Product
download:
button: "Download Report"
show:
report_taking_longer: >
Sorry, this report took too long to process. It may contain a lot of
data, or we are busy with other reports. Please try again later.
report_taking_longer_html: >
This report is taking longer to process than usual. It may contain a
lot of data or we are busy with other reports. Once it is finished, we'll
notify you via email.
report_link_label: Download report (when available)
revenues_by_hub:
name: Revenues by Hub
description: Revenues by Hub
@@ -1377,6 +1452,7 @@ en_CA:
enterprise_fee_summary:
name: "Enterprise Fee Summary"
description: "Summary of Enterprise Fees collected"
enterprise_fees_with_tax_report_by_order: "Enterprise Fees With Tax Report By Order"
errors:
no_report_type: "Please specify a report type"
report_not_found: "Report not found"
@@ -1515,8 +1591,10 @@ en_CA:
associated_subscriptions_error: This schedule cannot be deleted because it has associated subscriptions
vouchers:
new:
legend: New Voucher
back: Back
save: Save
voucher_code: Voucher Code
voucher_amount: Amount
controllers:
enterprises:
@@ -1528,6 +1606,9 @@ en_CA:
resend_confirmation_emails_feedback:
one: "Confirmation email sent for 1 order."
other: "Confirmation emails sent for %{count} orders."
send_invoice_feedback:
one: "Invoice email sent for 1 order."
other: "Invoice emails sent for %{count} orders."
api:
unknown_error: "Something went wrong. Our team has been notified."
invalid_api_key: "Invalid API key (%{key}) specified."
@@ -1544,6 +1625,10 @@ en_CA:
destroy_attachment_does_not_exist: "Terms and Conditions file does not exist"
orders:
failed_to_update: "Failed to update order"
query_param:
error:
title: Invalid query parameter
extra_fields: "Unsupported fields: %{fields}"
checkout:
already_ordered:
cart: "cart"
@@ -1887,6 +1972,14 @@ en_CA:
explaination: You can review and confirm your order in the next step which includes the final costs
submit: Next - Order Summary
cancel: Back to your details
voucher:
voucher: "%{voucher_amount} Voucher"
apply_voucher: Apply voucher
apply: Apply
placeholder: Enter voucher code
remove_code: Remove code
confirm_delete: Are you sure you want to remove the voucher?
warning_forfeit_remaining_amount: "Note: If your order total is less than your voucher you may not be able to spend the remaining value."
step3:
delivery_details:
title: Delivery details
@@ -1920,10 +2013,12 @@ en_CA:
select_a_payment_method: Select a payment method
no_shipping_methods_available: Checkout is not possible because no shipping/pick-up options are available. Please contact the shop owner.
voucher_not_found: Not found
add_voucher_error: There was an error while adding the voucher
order_paid: PAID
order_not_paid: NOT PAID
order_total: Total order
order_payment: "Paying via:"
no_payment_required: "No payment required"
order_billing_address: Billing address
order_delivery_on: Delivery on
order_delivery_address: Delivery address
@@ -2417,6 +2512,7 @@ en_CA:
shipping_method_destroy_error: "That shipping method cannot be deleted as it is referenced by an order: %{number}."
fees: "Fees"
fee_name: "Fee Name"
fee_owner: "Fee Owner"
item_cost: "Item cost"
bulk: "Bulk"
shop_variant_quantity_min: "min"
@@ -2889,8 +2985,10 @@ en_CA:
no_orders_found: "No Orders Found"
order_information: "Order Information"
new_payment: "New Payment"
new_invoice: "New Invoice"
date_completed: "Date Completed"
amount: "Amount"
invoice_number: "Invoice Number"
state_names:
ready: Ready
pending: Pending
@@ -3412,6 +3510,13 @@ en_CA:
first: "First"
previous: "Previous"
last: "Last"
webhook_endpoints:
create:
success: Webhook endpoint successfully created
error: Webhook endpoint failed to create
destroy:
success: Webhook endpoint successfully deleted
error: Webhood endpoint failed to delete
spree:
add_country: "Add country"
add_state: "Add Province"
@@ -3585,6 +3690,7 @@ en_CA:
shipping_categories: "Shipping Categories"
new_shipping_category: "New Shipping Category"
back_to_shipping_categories: "Back to Shipping Categories"
editing_shipping_category: "Edit Shipping Category"
name: "Name"
description: "Description"
type: "Type"
@@ -3772,6 +3878,8 @@ en_CA:
cancel_orders: "Cancel Orders"
resend_confirmation: "Resend Confirmation"
resend_confirmation_confirm_html: "This will resend the confirmation email to the customer. <br />Are you sure you want to proceed?"
send_invoice: "Send Invoices"
send_invoice_confirm_html: "This will email customer invoices for all selected complete orders. <br> Are you sure you want to proceed?"
selected:
zero: "No order selected"
one: "1 order selected"
@@ -3825,6 +3933,8 @@ en_CA:
many: "You have %{count} active order cycles."
other: "You have %{count} active order cycles."
manage_order_cycles: "MANAGE ORDER CYCLES"
version:
view_all_releases: View all releases
shipping_methods:
index:
shipping_methods: "Shipping Methods"
@@ -3916,6 +4026,7 @@ en_CA:
no_payment_via_admin_backend: Paypal payments cannot be captured in the backoffice.
products:
image_upload_error: "Please upload the image in JPG, PNG, GIF, SVG or WEBP format."
image_not_processable: "Image attachment is not a valid image."
new:
title: "New Product"
new_product: "New Product"
@@ -3947,7 +4058,6 @@ en_CA:
category: Category
tax_category: Tax Category
inherits_properties?: Inherits Properties?
available_on: Available On
av_on: "Av. On"
import_date: "Import Date"
products_variant:
@@ -4188,6 +4298,16 @@ en_CA:
api_keys:
regenerate_key: "Regenerate Key"
title: API key
webhook_endpoints:
title: Webhook Endpoints
description: Events in the system may trigger webhooks to external systems.
event_types:
order_cycle_opened: Order Cycle Opened
event_type:
header: Event type
url:
header: Endpoint URL
create_placeholder: Enter the URL of the remove webhook endpoint
developer_settings:
title: Developer Settings
form:

View File

@@ -200,6 +200,8 @@ en_DE:
confirm_resend_order_confirmation: "Are you sure you want to resend the order confirmation email?"
must_have_valid_business_number: "%{enterprise_name} must have a valid ABN before invoices can be sent."
invoice: "Invoice"
active: "Active"
cancelled: "Cancelled"
more: "More"
say_no: "No"
say_yes: "Yes"
@@ -496,6 +498,12 @@ en_DE:
index:
header:
title: Bulk Edit Products
filters:
producers:
label: Producers
categories:
label: Categories
search: Search
product_import:
title: Product Import
file_not_found: File not found or could not be opened
@@ -3211,7 +3219,6 @@ en_DE:
category: Category
tax_category: Tax Category
inherits_properties?: Inherits Properties?
available_on: Available On
av_on: "Av. On"
import_date: "Import Date"
products_variant:

View File

@@ -344,6 +344,10 @@ en_FR:
confirm_resend_order_confirmation: "Are you sure you want to resend the order confirmation email?"
must_have_valid_business_number: "%{enterprise_name} must have a valid ABN before invoices can be sent."
invoice: "Invoice"
file: "File"
active: "Active"
download: "Download"
cancelled: "Cancelled"
more: "More"
say_no: "No"
say_yes: "Yes"
@@ -397,6 +401,7 @@ en_FR:
allow_cookies: "Allow Cookies"
notes: Notes
error: Error
voucher: Voucher
processing_payment: "Processing payment..."
no_pending_payments: "No pending payments"
invalid_payment_state: "Invalid payment state: %{state}"
@@ -688,9 +693,26 @@ en_FR:
header:
title: Bulk Edit Products
loading: Loading your products
content:
sort:
pagination:
total_html: "<strong>%{total} products</strong> in your catalogue. Showing %{from} to %{to}."
per_page:
show: Show
per_page: "%{num} per page"
clear_search: Clear search
filters:
search_products: Search for products
all_producers: All producers
all_categories: All categories
producers:
label: Producers
categories:
label: Categories
search: Search
no_products:
no_products_found: No products found
import_products: Import multiple products
no_products_found_for_search: No products found for your search criteria
product_import:
title: Product Import
file_not_found: File not found or could not be opened
@@ -1373,6 +1395,7 @@ en_FR:
email_confirmation: "Email confirmation is pending. We've sent a confirmation email to %{email}."
not_visible: "%{enterprise} is not visible and so cannot be found on the map or in searches"
reports:
deprecated: "This report is deprecated and will be removed in a future release."
hidden: HIDDEN
unitsize: UNITSIZE
total: TOTAL
@@ -2006,6 +2029,7 @@ en_FR:
order_not_paid: NOT PAID
order_total: Total order
order_payment: "Paying via:"
no_payment_required: "No payment required"
order_billing_address: Billing address
order_delivery_on: Delivery on
order_delivery_address: Delivery address
@@ -2976,6 +3000,7 @@ en_FR:
date_completed: "Date Completed"
amount: "Amount"
invoice_number: "Invoice Number"
invoice_file: "File"
state_names:
ready: Ready
pending: Pending
@@ -3472,6 +3497,7 @@ en_FR:
customer_details: "Customer Details"
adjustments: "Adjustments"
payments: "Payments"
invoices: "Invoices"
return_authorizations: "Return Authorizations"
credit_owed: "Credit Owed"
new_adjustment: "New Adjustment"
@@ -4046,7 +4072,6 @@ en_FR:
category: Category
tax_category: Tax Category
inherits_properties?: Inherits Properties?
available_on: Available On
av_on: "Av. On"
import_date: "Import Date"
products_variant:

Some files were not shown because too many files have changed in this diff Show More