Commit Graph

14678 Commits

Author SHA1 Message Date
Matt-Yorkley
b1de64bf3e Remove unnecessary iterator
(cherry picked from commit 15000c7ed1)
2023-06-23 14:16:45 +10:00
Matt-Yorkley
e976cc6d95 Disable variant is_master column
(cherry picked from commit 733dd3c428)
2023-06-23 14:16:45 +10:00
Matt-Yorkley
1b304e2aa4 Remove is_master from variant serializer
(cherry picked from commit fbd09869bb)
2023-06-23 14:16:44 +10:00
Matt-Yorkley
48cdca59fd Remove superfluous method from products controller
(cherry picked from commit ced60d4382)
2023-06-23 14:16:44 +10:00
Matt-Yorkley
aa9fd682d8 Remove is_master and not_master scopes
(cherry picked from commit 1daab8994d)
2023-06-23 14:16:44 +10:00
Matt-Yorkley
dda3cfa58d Remove master variant validation conditionals
(cherry picked from commit 85059bfb26)
2023-06-23 14:16:44 +10:00
Matt-Yorkley
9da649a296 Improve validation feedback on new variant page and add test coverage
(cherry picked from commit 8247dce2dc)
2023-06-23 14:16:44 +10:00
Matt-Yorkley
2e53b9a0c6 Fix flaky spec: use milliseconds in cache service and remove sleep
(cherry picked from commit 618900767f)
2023-06-23 14:16:44 +10:00
Matt-Yorkley
89b59f97ee Reorganise associations, validations, scopes and callbacks for clarity
(cherry picked from commit 1922598d2d)
2023-06-23 14:16:44 +10:00
Matt-Yorkley
26d3cffba3 Remove master variant from product
(cherry picked from commit 3ef7d2c9ff)
2023-06-23 14:16:44 +10:00
Matt-Yorkley
8e99f496ff Migrate product image from master variant to product
(cherry picked from commit 7dc1091bc2)
2023-06-23 14:16:44 +10:00
Matt-Yorkley
2f2506e698 Migrate master variant :sku to product
(cherry picked from commit d8649fc9fb)
2023-06-23 14:16:44 +10:00
Matt-Yorkley
7ef9c2f56a Stop storing unit_value and unit_description on master variant
(cherry picked from commit 6b9b5ea347)
2023-06-23 14:16:44 +10:00
Matt-Yorkley
ee4402f751 Stop using master variant for storing :display_as value
(cherry picked from commit 8c0b8dad85)
2023-06-23 14:16:44 +10:00
Matt-Yorkley
79a2d1228d Stop using master variant as a potential store for prices
(cherry picked from commit 1b06c20197)
2023-06-23 14:16:44 +10:00
Matt-Yorkley
75ccc5c72f Simplify product images delegation mess
(cherry picked from commit d4188da7c1)
2023-06-23 14:16:44 +10:00
Matt-Yorkley
aca72e6071 Remove dead code
(cherry picked from commit 42a5a48816)
2023-06-23 14:16:44 +10:00
David Cook
35d9837f24 Show current version at bottom of admin dashboard
With generic link to the releases page. We could provide a link to latest tag with `git describe --tags --abbrev=0`. But I thought it better to keep things simple.
2023-06-16 09:11:59 +10:00
Matt-Yorkley
7068df5d4b Merge pull request #10804 from Matt-Yorkley/public-images
Update ActiveStorage image processing
2023-06-15 15:49:11 +01:00
Konrad
7a10edff82 Merge pull request #10988 from jibees/10980-white-label-trix-bullets-and-numbers-are-displayed-outside-the-text-field
[White Label] Custom tab content editor: order and unordered list should have a margin-left set
2023-06-15 16:13:19 +02:00
Maikel
701fef84f3 Merge pull request #10850 from mkllnk/require-belongs-to--part1
Require belongs_to associations - part 1
2023-06-15 09:20:42 +10:00
Filipe
e6d42a0c4f Merge pull request #10999 from Matt-Yorkley/bom-issues
Fix BOM order loading issue
2023-06-14 19:01:54 +01:00
Matt-Yorkley
395cf7fb8d Use direct image URLs for enterprise logos 2023-06-14 12:53:20 +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
b510668ecf Render direct URLs for s3 images 2023-06-14 10:56:10 +01:00
Matt-Yorkley
6f12d012ed Use #url helper 2023-06-14 10:56:10 +01:00
Matt-Yorkley
551d0d3a93 Simplify calling #url_for in models 2023-06-14 10:56:10 +01:00
Matt-Yorkley
a898915724 Use named image variants 2023-06-14 10:56:10 +01:00
Matt-Yorkley
e54cff2274 Set images to public-read
Defining an alternate s3 configuration set to `public: true` means we can use it selectively. It sets the objects to `acl: "public-read"` by default (read-only) and means any image tags for those assets can use direct public links in the src attribute (without hitting the ActiveStorage::Representation endpoint). The default non-public service will still be used by default for any other files on instances using s3.
2023-06-14 10:56:10 +01:00
Maikel Linke
91d0dabc1d Require associations on DistributorShippingMethod 2023-06-14 15:09:12 +10:00
Maikel Linke
bd11475fe1 Require associations on DistributorPaymentMethod 2023-06-14 15:08:22 +10:00
Maikel Linke
ed231ec512 Update belongs_to default in Customer model 2023-06-14 15:08:05 +10:00
Maikel Linke
fc00a48d67 Require associations of CoordinatorFee 2023-06-14 15:08:05 +10:00
Maikel Linke
c02c90317f Require user of column preference record
It doesn't make sense to have a preference without a user. And it was
already enforced in the database.
2023-06-14 15:07:43 +10:00
Maikel Linke
2d4cfd7548 Validate and enforce AdjustmentMetadata associations 2023-06-14 15:07:43 +10:00
Maikel Linke
d88781a083 Start to adopt new default to require belongs_to
Newer version of Rails have this option as default. We can slowly
transition to opt in gradually, model by model. Once all models are
covered, we can change the default and remove the setting from the
models again.

The style violation was added to the todo file because it's temporary.

We have 60 models using `belongs_to`. And changing them all at once
breaks some specs. So let's do it gradually.
2023-06-14 15:06:59 +10:00
Matt-Yorkley
73b2d37224 Don't try to load orders if the number of line_items with the current filters applied is zero
This ends up sending a request to the orders endpoint with no filters and no search params, which then tries to load every order in the entire database if the user is superadmin, which blows up.
2023-06-13 15:47:19 +01:00
Matt-Yorkley
4e7fab6914 Delete dead code Checkout#find_transition
This method is only called from tests and nowhere else in the codebase. We may as well remove it.
2023-06-13 14:58:16 +01:00
Matt-Yorkley
5487aa19fc Fix missing checkout_state_path 2023-06-13 14:58:16 +01:00
Mohamed ABDELLANI
907c65d98c run create_tax_charge! after transition to payment state 2023-06-13 14:58:16 +01:00
Mohamed ABDELLANI
c2aaf88e98 remove checkout controller 2023-06-13 14:58:16 +01:00
Mohamed ABDELLANI
fc0cca2210 remove legacy checkout view 2023-06-13 14:58:16 +01:00
Matt-Yorkley
abd55b2104 Move order to completed whether it's current state is payment or confirmation 2023-06-13 10:14:09 +01:00
Matt-Yorkley
47df9493ae Fix ProcessPaymentIntent service 2023-06-13 10:14:09 +01:00
David Cook
e4c65ea87d Prettify palette file 2023-06-13 11:46:28 +10:00
David Cook
f007cf3dad Fix up table borders 2023-06-13 11:45:39 +10:00
David Cook
edcdcd3f74 Use header colour for table headers 2023-06-13 11:45:39 +10:00
David Cook
16534319b6 Replace dark blue with "Sherpa blue"
It looks like it’s used in headers, some buttons and a loading message
2023-06-13 11:45:39 +10:00
David Cook
d85ea628e2 Change default font colour to near-black
It looks like this is the main font colour in the new designs.
2023-06-13 11:45:39 +10:00
David Cook
821446e150 Style pagination links
And provide a basic hover state for most other buttons.
The pagination button hover and active states will need updating.

The darker background colour sometimes wraps a whole table (eg products table).
2023-06-13 11:45:39 +10:00