mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-22 20:16:50 +00:00
Compare commits
480 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cd99b502d8 | ||
|
|
ba6dd01446 | ||
|
|
98ea70bfa0 | ||
|
|
40abefa908 | ||
|
|
6882201533 | ||
|
|
86500dc2aa | ||
|
|
a93eef38c0 | ||
|
|
f60e7a97fd | ||
|
|
b38ad54e15 | ||
|
|
0e85811cab | ||
|
|
51f86cfef4 | ||
|
|
03863d2bb2 | ||
|
|
e2bcb80ac4 | ||
|
|
c6743d8c6b | ||
|
|
fd8766ec77 | ||
|
|
3e66f475e5 | ||
|
|
6de27703af | ||
|
|
f448c95bbe | ||
|
|
39bb25e959 | ||
|
|
3793585c38 | ||
|
|
7ef95f82c0 | ||
|
|
a46145f44f | ||
|
|
20d4cb1366 | ||
|
|
f269fb9104 | ||
|
|
ac0c1f3c70 | ||
|
|
a58e0fe217 | ||
|
|
09790b35ef | ||
|
|
c4a7c05c05 | ||
|
|
155d05265d | ||
|
|
4b4450d34f | ||
|
|
447165f8a1 | ||
|
|
c1b85b7409 | ||
|
|
cc5b310694 | ||
|
|
1ac2e1a8a6 | ||
|
|
2acc339341 | ||
|
|
894a11c9c1 | ||
|
|
5864e2d36e | ||
|
|
6bd28bcad8 | ||
|
|
4187380225 | ||
|
|
786cb06c7d | ||
|
|
60595059e2 | ||
|
|
41f9f07a80 | ||
|
|
e5afa3a26e | ||
|
|
b3c4a38b0f | ||
|
|
18d98500e9 | ||
|
|
a821117b83 | ||
|
|
a146782bcd | ||
|
|
eba60a6130 | ||
|
|
3213c30a37 | ||
|
|
6fe68322da | ||
|
|
1dddaf9b14 | ||
|
|
e5bdaa603a | ||
|
|
9d1b059835 | ||
|
|
b70ba7085a | ||
|
|
97e8d1d708 | ||
|
|
6e25dec617 | ||
|
|
9b5e70dc17 | ||
|
|
529ea20289 | ||
|
|
95e5bf16dd | ||
|
|
3e15e87b11 | ||
|
|
1fb162bb4c | ||
|
|
04ac55b91e | ||
|
|
08a4536a6a | ||
|
|
01fe6abeed | ||
|
|
a7944af73d | ||
|
|
094ef92638 | ||
|
|
98e4136be5 | ||
|
|
61598fc971 | ||
|
|
e4a7fe7cb2 | ||
|
|
8ba0ac0b8f | ||
|
|
511bb73278 | ||
|
|
2522ac4ad5 | ||
|
|
89f97ba0ec | ||
|
|
ef4454ddba | ||
|
|
0d16be3f94 | ||
|
|
70dde65687 | ||
|
|
33cfee2f9f | ||
|
|
8f2403394e | ||
|
|
2f9751f7ea | ||
|
|
b475476a22 | ||
|
|
01bfd4bd9d | ||
|
|
128a2127c9 | ||
|
|
22860839e6 | ||
|
|
117f0b41a2 | ||
|
|
5efc3dc221 | ||
|
|
7d399b4c6d | ||
|
|
691853843d | ||
|
|
08529b3e7e | ||
|
|
d576f3ea96 | ||
|
|
63597b0221 | ||
|
|
afbd2b520e | ||
|
|
8e1631bfc7 | ||
|
|
63cb82717b | ||
|
|
cb1fd77531 | ||
|
|
718f9c4af8 | ||
|
|
db7c397345 | ||
|
|
e19a407a39 | ||
|
|
3c104158db | ||
|
|
d9e0a6a04f | ||
|
|
99f127148e | ||
|
|
cce6ba65dd | ||
|
|
bb6162059d | ||
|
|
e6d9545c30 | ||
|
|
4162215582 | ||
|
|
2b8b690892 | ||
|
|
b4a9a6fea5 | ||
|
|
cf66d96746 | ||
|
|
c82db9716c | ||
|
|
b1db06a3c6 | ||
|
|
a199f80ed4 | ||
|
|
2cd6b05aba | ||
|
|
9bcf0d5b38 | ||
|
|
9795734dc8 | ||
|
|
e5242bab49 | ||
|
|
d4052a0e62 | ||
|
|
b5b4f6df82 | ||
|
|
d89ae67c4d | ||
|
|
a225a4e440 | ||
|
|
626ced812a | ||
|
|
75bdb82b5c | ||
|
|
74ba812061 | ||
|
|
c966c3b8d7 | ||
|
|
762d0ca338 | ||
|
|
131b22576b | ||
|
|
704da21c60 | ||
|
|
8bbb150b07 | ||
|
|
9670ca0fbb | ||
|
|
76f91e7854 | ||
|
|
f911f66ead | ||
|
|
1a8a12fb0c | ||
|
|
9bc41cf04f | ||
|
|
869532d094 | ||
|
|
db88121ed8 | ||
|
|
262baf1870 | ||
|
|
277a2a4d58 | ||
|
|
11a748b94e | ||
|
|
46cd05c54a | ||
|
|
ff3784ad3f | ||
|
|
4f18cf6645 | ||
|
|
aa982fe8df | ||
|
|
6a126835cc | ||
|
|
c95ce5eb12 | ||
|
|
86717f7b25 | ||
|
|
35fb4c03a7 | ||
|
|
f1cf828f34 | ||
|
|
ddf6d0b7e2 | ||
|
|
b1324c6269 | ||
|
|
26123510a6 | ||
|
|
3e860f6d54 | ||
|
|
97a087707d | ||
|
|
f065df669a | ||
|
|
a2196b08a3 | ||
|
|
aa7d08dff7 | ||
|
|
fab3486669 | ||
|
|
71e97b3eba | ||
|
|
021f33645d | ||
|
|
058ba2bb8c | ||
|
|
a5ead1da86 | ||
|
|
0af845a02d | ||
|
|
79eef161f5 | ||
|
|
0005a77115 | ||
|
|
a0b9eff2c1 | ||
|
|
c571767cfb | ||
|
|
b9bb43054a | ||
|
|
8fb51165bc | ||
|
|
5e7d4bf0c3 | ||
|
|
f6e0b9af0e | ||
|
|
d2ebda8844 | ||
|
|
8883aa13ad | ||
|
|
12f7e2d685 | ||
|
|
083f512aae | ||
|
|
5a06ba651a | ||
|
|
d31208d1e5 | ||
|
|
7b2f2ef690 | ||
|
|
13dfbb9a0c | ||
|
|
8b12fd4af1 | ||
|
|
f071ab2038 | ||
|
|
f49e5a8610 | ||
|
|
16d0235a6e | ||
|
|
ea8cb9ce7d | ||
|
|
00b6b58b4d | ||
|
|
23ebe91d32 | ||
|
|
007dbc858f | ||
|
|
e9a00eb0d4 | ||
|
|
7451f06fe1 | ||
|
|
f7795ca21a | ||
|
|
cd0b97bf0a | ||
|
|
18282a6f73 | ||
|
|
c335ec3b29 | ||
|
|
2bb406fe6a | ||
|
|
1a8a0f33d0 | ||
|
|
7eac465b18 | ||
|
|
404a2d3a2d | ||
|
|
47e954afcb | ||
|
|
c95c2f5772 | ||
|
|
14a1992d52 | ||
|
|
e98ad9096d | ||
|
|
7489fd98bf | ||
|
|
189d007304 | ||
|
|
a97b5b7c90 | ||
|
|
9b1da14380 | ||
|
|
f61fbee52a | ||
|
|
aa8067f96b | ||
|
|
d2701226b6 | ||
|
|
4bbdcc109d | ||
|
|
09254215a5 | ||
|
|
63fcb40f6c | ||
|
|
1a6257257a | ||
|
|
e24d2e5077 | ||
|
|
eb724bbe10 | ||
|
|
e753f47291 | ||
|
|
df353aa006 | ||
|
|
7b87476986 | ||
|
|
837c9bd7d8 | ||
|
|
394043dcc2 | ||
|
|
bc8ba48100 | ||
|
|
1b93d7a45f | ||
|
|
1137341591 | ||
|
|
4db0075de3 | ||
|
|
2a6a3fd64a | ||
|
|
9055e186b6 | ||
|
|
965ee4a88f | ||
|
|
0a6d959742 | ||
|
|
cbc0cb707d | ||
|
|
0e0e9402dd | ||
|
|
71609a6489 | ||
|
|
5b2a7bf7e7 | ||
|
|
8ec6b8682f | ||
|
|
a1efa685f9 | ||
|
|
03b43e3302 | ||
|
|
75d0be410f | ||
|
|
afe92dfcad | ||
|
|
5dea7d218a | ||
|
|
28c2601a24 | ||
|
|
07a2a584c3 | ||
|
|
334b9b520a | ||
|
|
0c03ca26af | ||
|
|
9a9dd6a308 | ||
|
|
df0c98d013 | ||
|
|
5a94e3b644 | ||
|
|
f707284c6c | ||
|
|
edca260af4 | ||
|
|
636d449de1 | ||
|
|
2f58f932a7 | ||
|
|
68aa42860e | ||
|
|
c4fbb2e715 | ||
|
|
dca51ec298 | ||
|
|
e37a065f10 | ||
|
|
92216cc1c7 | ||
|
|
ca7b1f047b | ||
|
|
1125ac635b | ||
|
|
1f3560e964 | ||
|
|
648023750b | ||
|
|
06c19641b4 | ||
|
|
49dbca71b8 | ||
|
|
ec8a892e13 | ||
|
|
a69d89130f | ||
|
|
3ddc142ee9 | ||
|
|
d75bc2fd14 | ||
|
|
6e88090b89 | ||
|
|
cfb81d7f94 | ||
|
|
a6753b832c | ||
|
|
2eb67cf61b | ||
|
|
fea5c27437 | ||
|
|
9db14a5e8c | ||
|
|
99035a250b | ||
|
|
27c6a842bd | ||
|
|
3cb6f77cbb | ||
|
|
475474b179 | ||
|
|
073c4bc1ae | ||
|
|
e052f36cc6 | ||
|
|
827faef690 | ||
|
|
b69aeae892 | ||
|
|
f92ca964db | ||
|
|
030ad350b6 | ||
|
|
8bcb19f293 | ||
|
|
f61cdb6608 | ||
|
|
431f30bb52 | ||
|
|
f785851236 | ||
|
|
fcb013eb2a | ||
|
|
5ff13b6e3e | ||
|
|
3e0ff968bd | ||
|
|
6c3c46b0f5 | ||
|
|
0acd4fc9a1 | ||
|
|
a074f627b2 | ||
|
|
3d65929a74 | ||
|
|
d89a0e2cd9 | ||
|
|
198d4be18f | ||
|
|
ecad6c1982 | ||
|
|
42e26f3328 | ||
|
|
cb23cda9e9 | ||
|
|
4255dd9141 | ||
|
|
654bde6207 | ||
|
|
4ecbf51b33 | ||
|
|
837e65d72a | ||
|
|
aa9a85159e | ||
|
|
db993652c4 | ||
|
|
b500486f6b | ||
|
|
11a7316b9d | ||
|
|
75ed148490 | ||
|
|
2f82afcb07 | ||
|
|
fcf6f1929b | ||
|
|
6f90a7b07f | ||
|
|
36fa34a39e | ||
|
|
d516b1d885 | ||
|
|
2027590a8a | ||
|
|
2c8bead8a0 | ||
|
|
d9aa1b054a | ||
|
|
a8eecf963d | ||
|
|
bba85e5e79 | ||
|
|
a712f254e0 | ||
|
|
5a05a21dad | ||
|
|
f95b0e3c54 | ||
|
|
755222a35d | ||
|
|
e52937c113 | ||
|
|
4fe9a936f0 | ||
|
|
a253228b96 | ||
|
|
b41302d5d8 | ||
|
|
dd0375aed4 | ||
|
|
d3cca04703 | ||
|
|
3e32abe64f | ||
|
|
dc1a24339c | ||
|
|
95f123d137 | ||
|
|
b016337d4f | ||
|
|
24a60cd108 | ||
|
|
2699e17b63 | ||
|
|
527f4e2cb3 | ||
|
|
a6cec20056 | ||
|
|
31738ceb49 | ||
|
|
674ca3026b | ||
|
|
a3d9f1f3cc | ||
|
|
4d2235c9cc | ||
|
|
de76a1d41e | ||
|
|
23627c5453 | ||
|
|
5a25de1c82 | ||
|
|
355b5ab56f | ||
|
|
bcd0173ed0 | ||
|
|
7c694e3cf3 | ||
|
|
89ea9913e6 | ||
|
|
c821380ff1 | ||
|
|
0f2fd47ca0 | ||
|
|
92031120e3 | ||
|
|
e4e84b0a86 | ||
|
|
a7d873356d | ||
|
|
148349f0f3 | ||
|
|
ba7b53051a | ||
|
|
5803c0fe50 | ||
|
|
2e701656d2 | ||
|
|
a8efbffca6 | ||
|
|
ef724d2de8 | ||
|
|
bb848811e6 | ||
|
|
7f0c5b8a7a | ||
|
|
6ebc6bcd6f | ||
|
|
bcd2790649 | ||
|
|
7918c2f37c | ||
|
|
1ef7247311 | ||
|
|
235a2574dc | ||
|
|
4dc07d9872 | ||
|
|
a87c46843c | ||
|
|
7ff69d5e6d | ||
|
|
9653b0a965 | ||
|
|
aca3a76854 | ||
|
|
d38cf1da1f | ||
|
|
a226aedaec | ||
|
|
baca89c575 | ||
|
|
c5471fc25c | ||
|
|
b39ed424f6 | ||
|
|
e4cf6421bd | ||
|
|
0776fcf5cc | ||
|
|
59358443b4 | ||
|
|
c4911b1947 | ||
|
|
6c24d4bc1a | ||
|
|
8753076dcd | ||
|
|
7f5e58bcc3 | ||
|
|
d839313cf5 | ||
|
|
f51f304818 | ||
|
|
7f09fd4c19 | ||
|
|
87692b06e6 | ||
|
|
b8617e0a5a | ||
|
|
6701afcdce | ||
|
|
fbf0e48a07 | ||
|
|
e4087e9c65 | ||
|
|
c790373804 | ||
|
|
43401e4b5e | ||
|
|
5948c20326 | ||
|
|
74aabbbb5f | ||
|
|
522a7384e7 | ||
|
|
0eea932778 | ||
|
|
db8f8a2675 | ||
|
|
3ef5953db2 | ||
|
|
586c97b22c | ||
|
|
d54cb9182f | ||
|
|
3257f16667 | ||
|
|
178c0a441b | ||
|
|
937cede9b8 | ||
|
|
3ff60ede2a | ||
|
|
3b73f72ac2 | ||
|
|
3b4baab01a | ||
|
|
4476d7f69e | ||
|
|
6cf0c73453 | ||
|
|
d3c2158121 | ||
|
|
0cb2739139 | ||
|
|
0cca01345c | ||
|
|
3ebba9502a | ||
|
|
a5190ec5d7 | ||
|
|
5bfe079262 | ||
|
|
7b641ace23 | ||
|
|
7bcb0bcaa8 | ||
|
|
7ecd67a3fe | ||
|
|
d9f459d94a | ||
|
|
76756923ba | ||
|
|
401dd99225 | ||
|
|
e21ef3f182 | ||
|
|
9e1d8ab369 | ||
|
|
00988dc1e7 | ||
|
|
7007de752d | ||
|
|
832fbb7d5d | ||
|
|
dc7c674a0e | ||
|
|
bfea47802e | ||
|
|
28ebb303af | ||
|
|
f20cf509d3 | ||
|
|
3f9a3b41da | ||
|
|
38811b5a28 | ||
|
|
f791f6fa20 | ||
|
|
c84f9e56fb | ||
|
|
355837547e | ||
|
|
0f5c39317a | ||
|
|
43877f4e34 | ||
|
|
b427fd6876 | ||
|
|
a31487a86d | ||
|
|
84a40e6ae0 | ||
|
|
19f32b7825 | ||
|
|
93e422ec59 | ||
|
|
6e9ae0b0db | ||
|
|
a1438bdb3d | ||
|
|
510f74f654 | ||
|
|
52452f7939 | ||
|
|
b3240f859a | ||
|
|
2de442f44d | ||
|
|
c2211c501d | ||
|
|
6c340f8ed4 | ||
|
|
a22cc96ea5 | ||
|
|
8c9733d8da | ||
|
|
ff9ad96b74 | ||
|
|
8479d4ff7c | ||
|
|
d450aff607 | ||
|
|
1c28b9783f | ||
|
|
f92c082df8 | ||
|
|
d69f714032 | ||
|
|
50d0952dd5 | ||
|
|
5453a1c0fa | ||
|
|
18231cd950 | ||
|
|
5629dfbe09 | ||
|
|
21b80db0ee | ||
|
|
c22799bda1 | ||
|
|
2b187c0547 | ||
|
|
65b760b119 | ||
|
|
f73e5c74fb | ||
|
|
7008b5ec7b | ||
|
|
f167b09397 | ||
|
|
54c645e33a | ||
|
|
385446807d | ||
|
|
ea2cb4e6c0 | ||
|
|
303bf5420e | ||
|
|
58a96c6500 | ||
|
|
4f50afc188 | ||
|
|
e388238a25 | ||
|
|
1674c6a252 | ||
|
|
93ebfb6a4f | ||
|
|
47404b1dc8 | ||
|
|
c24ceac063 | ||
|
|
c5a2d183d8 | ||
|
|
e86b6443f2 | ||
|
|
bf4bb854b1 | ||
|
|
779241db7a | ||
|
|
11f1f6cff1 | ||
|
|
7ad6e1b76a | ||
|
|
d414122efd | ||
|
|
7e2d9ff381 | ||
|
|
413896af5d |
1
.browserslistrc
Normal file
1
.browserslistrc
Normal file
@@ -0,0 +1 @@
|
||||
defaults
|
||||
70
.env
Normal file
70
.env
Normal file
@@ -0,0 +1,70 @@
|
||||
# Default ENV vars (primarily for the development environment).
|
||||
# Create `.env.development.local` or `.env.test.local` to add any local overrides.
|
||||
|
||||
# Time zone must match the operating system time zone in order to pass all tests.
|
||||
# This string is the key for the MAPPING hash constant in ActiveSupport::TimeZone.
|
||||
# Documentation including the hash="https://api.rubyonrails.org/classes/ActiveSupport/TimeZone.html
|
||||
TIMEZONE="Melbourne"
|
||||
|
||||
# Default country for dropdowns etc. See for codes="http://en.wikipedia.org/wiki/ISO_3166-1
|
||||
DEFAULT_COUNTRY_CODE="AU"
|
||||
|
||||
# Locale for translation.
|
||||
LOCALE="en"
|
||||
|
||||
# For multilingual - ENV doesn't have array so pass it as string with commas
|
||||
AVAILABLE_LOCALES="en,es"
|
||||
|
||||
# Spree zone.
|
||||
CHECKOUT_ZONE="Australia"
|
||||
|
||||
# Find currency codes at http://en.wikipedia.org/wiki/ISO_4217.
|
||||
CURRENCY="AUD"
|
||||
|
||||
# The whenever gem can set the `MAILTO` variable for our cron jobs.
|
||||
# You can define an email address to notify if any job outputs something.
|
||||
# But you need a working mail server setup so that the message is delivered.
|
||||
# See: config/schedule.rb
|
||||
# SCHEDULE_NOTIFICATIONS="admin@example.com"
|
||||
|
||||
# Mail settings
|
||||
MAIL_HOST="example.com"
|
||||
MAIL_DOMAIN="example.com"
|
||||
MAIL_PORT="25"
|
||||
SMTP_USERNAME="ofn"
|
||||
SMTP_PASSWORD="f00d"
|
||||
|
||||
# Optional mail settings
|
||||
# MAIL_SECURE_CONNECTION="TLS' # 'None' (default), 'SSL' or 'TLS'
|
||||
# MAILS_FROM="hello@example.com"
|
||||
# MAIL_BCC="manager@example.com"
|
||||
|
||||
# Javascript error reporting via Bugsnag.
|
||||
# BUGSNAG_JS_KEY=""
|
||||
|
||||
# SingleSignOn login for Discourse
|
||||
#
|
||||
# DISCOURSE_SSO_SECRET should be a random string. It must be the same as provided to your Discourse instance.
|
||||
# DISCOURSE_SSO_SECRET=""
|
||||
#
|
||||
# DISCOURSE_URL must be the URL of your Discourse instance.
|
||||
# DISCOURSE_URL="https://noticeboard.openfoodnetwork.org.au"
|
||||
|
||||
# see="https://developers.google.com/maps/documentation/javascript/get-api-key
|
||||
# GOOGLE_MAPS_API_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||
|
||||
# Stripe Connect details for instance account
|
||||
# Find these under 'API keys' and 'Connect' in your Stripe account dashboard -> Account Settings
|
||||
# Under 'Connect', the Redirect URI should be set to https://YOUR_SERVER_URL/stripe/callbacks (e.g. https://openfoodnetwork.org.uk/stripe/callbacks)
|
||||
# Under 'Webhooks', you should set up a Connect endpoint pointing to https://YOUR_SERVER_URL/stripe/webhooks e.g. (https://openfoodnetwork.org.uk/stripe/webhooks)
|
||||
# STRIPE_INSTANCE_SECRET_KEY="sk_test_xxxxxx" # This can be a test key or a live key
|
||||
# STRIPE_INSTANCE_PUBLISHABLE_KEY="pk_test_xxxx" # This can be a test key or a live key
|
||||
# STRIPE_CLIENT_ID="ca_xxxx" # This can be a development ID or a production ID
|
||||
# STRIPE_ENDPOINT_SECRET="whsec_xxxx"
|
||||
|
||||
# Feature toggles
|
||||
#
|
||||
# Adding user emails separated by commas will enable them the use of certain features. See
|
||||
# config/initializers/feature_toggles.rb for details.
|
||||
#
|
||||
# BETA_TESTERS="ofn@example.com,superadmin@example.com"
|
||||
7
.env.development
Normal file
7
.env.development
Normal file
@@ -0,0 +1,7 @@
|
||||
# ENV vars for the development environment
|
||||
# Override locally with `.env.development.local`
|
||||
|
||||
SECRET_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||
|
||||
OFN_REDIS_URL="redis://localhost:6379/1"
|
||||
OFN_REDIS_JOBS_URL="redis://localhost:6379/2"
|
||||
4
.env.test
Normal file
4
.env.test
Normal file
@@ -0,0 +1,4 @@
|
||||
# ENV vars for the test environment
|
||||
# Override locally with `.env.test.local`
|
||||
|
||||
SECRET_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||
1
.github/workflows/build.yml
vendored
1
.github/workflows/build.yml
vendored
@@ -9,6 +9,7 @@ env:
|
||||
DISABLE_KNAPSACK: true
|
||||
TIMEZONE: UTC
|
||||
COVERAGE: true
|
||||
RSPEC_RETRY_RETRY_COUNT: 3
|
||||
|
||||
jobs:
|
||||
test-controllers-and-serializers:
|
||||
|
||||
10
.gitignore
vendored
10
.gitignore
vendored
@@ -2,6 +2,9 @@
|
||||
.rbenv-version
|
||||
.python-version
|
||||
.byebug_history
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.swp
|
||||
*.swo
|
||||
*.swp
|
||||
@@ -46,5 +49,10 @@ vendor/bundle/
|
||||
coverage
|
||||
/reports/
|
||||
!/reports/README.md
|
||||
bin/
|
||||
/spec/components/stories/**/*.stories.json
|
||||
|
||||
/public/packs
|
||||
/public/packs-test
|
||||
/yarn-error.log
|
||||
yarn-debug.log*
|
||||
.yarn-integrity
|
||||
|
||||
@@ -18,49 +18,22 @@
|
||||
#
|
||||
# This process probably doesn't need repeating. Otherwise there is plenty
|
||||
# of room for improvements and automation.
|
||||
|
||||
Layout/LineLength:
|
||||
Max: 100
|
||||
Exclude:
|
||||
- app/controllers/spree/admin/products_controller.rb
|
||||
- app/controllers/spree/admin/reports_controller.rb
|
||||
- app/controllers/spree/paypal_controller.rb
|
||||
- engines/order_management/spec/services/order_management/order/stripe_sca_payment_authorize_spec.rb
|
||||
- engines/order_management/spec/services/order_management/order/updater_spec.rb
|
||||
- engines/order_management/spec/services/order_management/reports/bulk_coop/bulk_coop_report_spec.rb
|
||||
- lib/open_food_network/reports/line_items.rb
|
||||
- spec/controllers/spree/admin/orders/invoices_spec.rb
|
||||
- spec/controllers/spree/admin/tax_rates_controller_spec.rb
|
||||
- spec/controllers/user_passwords_controller_spec.rb
|
||||
- spec/features/admin/configuration/general_settings_spec.rb
|
||||
- spec/features/consumer/shopping/unit_price_spec.rb
|
||||
- spec/helpers/admin/orders_helper_spec.rb
|
||||
- spec/lib/open_food_network/order_cycle_management_report_spec.rb
|
||||
- spec/lib/stripe/authorize_response_patcher_spec.rb
|
||||
- spec/services/bulk_invoice_service_spec.rb
|
||||
- spec/services/content_sanitizer_spec.rb
|
||||
- spec/services/process_payment_intent_spec.rb
|
||||
- spec/support/features/datepicker_helper.rb
|
||||
- app/controllers/admin/bulk_line_items_controller.rb
|
||||
- app/controllers/admin/contents_controller.rb
|
||||
- app/controllers/admin/customers_controller.rb
|
||||
- app/controllers/admin/enterprise_fees_controller.rb
|
||||
- app/controllers/admin/enterprise_relationships_controller.rb
|
||||
- app/controllers/admin/enterprise_roles_controller.rb
|
||||
- app/controllers/admin/enterprises_controller.rb
|
||||
- app/controllers/admin/inventory_items_controller.rb
|
||||
- app/controllers/admin/manager_invitations_controller.rb
|
||||
- app/controllers/admin/product_import_controller.rb
|
||||
- app/controllers/admin/schedules_controller.rb
|
||||
- app/controllers/admin/subscriptions_controller.rb
|
||||
- app/controllers/api/enterprise_attachment_controller.rb
|
||||
- app/controllers/api/product_images_controller.rb
|
||||
- app/controllers/spree/paypal_controller_decorator.rb
|
||||
- app/controllers/stripe/callbacks_controller.rb
|
||||
- app/controllers/api/v0/order_cycles_controller.rb
|
||||
- app/controllers/spree/paypal_controller.rb
|
||||
- app/helpers/angular_form_builder.rb
|
||||
- app/helpers/angular_form_helper.rb
|
||||
- app/helpers/checkout_helper.rb
|
||||
- app/helpers/enterprises_helper.rb
|
||||
- app/helpers/markdown_helper.rb
|
||||
- app/helpers/order_cycles_helper.rb
|
||||
- app/helpers/spree/orders_helper.rb
|
||||
- app/jobs/subscription_confirm_job.rb
|
||||
@@ -69,110 +42,91 @@ Layout/LineLength:
|
||||
- app/models/concerns/order_shipment.rb
|
||||
- app/models/concerns/product_stock.rb
|
||||
- app/models/concerns/variant_stock.rb
|
||||
- app/models/content_configuration.rb
|
||||
- app/models/customer.rb
|
||||
- app/models/enterprise_group.rb
|
||||
- app/models/enterprise_role.rb
|
||||
- app/models/inventory_item.rb
|
||||
- app/models/product_import/entry_processor.rb
|
||||
- app/models/product_import/spreadsheet_entry.rb
|
||||
- app/models/product_import/unit_converter.rb
|
||||
- app/models/proxy_order.rb
|
||||
- app/models/schedule.rb
|
||||
- app/models/spree/app_configuration.rb
|
||||
- app/models/spree/gateway/stripe_connect.rb
|
||||
- app/models/spree/image.rb
|
||||
- app/models/spree/line_item.rb
|
||||
- app/models/spree/order.rb
|
||||
- app/models/spree/payment_method.rb
|
||||
- app/models/spree/product.rb
|
||||
- app/models/spree/user.rb
|
||||
- app/models/spree/variant.rb
|
||||
- app/models/spree/preferences/store.rb
|
||||
- app/models/subscription.rb
|
||||
- app/models/variant_override.rb
|
||||
- app/serializers/api/admin/subscription_line_item_serializer.rb
|
||||
- app/serializers/api/admin/subscription_serializer.rb
|
||||
- app/services/cart_service.rb
|
||||
- app/services/checkout/post_checkout_actions.rb
|
||||
- app/services/default_stock_location.rb
|
||||
- app/services/embedded_page_service.rb
|
||||
- app/services/order_cycle_form.rb
|
||||
- app/services/order_factory.rb
|
||||
- app/services/order_syncer.rb
|
||||
- app/services/variant_units/variant_and_line_item_naming.rb
|
||||
- engines/order_management/app/services/order_management/reports/bulk_coop/bulk_coop_report.rb
|
||||
- engines/order_management/app/services/order_management/subscriptions/validator.rb
|
||||
- engines/order_management/spec/services/order_management/order/stripe_sca_payment_authorize_spec.rb
|
||||
- engines/order_management/spec/services/order_management/order/updater_spec.rb
|
||||
- engines/web/app/helpers/web/cookies_policy_helper.rb
|
||||
- engines/web/config/routes.rb
|
||||
- engines/web/spec/features/consumer/cookies_spec.rb
|
||||
- Gemfile
|
||||
- lib/discourse/single_sign_on.rb
|
||||
- lib/open_food_network/available_payment_method_filter.rb
|
||||
- lib/open_food_network/bulk_coop_report.rb
|
||||
- lib/open_food_network/customers_report.rb
|
||||
- lib/open_food_network/enterprise_fee_applicator.rb
|
||||
- lib/open_food_network/enterprise_fee_calculator.rb
|
||||
- lib/open_food_network/enterprise_issue_validator.rb
|
||||
- lib/open_food_network/group_buy_report.rb
|
||||
- lib/open_food_network/lettuce_share_report.rb
|
||||
- lib/open_food_network/order_cycle_form_applicator.rb
|
||||
- lib/open_food_network/order_cycle_management_report.rb
|
||||
- lib/open_food_network/order_cycle_permissions.rb
|
||||
- lib/open_food_network/payments_report.rb
|
||||
- lib/open_food_network/reports/line_items.rb
|
||||
- lib/open_food_network/sales_tax_report.rb
|
||||
- lib/open_food_network/scope_variants_for_search.rb
|
||||
- lib/open_food_network/xero_invoices_report.rb
|
||||
- lib/spree/core/calculated_adjustments.rb
|
||||
- lib/spree/localized_number.rb
|
||||
- lib/stripe/credit_card_clone_finder.rb
|
||||
- lib/tasks/data.rake
|
||||
- lib/tasks/enterprises.rake
|
||||
- spec/controllers/admin/bulk_line_items_controller_spec.rb
|
||||
- spec/controllers/admin/column_preferences_controller_spec.rb
|
||||
- spec/controllers/admin/customers_controller_spec.rb
|
||||
- spec/controllers/admin/enterprises_controller_spec.rb
|
||||
- spec/controllers/admin/inventory_items_controller_spec.rb
|
||||
- spec/controllers/admin/manager_invitations_controller_spec.rb
|
||||
- spec/controllers/admin/order_cycles_controller_spec.rb
|
||||
- spec/controllers/admin/proxy_orders_controller_spec.rb
|
||||
- spec/controllers/admin/schedules_controller_spec.rb
|
||||
- spec/controllers/admin/stripe_accounts_controller_spec.rb
|
||||
- spec/controllers/admin/stripe_connect_settings_controller_spec.rb
|
||||
- spec/controllers/admin/subscription_line_items_controller_spec.rb
|
||||
- spec/controllers/admin/subscriptions_controller_spec.rb
|
||||
- spec/controllers/admin/variant_overrides_controller_spec.rb
|
||||
- spec/controllers/api/base_controller_spec.rb
|
||||
- spec/controllers/api/exchange_products_controller_spec.rb
|
||||
- spec/controllers/api/logos_controller_spec.rb
|
||||
- spec/controllers/api/order_cycles_controller_spec.rb
|
||||
- spec/controllers/api/orders_controller_spec.rb
|
||||
- spec/controllers/api/product_images_controller_spec.rb
|
||||
- spec/controllers/api/products_controller_spec.rb
|
||||
- spec/controllers/api/promo_images_controller_spec.rb
|
||||
- spec/controllers/api/states_controller_spec.rb
|
||||
- spec/controllers/api/terms_and_conditions_controller_spec.rb
|
||||
- spec/controllers/api/variants_controller_spec.rb
|
||||
- spec/controllers/api/v0/base_controller_spec.rb
|
||||
- spec/controllers/api/v0/enterprises_controller_spec.rb
|
||||
- spec/controllers/api/v0/exchange_products_controller_spec.rb
|
||||
- spec/controllers/api/v0/logos_controller_spec.rb
|
||||
- spec/controllers/api/v0/order_cycles_controller_spec.rb
|
||||
- spec/controllers/api/v0/orders_controller_spec.rb
|
||||
- spec/controllers/api/v0/product_images_controller_spec.rb
|
||||
- spec/controllers/api/v0/products_controller_spec.rb
|
||||
- spec/controllers/api/v0/promo_images_controller_spec.rb
|
||||
- spec/controllers/api/v0/terms_and_conditions_controller_spec.rb
|
||||
- spec/controllers/cart_controller_spec.rb
|
||||
- spec/controllers/checkout_controller_spec.rb
|
||||
- spec/controllers/enterprises_controller_spec.rb
|
||||
- spec/controllers/line_items_controller_spec.rb
|
||||
- spec/controllers/shop_controller_spec.rb
|
||||
- spec/controllers/shops_controller_spec.rb
|
||||
- spec/controllers/spree/admin/adjustments_controller_spec.rb
|
||||
- spec/controllers/spree/admin/base_controller_spec.rb
|
||||
- spec/controllers/spree/admin/orders_controller_spec.rb
|
||||
- spec/controllers/spree/admin/orders/customer_details_controller_spec.rb
|
||||
- spec/controllers/spree/admin/orders/invoices_spec.rb
|
||||
- spec/controllers/spree/admin/payment_methods_controller_spec.rb
|
||||
- spec/controllers/spree/admin/products_controller_spec.rb
|
||||
- spec/controllers/spree/admin/reports_controller_spec.rb
|
||||
- spec/controllers/spree/admin/variants_controller_spec.rb
|
||||
- spec/controllers/spree/credit_cards_controller_spec.rb
|
||||
- spec/controllers/spree/orders_controller_spec.rb
|
||||
- spec/controllers/spree/users_controller_spec.rb
|
||||
- spec/controllers/spree/user_sessions_controller_spec.rb
|
||||
- spec/controllers/stripe/callbacks_controller_spec.rb
|
||||
- spec/controllers/stripe/webhooks_controller_spec.rb
|
||||
- spec/controllers/user_confirmations_controller_spec.rb
|
||||
- spec/factories/line_item_factory.rb
|
||||
- spec/factories/order_factory.rb
|
||||
- spec/factories/shipment_factory.rb
|
||||
- spec/factories/stock_location_factory.rb
|
||||
- spec/factories/user_factory.rb
|
||||
- spec/features/admin/adjustments_spec.rb
|
||||
- spec/features/admin/bulk_order_management_spec.rb
|
||||
- spec/features/admin/bulk_product_update_spec.rb
|
||||
@@ -180,13 +134,10 @@ Layout/LineLength:
|
||||
- spec/features/admin/customers_spec.rb
|
||||
- spec/features/admin/enterprise_fees_spec.rb
|
||||
- spec/features/admin/enterprise_relationships_spec.rb
|
||||
- spec/features/admin/enterprise_roles_spec.rb
|
||||
- spec/features/admin/enterprises/images_spec.rb
|
||||
- spec/features/admin/enterprises/index_spec.rb
|
||||
- spec/features/admin/enterprises_spec.rb
|
||||
- spec/features/admin/enterprise_user_spec.rb
|
||||
- spec/features/admin/multilingual_spec.rb
|
||||
- spec/features/admin/order_cycles/complex_creating_specific_time_spec.rb
|
||||
- spec/features/admin/order_cycles/complex_editing_multiple_product_pages_spec.rb
|
||||
- spec/features/admin/order_cycles/complex_editing_spec.rb
|
||||
- spec/features/admin/order_cycles/complex_updating_specific_time_spec.rb
|
||||
@@ -195,6 +146,7 @@ Layout/LineLength:
|
||||
- spec/features/admin/order_spec.rb
|
||||
- spec/features/admin/overview_spec.rb
|
||||
- spec/features/admin/payment_method_spec.rb
|
||||
- spec/features/admin/payments_stripe_spec.rb
|
||||
- spec/features/admin/product_import_spec.rb
|
||||
- spec/features/admin/products_spec.rb
|
||||
- spec/features/admin/reports_spec.rb
|
||||
@@ -204,76 +156,49 @@ Layout/LineLength:
|
||||
- spec/features/admin/tag_rules_spec.rb
|
||||
- spec/features/admin/users_spec.rb
|
||||
- spec/features/admin/variant_overrides_spec.rb
|
||||
- spec/features/consumer/account/cards_spec.rb
|
||||
- spec/features/consumer/account/settings_spec.rb
|
||||
- spec/features/consumer/account_spec.rb
|
||||
- spec/features/consumer/authentication_spec.rb
|
||||
- spec/features/consumer/caching/darkswarm_caching_spec.rb
|
||||
- spec/features/consumer/caching/shops_caching_spec.rb
|
||||
- spec/features/consumer/groups_spec.rb
|
||||
- spec/features/consumer/multilingual_spec.rb
|
||||
- spec/features/consumer/producers_spec.rb
|
||||
- spec/features/consumer/registration_spec.rb
|
||||
- spec/features/consumer/shopping/cart_spec.rb
|
||||
- spec/features/consumer/shopping/checkout_auth_spec.rb
|
||||
- spec/features/consumer/shopping/checkout_spec.rb
|
||||
- spec/features/consumer/shopping/checkout_stripe_spec.rb
|
||||
- spec/features/consumer/shopping/embedded_groups_spec.rb
|
||||
- spec/features/consumer/shopping/embedded_shopfronts_spec.rb
|
||||
- spec/features/consumer/shopping/orders_spec.rb
|
||||
- spec/features/consumer/shopping/products_spec.rb
|
||||
- spec/features/consumer/shopping/shopping_spec.rb
|
||||
- spec/features/consumer/shopping/unit_price_spec.rb
|
||||
- spec/features/consumer/shopping/variant_overrides_spec.rb
|
||||
- spec/features/consumer/shops_spec.rb
|
||||
- spec/helpers/admin/subscriptions_helper_spec.rb
|
||||
- spec/helpers/checkout_helper_spec.rb
|
||||
- spec/helpers/enterprises_helper_spec.rb
|
||||
- spec/helpers/groups_helper_spec.rb
|
||||
- spec/helpers/injection_helper_spec.rb
|
||||
- spec/helpers/order_cycles_helper_spec.rb
|
||||
- spec/helpers/spree/admin/base_helper_spec.rb
|
||||
- spec/jobs/confirm_order_job_spec.rb
|
||||
- spec/jobs/subscription_confirm_job_spec.rb
|
||||
- spec/jobs/subscription_placement_job_spec.rb
|
||||
- spec/lib/open_food_network/address_finder_spec.rb
|
||||
- spec/lib/open_food_network/customers_report_spec.rb
|
||||
- spec/lib/open_food_network/enterprise_fee_applicator_spec.rb
|
||||
- spec/lib/open_food_network/enterprise_fee_calculator_spec.rb
|
||||
- spec/lib/open_food_network/group_buy_report_spec.rb
|
||||
- spec/lib/open_food_network/lettuce_share_report_spec.rb
|
||||
- spec/lib/open_food_network/order_cycle_form_applicator_spec.rb
|
||||
- spec/lib/open_food_network/order_cycle_management_report_spec.rb
|
||||
- spec/lib/open_food_network/order_cycle_permissions_spec.rb
|
||||
- spec/lib/open_food_network/order_grouper_spec.rb
|
||||
- spec/lib/open_food_network/orders_and_fulfillments_report_spec.rb
|
||||
- spec/lib/open_food_network/permissions_spec.rb
|
||||
- spec/lib/open_food_network/products_and_inventory_report_spec.rb
|
||||
- spec/lib/open_food_network/scope_variant_to_hub_spec.rb
|
||||
- spec/lib/open_food_network/tag_rule_applicator_spec.rb
|
||||
- spec/lib/open_food_network/users_and_enterprises_report_spec.rb
|
||||
- spec/lib/open_food_network/xero_invoices_report_spec.rb
|
||||
- spec/lib/spree/core/calculated_adjustments_spec.rb
|
||||
- spec/lib/stripe/account_connector_spec.rb
|
||||
- spec/lib/stripe/webhook_handler_spec.rb
|
||||
- spec/lib/stripe/authorize_response_patcher_spec.rb
|
||||
- spec/mailers/order_mailer_spec.rb
|
||||
- spec/mailers/producer_mailer_spec.rb
|
||||
- spec/mailers/subscription_mailer_spec.rb
|
||||
- spec/models/calculator/flexi_rate_spec.rb
|
||||
- spec/models/calculator/price_sack_spec.rb
|
||||
- spec/models/calculator/weight_spec.rb
|
||||
- spec/models/column_preference_spec.rb
|
||||
- spec/models/concerns/order_shipment_spec.rb
|
||||
- spec/models/concerns/product_stock_spec.rb
|
||||
- spec/models/customer_spec.rb
|
||||
- spec/models/enterprise_caching_spec.rb
|
||||
- spec/models/enterprise_fee_spec.rb
|
||||
- spec/models/enterprise_group_spec.rb
|
||||
- spec/models/enterprise_relationship_spec.rb
|
||||
- spec/models/enterprise_spec.rb
|
||||
- spec/models/exchange_spec.rb
|
||||
- spec/models/order_cycle_spec.rb
|
||||
- spec/models/product_importer_spec.rb
|
||||
- spec/models/product_import/reset_absent_spec.rb
|
||||
- spec/models/proxy_order_spec.rb
|
||||
- spec/models/spree/ability_spec.rb
|
||||
- spec/models/spree/address_spec.rb
|
||||
- spec/models/spree/adjustment_spec.rb
|
||||
@@ -284,91 +209,50 @@ Layout/LineLength:
|
||||
- spec/models/spree/order/checkout_spec.rb
|
||||
- spec/models/spree/order_inventory_spec.rb
|
||||
- spec/models/spree/order_spec.rb
|
||||
- spec/models/spree/order/state_machine_spec.rb
|
||||
- spec/models/spree/payment_method_spec.rb
|
||||
- spec/models/spree/payment_spec.rb
|
||||
- spec/models/spree/product_set_spec.rb
|
||||
- spec/models/spree/product_spec.rb
|
||||
- spec/models/spree/return_authorization_spec.rb
|
||||
- spec/models/spree/shipping_method_spec.rb
|
||||
- spec/models/spree/stock_item_spec.rb
|
||||
- spec/models/spree/taxon_spec.rb
|
||||
- spec/models/spree/tax_rate_spec.rb
|
||||
- spec/models/spree/user_spec.rb
|
||||
- spec/models/spree/variant_spec.rb
|
||||
- spec/models/stripe_account_spec.rb
|
||||
- spec/models/tag_rule/discount_order_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/terms_of_service_file_spec.rb
|
||||
- spec/models/variant_override_spec.rb
|
||||
- spec/performance/orders_controller_spec.rb
|
||||
- spec/performance/shop_controller_spec.rb
|
||||
- spec/requests/api/orders_spec.rb
|
||||
- spec/requests/checkout/failed_checkout_spec.rb
|
||||
- spec/requests/embedded_shopfronts_headers_spec.rb
|
||||
- spec/serializers/api/admin/customer_serializer_spec.rb
|
||||
- spec/serializers/api/admin/exchange_serializer_spec.rb
|
||||
- spec/serializers/api/admin/for_order_cycle/supplied_product_serializer_spec.rb
|
||||
- spec/serializers/api/admin/order_cycle_serializer_spec.rb
|
||||
- spec/serializers/api/admin/subscription_customer_serializer_spec.rb
|
||||
- spec/serializers/api/admin/variant_override_serializer_spec.rb
|
||||
- spec/serializers/api/current_order_serializer_spec.rb
|
||||
- spec/serializers/api/enterprise_shopfront_serializer_spec.rb
|
||||
- spec/serializers/api/order_serializer_spec.rb
|
||||
- spec/services/address_geocoder_spec.rb
|
||||
- spec/services/cart_service_spec.rb
|
||||
- spec/services/checkout/form_data_adapter_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_products_spec.rb
|
||||
- spec/services/order_cycle_distributed_variants_spec.rb
|
||||
- spec/services/order_cycle_form_spec.rb
|
||||
- spec/services/order_factory_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/products_renderer_spec.rb
|
||||
- spec/services/product_tag_rules_filterer_spec.rb
|
||||
- spec/services/variant_units/option_value_namer_spec.rb
|
||||
- spec/spec_helper.rb
|
||||
- spec/support/cancan_helper.rb
|
||||
- spec/support/matchers/delegate_matchers.rb
|
||||
- spec/support/features/datepicker_helper.rb
|
||||
- spec/support/matchers/select2_matchers.rb
|
||||
- spec/support/matchers/table_matchers.rb
|
||||
- spec/support/request/shop_workflow.rb
|
||||
- spec/support/request/stripe_stubs.rb
|
||||
- spec/support/request/web_helper.rb
|
||||
- spec/support/seeds.rb
|
||||
- spec/swagger_helper.rb
|
||||
- spec/views/spree/admin/payment_methods/index.html.haml_spec.rb
|
||||
|
||||
Metrics/AbcSize:
|
||||
Max: 15
|
||||
Exclude:
|
||||
- app/controllers/admin/schedules_controller.rb
|
||||
- app/controllers/checkout_controller.rb
|
||||
- app/controllers/spree/admin/general_settings_controller.rb
|
||||
- app/controllers/spree/admin/images_controller.rb
|
||||
- app/controllers/spree/admin/mail_methods_controller.rb
|
||||
- app/controllers/spree/admin/shipping_methods_controller.rb
|
||||
- app/controllers/spree/paypal_controller.rb
|
||||
- app/helpers/spree/base_helper.rb
|
||||
- app/jobs/subscription_placement_job.rb
|
||||
- app/models/order_cycle.rb
|
||||
- app/models/product_import/unit_converter.rb
|
||||
- app/models/spree/gateway/pay_pal_express.rb
|
||||
- app/serializers/api/admin/enterprise_serializer.rb
|
||||
- app/services/order_factory.rb
|
||||
- app/services/variants_stock_levels.rb
|
||||
- engines/order_management/app/services/order_management/subscriptions/form.rb
|
||||
- lib/open_food_network/enterprise_fee_calculator.rb
|
||||
- lib/open_food_network/order_grouper.rb
|
||||
- lib/spree/core/controller_helpers/auth.rb
|
||||
- lib/spree/core/controller_helpers/common.rb
|
||||
- lib/spree/core/product_duplicator.rb
|
||||
- lib/stripe/authorize_response_patcher.rb
|
||||
- lib/stripe/profile_storer.rb
|
||||
- app/controllers/admin/bulk_line_items_controller.rb
|
||||
- app/controllers/admin/customers_controller.rb
|
||||
- app/controllers/admin/enterprise_fees_controller.rb
|
||||
@@ -376,19 +260,23 @@ Metrics/AbcSize:
|
||||
- app/controllers/admin/order_cycles_controller.rb
|
||||
- app/controllers/admin/product_import_controller.rb
|
||||
- app/controllers/admin/resource_controller.rb
|
||||
- app/controllers/admin/schedules_controller.rb
|
||||
- app/controllers/admin/stripe_accounts_controller.rb
|
||||
- app/controllers/admin/subscription_line_items_controller.rb
|
||||
- app/controllers/admin/subscriptions_controller.rb
|
||||
- app/controllers/api/enterprises_controller.rb
|
||||
- app/controllers/api/product_images_controller.rb
|
||||
- app/controllers/api/products_controller.rb
|
||||
- app/controllers/api/shipments_controller.rb
|
||||
- app/controllers/api/taxons_controller.rb
|
||||
- app/controllers/api/variants_controller.rb
|
||||
- app/controllers/application_controller.rb
|
||||
- app/controllers/cart_controller.rb
|
||||
- app/controllers/api/v0/enterprises_controller.rb
|
||||
- app/controllers/api/v0/product_images_controller.rb
|
||||
- app/controllers/api/v0/products_controller.rb
|
||||
- app/controllers/api/v0/shipments_controller.rb
|
||||
- app/controllers/api/v0/taxons_controller.rb
|
||||
- app/controllers/api/v0/variants_controller.rb
|
||||
- app/controllers/checkout_controller.rb
|
||||
- app/controllers/discourse_sso_controller.rb
|
||||
- app/controllers/enterprises_controller.rb
|
||||
- app/controllers/spree/admin/adjustments_controller.rb
|
||||
- app/controllers/spree/admin/general_settings_controller.rb
|
||||
- app/controllers/spree/admin/images_controller.rb
|
||||
- app/controllers/spree/admin/mail_methods_controller.rb
|
||||
- app/controllers/spree/admin/orders_controller.rb
|
||||
- app/controllers/spree/admin/orders/customer_details_controller.rb
|
||||
- app/controllers/spree/admin/overview_controller.rb
|
||||
@@ -397,14 +285,14 @@ Metrics/AbcSize:
|
||||
- app/controllers/spree/admin/products_controller.rb
|
||||
- app/controllers/spree/admin/reports_controller.rb
|
||||
- app/controllers/spree/admin/search_controller.rb
|
||||
- app/controllers/spree/admin/shipping_methods_controller.rb
|
||||
- app/controllers/spree/admin/taxons_controller.rb
|
||||
- app/controllers/spree/admin/users_controller.rb
|
||||
- app/controllers/spree/admin/variants_controller.rb
|
||||
- app/controllers/spree/credit_cards_controller.rb
|
||||
- app/controllers/spree/orders_controller.rb
|
||||
- app/controllers/spree/paypal_controller_decorator.rb
|
||||
- app/controllers/spree/paypal_controller.rb
|
||||
- app/controllers/spree/user_passwords_controller.rb
|
||||
- app/controllers/spree/user_registrations_controller.rb
|
||||
- app/controllers/spree/users_controller.rb
|
||||
- app/controllers/spree/user_sessions_controller.rb
|
||||
- app/controllers/stripe/callbacks_controller.rb
|
||||
@@ -416,21 +304,26 @@ Metrics/AbcSize:
|
||||
- app/helpers/spree/admin/base_helper.rb
|
||||
- app/helpers/spree/admin/navigation_helper.rb
|
||||
- app/helpers/spree/admin/zones_helper.rb
|
||||
- app/helpers/spree/base_helper.rb
|
||||
- app/helpers/spree/orders_helper.rb
|
||||
- app/mailers/spree/order_mailer.rb
|
||||
- app/models/calculator/flat_percent_per_item.rb
|
||||
- app/models/column_preference.rb
|
||||
- app/models/enterprise_group.rb
|
||||
- app/models/enterprise.rb
|
||||
- app/models/enterprise_relationship.rb
|
||||
- app/models/order_cycle.rb
|
||||
- app/models/product_import/entry_processor.rb
|
||||
- app/models/product_import/entry_validator.rb
|
||||
- app/models/product_import/product_importer.rb
|
||||
- app/models/product_import/unit_converter.rb
|
||||
- app/models/proxy_order.rb
|
||||
- app/models/spree/ability.rb
|
||||
- app/models/spree/address.rb
|
||||
- app/models/spree/gateway/pay_pal_express.rb
|
||||
- app/models/spree/item_adjustments.rb
|
||||
- app/models/spree/line_item.rb
|
||||
- app/models/spree/order/checkout.rb
|
||||
- app/models/spree/order_contents.rb
|
||||
- app/models/spree/order_inventory.rb
|
||||
- app/models/spree/order.rb
|
||||
- app/models/spree/payment/processing.rb
|
||||
@@ -445,13 +338,18 @@ Metrics/AbcSize:
|
||||
- app/models/spree/tax_rate.rb
|
||||
- app/models/spree/variant.rb
|
||||
- app/models/spree/zone.rb
|
||||
- app/serializers/api/product_serializer.rb
|
||||
- app/serializers/api/admin/enterprise_serializer.rb
|
||||
- app/serializers/api/variant_serializer.rb
|
||||
- app/services/cap_quantity.rb
|
||||
- app/services/cart_service.rb
|
||||
- app/services/create_order_cycle.rb
|
||||
- app/services/sets/model_set.rb
|
||||
- app/services/order_cycle_form.rb
|
||||
- app/services/order_factory.rb
|
||||
- app/services/order_syncer.rb
|
||||
- app/services/place_proxy_order.rb
|
||||
- app/services/process_payment_intent.rb
|
||||
- app/services/sets/model_set.rb
|
||||
- app/services/variants_stock_levels.rb
|
||||
- app/services/variant_units/option_value_namer.rb
|
||||
- app/services/variant_units/variant_and_line_item_naming.rb
|
||||
- engines/order_management/app/services/order_management/order/updater.rb
|
||||
@@ -459,11 +357,12 @@ Metrics/AbcSize:
|
||||
- engines/order_management/app/services/order_management/stock/estimator.rb
|
||||
- engines/order_management/app/services/order_management/stock/package.rb
|
||||
- engines/order_management/app/services/order_management/stock/packer.rb
|
||||
- engines/order_management/app/services/order_management/subscriptions/form.rb
|
||||
- engines/order_management/app/services/order_management/subscriptions/validator.rb
|
||||
- lib/active_merchant/billing/gateways/stripe_decorator.rb
|
||||
- lib/active_merchant/billing/gateways/stripe_payment_intents.rb
|
||||
- lib/discourse/single_sign_on.rb
|
||||
- lib/open_food_network/customers_report.rb
|
||||
- lib/open_food_network/enterprise_fee_calculator.rb
|
||||
- lib/open_food_network/enterprise_issue_validator.rb
|
||||
- lib/open_food_network/group_buy_report.rb
|
||||
- lib/open_food_network/lettuce_share_report.rb
|
||||
@@ -471,6 +370,7 @@ Metrics/AbcSize:
|
||||
- lib/open_food_network/order_cycle_form_applicator.rb
|
||||
- lib/open_food_network/order_cycle_management_report.rb
|
||||
- lib/open_food_network/order_cycle_permissions.rb
|
||||
- lib/open_food_network/order_grouper.rb
|
||||
- lib/open_food_network/orders_and_fulfillments_report/supplier_totals_report.rb
|
||||
- lib/open_food_network/packing_report.rb
|
||||
- lib/open_food_network/payments_report.rb
|
||||
@@ -482,15 +382,18 @@ Metrics/AbcSize:
|
||||
- lib/open_food_network/xero_invoices_report.rb
|
||||
- lib/spree/api/controller_setup.rb
|
||||
- lib/spree/core/calculated_adjustments.rb
|
||||
- lib/spree/core/controller_helpers/auth.rb
|
||||
- lib/spree/core/controller_helpers/common.rb
|
||||
- lib/spree/core/controller_helpers/order.rb
|
||||
- lib/spree/core/controller_helpers/respond_with.rb
|
||||
- lib/spree/core/controller_helpers/ssl.rb
|
||||
- lib/spree/core/delegate_belongs_to.rb
|
||||
- lib/spree/core/permalinks.rb
|
||||
- lib/spree/core/product_duplicator.rb
|
||||
- lib/spree/core/s3_support.rb
|
||||
- lib/spree/localized_number.rb
|
||||
- lib/spree/money.rb
|
||||
- lib/stripe/account_connector.rb
|
||||
- lib/stripe/authorize_response_patcher.rb
|
||||
- lib/stripe/profile_storer.rb
|
||||
- lib/tasks/enterprises.rake
|
||||
- lib/tasks/sample_data/order_factory.rb
|
||||
- lib/tasks/sample_data/product_factory.rb
|
||||
@@ -522,17 +425,15 @@ Metrics/BlockLength:
|
||||
"scenario"
|
||||
]
|
||||
Exclude:
|
||||
- spec/features/admin/order_cycles/complex_updating_specific_time_spec.rb
|
||||
- spec/features/admin/tag_rules_spec.rb
|
||||
- app/models/spree/order/checkout.rb
|
||||
- app/models/spree/payment/processing.rb
|
||||
- app/models/spree/payment.rb
|
||||
- app/models/spree/shipment.rb
|
||||
- lib/spree/core/controller_helpers/common.rb
|
||||
- lib/spree/core/controller_helpers/ssl.rb
|
||||
- lib/tasks/data.rake
|
||||
- spec/controllers/spree/admin/invoices_controller_spec.rb
|
||||
- spec/factories/address_factory.rb
|
||||
- spec/factories/enterprise_factory.rb
|
||||
- spec/factories/line_item_factory.rb
|
||||
- spec/factories/order_cycle_factory.rb
|
||||
- spec/factories/order_factory.rb
|
||||
- spec/factories/payment_method_factory.rb
|
||||
@@ -543,11 +444,13 @@ Metrics/BlockLength:
|
||||
- spec/factories/subscription_factory.rb
|
||||
- spec/factories/user_factory.rb
|
||||
- spec/factories/variant_factory.rb
|
||||
- spec/features/admin/order_cycles/complex_updating_specific_time_spec.rb
|
||||
- spec/features/consumer/shopping/checkout_spec.rb
|
||||
- spec/features/consumer/shopping/embedded_shopfronts_spec.rb
|
||||
- spec/lib/open_food_network/group_buy_report_spec.rb
|
||||
- spec/models/tag_rule/discount_order_spec.rb
|
||||
- spec/requests/api/orders_spec.rb
|
||||
- spec/spec_helper.rb
|
||||
- spec/support/cancan_helper.rb
|
||||
- spec/support/matchers/select2_matchers.rb
|
||||
- spec/support/matchers/table_matchers.rb
|
||||
- spec/swagger_helper.rb
|
||||
@@ -555,30 +458,14 @@ Metrics/BlockLength:
|
||||
Metrics/CyclomaticComplexity:
|
||||
Max: 6
|
||||
Exclude:
|
||||
- app/controllers/admin/resource_controller.rb
|
||||
- app/controllers/admin/enterprise_fees_controller.rb
|
||||
- app/controllers/admin/enterprises_controller.rb
|
||||
- app/controllers/spree/admin/orders_controller.rb
|
||||
- app/controllers/spree/admin/payment_methods_controller.rb
|
||||
- app/controllers/spree/admin/payments_controller.rb
|
||||
- app/controllers/spree/admin/products_controller.rb
|
||||
- app/controllers/spree/admin/users_controller.rb
|
||||
- app/models/product_import/entry_validator.rb
|
||||
- app/models/spree/order_inventory.rb
|
||||
- app/models/spree/order.rb
|
||||
- app/models/spree/shipment.rb
|
||||
- app/models/spree/tax_rate.rb
|
||||
- app/models/spree/variant.rb
|
||||
- engines/order_management/app/services/order_management/reports/enterprise_fee_summary/parameters.rb
|
||||
- lib/active_merchant/billing/gateways/stripe_decorator.rb
|
||||
- lib/open_food_network/group_buy_report.rb
|
||||
- lib/open_food_network/order_cycle_form_applicator.rb
|
||||
- lib/open_food_network/order_cycle_permissions.rb
|
||||
- lib/open_food_network/payments_report.rb
|
||||
- lib/spree/core/controller_helpers/common.rb
|
||||
- lib/stripe/authorize_response_patcher.rb
|
||||
- lib/stripe/credit_card_clone_destroyer.rb
|
||||
- spec/support/i18n_translations_checker.rb
|
||||
- app/controllers/admin/enterprise_fees_controller.rb
|
||||
- app/controllers/admin/enterprises_controller.rb
|
||||
- app/controllers/spree/admin/taxons_controller.rb
|
||||
- app/controllers/spree/admin/users_controller.rb
|
||||
- app/controllers/spree/orders_controller.rb
|
||||
- app/helpers/checkout_helper.rb
|
||||
- app/helpers/order_cycles_helper.rb
|
||||
@@ -586,78 +473,88 @@ Metrics/CyclomaticComplexity:
|
||||
- app/helpers/spree/admin/navigation_helper.rb
|
||||
- app/models/enterprise.rb
|
||||
- app/models/enterprise_relationship.rb
|
||||
- app/models/product_import/entry_validator.rb
|
||||
- app/models/spree/ability.rb
|
||||
- app/models/spree/address.rb
|
||||
- app/models/spree/order/checkout.rb
|
||||
- app/models/spree/payment_method.rb
|
||||
- app/models/spree/order_inventory.rb
|
||||
- app/models/spree/payment.rb
|
||||
- app/models/spree/preference.rb
|
||||
- app/models/spree/preferences/preferable.rb
|
||||
- app/models/spree/preferences/preferable_class_methods.rb
|
||||
- app/models/spree/preferences/preferable.rb
|
||||
- app/models/spree/product.rb
|
||||
- app/models/spree/return_authorization.rb
|
||||
- app/models/spree/shipment.rb
|
||||
- app/models/spree/tax_rate.rb
|
||||
- app/models/spree/variant.rb
|
||||
- app/models/spree/zone.rb
|
||||
- app/services/cart_service.rb
|
||||
- app/services/sets/variant_override_set.rb
|
||||
- engines/order_management/app/services/order_management/reports/bulk_coop/bulk_coop_report.rb
|
||||
- engines/order_management/app/services/order_management/reports/enterprise_fee_summary/parameters.rb
|
||||
- engines/order_management/app/services/order_management/stock/estimator.rb
|
||||
- lib/active_merchant/billing/gateways/stripe_payment_intents.rb
|
||||
- lib/discourse/single_sign_on.rb
|
||||
- lib/open_food_network/enterprise_issue_validator.rb
|
||||
- lib/spree/core/calculated_adjustments.rb
|
||||
- lib/spree/core/controller_helpers/order.rb
|
||||
- lib/spree/core/controller_helpers/respond_with.rb
|
||||
- lib/spree/core/controller_helpers/ssl.rb
|
||||
- lib/spree/localized_number.rb
|
||||
- spec/models/product_importer_spec.rb
|
||||
|
||||
Metrics/PerceivedComplexity:
|
||||
Max: 7
|
||||
Exclude:
|
||||
- app/controllers/spree/admin/payment_methods_controller.rb
|
||||
- app/controllers/spree/admin/payments_controller.rb
|
||||
- app/controllers/spree/admin/users_controller.rb
|
||||
- app/models/product_import/entry_validator.rb
|
||||
- app/models/spree/order_inventory.rb
|
||||
- app/models/spree/shipment.rb
|
||||
- app/models/spree/variant.rb
|
||||
- lib/active_merchant/billing/gateways/stripe_decorator.rb
|
||||
- lib/open_food_network/group_buy_report.rb
|
||||
- lib/open_food_network/order_cycle_form_applicator.rb
|
||||
- lib/open_food_network/order_cycle_permissions.rb
|
||||
- lib/open_food_network/payments_report.rb
|
||||
- lib/spree/core/calculated_adjustments.rb
|
||||
- lib/spree/core/controller_helpers/common.rb
|
||||
- lib/spree/core/controller_helpers/order.rb
|
||||
- lib/spree/core/controller_helpers/respond_with.rb
|
||||
- lib/spree/localized_number.rb
|
||||
- lib/stripe/authorize_response_patcher.rb
|
||||
- lib/stripe/credit_card_clone_destroyer.rb
|
||||
- spec/models/product_importer_spec.rb
|
||||
- spec/support/i18n_translations_checker.rb
|
||||
|
||||
Metrics/PerceivedComplexity:
|
||||
Max: 7
|
||||
Exclude:
|
||||
- app/controllers/admin/enterprises_controller.rb
|
||||
- app/controllers/api/variants_controller.rb
|
||||
- app/controllers/api/v0/variants_controller.rb
|
||||
- app/controllers/spree/admin/orders_controller.rb
|
||||
- app/controllers/spree/admin/payment_methods_controller.rb
|
||||
- app/controllers/spree/admin/payments_controller.rb
|
||||
- app/controllers/spree/admin/taxons_controller.rb
|
||||
- app/controllers/spree/admin/users_controller.rb
|
||||
- app/controllers/spree/orders_controller.rb
|
||||
- app/helpers/checkout_helper.rb
|
||||
- app/helpers/order_cycles_helper.rb
|
||||
- app/helpers/spree/admin/navigation_helper.rb
|
||||
- app/models/enterprise_relationship.rb
|
||||
- app/models/product_import/entry_validator.rb
|
||||
- app/models/spree/ability.rb
|
||||
- app/models/spree/address.rb
|
||||
- app/models/spree/order/checkout.rb
|
||||
- app/models/spree/order.rb
|
||||
- app/models/spree/order_inventory.rb
|
||||
- app/models/spree/preferences/preferable_class_methods.rb
|
||||
- app/models/spree/preferences/preferable.rb
|
||||
- app/models/spree/product.rb
|
||||
- app/models/spree/return_authorization.rb
|
||||
- app/models/spree/tax_rate.rb
|
||||
- app/models/spree/variant.rb
|
||||
- app/models/spree/zone.rb
|
||||
- engines/order_management/app/services/order_management/reports/bulk_coop/bulk_coop_report.rb
|
||||
- engines/order_management/app/services/order_management/stock/estimator.rb
|
||||
- lib/active_merchant/billing/gateways/stripe_payment_intents.rb
|
||||
- lib/discourse/single_sign_on.rb
|
||||
- lib/open_food_network/enterprise_issue_validator.rb
|
||||
- lib/open_food_network/group_buy_report.rb
|
||||
- lib/open_food_network/order_cycle_form_applicator.rb
|
||||
- lib/open_food_network/order_cycle_permissions.rb
|
||||
- lib/open_food_network/payments_report.rb
|
||||
- lib/spree/core/calculated_adjustments.rb
|
||||
- lib/spree/core/controller_helpers/order.rb
|
||||
- lib/spree/core/controller_helpers/respond_with.rb
|
||||
- lib/spree/core/controller_helpers/ssl.rb
|
||||
- lib/spree/localized_number.rb
|
||||
- spec/models/product_importer_spec.rb
|
||||
|
||||
Metrics/MethodLength:
|
||||
Max: 10
|
||||
Exclude:
|
||||
- app/controllers/admin/bulk_line_items_controller.rb
|
||||
- app/controllers/admin/contents_controller.rb
|
||||
- app/controllers/admin/customers_controller.rb
|
||||
- app/controllers/admin/enterprise_fees_controller.rb
|
||||
@@ -667,11 +564,11 @@ Metrics/MethodLength:
|
||||
- app/controllers/admin/resource_controller.rb
|
||||
- app/controllers/admin/stripe_accounts_controller.rb
|
||||
- app/controllers/admin/subscriptions_controller.rb
|
||||
- app/controllers/api/products_controller.rb
|
||||
- app/controllers/api/shipments_controller.rb
|
||||
- app/controllers/api/taxons_controller.rb
|
||||
- app/controllers/api/variants_controller.rb
|
||||
- app/controllers/cart_controller.rb
|
||||
- app/controllers/api/v0/product_images_controller.rb
|
||||
- app/controllers/api/v0/products_controller.rb
|
||||
- app/controllers/api/v0/shipments_controller.rb
|
||||
- app/controllers/api/v0/taxons_controller.rb
|
||||
- app/controllers/api/v0/variants_controller.rb
|
||||
- app/controllers/shop_controller.rb
|
||||
- app/controllers/spree/admin/orders_controller.rb
|
||||
- app/controllers/spree/admin/orders/customer_details_controller.rb
|
||||
@@ -685,7 +582,7 @@ Metrics/MethodLength:
|
||||
- app/controllers/spree/admin/variants_controller.rb
|
||||
- app/controllers/spree/credit_cards_controller.rb
|
||||
- app/controllers/spree/orders_controller.rb
|
||||
- app/controllers/spree/paypal_controller_decorator.rb
|
||||
- app/controllers/spree/paypal_controller.rb
|
||||
- app/controllers/spree/user_sessions_controller.rb
|
||||
- app/controllers/stripe/callbacks_controller.rb
|
||||
- app/controllers/user_confirmations_controller.rb
|
||||
@@ -696,6 +593,7 @@ Metrics/MethodLength:
|
||||
- app/helpers/spree/admin/base_helper.rb
|
||||
- app/helpers/spree/admin/navigation_helper.rb
|
||||
- app/mailers/producer_mailer.rb
|
||||
- app/models/calculator/default_tax.rb
|
||||
- app/models/column_preference.rb
|
||||
- app/models/enterprise.rb
|
||||
- app/models/enterprise_relationship.rb
|
||||
@@ -707,28 +605,30 @@ Metrics/MethodLength:
|
||||
- app/models/spree/ability.rb
|
||||
- app/models/spree/address.rb
|
||||
- app/models/spree/credit_card.rb
|
||||
- app/models/spree/gateway/pay_pal_express.rb
|
||||
- app/models/spree/order/checkout.rb
|
||||
- app/models/spree/order_contents.rb
|
||||
- app/models/spree/order_inventory.rb
|
||||
- app/models/spree/order.rb
|
||||
- app/models/spree/payment_method.rb
|
||||
- app/models/spree/payment/processing.rb
|
||||
- app/models/spree/preference.rb
|
||||
- app/models/spree/preferences/preferable_class_methods.rb
|
||||
- app/models/spree/preferences/preferable.rb
|
||||
- app/models/spree/preferences/store.rb
|
||||
- app/models/spree/product.rb
|
||||
- app/models/spree/product_decorator.rb
|
||||
- app/models/spree/return_authorization.rb
|
||||
- app/models/spree/shipment.rb
|
||||
- app/models/spree/taxon.rb
|
||||
- app/models/spree/tax_rate.rb
|
||||
- app/models/spree/variant.rb
|
||||
- app/models/spree/zone.rb
|
||||
- app/serializers/api/admin/order_cycle_serializer.rb
|
||||
- app/serializers/api/cached_enterprise_serializer.rb
|
||||
- app/services/cart_service.rb
|
||||
- app/services/mail_configuration.rb
|
||||
- app/services/order_cycle_form.rb
|
||||
- app/services/permitted_attributes/checkout.rb
|
||||
- app/services/place_proxy_order.rb
|
||||
- app/services/process_payment_intent.rb
|
||||
- app/services/variant_units/option_value_namer.rb
|
||||
- engines/order_management/app/services/order_management/order/updater.rb
|
||||
- engines/order_management/app/services/order_management/reports/bulk_coop/bulk_coop_allocation_report.rb
|
||||
@@ -754,7 +654,6 @@ Metrics/MethodLength:
|
||||
- lib/open_food_network/payments_report.rb
|
||||
- lib/open_food_network/permissions.rb
|
||||
- lib/open_food_network/products_and_inventory_report.rb
|
||||
- lib/open_food_network/rack_request_blocker.rb
|
||||
- lib/open_food_network/reports/line_items.rb
|
||||
- lib/open_food_network/sales_tax_report.rb
|
||||
- lib/open_food_network/users_and_enterprises_report.rb
|
||||
@@ -776,32 +675,27 @@ Metrics/MethodLength:
|
||||
- spec/features/consumer/shopping/variant_overrides_spec.rb
|
||||
- spec/models/product_importer_spec.rb
|
||||
- spec/support/i18n_translations_checker.rb
|
||||
- app/controllers/admin/bulk_line_items_controller.rb
|
||||
- app/controllers/spree/paypal_controller.rb
|
||||
- app/jobs/subscription_placement_job.rb
|
||||
- app/models/spree/gateway/pay_pal_express.rb
|
||||
|
||||
Metrics/ClassLength:
|
||||
Max: 100
|
||||
Exclude:
|
||||
- app/controllers/admin/customers_controller.rb
|
||||
- app/controllers/spree/admin/payments_controller.rb
|
||||
- app/controllers/spree/paypal_controller.rb
|
||||
- engines/order_management/app/services/order_management/order/updater.rb
|
||||
- app/controllers/admin/enterprises_controller.rb
|
||||
- app/controllers/admin/order_cycles_controller.rb
|
||||
- app/controllers/admin/resource_controller.rb
|
||||
- app/controllers/admin/schedules_controller.rb
|
||||
- app/controllers/admin/subscriptions_controller.rb
|
||||
- app/controllers/api/products_controller.rb
|
||||
- app/controllers/api/v0/products_controller.rb
|
||||
- app/controllers/application_controller.rb
|
||||
- app/controllers/checkout_controller.rb
|
||||
- app/controllers/spree/admin/orders_controller.rb
|
||||
- app/controllers/spree/admin/payment_methods_controller.rb
|
||||
- app/controllers/spree/admin/payments_controller.rb
|
||||
- app/controllers/spree/admin/products_controller.rb
|
||||
- app/controllers/spree/admin/reports_controller.rb
|
||||
- app/controllers/spree/admin/users_controller.rb
|
||||
- app/controllers/spree/orders_controller.rb
|
||||
- app/controllers/spree/paypal_controller.rb
|
||||
- app/models/enterprise.rb
|
||||
- app/models/order_cycle.rb
|
||||
- app/models/product_import/entry_processor.rb
|
||||
@@ -816,12 +710,15 @@ Metrics/ClassLength:
|
||||
- app/models/spree/payment.rb
|
||||
- app/models/spree/product.rb
|
||||
- app/models/spree/shipment.rb
|
||||
- app/models/spree/tax_rate.rb
|
||||
- app/models/spree/user.rb
|
||||
- app/models/spree/variant.rb
|
||||
- app/models/spree/zone.rb
|
||||
- app/serializers/api/cached_enterprise_serializer.rb
|
||||
- app/serializers/api/enterprise_shopfront_serializer.rb
|
||||
- app/services/cart_service.rb
|
||||
- app/services/order_syncer.rb
|
||||
- engines/order_management/app/services/order_management/order/updater.rb
|
||||
- engines/order_management/app/services/order_management/reports/bulk_coop/bulk_coop_report.rb
|
||||
- engines/order_management/app/services/order_management/reports/enterprise_fee_summary/scope.rb
|
||||
- lib/active_merchant/billing/gateways/stripe_payment_intents.rb
|
||||
@@ -842,20 +739,19 @@ Metrics/ModuleLength:
|
||||
- app/helpers/injection_helper.rb
|
||||
- app/helpers/spree/admin/base_helper.rb
|
||||
- app/helpers/spree/admin/navigation_helper.rb
|
||||
- app/helpers/spree/admin/orders_helper.rb
|
||||
- app/models/spree/order/checkout.rb
|
||||
- app/models/spree/payment/processing.rb
|
||||
- engines/order_management/spec/services/order_management/subscriptions/proxy_order_syncer_spec.rb
|
||||
- engines/order_management/spec/services/order_management/subscriptions/validator_spec.rb
|
||||
- engines/order_management/spec/services/order_management/subscriptions/summary_spec.rb
|
||||
- lib/open_food_network/column_preference_defaults.rb
|
||||
- spec/controllers/admin/order_cycles_controller_spec.rb
|
||||
- spec/controllers/api/orders_controller_spec.rb
|
||||
- spec/lib/open_food_network/order_cycle_form_applicator_spec.rb
|
||||
- spec/lib/open_food_network/order_cycle_permissions_spec.rb
|
||||
- spec/models/spree/adjustment_spec.rb
|
||||
- spec/models/spree/credit_card_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/variant_spec.rb
|
||||
|
||||
Metrics/ParameterLists:
|
||||
@@ -865,9 +761,16 @@ Metrics/ParameterLists:
|
||||
- app/models/product_import/entry_processor.rb
|
||||
- lib/open_food_network/xero_invoices_report.rb
|
||||
- spec/features/admin/reports_spec.rb
|
||||
- spec/support/controller_requests_helper.rb
|
||||
|
||||
Lint/UselessAssignment:
|
||||
Exclude:
|
||||
- 'spec/**/*'
|
||||
- 'app/models/spree/taxon.rb'
|
||||
- 'lib/spree/core/controller_helpers/common.rb'
|
||||
- app/models/spree/credit_card.rb
|
||||
- app/models/spree/taxon.rb
|
||||
- lib/spree/core/controller_helpers/common.rb
|
||||
|
||||
Metrics/BlockNesting:
|
||||
Max: 3
|
||||
Exclude:
|
||||
- app/models/spree/payment/processing.rb
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1 +1 @@
|
||||
2.5.9
|
||||
2.7.3
|
||||
|
||||
6
.simplecov
Normal file → Executable file
6
.simplecov
Normal file → Executable file
@@ -16,5 +16,7 @@ SimpleCov.start 'rails' do
|
||||
add_filter '/lib/tasks/sample_data/'
|
||||
end
|
||||
|
||||
require 'codecov'
|
||||
SimpleCov.formatter = SimpleCov::Formatter::Codecov
|
||||
if ENV['CI']
|
||||
require 'codecov'
|
||||
SimpleCov.formatter = SimpleCov::Formatter::Codecov
|
||||
end
|
||||
|
||||
32
Gemfile
32
Gemfile
@@ -1,18 +1,20 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
source 'https://rubygems.org'
|
||||
ruby "2.5.9"
|
||||
ruby "2.7.3"
|
||||
git_source(:github) { |repo_name| "https://github.com/#{repo_name}.git" }
|
||||
|
||||
gem 'rails', '~> 6.0.3.7'
|
||||
gem 'dotenv-rails', require: 'dotenv/rails-now' # Load ENV vars before other gems
|
||||
|
||||
gem 'rails', '~> 6.1.4'
|
||||
|
||||
gem 'activemerchant', '>= 1.78.0'
|
||||
gem 'angular-rails-templates', '>= 0.3.0'
|
||||
gem 'awesome_nested_set'
|
||||
gem 'ransack', '2.4.1'
|
||||
gem 'ransack', '2.4.2'
|
||||
gem 'responders'
|
||||
gem 'sass', '~> 3.4.0' # this restriction originates from foundation-rails's version
|
||||
gem 'sass-rails', '< 5.1.0' # this restriction originates from the compass-rails's version
|
||||
gem 'webpacker', '~> 5'
|
||||
|
||||
gem 'i18n'
|
||||
gem 'i18n-js', '~> 3.8.3'
|
||||
@@ -23,6 +25,8 @@ gem "activerecord-import"
|
||||
gem "db2fog", github: "openfoodfoundation/db2fog", branch: "rails-6"
|
||||
gem "fog-aws", "~> 2.0" # db2fog does not support v3
|
||||
|
||||
gem "valid_email2"
|
||||
|
||||
gem "catalog", path: "./engines/catalog"
|
||||
gem 'dfc_provider', path: './engines/dfc_provider'
|
||||
gem "order_management", path: "./engines/order_management"
|
||||
@@ -50,7 +54,7 @@ gem 'devise-token_authenticatable'
|
||||
gem 'jwt', '~> 2.2'
|
||||
gem 'oauth2', '~> 1.4.7' # Used for Stripe Connect
|
||||
|
||||
gem 'kaminari', '~> 1.2.1'
|
||||
gem 'pagy', '~> 4.8'
|
||||
|
||||
gem 'andand'
|
||||
gem 'angularjs-rails', '1.5.5'
|
||||
@@ -64,23 +68,23 @@ gem 'actionpack-action_caching'
|
||||
# AMS is deprecated, we will introduce an alternative at some point
|
||||
gem "active_model_serializers", "0.8.4"
|
||||
gem 'activerecord-session_store'
|
||||
gem 'acts-as-taggable-on', '~> 7.0'
|
||||
gem 'acts-as-taggable-on', '~> 8.1'
|
||||
gem 'angularjs-file-upload-rails', '~> 2.4.1'
|
||||
gem 'bigdecimal', '3.0.2'
|
||||
gem 'bootsnap', require: false
|
||||
gem 'custom_error_message', github: 'jeremydurham/custom-err-msg'
|
||||
gem 'dalli'
|
||||
gem 'figaro'
|
||||
gem 'geocoder'
|
||||
gem 'gmaps4rails'
|
||||
gem 'mimemagic', '> 0.3.5'
|
||||
gem 'paper_trail', '~> 10.3.1'
|
||||
gem 'paperclip', '~> 3.4.1'
|
||||
gem 'paper_trail', '~> 12.0.0'
|
||||
gem 'rack-rewrite'
|
||||
gem 'rack-ssl', require: 'rack/ssl'
|
||||
gem 'roadie-rails'
|
||||
|
||||
gem 'redis', '>= 4.0', require: ['redis', 'redis/connection/hiredis']
|
||||
gem 'hiredis'
|
||||
gem 'redis', '>= 4.0', require: ['redis', 'redis/connection/hiredis']
|
||||
gem 'sidekiq'
|
||||
gem 'sidekiq-scheduler'
|
||||
|
||||
@@ -151,23 +155,25 @@ end
|
||||
group :test do
|
||||
gem 'byebug'
|
||||
gem 'codecov', require: false
|
||||
gem 'pdf-reader'
|
||||
gem 'rails-controller-testing'
|
||||
gem 'simplecov', require: false
|
||||
gem 'test-prof'
|
||||
gem 'webmock'
|
||||
gem 'rails-controller-testing'
|
||||
gem 'pdf-reader'
|
||||
# See spec/spec_helper.rb for instructions
|
||||
# gem 'perftools.rb'
|
||||
end
|
||||
|
||||
group :development do
|
||||
gem 'debugger-linecache'
|
||||
gem 'pry'
|
||||
gem 'pry-byebug'
|
||||
gem 'foreman'
|
||||
gem 'pry', '~> 0.13.0'
|
||||
gem 'pry-byebug', '~> 3.9.0'
|
||||
gem 'rubocop'
|
||||
gem 'rubocop-rails'
|
||||
gem 'spring'
|
||||
gem 'spring-commands-rspec'
|
||||
gem 'web-console'
|
||||
|
||||
gem "view_component_storybook", require: "view_component/storybook/engine"
|
||||
|
||||
|
||||
244
Gemfile.lock
244
Gemfile.lock
@@ -57,59 +57,61 @@ GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
Ascii85 (1.1.0)
|
||||
actioncable (6.0.3.7)
|
||||
actionpack (= 6.0.3.7)
|
||||
actioncable (6.1.4)
|
||||
actionpack (= 6.1.4)
|
||||
activesupport (= 6.1.4)
|
||||
nio4r (~> 2.0)
|
||||
websocket-driver (>= 0.6.1)
|
||||
actionmailbox (6.0.3.7)
|
||||
actionpack (= 6.0.3.7)
|
||||
activejob (= 6.0.3.7)
|
||||
activerecord (= 6.0.3.7)
|
||||
activestorage (= 6.0.3.7)
|
||||
activesupport (= 6.0.3.7)
|
||||
actionmailbox (6.1.4)
|
||||
actionpack (= 6.1.4)
|
||||
activejob (= 6.1.4)
|
||||
activerecord (= 6.1.4)
|
||||
activestorage (= 6.1.4)
|
||||
activesupport (= 6.1.4)
|
||||
mail (>= 2.7.1)
|
||||
actionmailer (6.0.3.7)
|
||||
actionpack (= 6.0.3.7)
|
||||
actionview (= 6.0.3.7)
|
||||
activejob (= 6.0.3.7)
|
||||
actionmailer (6.1.4)
|
||||
actionpack (= 6.1.4)
|
||||
actionview (= 6.1.4)
|
||||
activejob (= 6.1.4)
|
||||
activesupport (= 6.1.4)
|
||||
mail (~> 2.5, >= 2.5.4)
|
||||
rails-dom-testing (~> 2.0)
|
||||
actionpack (6.0.3.7)
|
||||
actionview (= 6.0.3.7)
|
||||
activesupport (= 6.0.3.7)
|
||||
rack (~> 2.0, >= 2.0.8)
|
||||
actionpack (6.1.4)
|
||||
actionview (= 6.1.4)
|
||||
activesupport (= 6.1.4)
|
||||
rack (~> 2.0, >= 2.0.9)
|
||||
rack-test (>= 0.6.3)
|
||||
rails-dom-testing (~> 2.0)
|
||||
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
||||
actionpack-action_caching (1.2.2)
|
||||
actionpack (>= 4.0.0)
|
||||
actiontext (6.0.3.7)
|
||||
actionpack (= 6.0.3.7)
|
||||
activerecord (= 6.0.3.7)
|
||||
activestorage (= 6.0.3.7)
|
||||
activesupport (= 6.0.3.7)
|
||||
actiontext (6.1.4)
|
||||
actionpack (= 6.1.4)
|
||||
activerecord (= 6.1.4)
|
||||
activestorage (= 6.1.4)
|
||||
activesupport (= 6.1.4)
|
||||
nokogiri (>= 1.8.5)
|
||||
actionview (6.0.3.7)
|
||||
activesupport (= 6.0.3.7)
|
||||
actionview (6.1.4)
|
||||
activesupport (= 6.1.4)
|
||||
builder (~> 3.1)
|
||||
erubi (~> 1.4)
|
||||
rails-dom-testing (~> 2.0)
|
||||
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
||||
active_model_serializers (0.8.4)
|
||||
activemodel (>= 3.0)
|
||||
activejob (6.0.3.7)
|
||||
activesupport (= 6.0.3.7)
|
||||
activejob (6.1.4)
|
||||
activesupport (= 6.1.4)
|
||||
globalid (>= 0.3.6)
|
||||
activemerchant (1.120.0)
|
||||
activemerchant (1.121.0)
|
||||
activesupport (>= 4.2)
|
||||
builder (>= 2.1.2, < 4.0.0)
|
||||
i18n (>= 0.6.9)
|
||||
nokogiri (~> 1.4)
|
||||
activemodel (6.0.3.7)
|
||||
activesupport (= 6.0.3.7)
|
||||
activerecord (6.0.3.7)
|
||||
activemodel (= 6.0.3.7)
|
||||
activesupport (= 6.0.3.7)
|
||||
activemodel (6.1.4)
|
||||
activesupport (= 6.1.4)
|
||||
activerecord (6.1.4)
|
||||
activemodel (= 6.1.4)
|
||||
activesupport (= 6.1.4)
|
||||
activerecord-import (1.1.0)
|
||||
activerecord (>= 3.2)
|
||||
activerecord-postgresql-adapter (0.0.1)
|
||||
@@ -120,22 +122,24 @@ GEM
|
||||
multi_json (~> 1.11, >= 1.11.2)
|
||||
rack (>= 2.0.8, < 3)
|
||||
railties (>= 5.2.4.1)
|
||||
activestorage (6.0.3.7)
|
||||
actionpack (= 6.0.3.7)
|
||||
activejob (= 6.0.3.7)
|
||||
activerecord (= 6.0.3.7)
|
||||
activestorage (6.1.4)
|
||||
actionpack (= 6.1.4)
|
||||
activejob (= 6.1.4)
|
||||
activerecord (= 6.1.4)
|
||||
activesupport (= 6.1.4)
|
||||
marcel (~> 1.0.0)
|
||||
activesupport (6.0.3.7)
|
||||
mini_mime (>= 1.1.0)
|
||||
activesupport (6.1.4)
|
||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||
i18n (>= 0.7, < 2)
|
||||
minitest (~> 5.1)
|
||||
tzinfo (~> 1.1)
|
||||
zeitwerk (~> 2.2, >= 2.2.2)
|
||||
acts-as-taggable-on (7.0.0)
|
||||
i18n (>= 1.6, < 2)
|
||||
minitest (>= 5.1)
|
||||
tzinfo (~> 2.0)
|
||||
zeitwerk (~> 2.3)
|
||||
acts-as-taggable-on (8.1.0)
|
||||
activerecord (>= 5.0, < 6.2)
|
||||
acts_as_list (1.0.4)
|
||||
activerecord (>= 4.2)
|
||||
addressable (2.7.0)
|
||||
addressable (2.8.0)
|
||||
public_suffix (>= 2.0.2, < 5.0)
|
||||
afm (0.2.2)
|
||||
andand (1.3.3)
|
||||
@@ -157,9 +161,11 @@ GEM
|
||||
json (~> 1.4)
|
||||
nokogiri (~> 1)
|
||||
bcrypt (3.1.16)
|
||||
bigdecimal (3.0.2)
|
||||
bindex (0.8.1)
|
||||
bootsnap (1.7.5)
|
||||
msgpack (~> 1.0)
|
||||
bugsnag (6.20.0)
|
||||
bugsnag (6.21.0)
|
||||
concurrent-ruby (~> 1.0)
|
||||
builder (3.2.4)
|
||||
bullet (6.1.4)
|
||||
@@ -223,7 +229,7 @@ GEM
|
||||
activerecord (>= 5.a)
|
||||
database_cleaner-core (~> 2.0.0)
|
||||
database_cleaner-core (2.0.1)
|
||||
ddtrace (0.50.0)
|
||||
ddtrace (0.51.1)
|
||||
ffi (~> 1.0)
|
||||
msgpack
|
||||
debugger-linecache (1.2.0)
|
||||
@@ -239,6 +245,10 @@ GEM
|
||||
devise (>= 4.0.0, < 5.0.0)
|
||||
diff-lcs (1.4.4)
|
||||
docile (1.3.5)
|
||||
dotenv (2.7.6)
|
||||
dotenv-rails (2.7.6)
|
||||
dotenv (= 2.7.6)
|
||||
railties (>= 3.2)
|
||||
e2mmap (0.1.0)
|
||||
erubi (1.10.0)
|
||||
et-orbi (1.2.4)
|
||||
@@ -260,9 +270,7 @@ GEM
|
||||
faraday-net_http (1.0.1)
|
||||
faraday-net_http_persistent (1.1.0)
|
||||
ffaker (2.18.0)
|
||||
ffi (1.15.1)
|
||||
figaro (1.2.0)
|
||||
thor (>= 0.14.0, < 2)
|
||||
ffi (1.15.3)
|
||||
flipper (0.20.4)
|
||||
flipper-active_record (0.20.4)
|
||||
activerecord (>= 5.0, < 7)
|
||||
@@ -287,6 +295,7 @@ GEM
|
||||
fog-xml (0.1.3)
|
||||
fog-core
|
||||
nokogiri (>= 1.5.11, < 2.0.0)
|
||||
foreman (0.87.2)
|
||||
formatador (0.2.5)
|
||||
foundation-icons-sass-rails (3.0.0)
|
||||
railties (>= 3.1.1)
|
||||
@@ -306,7 +315,7 @@ GEM
|
||||
globalid (0.4.2)
|
||||
activesupport (>= 4.2.0)
|
||||
gmaps4rails (2.1.2)
|
||||
good_migrations (0.0.2)
|
||||
good_migrations (0.1.0)
|
||||
activerecord (>= 3.1)
|
||||
railties (>= 3.1)
|
||||
haml (5.2.1)
|
||||
@@ -337,27 +346,15 @@ GEM
|
||||
multi_json (~> 1.0)
|
||||
rspec (>= 2.0, < 4.0)
|
||||
jwt (2.2.3)
|
||||
kaminari (1.2.1)
|
||||
activesupport (>= 4.1.0)
|
||||
kaminari-actionview (= 1.2.1)
|
||||
kaminari-activerecord (= 1.2.1)
|
||||
kaminari-core (= 1.2.1)
|
||||
kaminari-actionview (1.2.1)
|
||||
actionview
|
||||
kaminari-core (= 1.2.1)
|
||||
kaminari-activerecord (1.2.1)
|
||||
activerecord
|
||||
kaminari-core (= 1.2.1)
|
||||
kaminari-core (1.2.1)
|
||||
kgio (2.11.3)
|
||||
knapsack (1.22.0)
|
||||
knapsack (3.1.0)
|
||||
rake
|
||||
launchy (2.5.0)
|
||||
addressable (~> 2.7)
|
||||
letter_opener (1.7.0)
|
||||
launchy (~> 2.2)
|
||||
libv8-node (15.14.0.1)
|
||||
loofah (2.9.1)
|
||||
loofah (2.10.0)
|
||||
crass (~> 1.0.2)
|
||||
nokogiri (>= 1.5.9)
|
||||
mail (2.7.1)
|
||||
@@ -394,8 +391,9 @@ GEM
|
||||
multi_xml (~> 0.5)
|
||||
rack (>= 1.2, < 3)
|
||||
orm_adapter (0.5.0)
|
||||
paper_trail (10.3.1)
|
||||
activerecord (>= 4.2)
|
||||
pagy (4.10.1)
|
||||
paper_trail (12.0.0)
|
||||
activerecord (>= 5.2)
|
||||
request_store (~> 1.1)
|
||||
paperclip (3.4.2)
|
||||
activemodel (>= 3.0.0)
|
||||
@@ -406,7 +404,7 @@ GEM
|
||||
parallel (1.20.1)
|
||||
paranoia (2.4.3)
|
||||
activerecord (>= 4.0, < 6.2)
|
||||
parser (3.0.1.1)
|
||||
parser (3.0.2.0)
|
||||
ast (~> 2.4.1)
|
||||
paypal-sdk-core (0.3.4)
|
||||
multi_json (~> 1.0)
|
||||
@@ -421,12 +419,12 @@ GEM
|
||||
ttfunk
|
||||
pg (1.2.3)
|
||||
power_assert (2.0.0)
|
||||
pry (0.14.1)
|
||||
pry (0.13.1)
|
||||
coderay (~> 1.1)
|
||||
method_source (~> 1.0)
|
||||
pry-byebug (3.8.0)
|
||||
pry-byebug (3.9.0)
|
||||
byebug (~> 11.0)
|
||||
pry (~> 0.10)
|
||||
pry (~> 0.13.0)
|
||||
public_suffix (4.0.6)
|
||||
raabro (1.4.0)
|
||||
racc (1.5.2)
|
||||
@@ -435,25 +433,27 @@ GEM
|
||||
rack (>= 1.2.0)
|
||||
rack-protection (2.1.0)
|
||||
rack
|
||||
rack-proxy (0.7.0)
|
||||
rack
|
||||
rack-rewrite (1.5.1)
|
||||
rack-ssl (1.4.1)
|
||||
rack
|
||||
rack-test (1.1.0)
|
||||
rack (>= 1.0, < 3)
|
||||
rails (6.0.3.7)
|
||||
actioncable (= 6.0.3.7)
|
||||
actionmailbox (= 6.0.3.7)
|
||||
actionmailer (= 6.0.3.7)
|
||||
actionpack (= 6.0.3.7)
|
||||
actiontext (= 6.0.3.7)
|
||||
actionview (= 6.0.3.7)
|
||||
activejob (= 6.0.3.7)
|
||||
activemodel (= 6.0.3.7)
|
||||
activerecord (= 6.0.3.7)
|
||||
activestorage (= 6.0.3.7)
|
||||
activesupport (= 6.0.3.7)
|
||||
bundler (>= 1.3.0)
|
||||
railties (= 6.0.3.7)
|
||||
rails (6.1.4)
|
||||
actioncable (= 6.1.4)
|
||||
actionmailbox (= 6.1.4)
|
||||
actionmailer (= 6.1.4)
|
||||
actionpack (= 6.1.4)
|
||||
actiontext (= 6.1.4)
|
||||
actionview (= 6.1.4)
|
||||
activejob (= 6.1.4)
|
||||
activemodel (= 6.1.4)
|
||||
activerecord (= 6.1.4)
|
||||
activestorage (= 6.1.4)
|
||||
activesupport (= 6.1.4)
|
||||
bundler (>= 1.15.0)
|
||||
railties (= 6.1.4)
|
||||
sprockets-rails (>= 2.0.0)
|
||||
rails-controller-testing (1.0.5)
|
||||
actionpack (>= 5.0.1.rc1)
|
||||
@@ -468,16 +468,16 @@ GEM
|
||||
i18n (>= 0.7, < 2)
|
||||
railties (>= 6.0.0, < 7)
|
||||
rails_safe_tasks (1.0.0)
|
||||
railties (6.0.3.7)
|
||||
actionpack (= 6.0.3.7)
|
||||
activesupport (= 6.0.3.7)
|
||||
railties (6.1.4)
|
||||
actionpack (= 6.1.4)
|
||||
activesupport (= 6.1.4)
|
||||
method_source
|
||||
rake (>= 0.8.7)
|
||||
thor (>= 0.20.3, < 2.0)
|
||||
rake (>= 0.13)
|
||||
thor (~> 1.0)
|
||||
rainbow (3.0.0)
|
||||
raindrops (0.19.1)
|
||||
rake (13.0.3)
|
||||
ransack (2.4.1)
|
||||
ransack (2.4.2)
|
||||
activerecord (>= 5.2.4)
|
||||
activesupport (>= 5.2.4)
|
||||
i18n
|
||||
@@ -485,7 +485,7 @@ GEM
|
||||
rb-inotify (0.10.1)
|
||||
ffi (~> 1.0)
|
||||
redcarpet (3.5.1)
|
||||
redis (4.2.5)
|
||||
redis (4.3.1)
|
||||
regexp_parser (2.1.1)
|
||||
request_store (1.5.0)
|
||||
rack (>= 1.4)
|
||||
@@ -538,7 +538,7 @@ GEM
|
||||
rswag-ui (2.4.0)
|
||||
actionpack (>= 3.1, < 7.0)
|
||||
railties (>= 3.1, < 7.0)
|
||||
rubocop (1.16.1)
|
||||
rubocop (1.18.3)
|
||||
parallel (~> 1.10)
|
||||
parser (>= 3.0.0.0)
|
||||
rainbow (>= 2.2.2, < 4.0)
|
||||
@@ -549,7 +549,7 @@ GEM
|
||||
unicode-display_width (>= 1.4.0, < 3.0)
|
||||
rubocop-ast (1.7.0)
|
||||
parser (>= 3.0.1.1)
|
||||
rubocop-rails (2.10.1)
|
||||
rubocop-rails (2.11.3)
|
||||
activesupport (>= 4.2.0)
|
||||
rack (>= 1.1)
|
||||
rubocop (>= 1.7.0, < 2.0)
|
||||
@@ -569,8 +569,9 @@ GEM
|
||||
selenium-webdriver (3.142.7)
|
||||
childprocess (>= 0.5, < 4.0)
|
||||
rubyzip (>= 1.2.2)
|
||||
shoulda-matchers (4.5.1)
|
||||
activesupport (>= 4.2.0)
|
||||
semantic_range (3.0.0)
|
||||
shoulda-matchers (5.0.0)
|
||||
activesupport (>= 5.2.0)
|
||||
sidekiq (6.2.1)
|
||||
connection_pool (>= 2.2.2)
|
||||
rack (~> 2.0)
|
||||
@@ -606,20 +607,19 @@ GEM
|
||||
activerecord (>= 5.1)
|
||||
state_machines-activemodel (>= 0.8.0)
|
||||
stringex (2.8.5)
|
||||
stripe (5.33.0)
|
||||
stripe (5.37.0)
|
||||
temple (0.8.2)
|
||||
test-prof (1.0.5)
|
||||
test-prof (1.0.6)
|
||||
test-unit (3.4.4)
|
||||
power_assert
|
||||
thor (1.1.0)
|
||||
thread_safe (0.3.6)
|
||||
thwait (0.2.0)
|
||||
e2mmap
|
||||
tilt (2.0.10)
|
||||
timecop (0.9.4)
|
||||
ttfunk (1.7.0)
|
||||
tzinfo (1.2.9)
|
||||
thread_safe (~> 0.1)
|
||||
tzinfo (2.0.4)
|
||||
concurrent-ruby (~> 1.0)
|
||||
uglifier (4.2.0)
|
||||
execjs (>= 0.3.0, < 3)
|
||||
unicode-display_width (2.0.0)
|
||||
@@ -633,12 +633,21 @@ GEM
|
||||
get_process_mem (~> 0)
|
||||
unicorn (>= 4, < 7)
|
||||
uniform_notifier (1.14.2)
|
||||
view_component (2.34.0)
|
||||
activesupport (>= 5.0.0, < 7.0)
|
||||
view_component_storybook (0.8.0)
|
||||
valid_email2 (4.0.0)
|
||||
activemodel (>= 3.2)
|
||||
mail (~> 2.5)
|
||||
view_component (2.35.0)
|
||||
activesupport (>= 5.0.0, < 8.0)
|
||||
method_source (~> 1.0)
|
||||
view_component_storybook (0.9.0)
|
||||
view_component (>= 2.2)
|
||||
warden (1.2.9)
|
||||
rack (>= 2.0.9)
|
||||
web-console (4.1.0)
|
||||
actionview (>= 6.0.0)
|
||||
activemodel (>= 6.0.0)
|
||||
bindex (>= 0.4.0)
|
||||
railties (>= 6.0.0)
|
||||
webdrivers (4.6.0)
|
||||
nokogiri (~> 1.6)
|
||||
rubyzip (>= 1.3.0)
|
||||
@@ -647,7 +656,12 @@ GEM
|
||||
addressable (>= 2.3.6)
|
||||
crack (>= 0.3.2)
|
||||
hashdiff (>= 0.4.0, < 2.0.0)
|
||||
websocket-driver (0.7.4)
|
||||
webpacker (5.4.0)
|
||||
activesupport (>= 5.2)
|
||||
rack-proxy (>= 0.6.1)
|
||||
railties (>= 5.2)
|
||||
semantic_range (>= 2.3.0)
|
||||
websocket-driver (0.7.5)
|
||||
websocket-extensions (>= 0.1.0)
|
||||
websocket-extensions (0.1.5)
|
||||
whenever (1.0.0)
|
||||
@@ -670,7 +684,7 @@ DEPENDENCIES
|
||||
activerecord-import
|
||||
activerecord-postgresql-adapter
|
||||
activerecord-session_store
|
||||
acts-as-taggable-on (~> 7.0)
|
||||
acts-as-taggable-on (~> 8.1)
|
||||
acts_as_list (= 1.0.4)
|
||||
andand
|
||||
angular-rails-templates (>= 0.3.0)
|
||||
@@ -680,6 +694,7 @@ DEPENDENCIES
|
||||
awesome_nested_set
|
||||
awesome_print
|
||||
aws-sdk (= 1.67.0)
|
||||
bigdecimal (= 3.0.2)
|
||||
bootsnap
|
||||
bugsnag
|
||||
bullet
|
||||
@@ -701,13 +716,14 @@ DEPENDENCIES
|
||||
devise-encryptable
|
||||
devise-token_authenticatable
|
||||
dfc_provider!
|
||||
dotenv-rails
|
||||
factory_bot_rails (= 6.2.0)
|
||||
ffaker
|
||||
figaro
|
||||
flipper
|
||||
flipper-active_record
|
||||
flipper-ui
|
||||
fog-aws (~> 2.0)
|
||||
foreman
|
||||
foundation-icons-sass-rails
|
||||
foundation-rails (= 5.5.2.1)
|
||||
fuubar (~> 2.5.1)
|
||||
@@ -726,7 +742,6 @@ DEPENDENCIES
|
||||
json
|
||||
json_spec (~> 1.1.4)
|
||||
jwt (~> 2.2)
|
||||
kaminari (~> 1.2.1)
|
||||
knapsack
|
||||
letter_opener (>= 1.4.1)
|
||||
mimemagic (> 0.3.5)
|
||||
@@ -735,22 +750,23 @@ DEPENDENCIES
|
||||
oauth2 (~> 1.4.7)
|
||||
ofn-qz!
|
||||
order_management!
|
||||
paper_trail (~> 10.3.1)
|
||||
pagy (~> 4.8)
|
||||
paper_trail (~> 12.0.0)
|
||||
paperclip (~> 3.4.1)
|
||||
paranoia (~> 2.4)
|
||||
paypal-sdk-merchant (= 1.117.2)
|
||||
pdf-reader
|
||||
pg (~> 1.2.3)
|
||||
pry
|
||||
pry-byebug
|
||||
pry (~> 0.13.0)
|
||||
pry-byebug (~> 3.9.0)
|
||||
rack-mini-profiler (< 3.0.0)
|
||||
rack-rewrite
|
||||
rack-ssl
|
||||
rails (~> 6.0.3.7)
|
||||
rails (~> 6.1.4)
|
||||
rails-controller-testing
|
||||
rails-i18n
|
||||
rails_safe_tasks (~> 1.0)
|
||||
ransack (= 2.4.1)
|
||||
ransack (= 2.4.2)
|
||||
redcarpet
|
||||
redis (>= 4.0)
|
||||
responders
|
||||
@@ -761,7 +777,6 @@ DEPENDENCIES
|
||||
rswag
|
||||
rubocop
|
||||
rubocop-rails
|
||||
sass (~> 3.4.0)
|
||||
sass-rails (< 5.1.0)
|
||||
select2-rails!
|
||||
selenium-webdriver
|
||||
@@ -780,17 +795,20 @@ DEPENDENCIES
|
||||
uglifier (>= 1.0.3)
|
||||
unicorn-rails
|
||||
unicorn-worker-killer
|
||||
valid_email2
|
||||
view_component
|
||||
view_component_storybook
|
||||
web!
|
||||
web-console
|
||||
webdrivers
|
||||
webmock
|
||||
webpacker (~> 5)
|
||||
whenever
|
||||
wicked_pdf
|
||||
wkhtmltopdf-binary
|
||||
|
||||
RUBY VERSION
|
||||
ruby 2.5.9p229
|
||||
ruby 2.7.3p183
|
||||
|
||||
BUNDLED WITH
|
||||
1.17.3
|
||||
2.1.4
|
||||
|
||||
5
Procfile
Normal file
5
Procfile
Normal file
@@ -0,0 +1,5 @@
|
||||
# Foreman Procfile. Start all dev server processes with: `foreman start`
|
||||
|
||||
rails: bundle exec rails s -p 3000
|
||||
webpack: ./bin/webpack-dev-server
|
||||
sidekiq: bundle exec sidekiq -q mailers -q default
|
||||
@@ -34,7 +34,7 @@ We also have a [Super Admin Guide][super-admin-guide] to help with configuration
|
||||
|
||||
## Testing
|
||||
|
||||
If you'd like to help out with testing, please introduce yourself on the #testing channel on [Slack][slack-invite] and download the [ZenHub browser extension][zenhub] to view the development pipeline. Also, do have a look in our [Welcome New QAs board](https://github.com/openfoodfoundation/openfoodnetwork/projects/31) for some good first issues, both on manual and automated testing (RSpec/Capybara).
|
||||
If you'd like to help out with testing, please introduce yourself on the #testing channel on [Slack][slack-invite] and download the [ZenHub browser extension][zenhub] to view the development pipeline. Also, do have a look in our [Welcome New QAs board](https://github.com/orgs/openfoodfoundation/projects/1) for some good first issues, both on manual and automated testing (RSpec/Capybara).
|
||||
|
||||
We use [BrowserStack](https://www.browserstack.com/) as a manual testing tool. BrowserStack provides open source projects with unlimited and free of charge accounts. A big thanks to them!
|
||||
|
||||
@@ -47,5 +47,5 @@ Copyright (c) 2012 - 2020 Open Food Foundation, released under the AGPL licence.
|
||||
[ofn-handbook]: https://ofn-user-guide.gitbook.io/ofn-handbook/
|
||||
[ofn-install]: https://github.com/openfoodfoundation/ofn-install
|
||||
[super-admin-guide]: https://ofn-user-guide.gitbook.io/ofn-super-admin-guide
|
||||
[welcome-dev]: https://github.com/openfoodfoundation/openfoodnetwork/projects/27
|
||||
[welcome-dev]: https://github.com/orgs/openfoodfoundation/projects/2
|
||||
[zenhub]: https://www.zenhub.com/extension
|
||||
|
||||
4
Rakefile
4
Rakefile
@@ -8,6 +8,6 @@ require_relative 'config/application'
|
||||
|
||||
Openfoodnetwork::Application.load_tasks
|
||||
|
||||
unless ENV['DISABLE_KNAPSACK']
|
||||
Knapsack.load_tasks if defined?(Knapsack)
|
||||
if !ENV['DISABLE_KNAPSACK'] && defined?(Knapsack)
|
||||
Knapsack.load_tasks
|
||||
end
|
||||
|
||||
@@ -8,6 +8,7 @@ angular.module("ofn.admin", [
|
||||
"admin.dropdown",
|
||||
"admin.products",
|
||||
"admin.taxons",
|
||||
"infinite-scroll"
|
||||
"infinite-scroll",
|
||||
"admin.orders"
|
||||
]).config ($httpProvider) ->
|
||||
$httpProvider.defaults.headers.common["Accept"] = "application/json, text/javascript, */*"
|
||||
|
||||
@@ -110,5 +110,8 @@
|
||||
// foundation
|
||||
//= require ../shared/mm-foundation-tpls-0.9.0-20180826174721.min.js
|
||||
|
||||
// LocalStorage
|
||||
//= require ../shared/angular-local-storage.js
|
||||
|
||||
// requires the rest of the JS code in this folder
|
||||
//= require_tree .
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
angular.module("ofn.admin").directive "select2WatchNgModel", () ->
|
||||
restrict: 'E'
|
||||
scope: true
|
||||
require: "ngModel"
|
||||
link: (scope, element, attrs, ngModel) ->
|
||||
ngModel.$render = () ->
|
||||
newValue = ngModel.$viewValue;
|
||||
element.children(".select2").select2("val", newValue)
|
||||
@@ -1,12 +1,14 @@
|
||||
angular.module("admin.enterprises")
|
||||
.controller "enterpriseCtrl", ($scope, $http, $window, NavigationCheck, enterprise, Enterprises, EnterprisePaymentMethods, EnterpriseShippingMethods, SideMenu, StatusMessage) ->
|
||||
.controller "enterpriseCtrl", ($scope, $http, $window, NavigationCheck, enterprise, Enterprises, EnterprisePaymentMethods, EnterpriseShippingMethods, SideMenu, StatusMessage, RequestMonitor) ->
|
||||
$scope.Enterprise = enterprise
|
||||
$scope.Enterprises = Enterprises
|
||||
$scope.PaymentMethods = EnterprisePaymentMethods.paymentMethods
|
||||
$scope.ShippingMethods = EnterpriseShippingMethods.shippingMethods
|
||||
$scope.navClear = NavigationCheck.clear
|
||||
$scope.menu = SideMenu
|
||||
$scope.newManager = { id: null, email: (t('add_manager')) }
|
||||
$scope.StatusMessage = StatusMessage
|
||||
$scope.RequestMonitor = RequestMonitor
|
||||
|
||||
$scope.$watch 'enterprise_form.$dirty', (newValue) ->
|
||||
StatusMessage.display 'notice', t('admin.unsaved_changes') if newValue
|
||||
@@ -90,3 +92,6 @@ angular.module("admin.enterprises")
|
||||
|
||||
$scope.translation = (key) ->
|
||||
t('js.admin.enterprises.form.images.' + key)
|
||||
|
||||
$scope.loadSuppliers = ->
|
||||
RequestMonitor.load $scope.suppliers = Enterprises.index(action: "visible", ams_prefix: "basic", "q[is_primary_producer_eq]": "true")
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
angular.module("admin.enterprises").directive "ofnProducerAutocomplete", (Enterprises, AutocompleteSelect2) ->
|
||||
scope: true
|
||||
link: (scope,element,attrs) ->
|
||||
scope.loadSuppliers() if !scope.suppliers
|
||||
multiple = scope.$eval attrs.multipleSelection
|
||||
placeholder = attrs.placeholder
|
||||
initialSelection = scope.$eval attrs.ngModel
|
||||
|
||||
setTimeout ->
|
||||
scope.suppliers.$promise.then (data) ->
|
||||
AutocompleteSelect2.autocomplete(
|
||||
multiple,
|
||||
placeholder,
|
||||
element,
|
||||
(-> Enterprises.findByID(initialSelection)),
|
||||
(-> Enterprises.findByIDs(initialSelection)),
|
||||
((term) -> Enterprises.findByTerm(scope.suppliers, term))
|
||||
)
|
||||
@@ -52,6 +52,7 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout,
|
||||
$scope.loadOrders = ->
|
||||
RequestMonitor.load $scope.orders = Orders.index(
|
||||
"q[state_not_eq]": "canceled",
|
||||
"q[shipment_state_not_eq]": "shipped",
|
||||
"q[completed_at_not_null]": "true",
|
||||
"q[distributor_id_eq]": $scope.distributorFilter,
|
||||
"q[order_cycle_id_eq]": $scope.orderCycleFilter,
|
||||
@@ -62,6 +63,7 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout,
|
||||
$scope.loadLineItems = ->
|
||||
RequestMonitor.load LineItems.index(
|
||||
"q[order_state_not_eq]": "canceled",
|
||||
"q[order_shipment_state_not_eq]": "shipped",
|
||||
"q[order_completed_at_not_null]": "true",
|
||||
"q[order_distributor_id_eq]": $scope.distributorFilter,
|
||||
"q[variant_product_supplier_id_eq]": $scope.supplierFilter,
|
||||
@@ -127,12 +129,12 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout,
|
||||
$scope.selectedUnitsVariant = unitsVariant
|
||||
|
||||
$scope.sumUnitValues = ->
|
||||
sum = $scope.filteredLineItems.reduce (sum,lineItem) ->
|
||||
sum = $scope.filteredLineItems?.reduce (sum,lineItem) ->
|
||||
sum + lineItem.final_weight_volume
|
||||
, 0
|
||||
|
||||
$scope.sumMaxUnitValues = ->
|
||||
sum = $scope.filteredLineItems.reduce (sum,lineItem) ->
|
||||
sum = $scope.filteredLineItems?.reduce (sum,lineItem) ->
|
||||
sum + lineItem.max_quantity * lineItem.units_variant.unit_value
|
||||
, 0
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
angular.module("admin.orders").controller "ordersCtrl", ($scope, $timeout, RequestMonitor, Orders, SortOptions, $window, $filter) ->
|
||||
angular.module("admin.orders").controller "ordersCtrl", ($scope, $timeout, RequestMonitor, Orders, SortOptions, $window, $filter, $location, KeyValueMapStore) ->
|
||||
$scope.RequestMonitor = RequestMonitor
|
||||
$scope.pagination = Orders.pagination
|
||||
$scope.orders = Orders.all
|
||||
@@ -15,39 +15,54 @@ angular.module("admin.orders").controller "ordersCtrl", ($scope, $timeout, Reque
|
||||
$scope.poll = 0
|
||||
$scope.rowStatus = {}
|
||||
|
||||
KeyValueMapStore.localStorageKey = 'ordersFilters'
|
||||
KeyValueMapStore.storableKeys = ["q", "sorting", "page", "per_page"]
|
||||
|
||||
$scope.initialise = ->
|
||||
unless KeyValueMapStore.restoreValues($scope)
|
||||
$scope.setDefaults()
|
||||
|
||||
$scope.fetchResults()
|
||||
|
||||
$scope.setDefaults = ->
|
||||
$scope.per_page = 15
|
||||
$scope.q = {
|
||||
completed_at_not_null: true
|
||||
}
|
||||
|
||||
$scope.clearFilters = () ->
|
||||
KeyValueMapStore.clearKeyValueMap()
|
||||
$scope.setDefaults()
|
||||
$scope.fetchResults()
|
||||
|
||||
$scope.fetchResults = (page=1) ->
|
||||
startDateWithTime = $scope.appendStringIfNotEmpty($scope['q']['completed_at_gteq'], ' 00:00:00')
|
||||
endDateWithTime = $scope.appendStringIfNotEmpty($scope['q']['completed_at_lteq'], ' 23:59:59')
|
||||
startDateWithTime = $scope.appendStringIfNotEmpty($scope.q?.completed_at_gteq, ' 00:00:00')
|
||||
endDateWithTime = $scope.appendStringIfNotEmpty($scope.q?.completed_at_lteq, ' 23:59:59')
|
||||
|
||||
$scope.resetSelected()
|
||||
params = {
|
||||
'q[completed_at_gteq]': startDateWithTime,
|
||||
'q[completed_at_lteq]': endDateWithTime,
|
||||
'q[state_eq]': $scope['q']['state_eq'],
|
||||
'q[number_cont]': $scope['q']['number_cont'],
|
||||
'q[email_cont]': $scope['q']['email_cont'],
|
||||
'q[bill_address_firstname_start]': $scope['q']['bill_address_firstname_start'],
|
||||
'q[bill_address_lastname_start]': $scope['q']['bill_address_lastname_start'],
|
||||
'q[state_eq]': $scope.q?.state_eq,
|
||||
'q[number_cont]': $scope.q?.number_cont,
|
||||
'q[email_cont]': $scope.q?.email_cont,
|
||||
'q[bill_address_firstname_start]': $scope.q?.bill_address_firstname_start,
|
||||
'q[bill_address_lastname_start]': $scope.q?.bill_address_lastname_start,
|
||||
# Set default checkbox values to null. See: https://github.com/openfoodfoundation/openfoodnetwork/pull/3076#issuecomment-440010498
|
||||
'q[completed_at_not_null]': $scope['q']['completed_at_not_null'] || null,
|
||||
'q[distributor_id_in][]': $scope['q']['distributor_id_in'],
|
||||
'q[order_cycle_id_in][]': $scope['q']['order_cycle_id_in'],
|
||||
'q[completed_at_not_null]': $scope.q?.completed_at_not_null || null,
|
||||
'q[distributor_id_in][]': $scope.q?.distributor_id_in,
|
||||
'q[order_cycle_id_in][]': $scope.q?.order_cycle_id_in,
|
||||
'q[s]': $scope.sorting || 'completed_at desc',
|
||||
shipping_method_id: $scope.shipping_method_id,
|
||||
shipping_method_id: $scope.q?.shipping_method_id,
|
||||
per_page: $scope.per_page,
|
||||
page: page
|
||||
}
|
||||
KeyValueMapStore.setStoredValues($scope)
|
||||
RequestMonitor.load(Orders.index(params).$promise)
|
||||
|
||||
$scope.appendStringIfNotEmpty = (baseString, stringToAppend) ->
|
||||
return baseString unless baseString
|
||||
return baseString if baseString.endsWith(stringToAppend)
|
||||
|
||||
baseString + stringToAppend
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
angular.module("admin.orders", ['admin.indexUtils', 'ngResource', 'mm.foundation'])
|
||||
angular.module("admin.orders", ['admin.indexUtils', 'ngResource', 'mm.foundation', "OFNShared"])
|
||||
|
||||
@@ -2,6 +2,6 @@ angular.module("admin.paymentMethods").controller "ProvidersCtrl", ($scope, paym
|
||||
if paymentMethod.type
|
||||
$scope.include_html = "/admin/payment_methods/show_provider_preferences?" +
|
||||
"provider_type=#{paymentMethod.type};" +
|
||||
"pm_id=#{paymentMethod.id};"
|
||||
"pm_id=#{paymentMethod.id || ''};"
|
||||
else
|
||||
$scope.include_html = ""
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
angular.module("admin.products")
|
||||
.controller "unitsCtrl", ($scope, VariantUnitManager, OptionValueNamer, UnitPrices) ->
|
||||
.controller "unitsCtrl", ($scope, VariantUnitManager, OptionValueNamer, UnitPrices, PriceParser) ->
|
||||
$scope.product = { master: {} }
|
||||
$scope.product.master.product = $scope.product
|
||||
$scope.placeholder_text = ""
|
||||
@@ -26,9 +26,9 @@ angular.module("admin.products")
|
||||
|
||||
$scope.processUnitValueWithDescription = ->
|
||||
if $scope.product.master.hasOwnProperty("unit_value_with_description")
|
||||
match = $scope.product.master.unit_value_with_description.match(/^([\d\.]+(?= *|$)|)( *)(.*)$/)
|
||||
match = $scope.product.master.unit_value_with_description.match(/^([\d\.,]+(?= *|$)|)( *)(.*)$/)
|
||||
if match
|
||||
$scope.product.master.unit_value = parseFloat(match[1])
|
||||
$scope.product.master.unit_value = PriceParser.parse(match[1])
|
||||
$scope.product.master.unit_value = null if isNaN($scope.product.master.unit_value)
|
||||
$scope.product.master.unit_value *= $scope.product.variant_unit_scale if $scope.product.master.unit_value && $scope.product.variant_unit_scale
|
||||
$scope.product.master.unit_description = match[3]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
angular.module("admin.products").controller "variantUnitsCtrl", ($scope, VariantUnitManager, $timeout, UnitPrices) ->
|
||||
angular.module("admin.products").controller "variantUnitsCtrl", ($scope, VariantUnitManager, $timeout, UnitPrices, PriceParser) ->
|
||||
|
||||
$scope.unitName = (scale, type) ->
|
||||
VariantUnitManager.getUnitName(scale, type)
|
||||
@@ -23,7 +23,7 @@ angular.module("admin.products").controller "variantUnitsCtrl", ($scope, Variant
|
||||
|
||||
$scope.updateValue = ->
|
||||
unit_value_human = angular.element('#unit_value_human').val()
|
||||
$scope.unit_value = unit_value_human * $scope.scale
|
||||
$scope.unit_value = PriceParser.parse(unit_value_human) * $scope.scale
|
||||
|
||||
variant_unit_value = angular.element('#variant_unit_value').val()
|
||||
$scope.unit_value_human = variant_unit_value / $scope.scale
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
angular.module("admin.products").factory "UnitPrices", (VariantUnitManager, localizeCurrencyFilter, unlocalizeCurrencyFilter) ->
|
||||
angular.module("admin.products").factory "UnitPrices", (VariantUnitManager, localizeCurrencyFilter, PriceParser) ->
|
||||
class UnitPrices
|
||||
@displayableUnitPrice: (price, scale, unit_type, unit_value, variant_unit_name) ->
|
||||
price = unlocalizeCurrencyFilter(price)
|
||||
price = PriceParser.parse(price)
|
||||
if price && !isNaN(price) && unit_type && unit_value
|
||||
value = localizeCurrencyFilter(UnitPrices.price(price, scale, unit_type, unit_value, variant_unit_name))
|
||||
unit = UnitPrices.unit(scale, unit_type, variant_unit_name)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
angular.module("admin.resources").factory 'Enterprises', ($q, EnterpriseResource) ->
|
||||
angular.module("admin.resources").factory 'Enterprises', ($q, $filter, EnterpriseResource) ->
|
||||
new class Enterprises
|
||||
byID: {}
|
||||
pristineByID: {}
|
||||
@@ -50,6 +50,17 @@ angular.module("admin.resources").factory 'Enterprises', ($q, EnterpriseResource
|
||||
))
|
||||
deferred.promise
|
||||
|
||||
findByID: (id) ->
|
||||
@byID[id]
|
||||
|
||||
# For finding multiple Enterprises represented by comma delimited string
|
||||
findByIDs: (ids) ->
|
||||
@byID[id] for id in ids.split(",") when @byID[id]
|
||||
|
||||
findByTerm: (enterprises, term) ->
|
||||
$filter('filter')(enterprises, term)
|
||||
|
||||
|
||||
removeLogo: performActionOnEnterpriseResource(EnterpriseResource.removeLogo)
|
||||
removePromoImage: performActionOnEnterpriseResource(EnterpriseResource.removePromoImage)
|
||||
removeTermsAndConditions: performActionOnEnterpriseResource(EnterpriseResource.removeTermsAndConditions)
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
angular.module("admin.indexUtils").factory 'KeyValueMapStore', (localStorageService)->
|
||||
new class KeyValueMapStore
|
||||
localStorageKey: ''
|
||||
storableKeys: []
|
||||
|
||||
constructor: ->
|
||||
localStorageService.setStorageType("sessionStorage")
|
||||
|
||||
getStoredKeyValueMap: ->
|
||||
localStorageService.get(@localStorageKey) || {}
|
||||
|
||||
setStoredValues: (source) ->
|
||||
keyValueMap = {}
|
||||
for key in @storableKeys
|
||||
keyValueMap[key] = source[key]
|
||||
localStorageService.set(@localStorageKey, keyValueMap)
|
||||
|
||||
restoreValues: (target) ->
|
||||
storedKeyValueMap = @getStoredKeyValueMap()
|
||||
|
||||
return false if _.isEmpty(storedKeyValueMap)
|
||||
|
||||
for k,v of storedKeyValueMap
|
||||
target[k] = v
|
||||
|
||||
return true
|
||||
|
||||
clearKeyValueMap: () ->
|
||||
localStorageService.remove(@localStorageKey)
|
||||
@@ -1,30 +1,17 @@
|
||||
angular.module("admin.taxons").directive "ofnTaxonAutocomplete", (Taxons, $sanitize) ->
|
||||
angular.module("admin.taxons").directive "ofnTaxonAutocomplete", (Taxons, AutocompleteSelect2) ->
|
||||
# Adapted from Spree's existing taxon autocompletion
|
||||
scope: true
|
||||
link: (scope,element,attrs) ->
|
||||
multiple = scope.$eval attrs.multipleSelection
|
||||
placeholder = attrs.placeholder
|
||||
initalSelection = scope.$eval attrs.ngModel
|
||||
initialSelection = scope.$eval attrs.ngModel
|
||||
|
||||
setTimeout ->
|
||||
element.select2
|
||||
placeholder: placeholder
|
||||
multiple: multiple
|
||||
initSelection: (element, callback) ->
|
||||
if multiple
|
||||
callback Taxons.findByIDs(initalSelection)
|
||||
else
|
||||
callback Taxons.findByID(initalSelection)
|
||||
query: (query) ->
|
||||
query.callback { results: Taxons.findByTerm(query.term) }
|
||||
formatResult: (taxon) ->
|
||||
$sanitize(taxon.name)
|
||||
formatSelection: (taxon) ->
|
||||
taxon.name
|
||||
|
||||
#Allows drag and drop
|
||||
if multiple
|
||||
element.select2("container").find("ul.select2-choices").sortable
|
||||
containment: 'parent'
|
||||
start: -> element.select2("onSortStart")
|
||||
update: -> element.select2("onSortEnd")
|
||||
AutocompleteSelect2.autocomplete(
|
||||
multiple,
|
||||
placeholder,
|
||||
element,
|
||||
(-> Taxons.findByID(initialSelection)),
|
||||
(-> Taxons.findByIDs(initialSelection)),
|
||||
((term) -> Taxons.findByTerm(term))
|
||||
)
|
||||
|
||||
@@ -2,10 +2,13 @@ angular.module("admin.utils").directive "datepicker", ($window, $timeout) ->
|
||||
require: "ngModel"
|
||||
link: (scope, element, attrs, ngModel) ->
|
||||
$timeout ->
|
||||
flatpickr(element, Object.assign(
|
||||
flapickrInstance = flatpickr(element, Object.assign(
|
||||
{},
|
||||
$window.FLATPICKR_DATE_DEFAULT, {
|
||||
onOpen: (selectedDates, dateStr, instance) ->
|
||||
instance.setDate(ngModel.$modelValue)
|
||||
}
|
||||
));
|
||||
ngModel.$render = () ->
|
||||
newValue = ngModel.$viewValue;
|
||||
flapickrInstance?.setDate(newValue)
|
||||
|
||||
@@ -3,6 +3,7 @@ angular.module("admin.utils").directive "ofnWithTip", ($sanitize)->
|
||||
element.attr('data-powertip', $sanitize(attrs.ofnWithTip))
|
||||
element.powerTip
|
||||
smartPlacement: true
|
||||
placement: element.attr('powertip-location')
|
||||
fadeInTime: 50
|
||||
fadeOutTime: 50
|
||||
intentPollInterval: 300
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
angular.module("admin.utils").filter "unlocalizeCurrency", ()->
|
||||
# Convert string to number using injected currency configuration.
|
||||
(price) ->
|
||||
# used decimal and thousands separators from currency configuration
|
||||
decimal_separator = I18n.toCurrency(.1, {precision: 1, unit: ''}).substring(1,2)
|
||||
thousands_separator = I18n.toCurrency(1000, {precision: 1, unit: ''}).substring(1,2)
|
||||
|
||||
if (price.length > 4)
|
||||
# remove configured thousands separator if price is greater than 999
|
||||
price = price.replaceAll(thousands_separator, '')
|
||||
|
||||
if (decimal_separator == ",")
|
||||
price = price.replace(",", ".")
|
||||
|
||||
return parseFloat(price)
|
||||
@@ -0,0 +1,31 @@
|
||||
angular.module("admin.utils").factory 'AutocompleteSelect2', ($sanitize) ->
|
||||
scope: true
|
||||
autocomplete: (
|
||||
multiple,
|
||||
placeholder,
|
||||
element,
|
||||
findByID,
|
||||
findByIDs,
|
||||
findByTerm
|
||||
) ->
|
||||
element.select2
|
||||
placeholder: placeholder
|
||||
multiple: multiple
|
||||
initSelection: (element, callback) ->
|
||||
if multiple
|
||||
callback findByIDs()
|
||||
else
|
||||
callback findByID()
|
||||
query: (query) ->
|
||||
query.callback { results: findByTerm(query.term) }
|
||||
formatResult: (item) ->
|
||||
$sanitize(item.name)
|
||||
formatSelection: (item) ->
|
||||
item.name
|
||||
|
||||
#Allows drag and drop
|
||||
if multiple
|
||||
element.select2("container").find("ul.select2-choices").sortable
|
||||
containment: 'parent'
|
||||
start: -> element.select2("onSortStart")
|
||||
update: -> element.select2("onSortEnd")
|
||||
@@ -0,0 +1,31 @@
|
||||
angular.module("admin.utils").factory "PriceParser", ->
|
||||
new class PriceParser
|
||||
parse: (price) =>
|
||||
return null unless price
|
||||
# used decimal and thousands separators from currency configuration
|
||||
decimal_separator = I18n.toCurrency(.1, {precision: 1, unit: ''}).substring(1,2)
|
||||
thousands_separator = I18n.toCurrency(1000, {precision: 1, unit: ''}).substring(1,2)
|
||||
|
||||
# Replace comma used as a decimal separator and remplace by "."
|
||||
price = this.replaceCommaByFinalPoint(price)
|
||||
|
||||
# Remove configured thousands separator if it is actually a thousands separator
|
||||
price = this.removeThousandsSeparator(price, thousands_separator)
|
||||
|
||||
if (decimal_separator == ",")
|
||||
price = price.replace(",", ".")
|
||||
|
||||
price = parseFloat(price)
|
||||
|
||||
return null if isNaN(price)
|
||||
|
||||
return price
|
||||
|
||||
replaceCommaByFinalPoint : (price) =>
|
||||
if price.match(/^[0-9]*(,{1})[0-9]{1,2}$/g) then price.replace(",", ".") else price
|
||||
|
||||
removeThousandsSeparator : (price, thousands_separator) =>
|
||||
if (new RegExp("^([0-9]*(" + thousands_separator + "{1})[0-9]{3}[0-9\.,]*)*$", "g").test(price))
|
||||
price.replaceAll(thousands_separator, '')
|
||||
else
|
||||
price
|
||||
@@ -51,14 +51,8 @@
|
||||
#
|
||||
#= require modernizr
|
||||
#
|
||||
#= require foundation
|
||||
#= require ./darkswarm
|
||||
#= require ./overrides
|
||||
#= require_tree ./mixins
|
||||
#= require_tree ./directives
|
||||
#= require_tree .
|
||||
|
||||
$ ->
|
||||
# Hacky fix for issue - http://foundation.zurb.com/forum/posts/2112-foundation-5100-syntax-error-in-js
|
||||
Foundation.set_namespace ""
|
||||
$(document).foundation()
|
||||
|
||||
@@ -7,13 +7,3 @@ $ ->
|
||||
|
||||
($ 'form#update-cart').submit ->
|
||||
($ 'form#update-cart #update-button').attr('disabled', true)
|
||||
|
||||
|
||||
# Temporarily handles the cart showing stuff
|
||||
$(document).ready ->
|
||||
$('.cart_adjustment').hide()
|
||||
|
||||
$('td.cart-adjustments a').click ->
|
||||
$('.cart_adjustment').toggle()
|
||||
$(this).html(t('item_handling_fees'))
|
||||
false
|
||||
|
||||
@@ -38,17 +38,12 @@ Darkswarm.controller "ProductsCtrl", ($scope, $sce, $filter, $rootScope, Product
|
||||
data.map( (taxon) ->
|
||||
$scope.supplied_taxons[taxon.id] = Taxons.taxons_by_id[taxon.id]
|
||||
)
|
||||
# Some taxons may be displayed in a dropdown.
|
||||
# Foundation needs initialising again to add dropdown actions.
|
||||
Foundation.init()
|
||||
|
||||
OrderCycleResource.properties params, (data)=>
|
||||
$scope.supplied_properties = {}
|
||||
data.map( (property) ->
|
||||
$scope.supplied_properties[property.id] = Properties.properties_by_id[property.id]
|
||||
)
|
||||
# Some properties may be displayed in a dropdown.
|
||||
# Foundation needs initialising again to add dropdown actions.
|
||||
Foundation.init()
|
||||
|
||||
$scope.loadMore = ->
|
||||
if ($scope.page * $scope.per_page) <= Products.products.length
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
window.OFNShared = angular.module("OFNShared", [
|
||||
"mm.foundation"
|
||||
"mm.foundation",
|
||||
"LocalStorageModule"
|
||||
]).config ($httpProvider) ->
|
||||
$httpProvider.defaults.headers.common["Accept"] = "application/json, text/javascript, */*"
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#table-filter {
|
||||
|
||||
.field {
|
||||
input[type="text"], input[type="phone"],
|
||||
input[type="email"], input[type="number"],
|
||||
@@ -9,6 +8,9 @@
|
||||
}
|
||||
|
||||
.actions {
|
||||
text-align: center;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
column-gap: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
$disabled-background: #c3c3c3;
|
||||
|
||||
label.disabled {
|
||||
color: #c3c3c3;
|
||||
color: $disabled-background;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
input[type='button'], input[type='submit'] {
|
||||
&:disabled {
|
||||
background-color: #c3c3c3;
|
||||
background-color: $disabled-background;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
@@ -16,4 +18,8 @@ input[type='button'], input[type='submit'] {
|
||||
.select2-choice > .select2-chosen {
|
||||
color: #a1a1a1;
|
||||
}
|
||||
|
||||
&.select2-container-multi .select2-choices .select2-search-choice {
|
||||
background-color: $disabled-background;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,6 +84,8 @@ $color-ste-sold-bg: $color-success !default;
|
||||
$color-ste-sold-text: $color-1 !default;
|
||||
$color-ste-pending-bg: $color-notice !default;
|
||||
$color-ste-pending-text: $color-1 !default;
|
||||
$color-ste-requires_authorization-bg: $color-notice !default;
|
||||
$color-ste-requires_authorization-text: $color-1 !default;
|
||||
$color-ste-awaiting_return-bg: $color-notice !default;
|
||||
$color-ste-awaiting_return-text: $color-1 !default;
|
||||
$color-ste-returned-bg: $color-notice !default;
|
||||
@@ -124,9 +126,9 @@ $color-ste-inactive-bg: $color-notice !default;
|
||||
$color-ste-inactive-text: $color-1 !default;
|
||||
|
||||
// Available states
|
||||
$states: completed, complete, sold, pending, awaiting_return, returned, credit_owed, paid, shipped, balance_due, backorder, checkout, cart, address, delivery, payment, confirm, canceled, ready, void, active, inactive !default;
|
||||
$states-bg-colors: $color-ste-completed-bg, $color-ste-complete-bg, $color-ste-sold-bg, $color-ste-pending-bg, $color-ste-awaiting_return-bg, $color-ste-returned-bg, $color-ste-credit_owed-bg, $color-ste-paid-bg, $color-ste-shipped-bg, $color-ste-balance_due-bg, $color-ste-backorder-bg, $color-ste-checkout-bg, $color-ste-cart-bg, $color-ste-address-bg, $color-ste-delivery-bg, $color-ste-payment-bg, $color-ste-confirm-bg, $color-ste-canceled-bg, $color-ste-ready-bg, $color-ste-void-bg, $color-ste-active-bg, $color-ste-inactive-bg !default;
|
||||
$states-text-colors: $color-ste-completed-text, $color-ste-complete-text, $color-ste-sold-text, $color-ste-pending-text, $color-ste-awaiting_return-text, $color-ste-returned-text, $color-ste-credit_owed-text, $color-ste-paid-text, $color-ste-shipped-text, $color-ste-balance_due-text, $color-ste-backorder-text, $color-ste-checkout-text, $color-ste-cart-text, $color-ste-address-text, $color-ste-delivery-text, $color-ste-payment-text, $color-ste-confirm-text, $color-ste-canceled-text, $color-ste-ready-text, $color-ste-void-text, $color-ste-active-text, $color-ste-inactive-text !default;
|
||||
$states: completed, complete, sold, pending, awaiting_return, returned, credit_owed, paid, shipped, balance_due, backorder, checkout, cart, address, delivery, payment, confirm, canceled, ready, void, requires_authorization, active, inactive !default;
|
||||
$states-bg-colors: $color-ste-completed-bg, $color-ste-complete-bg, $color-ste-sold-bg, $color-ste-pending-bg, $color-ste-awaiting_return-bg, $color-ste-returned-bg, $color-ste-credit_owed-bg, $color-ste-paid-bg, $color-ste-shipped-bg, $color-ste-balance_due-bg, $color-ste-backorder-bg, $color-ste-checkout-bg, $color-ste-cart-bg, $color-ste-address-bg, $color-ste-delivery-bg, $color-ste-payment-bg, $color-ste-confirm-bg, $color-ste-canceled-bg, $color-ste-ready-bg, $color-ste-void-bg, $color-ste-requires_authorization-bg, $color-ste-active-bg, $color-ste-inactive-bg !default;
|
||||
$states-text-colors: $color-ste-completed-text, $color-ste-complete-text, $color-ste-sold-text, $color-ste-pending-text, $color-ste-awaiting_return-text, $color-ste-returned-text, $color-ste-credit_owed-text, $color-ste-paid-text, $color-ste-shipped-text, $color-ste-balance_due-text, $color-ste-backorder-text, $color-ste-checkout-text, $color-ste-cart-text, $color-ste-address-text, $color-ste-delivery-text, $color-ste-payment-text, $color-ste-confirm-text, $color-ste-canceled-text, $color-ste-ready-text, $color-ste-void-text, $color-ste-requires_authorization-text, $color-ste-active-text, $color-ste-inactive-text !default;
|
||||
|
||||
// Available actions
|
||||
$actions: edit, clone, remove, void, capture, save, cancel, mail !default;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Admin
|
||||
class BulkLineItemsController < Spree::Admin::BaseController
|
||||
include PaginationData
|
||||
@@ -13,11 +15,11 @@ module Admin
|
||||
ransack(params[:q]).result.
|
||||
reorder('spree_line_items.order_id ASC, spree_line_items.id ASC')
|
||||
|
||||
@line_items = @line_items.page(page).per(params[:per_page]) if pagination_required?
|
||||
@pagy, @line_items = pagy(@line_items) if pagination_required?
|
||||
|
||||
render json: {
|
||||
line_items: serialized_line_items,
|
||||
pagination: pagination_data(@line_items)
|
||||
pagination: pagination_data
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Admin
|
||||
class ColumnPreferencesController < Admin::ResourceController
|
||||
before_action :load_collection, only: [:bulk_update]
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Admin
|
||||
class ContentsController < Spree::Admin::BaseController
|
||||
def edit
|
||||
@@ -16,7 +18,8 @@ module Admin
|
||||
# Save any uploaded images
|
||||
ContentConfig.save
|
||||
|
||||
flash[:success] = t(:successfully_updated, resource: I18n.t('admin.contents.edit.your_content'))
|
||||
flash[:success] =
|
||||
t(:successfully_updated, resource: I18n.t('admin.contents.edit.your_content'))
|
||||
|
||||
redirect_to main_app.edit_admin_contents_path
|
||||
end
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'open_food_network/address_finder'
|
||||
|
||||
module Admin
|
||||
@@ -10,7 +12,10 @@ module Admin
|
||||
tag_rule_mapping = TagRule.mapping_for(Enterprise.where(id: @customer.enterprise))
|
||||
render_as_json @customer, tag_rule_mapping: tag_rule_mapping
|
||||
},
|
||||
failure: lambda { render json: { errors: @customer.errors.full_messages }, status: :unprocessable_entity }
|
||||
failure: lambda {
|
||||
render json: { errors: @customer.errors.full_messages },
|
||||
status: :unprocessable_entity
|
||||
}
|
||||
} }
|
||||
|
||||
def index
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Admin
|
||||
class EnterpriseFeesController < Admin::ResourceController
|
||||
before_action :load_enterprise_fee_set, only: :index
|
||||
@@ -16,7 +18,9 @@ module Admin
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.json { render_as_json @collection, controller: self, include_calculators: @include_calculators }
|
||||
format.json {
|
||||
render_as_json @collection, controller: self, include_calculators: @include_calculators
|
||||
}
|
||||
# format.json { @presented_collection = @collection.each_with_index.map { |ef, i| EnterpriseFeePresenter.new(self, ef, i) } }
|
||||
end
|
||||
end
|
||||
@@ -56,10 +60,12 @@ module Admin
|
||||
order_cycle = OrderCycle.find_by(id: params[:order_cycle_id]) if params[:order_cycle_id]
|
||||
coordinator = Enterprise.find_by(id: params[:coordinator_id]) if params[:coordinator_id]
|
||||
order_cycle = OrderCycle.new(coordinator: coordinator) if order_cycle.nil? && coordinator.present?
|
||||
enterprises = OpenFoodNetwork::OrderCyclePermissions.new(spree_current_user, order_cycle).visible_enterprises
|
||||
enterprises = OpenFoodNetwork::OrderCyclePermissions.new(spree_current_user,
|
||||
order_cycle).visible_enterprises
|
||||
EnterpriseFee.for_enterprises(enterprises).order('enterprise_id', 'fee_type', 'name')
|
||||
else
|
||||
collection = EnterpriseFee.managed_by(spree_current_user).order('enterprise_id', 'fee_type', 'name')
|
||||
collection = EnterpriseFee.managed_by(spree_current_user).order('enterprise_id',
|
||||
'fee_type', 'name')
|
||||
collection = collection.for_enterprise(current_enterprise) if current_enterprise
|
||||
collection
|
||||
end
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Admin
|
||||
class EnterpriseGroupsController < Admin::ResourceController
|
||||
before_action :load_data, except: :index
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Admin
|
||||
class EnterpriseRelationshipsController < Admin::ResourceController
|
||||
def index
|
||||
@@ -16,7 +18,8 @@ module Admin
|
||||
if @enterprise_relationship.save
|
||||
render plain: Api::Admin::EnterpriseRelationshipSerializer.new(@enterprise_relationship).to_json
|
||||
else
|
||||
render status: :bad_request, json: { errors: @enterprise_relationship.errors.full_messages.join(', ') }
|
||||
render status: :bad_request,
|
||||
json: { errors: @enterprise_relationship.errors.full_messages.join(', ') }
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Admin
|
||||
class EnterpriseRolesController < Admin::ResourceController
|
||||
def index
|
||||
@@ -13,7 +15,8 @@ module Admin
|
||||
render plain: Api::Admin::EnterpriseRoleSerializer.new(@enterprise_role).to_json
|
||||
|
||||
else
|
||||
render status: :bad_request, json: { errors: @enterprise_role.errors.full_messages.join(', ') }
|
||||
render status: :bad_request,
|
||||
json: { errors: @enterprise_role.errors.full_messages.join(', ') }
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'open_food_network/referer_parser'
|
||||
require 'open_food_network/permissions'
|
||||
require 'open_food_network/order_cycle_permissions'
|
||||
@@ -32,7 +34,10 @@ module Admin
|
||||
def index
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.json { render_as_json @collection, ams_prefix: params[:ams_prefix], spree_current_user: spree_current_user }
|
||||
format.json {
|
||||
render_as_json @collection, ams_prefix: params[:ams_prefix],
|
||||
spree_current_user: spree_current_user
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -56,11 +61,15 @@ module Admin
|
||||
respond_with(@object) do |format|
|
||||
format.html { redirect_to location_after_save }
|
||||
format.js { render layout: false }
|
||||
format.json { render_as_json @object, ams_prefix: 'index', spree_current_user: spree_current_user }
|
||||
format.json {
|
||||
render_as_json @object, ams_prefix: 'index', spree_current_user: spree_current_user
|
||||
}
|
||||
end
|
||||
else
|
||||
respond_with(@object) do |format|
|
||||
format.json { render json: { errors: @object.errors.messages }, status: :unprocessable_entity }
|
||||
format.json {
|
||||
render json: { errors: @object.errors.messages }, status: :unprocessable_entity
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -101,7 +110,8 @@ module Admin
|
||||
def for_order_cycle
|
||||
respond_to do |format|
|
||||
format.json do
|
||||
render json: @collection, each_serializer: Api::Admin::ForOrderCycle::EnterpriseSerializer, order_cycle: @order_cycle, spree_current_user: spree_current_user
|
||||
render json: @collection,
|
||||
each_serializer: Api::Admin::ForOrderCycle::EnterpriseSerializer, order_cycle: @order_cycle, spree_current_user: spree_current_user
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -109,7 +119,8 @@ module Admin
|
||||
def visible
|
||||
respond_to do |format|
|
||||
format.json do
|
||||
render_as_json @collection, ams_prefix: params[:ams_prefix] || 'basic', spree_current_user: spree_current_user
|
||||
render_as_json @collection, ams_prefix: params[:ams_prefix] || 'basic',
|
||||
spree_current_user: spree_current_user
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -152,7 +163,7 @@ module Admin
|
||||
if enterprises.present?
|
||||
enterprises.includes(
|
||||
supplied_products:
|
||||
[:supplier, master: [:images], variants: { option_values: :option_type }]
|
||||
[:supplier, { master: [:images], variants: { option_values: :option_type } }]
|
||||
)
|
||||
end
|
||||
when :index
|
||||
@@ -284,7 +295,8 @@ module Admin
|
||||
end
|
||||
|
||||
def strip_new_properties
|
||||
unless spree_current_user.admin? || params.dig(:enterprise, :producer_properties_attributes).nil?
|
||||
unless spree_current_user.admin? || params.dig(:enterprise,
|
||||
:producer_properties_attributes).nil?
|
||||
names = Spree::Property.pluck(:name)
|
||||
enterprise_params[:producer_properties_attributes].each do |key, property|
|
||||
enterprise_params[:producer_properties_attributes].delete key unless names.include? property[:property_name]
|
||||
|
||||
@@ -1,15 +1,23 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Admin
|
||||
class InventoryItemsController < Admin::ResourceController
|
||||
respond_to :json
|
||||
|
||||
respond_override update: { json: {
|
||||
success: lambda { render_as_json @inventory_item },
|
||||
failure: lambda { render json: { errors: @inventory_item.errors.full_messages }, status: :unprocessable_entity }
|
||||
failure: lambda {
|
||||
render json: { errors: @inventory_item.errors.full_messages },
|
||||
status: :unprocessable_entity
|
||||
}
|
||||
} }
|
||||
|
||||
respond_override create: { json: {
|
||||
success: lambda { render_as_json @inventory_item },
|
||||
failure: lambda { render json: { errors: @inventory_item.errors.full_messages }, status: :unprocessable_entity }
|
||||
failure: lambda {
|
||||
render json: { errors: @inventory_item.errors.full_messages },
|
||||
status: :unprocessable_entity
|
||||
}
|
||||
} }
|
||||
|
||||
private
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Admin
|
||||
class InvoiceSettingsController < Spree::Admin::BaseController
|
||||
def update
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Admin
|
||||
class ManagerInvitationsController < Spree::Admin::BaseController
|
||||
authorize_resource class: false
|
||||
@@ -11,7 +13,8 @@ module Admin
|
||||
existing_user = Spree::User.find_by(email: @email)
|
||||
|
||||
if existing_user
|
||||
render json: { errors: t('admin.enterprises.invite_manager.user_already_exists') }, status: :unprocessable_entity
|
||||
render json: { errors: t('admin.enterprises.invite_manager.user_already_exists') },
|
||||
status: :unprocessable_entity
|
||||
return
|
||||
end
|
||||
|
||||
@@ -20,7 +23,8 @@ module Admin
|
||||
if new_user
|
||||
render json: { user: new_user.id }, status: :ok
|
||||
else
|
||||
render json: { errors: t('admin.enterprises.invite_manager.error') }, status: :internal_server_error
|
||||
render json: { errors: t('admin.enterprises.invite_manager.error') },
|
||||
status: :internal_server_error
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Admin
|
||||
class MatomoSettingsController < Spree::Admin::BaseController
|
||||
def update
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Admin
|
||||
class OrderCyclesController < Admin::ResourceController
|
||||
include OrderCyclesHelper
|
||||
@@ -62,7 +64,7 @@ module Admin
|
||||
if @order_cycle_form.save
|
||||
respond_to do |format|
|
||||
flash[:notice] = I18n.t(:order_cycles_update_notice) if params[:reloading] == '1'
|
||||
format.html { redirect_to main_app.edit_admin_order_cycle_path(@order_cycle) }
|
||||
format.html { redirect_back(fallback_location: root_path) }
|
||||
format.json { render json: { success: true } }
|
||||
end
|
||||
else
|
||||
@@ -156,8 +158,8 @@ module Admin
|
||||
orders_close_at_gt = raw_params[:q].andand.delete(:orders_close_at_gt) || 31.days.ago
|
||||
raw_params[:q] = {
|
||||
g: [raw_params.delete(:q) || {}, { m: 'or',
|
||||
orders_close_at_gt: orders_close_at_gt,
|
||||
orders_close_at_null: true }]
|
||||
orders_close_at_gt: orders_close_at_gt,
|
||||
orders_close_at_null: true }]
|
||||
}
|
||||
@collection = collection
|
||||
end
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Admin
|
||||
class ProducerPropertiesController < Admin::ResourceController
|
||||
before_action :load_enterprise
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'roo'
|
||||
|
||||
module Admin
|
||||
@@ -12,7 +14,8 @@ module Admin
|
||||
|
||||
def import
|
||||
@filepath = save_uploaded_file(params[:file])
|
||||
@importer = ProductImport::ProductImporter.new(File.new(@filepath), spree_current_user, params[:settings])
|
||||
@importer = ProductImport::ProductImporter.new(File.new(@filepath), spree_current_user,
|
||||
params[:settings])
|
||||
@original_filename = params[:file].try(:original_filename)
|
||||
@non_updatable_fields = ProductImport::EntryValidator.non_updatable_fields
|
||||
|
||||
@@ -34,7 +37,8 @@ module Admin
|
||||
end
|
||||
|
||||
def reset_absent_products
|
||||
@importer = ProductImport::ProductImporter.new(File.new(params[:filepath]), spree_current_user, import_into: params[:import_into], enterprises_to_reset: params[:enterprises_to_reset], updated_ids: params[:updated_ids], settings: params[:settings])
|
||||
@importer = ProductImport::ProductImporter.new(File.new(params[:filepath]),
|
||||
spree_current_user, import_into: params[:import_into], enterprises_to_reset: params[:enterprises_to_reset], updated_ids: params[:updated_ids], settings: params[:settings])
|
||||
|
||||
if params.key?(:enterprises_to_reset) && params.key?(:updated_ids)
|
||||
@importer.reset_absent(params[:updated_ids])
|
||||
@@ -52,7 +56,8 @@ module Admin
|
||||
end
|
||||
|
||||
def process_data(method)
|
||||
@importer = ProductImport::ProductImporter.new(File.new(params[:filepath]), spree_current_user, start: params[:start], end: params[:end], settings: params[:settings])
|
||||
@importer = ProductImport::ProductImporter.new(File.new(params[:filepath]),
|
||||
spree_current_user, start: params[:start], end: params[:end], settings: params[:settings])
|
||||
|
||||
begin
|
||||
@importer.public_send("#{method}_entries")
|
||||
@@ -75,7 +80,8 @@ module Admin
|
||||
|
||||
def check_spreadsheet_has_data(importer)
|
||||
unless importer.item_count
|
||||
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)
|
||||
true
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Admin
|
||||
class ProxyOrdersController < Admin::ResourceController
|
||||
respond_to :json
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Admin
|
||||
class ResourceController < Spree::Admin::BaseController
|
||||
helper_method :new_object_url, :edit_object_url, :object_url, :collection_url
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'open_food_network/permissions'
|
||||
require 'order_management/subscriptions/proxy_order_syncer'
|
||||
|
||||
@@ -15,18 +17,31 @@ module Admin
|
||||
respond_to :json
|
||||
|
||||
respond_override create: { json: {
|
||||
success: lambda { render_as_json @schedule, editable_schedule_ids: permissions.editable_schedules.pluck(:id) },
|
||||
failure: lambda { render json: { errors: @schedule.errors.full_messages }, status: :unprocessable_entity }
|
||||
success: lambda {
|
||||
render_as_json @schedule,
|
||||
editable_schedule_ids: permissions.editable_schedules.pluck(:id)
|
||||
},
|
||||
failure: lambda {
|
||||
render json: { errors: @schedule.errors.full_messages },
|
||||
status: :unprocessable_entity
|
||||
}
|
||||
} }
|
||||
respond_override update: { json: {
|
||||
success: lambda { render_as_json @schedule, editable_schedule_ids: permissions.editable_schedules.pluck(:id) },
|
||||
failure: lambda { render json: { errors: @schedule.errors.full_messages }, status: :unprocessable_entity }
|
||||
success: lambda {
|
||||
render_as_json @schedule,
|
||||
editable_schedule_ids: permissions.editable_schedules.pluck(:id)
|
||||
},
|
||||
failure: lambda {
|
||||
render json: { errors: @schedule.errors.full_messages },
|
||||
status: :unprocessable_entity
|
||||
}
|
||||
} }
|
||||
|
||||
def index
|
||||
respond_to do |format|
|
||||
format.json do
|
||||
render_as_json @collection, ams_prefix: params[:ams_prefix], editable_schedule_ids: permissions.editable_schedules.pluck(:id)
|
||||
render_as_json @collection, ams_prefix: params[:ams_prefix],
|
||||
editable_schedule_ids: permissions.editable_schedules.pluck(:id)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -111,7 +126,8 @@ module Admin
|
||||
def check_dependent_subscriptions
|
||||
return if Subscription.where(schedule_id: @schedule).empty?
|
||||
|
||||
render json: { errors: [t('admin.schedules.destroy.associated_subscriptions_error')] }, status: :conflict
|
||||
render json: { errors: [t('admin.schedules.destroy.associated_subscriptions_error')] },
|
||||
status: :conflict
|
||||
end
|
||||
|
||||
def permissions
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'stripe/account_connector'
|
||||
|
||||
module Admin
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# This controller is used by super admin users to update the settings the app is using
|
||||
|
||||
module Admin
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'open_food_network/permissions'
|
||||
require 'open_food_network/order_cycle_permissions'
|
||||
require 'open_food_network/scope_variant_to_hub'
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'open_food_network/permissions'
|
||||
|
||||
module Admin
|
||||
@@ -85,7 +87,8 @@ module Admin
|
||||
def collection
|
||||
if request.format.json?
|
||||
permissions.editable_subscriptions.ransack(params[:q]).result
|
||||
.preload([:shop, :customer, :schedule, :subscription_line_items, :ship_address, :bill_address, proxy_orders: { order: :order_cycle }])
|
||||
.preload([:shop, :customer, :schedule, :subscription_line_items, :ship_address,
|
||||
:bill_address, { proxy_orders: { order: :order_cycle } }])
|
||||
else
|
||||
Subscription.where("1=0")
|
||||
end
|
||||
@@ -116,11 +119,13 @@ module Admin
|
||||
end
|
||||
|
||||
def wrap_bill_address_attrs
|
||||
subscription_params[:bill_address_attributes] = raw_params[:bill_address].slice(*Spree::Address.attribute_names)
|
||||
subscription_params[:bill_address_attributes] =
|
||||
raw_params[:bill_address].slice(*Spree::Address.attribute_names)
|
||||
end
|
||||
|
||||
def wrap_ship_address_attrs
|
||||
subscription_params[:ship_address_attributes] = raw_params[:ship_address].slice(*Spree::Address.attribute_names)
|
||||
subscription_params[:ship_address_attributes] =
|
||||
raw_params[:ship_address].slice(*Spree::Address.attribute_names)
|
||||
end
|
||||
|
||||
def check_for_open_orders
|
||||
@@ -129,14 +134,16 @@ module Admin
|
||||
@open_orders_to_keep = @subscription.proxy_orders.placed_and_open.pluck(:id)
|
||||
return if @open_orders_to_keep.empty? || params[:open_orders] == 'keep'
|
||||
|
||||
render json: { errors: { open_orders: t('admin.subscriptions.confirm_cancel_open_orders_msg') } }, status: :conflict
|
||||
render json: { errors: { open_orders: t('admin.subscriptions.confirm_cancel_open_orders_msg') } },
|
||||
status: :conflict
|
||||
end
|
||||
|
||||
def check_for_canceled_orders
|
||||
return if params[:canceled_orders] == 'notified'
|
||||
return if @subscription.proxy_orders.active.canceled.empty?
|
||||
|
||||
render json: { errors: { canceled_orders: t('admin.subscriptions.resume_canceled_orders_msg') } }, status: :conflict
|
||||
render json: { errors: { canceled_orders: t('admin.subscriptions.resume_canceled_orders_msg') } },
|
||||
status: :conflict
|
||||
end
|
||||
|
||||
def strip_banned_attrs
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Admin
|
||||
class TagRulesController < Admin::ResourceController
|
||||
respond_to :json
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'open_food_network/spree_api_key_loader'
|
||||
|
||||
module Admin
|
||||
|
||||
@@ -2,16 +2,15 @@
|
||||
|
||||
# Base controller for OFN's API
|
||||
require "spree/api/controller_setup"
|
||||
require "spree/core/controller_helpers/ssl"
|
||||
|
||||
module Api
|
||||
module V0
|
||||
class BaseController < ActionController::Metal
|
||||
include Pagy::Backend
|
||||
include RawParams
|
||||
include ActionController::StrongParameters
|
||||
include ActionController::RespondWith
|
||||
include Spree::Api::ControllerSetup
|
||||
include Spree::Core::ControllerHelpers::SSL
|
||||
include ::ActionController::Head
|
||||
include ::ActionController::ConditionalGet
|
||||
include ActionView::Layouts
|
||||
@@ -27,8 +26,6 @@ module Api
|
||||
rescue_from CanCan::AccessDenied, with: :unauthorized
|
||||
rescue_from ActiveRecord::RecordNotFound, with: :not_found
|
||||
|
||||
ssl_allowed
|
||||
|
||||
# Include these because we inherit from ActionController::Metal
|
||||
# rather than ActionController::Base and these are required for AMS
|
||||
include ActionController::Serialization
|
||||
|
||||
@@ -27,7 +27,7 @@ module Api
|
||||
|
||||
render_variant_count && return if params[:action_name] == "variant_count"
|
||||
|
||||
render_paginated_products paginated_products
|
||||
render_paginated_products
|
||||
end
|
||||
|
||||
private
|
||||
@@ -51,14 +51,6 @@ module Api
|
||||
new(@order_cycle, spree_current_user)
|
||||
end
|
||||
|
||||
def paginated_products
|
||||
return products unless pagination_required?
|
||||
|
||||
products.
|
||||
page(params[:page]).
|
||||
per(params[:per_page] || DEFAULT_PER_PAGE)
|
||||
end
|
||||
|
||||
def load_data_from_exchange
|
||||
exchange = Exchange.find_by(id: exchange_params[:exchange_id])
|
||||
|
||||
@@ -80,16 +72,20 @@ module Api
|
||||
end
|
||||
end
|
||||
|
||||
def render_paginated_products(paginated_products)
|
||||
def render_paginated_products
|
||||
results = products
|
||||
|
||||
@pagy, results = pagy(results, items: params[:per_page] || DEFAULT_PER_PAGE) if pagination_required?
|
||||
|
||||
serialized_products = ActiveModel::ArraySerializer.new(
|
||||
paginated_products,
|
||||
results,
|
||||
each_serializer: Api::Admin::ForOrderCycle::SuppliedProductSerializer,
|
||||
order_cycle: @order_cycle
|
||||
)
|
||||
|
||||
render json: {
|
||||
products: serialized_products,
|
||||
pagination: pagination_data(paginated_products)
|
||||
pagination: pagination_data
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
@@ -15,9 +15,11 @@ module Api
|
||||
|
||||
orders = SearchOrders.new(params, current_api_user).orders
|
||||
|
||||
@pagy, orders = pagy(orders, items: params[:per_page] || default_per_page) if pagination_required?
|
||||
|
||||
render json: {
|
||||
orders: serialized_orders(orders),
|
||||
pagination: pagination_data(orders)
|
||||
pagination: pagination_data
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
@@ -67,9 +67,7 @@ module Api
|
||||
|
||||
@products = product_query.
|
||||
ransack(query_params_with_defaults).
|
||||
result.
|
||||
page(params[:page] || 1).
|
||||
per(params[:per_page] || DEFAULT_PER_PAGE)
|
||||
result
|
||||
|
||||
render_paged_products @products
|
||||
end
|
||||
@@ -130,11 +128,12 @@ module Api
|
||||
includes(variants: [:product, :default_price, :stock_items]).
|
||||
where(supplier_id: producer_ids).
|
||||
by_producer.by_name.
|
||||
ransack(params[:q]).result.
|
||||
page(params[:page]).per(params[:per_page])
|
||||
ransack(params[:q]).result
|
||||
end
|
||||
|
||||
def render_paged_products(products, product_serializer = ::Api::Admin::ProductSerializer)
|
||||
@pagy, products = pagy(products, items: params[:per_page] || DEFAULT_PER_PAGE)
|
||||
|
||||
serialized_products = ActiveModel::ArraySerializer.new(
|
||||
products,
|
||||
each_serializer: product_serializer
|
||||
@@ -142,7 +141,7 @@ module Api
|
||||
|
||||
render json: {
|
||||
products: serialized_products,
|
||||
pagination: pagination_data(products)
|
||||
pagination: pagination_data
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ module Api
|
||||
includes(:country).order('name ASC')
|
||||
|
||||
if pagination?
|
||||
states = states.page(params[:page]).per(params[:per_page])
|
||||
_pagy, states = pagy(states)
|
||||
end
|
||||
|
||||
states
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module V0
|
||||
class TaxonsController < Api::V0::BaseController
|
||||
|
||||
@@ -5,11 +5,11 @@ require "application_responder"
|
||||
require 'cancan'
|
||||
require 'spree/core/controller_helpers/auth'
|
||||
require 'spree/core/controller_helpers/respond_with'
|
||||
require 'spree/core/controller_helpers/ssl'
|
||||
require 'spree/core/controller_helpers/common'
|
||||
require 'open_food_network/referer_parser'
|
||||
|
||||
class ApplicationController < ActionController::Base
|
||||
include Pagy::Backend
|
||||
self.responder = ApplicationResponder
|
||||
respond_to :html
|
||||
|
||||
@@ -32,7 +32,6 @@ class ApplicationController < ActionController::Base
|
||||
|
||||
include Spree::Core::ControllerHelpers::Auth
|
||||
include Spree::Core::ControllerHelpers::RespondWith
|
||||
include Spree::Core::ControllerHelpers::SSL
|
||||
include Spree::Core::ControllerHelpers::Common
|
||||
|
||||
prepend_before_action :restrict_iframes
|
||||
@@ -52,10 +51,10 @@ class ApplicationController < ActionController::Base
|
||||
|
||||
def redirect_to(options = {}, response_status = {})
|
||||
::Rails.logger.error("Redirected by #{begin
|
||||
caller(1).first
|
||||
rescue StandardError
|
||||
'unknown'
|
||||
end}")
|
||||
caller(1).first
|
||||
rescue StandardError
|
||||
'unknown'
|
||||
end}")
|
||||
super(options, response_status)
|
||||
end
|
||||
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'spree/core/controller_helpers/order'
|
||||
require 'spree/core/controller_helpers/ssl'
|
||||
require 'open_food_network/tag_rule_applicator'
|
||||
|
||||
class BaseController < ApplicationController
|
||||
layout 'darkswarm'
|
||||
|
||||
include Spree::Core::ControllerHelpers::Order
|
||||
include Spree::Core::ControllerHelpers::SSL
|
||||
|
||||
include I18nHelper
|
||||
include OrderCyclesHelper
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CartController < BaseController
|
||||
before_action :check_authorization
|
||||
|
||||
|
||||
@@ -10,8 +10,6 @@ class CheckoutController < ::BaseController
|
||||
helper 'terms_and_conditions'
|
||||
helper 'checkout'
|
||||
|
||||
ssl_required
|
||||
|
||||
# We need pessimistic locking to avoid race conditions.
|
||||
# Otherwise we fail on duplicate indexes or end up with negative stock.
|
||||
prepend_around_action CurrentOrderLocker, only: [:edit, :update]
|
||||
@@ -39,7 +37,7 @@ class CheckoutController < ::BaseController
|
||||
# This is only required because of spree_paypal_express. If we implement
|
||||
# a version of paypal that uses this controller, and more specifically
|
||||
# the #action_failed method, then we can remove this call
|
||||
OrderCheckoutRestart.new(@order).call
|
||||
reset_order_to_cart
|
||||
rescue Spree::Core::GatewayError => e
|
||||
rescue_from_spree_gateway_error(e)
|
||||
end
|
||||
@@ -84,7 +82,7 @@ class CheckoutController < ::BaseController
|
||||
@order = current_order
|
||||
|
||||
redirect_to(main_app.shop_path) && return if redirect_to_shop?
|
||||
redirect_to_cart_path && return unless valid_order_line_items?
|
||||
handle_invalid_stock && return unless valid_order_line_items?
|
||||
|
||||
before_address
|
||||
setup_for_current_state
|
||||
@@ -102,7 +100,10 @@ class CheckoutController < ::BaseController
|
||||
distributes_order_variants?(@order)
|
||||
end
|
||||
|
||||
def redirect_to_cart_path
|
||||
def handle_invalid_stock
|
||||
cancel_incomplete_payments if valid_payment_intent_provided?
|
||||
reset_order_to_cart
|
||||
|
||||
respond_to do |format|
|
||||
format.html do
|
||||
redirect_to main_app.cart_path
|
||||
@@ -114,6 +115,20 @@ class CheckoutController < ::BaseController
|
||||
end
|
||||
end
|
||||
|
||||
def cancel_incomplete_payments
|
||||
# The checkout could not complete due to stock running out. We void any pending (incomplete)
|
||||
# Stripe payments here as the order will need to be changed and resubmitted (or abandoned).
|
||||
@order.payments.incomplete.each do |payment|
|
||||
payment.void!
|
||||
payment.adjustment&.update_columns(eligible: false, state: "finalized")
|
||||
end
|
||||
flash[:notice] = I18n.t("checkout.payment_cancelled_due_to_stock")
|
||||
end
|
||||
|
||||
def reset_order_to_cart
|
||||
OrderCheckoutRestart.new(@order).call
|
||||
end
|
||||
|
||||
def setup_for_current_state
|
||||
method_name = :"before_#{@order.state}"
|
||||
__send__(method_name) if respond_to?(method_name, true)
|
||||
@@ -137,11 +152,13 @@ class CheckoutController < ::BaseController
|
||||
|
||||
last_payment = OrderPaymentFinder.new(@order).last_payment
|
||||
@order.state == "payment" &&
|
||||
last_payment&.state == "pending" &&
|
||||
last_payment&.state == "requires_authorization" &&
|
||||
last_payment&.response_code == params["payment_intent"]
|
||||
end
|
||||
|
||||
def handle_redirect_from_stripe
|
||||
return checkout_failed unless @order.process_payments!
|
||||
|
||||
if OrderWorkflow.new(@order).next && order_complete?
|
||||
checkout_succeeded
|
||||
redirect_to(order_path(@order)) && return
|
||||
@@ -154,6 +171,8 @@ class CheckoutController < ::BaseController
|
||||
while @order.state != "complete"
|
||||
if @order.state == "payment"
|
||||
return if redirect_to_payment_gateway
|
||||
|
||||
return action_failed unless @order.process_payments!
|
||||
end
|
||||
|
||||
next if OrderWorkflow.new(@order).next({ shipping_method_id: shipping_method_id })
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
module PaginationData
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
def pagination_data(objects)
|
||||
return unless objects.respond_to? :total_count
|
||||
def pagination_data
|
||||
return unless defined? @pagy
|
||||
|
||||
{
|
||||
results: objects.total_count,
|
||||
pages: objects.total_pages,
|
||||
results: @pagy.count,
|
||||
pages: @pagy.pages,
|
||||
page: (params[:page] || 1).to_i,
|
||||
per_page: (params[:per_page] || default_per_page).to_i
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'discourse/single_sign_on'
|
||||
|
||||
class DiscourseSsoController < ApplicationController
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'open_food_network/enterprise_injection_data'
|
||||
|
||||
class EnterprisesController < BaseController
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class GroupsController < BaseController
|
||||
layout 'darkswarm'
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class HomeController < BaseController
|
||||
layout 'darkswarm'
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class LineItemsController < BaseController
|
||||
respond_to :json
|
||||
|
||||
|
||||
8
app/controllers/locales_controller.rb
Normal file
8
app/controllers/locales_controller.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class LocalesController < BaseController
|
||||
def show
|
||||
UserLocaleSetter.new(spree_current_user, params[:id], cookies).set_locale
|
||||
redirect_back fallback_location: main_app.root_url
|
||||
end
|
||||
end
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class MapController < BaseController
|
||||
layout 'darkswarm'
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# For the API
|
||||
ActionController::Metal.class_eval do
|
||||
def spree_current_user
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class PaymentsController < BaseController
|
||||
ssl_required :redirect_to_authorize
|
||||
|
||||
respond_to :html
|
||||
|
||||
prepend_before_action :require_logged_in, only: :redirect_to_authorize
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ProducersController < BaseController
|
||||
layout 'darkswarm'
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'open_food_network/spree_api_key_loader'
|
||||
|
||||
class RegistrationController < BaseController
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ShopController < BaseController
|
||||
layout "darkswarm"
|
||||
before_action :require_distributor_chosen, :set_order_cycles, except: :changeable_orders_alert
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class ShopsController < BaseController
|
||||
layout 'darkswarm'
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class SitemapController < ApplicationController
|
||||
layout nil
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Spree
|
||||
module Admin
|
||||
class AdjustmentsController < ::Admin::ResourceController
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Spree
|
||||
module Admin
|
||||
class BaseController < ApplicationController
|
||||
ssl_required
|
||||
|
||||
helper 'shared'
|
||||
helper 'spree/admin/navigation'
|
||||
helper 'spree/admin/orders'
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Spree
|
||||
module Admin
|
||||
class CountriesController < ::Admin::ResourceController
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Spree
|
||||
module Admin
|
||||
class GeneralSettingsController < Spree::Admin::BaseController
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Spree
|
||||
module Admin
|
||||
class ImagesController < ::Admin::ResourceController
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Spree
|
||||
module Admin
|
||||
class InvoicesController < Spree::Admin::BaseController
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Spree
|
||||
module Admin
|
||||
class MailMethodsController < Spree::Admin::BaseController
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Spree
|
||||
module Admin
|
||||
module Orders
|
||||
@@ -23,7 +25,7 @@ module Spree
|
||||
@order.associate_user!(Spree.user_class.find_by(email: @order.email))
|
||||
end
|
||||
|
||||
OrderWorkflow.new(@order).complete
|
||||
OrderWorkflow.new(@order).advance_to_payment
|
||||
|
||||
@order.shipments.map(&:refresh_rates)
|
||||
flash[:success] = Spree.t('customer_details_updated')
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user