Commit Graph

324 Commits

Author SHA1 Message Date
Matt-Yorkley
65731f6c52 Update serializers and views for admin products index 2024-04-02 09:27:36 +11:00
Matt-Yorkley
c01bab5f27 Wrap commonly-repeated calls to Spree::Config to reduce unnecessary cache reads
These config values are relatively static but in some cases they can be called many times in the same request (like rendering a report or a large list of line_items in BOM). These values will now only get fetched from Redis/Postgres once at most per request/job.
2024-03-26 13:39:16 +00:00
Feruz Oripov
c2d8bdd414 cops 2024-02-27 01:01:22 +05:00
Feruz Oripov
81f40a99d9 Update CustomersWithBalanceQuery 2024-02-26 23:25:33 +05:00
Neal Chambers
ed06edda3f Fix Style/HashSyntax 2023-09-13 16:45:00 +09:00
Matt-Yorkley
5a48721af4 Update serializers, views, and JS for bulk products edit 2023-07-31 09:23:20 +10:00
Matt-Yorkley
42a3087cdb Remove :available_on attribute from Product class 2023-07-06 14:36:35 +01:00
Matt-Yorkley
fefa9288a4 Remove :permalink attribute from Product 2023-06-30 11:37:57 +01:00
Matt-Yorkley
3ef7d2c9ff Remove master variant from product 2023-06-16 21:23:44 +01:00
Matt-Yorkley
7dc1091bc2 Migrate product image from master variant to product 2023-06-16 21:23:44 +01:00
Matt-Yorkley
5ad37ce6a5 Return default image url on ActiveStorage errors in image loading 2023-06-14 12:53:20 +01:00
Matt-Yorkley
a898915724 Use named image variants 2023-06-14 10:56:10 +01:00
Neal Chambers
449430cabc Indent code to be more Readable 2023-06-09 16:39:29 +09:00
Matt-Yorkley
1995a44848 Improve eager-loading on admin products page adn resolve issue with serializer
For some reason eager-loaded data isn't passed to nested serializers when using associations. Defining the association as a method and passing in some optional paramaters resolves the issue.

This reduces queries run by the controller action by around 75%, as well as the response times.
2023-05-06 17:15:27 +01:00
Jean-Baptiste Bellet
70a6e9f44b Add a white_label_logo_link attribute to enterprise model 2023-04-26 11:04:47 +02:00
Jean-Baptiste Bellet
e3001cc8c4 Add white_label_logo to enterprise model as attachment
Co-Authored-By: Maikel <maikel@email.org.au>
2023-04-20 08:45:03 +02:00
James Wu
a75f16e23c Implement full_name_for_sorting 2023-04-11 15:25:20 +10:00
James Wu
546e90b286 Sort orders by last names 2023-04-11 15:25:20 +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
c20ae0de1e Edit hide_ofn_navigation in 'white label' panel for an enterprise 2023-03-30 09:17:57 +11:00
cyrillefr
c015b2066f Sort correctly in Bulk Order Managment
Converting date to utc + iso8601 format is
    sufficient to ensure proper sorting.
2023-02-20 21:41:58 +01:00
Cillian O'Ruanaidh
a8816b3788 Remove debugging code left in by accident 2022-11-18 14:40:30 +00:00
Cillian O'Ruanaidh
fbe6dcba7a Remove N+1 query loading tags for each order cycle exchange 2022-11-11 17:01:46 +00:00
Maikel Linke
4facab0335 Guard against invariable file types
Australian production had one JPG image which was not recognised as
such. The `content_type` was missing and trying to generate a URL for a
variant raised an error and crashed the page.

Testing for `variable?` includes testing for `attached?` and is more
defensive.
2022-06-01 17:16:55 +10:00
Maikel Linke
b7efa1b018 Replace Paperclip on Spree::Image 2022-06-01 17:16:55 +10:00
Maikel Linke
4a0ed99919 Replace Paperclip on Enterprise model
We configured Paperclip to convert images to JPG in some cases but I
omitted that here because we don't need it. If an image is better
represented as PNG or another format then the user should be able to
choose that.

Some specs were also testing the generated URL but the Active Storage
URL doesn't contain a style name anymore and it's not helpful to test
the URL.
2022-06-01 17:16:55 +10:00
GeorgeThoppil
898c470c00 Change enterprise visibility scope 2022-04-21 20:27:28 -04:00
Nihal Mohammed
15e7a5a4df Rename product_stock_display to product_low_stock_display
Rename product_stock_display to product_low_stock_display in enterprise_serializer and shop_variant_controller
2022-04-15 10:59:42 +10:00
Nihal M. Kelanthodika
f7a767988c Add preferred_product_stock_display to Enterprise model, serializer and permitted attributes. (Fixed alignment of guest orders radio button as well) 2022-04-15 10:53:28 +10:00
Maikel
a4bffc61f1 Merge pull request #8997 from apricot12/8968-Group-products-by-supplier-P1
Sort products by supplier in invoice
2022-04-13 11:54:12 +10:00
Nihal Mohammed
992cb9d920 Add invoice_order_by_supplier attribute to enterprise 2022-03-21 20:29:19 +05:30
Filipe
87c79a5941 Merge pull request #8294 from guidoDutra/8131-cancel-empty-orders-on-BOM-page
Cancel empty orders on BOM page
2022-03-18 11:24:26 +00:00
Jean-Baptiste Bellet
aa71e12020 Serialize variant_unit_scale to be used in the Bulk Order Managment
to retrieve scale of the product
2022-03-08 14:55:25 +01:00
François Turbelin
836a60a6c7 Add missing full_name bind to subscriptions serializer 2022-02-16 10:23:23 +11:00
Adrien Chauve
9b93102a96 More fixes 2022-02-16 10:23:22 +11:00
Matt-Yorkley
1c180299a5 Pass indexed payment method tags to PaymentMethod Serializer 2022-02-08 11:42:24 +00:00
Matt-Yorkley
37b5e1b014 Allow Payment Method Serializers to receive options 2022-02-08 11:42:24 +00:00
Maikel Linke
ee85b9654d Remove references to StripeConnect class 2022-01-24 12:35:45 +11:00
Guido Oliveira
db45d7f4eb Cancel empty orders on BOM page 2021-11-06 10:25:34 -03:00
Matt-Yorkley
cf5d964133 Update usages of old preference getters and setters 2021-11-04 11:48:30 +00:00
Matt-Yorkley
8393414bf5 Adapt admin enterprise form handling for both address and business_address 2021-10-06 15:06:56 +05:30
Maikel
a3c31f7d86 Revert "Kill stripe connect" 2021-09-20 08:39:34 +10:00
Luis Ramos
60a8ae6675 Remove Stripe Connect gateway and related code 2021-09-10 14:43:24 +05:30
Maikel Linke
e013d81e3d Simplify safe navigation operator use < and [] 2021-09-10 14:40:46 +10:00
Matt-Yorkley
1d5077061e Remove andand
This old gem implemented some functionality for handling nils which is no longer needed, as it's provided natively by Ruby with the &. operator.
2021-09-08 14:28:31 +01:00
Andy Brett
46cd05c54a Merge pull request #7712 from guidoDutra/1861-enable-shopfront-sorting-by-producer
Enable sorting by producer in shopfront
2021-07-06 09:27:42 -07:00
Andy Brett
31738ceb49 rename and consolidate authorization? methods 2021-06-17 14:23:59 -07:00
Guido Oliveira
c5471fc25c enable ordering shopfront by producer id 2021-06-16 15:02:27 -03:00
Jean-Baptiste Bellet
ddb63dff8a Add name of the customers into subscriptions table
- Thus, we can filter subscriptions by customer email
2021-04-20 16:09:48 +02:00
Pau Perez
5bca7d1f8f Remove the old balance's code branch
This keeps the `OrderBalance` abstraction but removes the old code now
that the feature is enabled for all users in all instances and there are
no bugs reported. It's become dead code.
2021-04-19 11:52:41 +02:00