Maikel Linke
0dabca583f
Set stronger secret password for managers
...
And avoid depending on Devise for this.
2025-12-12 15:17:57 +11:00
Ahmed Ejaz
913dded766
Refactor order cycle handling to simplify closed cycle checks and improve redirection messaging
2025-11-05 02:50:01 +05:00
Ahmed Ejaz
895e142e2c
Enhance order cycle closure handling with improved messaging and redirection logic
2025-10-26 02:08:53 +05:00
Ahmed Ejaz
10917161b0
Refactor order cycle expiry handling to allow skipping order emptying during checkout
2025-10-20 01:42:20 +05:00
Gareth Rogers
0a9eb173ea
Add report name and details to CSV files
2025-10-01 13:59:43 +10:00
David Cook
0225db6840
Refactor without setter methods
...
This class was originally built to flexibly accept paramters in any order. It also allowed you to specify multiple of the same type of parameter, with the later one overriding the earlier.
This is too flexible and likely to cause mistakes. And besides, we don't use that feature!
2025-05-05 12:59:27 +10:00
cyrillefr
7812d5f58a
Replace set_methods in order model
2025-04-24 09:29:40 +02:00
Gaetan Craig-Riou
08ad2af91a
Make sure Orders::CheckStockService is only instanciated once
2025-02-04 15:42:05 +11:00
Gaetan Craig-Riou
cdcab7c7c6
Update insufficient stock logic
...
We now check for insufficient stock when loading the checkout details
or before updating the order.
2025-02-04 15:39:47 +11:00
Gaetan Craig-Riou
c73c2dd8a8
Add basic out of stock modal
2025-02-04 15:39:47 +11:00
Gaetan Craig-Riou
a7cde069c6
Add Orders::CheckStockService and spec
...
Move sufficient_stock? to Orders::CheckStockService
2025-02-04 15:39:40 +11:00
Maikel Linke
6a8cc410d2
Replace broken order data
...
Bugsnag expects a string as value, not an ActiveRecord object. The
result was just "filtered" data, not showing any of the order's
attributes.
Since wanting to share the order data seems a common pattern, I added a
convenience method for it.
2024-11-21 15:58:55 +11:00
Maikel Linke
0d8df5d2a8
Replace Bugsnag calls with Alert.raise
2024-11-21 15:58:55 +11:00
Gaetan Craig-Riou
eb66244b74
Fix Bugsnag call to notify
...
Make sure we add metadata as expected:
https://docs.bugsnag.com/platforms/ruby/rails/reporting-handled-errors/#add_metadata
2024-11-06 14:01:48 +11:00
Maikel Linke
71ca292c92
Synchronise stock with DFC catalog during checkout
...
This will delay the checkout request by a few seconds if there's stock
to sync. But we minimise the chance of missing reduced stock from orders
on another platform.
We still have a gap between the checkout and placing a backorder. In
that time we can't guarantee enough stock. But let's tackle that after
the pilot.
2024-10-09 14:47:07 +11:00
Maikel Linke
adf0340153
Remove duplicate method
...
The method `CheckoutCallbacks#valid_order_line_items?` was a duplicate
of `OrderStockCheck#valid_order_line_items?`.
Apparently, it had been extracted twice:
* 1d074c2151
* 06eb98bdf4
But the first commit duplicated the method while the second moved the
original declaration.
2024-10-08 16:57:36 +11:00
Maikel Linke
037eb456c0
Remove unused controller ivar
2024-08-16 14:37:57 +10:00
Maikel Linke
aed78f3138
Simplify reports controller code branching
2024-08-16 14:37:57 +10:00
Feruz Oripov
9d919938f3
Group Order && OrderCycle related services and specs
2024-03-16 19:07:08 +05:00
Gaetan Craig-Riou
25af178011
Refactor updating order state
...
It makes the code a bit easier to read
2023-10-23 15:37:53 +11:00
Gaetan Craig-Riou
b09054a76a
Update order state when moving back through checkout step
...
Some important logic happens after the order transition from one state
to another. In particular, voucher are recalculated. To fix any
inconsistency, we make sure the order is the state matching the checkout
step we are on.
2023-10-18 09:45:05 +11:00
Neal Chambers
416d6e538a
Fix Style/HashSyntax
2023-09-09 09:00:38 +09:00
Neal Chambers
94f1b89a9f
Safely autocorrect Rails/RootPublicPath
...
Inspecting 1484 files
.............................................................................................C........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C.........................................................................................C..........C..........................................................................................................................................................................................................................................................................................................C....................................................................................................................................................................C...................C.............................................................C.C.......C....................
Offenses:
app/controllers/concerns/request_timeouts.rb:19:22: C: [Corrected] Rails/RootPublicPath: Use Rails.public_path.
file: Rails.root.join("public/500.html"),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/spree/core/controller_helpers/common.rb:45:30: C: [Corrected] Rails/RootPublicPath: Use Rails.public_path.
file: Rails.root.join("public/404.html"),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/controllers/api/v0/product_images_controller_spec.rb:13:22: C: [Corrected] Rails/RootPublicPath: Use Rails.public_path.
let(:pdf_path) { Rails.root.join("public/Terms-of-service.pdf") }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/controllers/api/v0/terms_and_conditions_controller_spec.rb:15:31: C: [Corrected] Rails/RootPublicPath: Use Rails.public_path.
let(:terms_file_path) { Rails.root.join("public/Terms-of-service.pdf") }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/models/terms_of_service_file_spec.rb:6:25: C: [Corrected] Rails/RootPublicPath: Use Rails.public_path.
let(:pdf) { File.open(Rails.root.join("public/Terms-of-service.pdf")) }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/bulk_product_update_spec.rb:907:37: C: [Corrected] Rails/RootPublicPath: Use Rails.public_path.
attach_file 'image-upload', Rails.root.join("public/500.jpg"), visible: false
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/enterprises/terms_and_conditions_spec.rb:27:30: C: [Corrected] Rails/RootPublicPath: Use Rails.public_path.
let(:original_terms) { Rails.root.join("public/Terms-of-service.pdf") }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/admin/enterprises/terms_and_conditions_spec.rb:28:29: C: [Corrected] Rails/RootPublicPath: Use Rails.public_path.
let(:updated_terms) { Rails.root.join("public/Terms-of-ServiceUK.pdf") }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/consumer/shopping/checkout_spec.rb:94:9: C: [Corrected] Rails/RootPublicPath: Use Rails.public_path.
Rails.root.join("public/Terms-of-service.pdf"),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/consumer/shopping/embedded_groups_spec.rb:18:9: C: [Corrected] Rails/RootPublicPath: Use Rails.public_path.
Rails.root.join("public/embedded-group-preview.html")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/consumer/shopping/embedded_groups_spec.rb:26:9: C: [Corrected] Rails/RootPublicPath: Use Rails.public_path.
Rails.root.join("public/embedded-group-preview.html")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/consumer/split_checkout_spec.rb:986:35: C: [Corrected] Rails/RootPublicPath: Use Rails.public_path.
let(:system_terms_path) { Rails.root.join("public/Terms-of-service.pdf") }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/consumer/split_checkout_spec.rb:987:33: C: [Corrected] Rails/RootPublicPath: Use Rails.public_path.
let(:shop_terms_path) { Rails.root.join("public/Terms-of-ServiceUK.pdf") }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1484 files inspected, 13 offenses detected, 13 offenses corrected
2023-08-14 17:29:11 +09:00
Matt-Yorkley
f3899ee251
Extract some related methods to CheckoutSteps concern
2023-08-04 08:43:15 +10: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
Mohamed ABDELLANI
e678c6149f
extract payment_faild from processing_failed
2023-06-27 09:26:26 +01:00
Mohamed ABDELLANI
4cca823a66
redirect user to payment when the card doesn't have enough credit
2023-06-27 09:14:48 +01:00
Mohamed ABDELLANI
c2aaf88e98
remove checkout controller
2023-06-13 14:58:16 +01:00
Konrad
4a66b62fa7
Merge pull request #10825 from jibees/10824-remove-feature-toggle-on-white-label-feature
...
Activate white label feature
2023-05-16 13:50:58 +02:00
Jean-Baptiste Bellet
aaa9bac4dd
Remove white_label feature toggle
...
White label is now activated for everyone.
+ add mock for `spec/controllers/spree/orders_controller_spec.rb`
2023-05-15 17:10:50 +02:00
Gaetan Craig-Riou
43ab881181
Rename order association to voucher_adjustments
...
The name vouchers is a bit confusing as the order is linked to a
voucher adjutment and not the actual voucher
2023-05-15 13:42:39 +10:00
Gaetan Craig-Riou
74e0b0f6b5
Add voucher adjustment loading to CheckoutCallbacks
...
This is needed so the voucher is loaded properly when the "checkout"
partials are render via cable_car.
2023-05-15 13:42:38 +10:00
Jean-Baptiste Bellet
f42f513f8c
Display white_label_logo image when hide_ofn_navigation is set to true
...
for both desktop and mobile view
2023-04-20 08:45:03 +02:00
Maikel Linke
43cbac7d17
Simplify report filename generation
2023-04-14 11:29:36 +10:00
Jean-Baptiste Bellet
6f8ab56d2e
Replace deprecated call render operations:
...
```
DEPRECATED: CableReady's `render operations:` call has been renamed to `render cable_ready:`. Please update your render call.
```
2023-04-05 14:19:34 +10:00
Jean-Baptiste Bellet
89036db666
Do not use a preference, but create a new column for hide_ofn_navigation
2023-03-30 09:19:17 +11:00
Jean-Baptiste Bellet
dd9fec58a4
Instead of parsing URLs pass order through method for Orders Ctrl
...
Use methods for before_actions
Maybe we should for hide_of_navigation too, but a name 'hide_ofn_navigation_for_order_distributor' seemed unhelpful..
2023-03-30 09:19:17 +11:00
Jean-Baptiste Bellet
4fa44e6c64
Put the white label behind a feature toggle white_label
...
+ update specs as well
+ for admin section also
2023-03-30 09:19:17 +11:00
Jean-Baptiste Bellet
4ad2a1a723
Prefer a concern that set a variable instead of a global helper
...
Therefor, for the right controllers, simply implements:
```
include WhiteLabel
before_action :hide_ofn_navigation, only: [:show, :edit]
```
This is mort robust, since we're working in a controller level, not parsing URLs...
2023-03-30 09:17:57 +11:00
Jean-Baptiste Bellet
9c84a6936a
Create a concern for manager invitations
...
Can be used elsewhere
Update manager_invitations.rb
2023-03-23 11:21:05 +01:00
Mikael Norlén
22b1dd3232
Add support for extra_fields query parameter
...
Api now supports optional fields.
These are included with the extra_fields query param.
Syntax: extra_fields[type]=field1,field2
2023-02-15 11:14:27 +01:00
Maikel Linke
0c769706aa
Split method for easier reading
2023-01-18 23:12:26 +00:00
Filipe
c3e4c53a01
Merge pull request #10074 from binarygit/order-cycle-closes-during-split-co
...
Redirect to shopfront when Order cycle closes during split checkout
2022-12-22 15:09:57 +00:00
binarygit
764c8d7d27
Redirect to shopfront when OC closes during split checkout
2022-12-01 15:13:36 +05:45
Mohamed ABDELLANI
e25f4b1daa
integrate ReportRenderingOptions in the View/Controller
2022-11-25 09:10:53 +01:00
Jean-Baptiste Bellet
e2441cdcf6
Use the report type or subtype as the title
2022-10-24 11:12:22 +02:00
Matt-Yorkley
980f004b83
Update Bugsnag error data
2022-10-19 17:36:52 +11:00
Maikel Linke
52e934ec2b
Consistently use our FeatureToggle module
...
Direct calls to Flipper have the downside that we can't add any new
functionality like storing the feature in the database when used.
2022-10-08 16:23:17 +02:00
binarygit
930721bea6
Redirect to shop front when OC closes during checkout
2022-10-03 20:51:41 +02:00