Commit Graph

9518 Commits

Author SHA1 Message Date
Maikel Linke
b7de80dd7f Remove unused count_on_hand setting from spec
This spec doesn't need to set the product's `count_on_hand`. The product
comes with a count of 3, but what matters is the count of variants.
2018-06-27 11:41:55 +10:00
Maikel Linke
306bfa1944 Remove unused method enterprise method
`Enterprise.has_supplied_products_on_hand?` is not used anywhere.
2018-06-27 11:25:44 +10:00
Maikel Linke
792701297b Remove unused scope Enterprise.active_distributors
Working on the Spree upgrade, we found that this scope is using the soon
obsolete column `spree_products.count_on_hand`. Trying to measure the
impact of changing this scope, I couldn't find any use of it.

There is a variable called `active_distributors` used when serialising
enterprises, but that variable is initialised with
`Enterprise.distributors_with_active_order_cycles.ready_for_checkout`,
not using the `active_distributors` scope.

See also:
https://github.com/openfoodfoundation/openfoodnetwork/issues/2013
2018-06-27 11:12:54 +10:00
Maikel
eb9064f5be Merge pull request #2383 from frank-west-iii/issue-2271-prepend-load
Fix NoMethodError in order cycles index
2018-06-27 09:12:18 +10:00
Maikel
f5346289c7 Merge pull request #2388 from Matt-Yorkley/uk/pi_available_on
Add available_on notes to PI guide
2018-06-26 17:58:39 +10:00
Maikel
3f334855d1 Merge pull request #2360 from oeoeaio/faster-stats
Rewrite user stat query for improved performance of homepage
2018-06-26 17:58:23 +10:00
Maikel
e9fad741e6 Merge pull request #2387 from Matt-Yorkley/embedded_referrers
Embedded response headers
2018-06-26 17:57:48 +10:00
Rob Harrington
ddb9ae1140 Load all shops that a user is associated with as a customer
Regardless of the presence of an order
2018-06-24 16:28:47 +10:00
Rob Harrington
5e6291bce3 Don't request customers if list is already populated 2018-06-22 15:39:47 +10:00
Rob Harrington
d1d9c5a092 Add help button to saved cards list on account page
Describes the purpose of the default card
2018-06-22 15:39:47 +10:00
Rob Harrington
7db7084008 Use help-modal to display help text for authorised shops
Also updated the text slightly to make it more clear when the purpose of authorised shops are
2018-06-22 15:39:47 +10:00
Rob Harrington
32622c77bc Add basic help modal directive
Useful for showing help text that is too long for a tool tip
2018-06-22 15:39:47 +10:00
Rob Harrington
6457a17fde Add basic view allowing customers to authorise shop use of their credit cards 2018-06-22 15:39:47 +10:00
Rob Harrington
ffa8a8c7d6 Create Api::BaseController to allow use of ActiveModelSerializers
Also add index action to Api::CustomersController
2018-06-22 15:39:47 +10:00
Rob Harrington
29922d4be9 Add allow_charges field to Customer model 2018-06-22 15:39:46 +10:00
Rob Harrington
6e76fd8164 Add Api::CustomersController with update action 2018-06-22 15:39:46 +10:00
Rob Harrington
e25574790b Split out float: right css from .help-btn.tiny selector 2018-06-22 15:39:46 +10:00
Keir Osborn
bd7e072938 embedded groups layout changes 2018-06-22 14:03:00 +10:00
Keir Osborn
f626a21c5e embedded groups initial test 2018-06-22 14:03:00 +10:00
Buildkite
964059f25b Merge remote-tracking branch 'origin/master' into HEAD 2018-06-22 02:41:15 +00:00
Buildkite
57dbf2e770 Merge remote-tracking branch 'origin/master' into HEAD 2018-06-22 00:59:28 +00:00
Rob Harrington
cf9f8edcce Allow html requests for OrderCycleController#update
This is still used from the Advanced Settings page, to update the order_cycle
2018-06-22 09:46:08 +10:00
Rob Harrington
25525ae30b Move applicator calls to OrderCycleForm 2018-06-22 09:46:08 +10:00
Rob Harrington
f88f4a5791 Refactor OrderCycleForm to make logic clearer 2018-06-22 09:46:08 +10:00
Rob Harrington
d9830749f1 Extract schedule syncing logic into OrderCycleForm 2018-06-22 09:46:08 +10:00
Rob Harrington
21bd9d2e10 Add basic specs for OrderCyclesController#create 2018-06-22 09:46:08 +10:00
Rob Harrington
ab9c06837b Add basic OrderCycleForm to handle create/update logic 2018-06-22 09:46:08 +10:00
Rob Harrington
3f5b6be5b6 Remove unnecessary respond_to blocks from OrderCyclesController 2018-06-22 09:46:08 +10:00
Matt-Yorkley
172fa168ea Change layout attribute to method with question mark 2018-06-21 15:19:40 +01:00
Matt-Yorkley
aaba6da162 Add available_on notes to PI guide 2018-06-21 14:20:59 +10:00
Matt-Yorkley
d9623176fb Include admin users as managers on new enterprises 2018-06-21 13:21:08 +10:00
Maikel Linke
d510df5236 Remove obsolete goWithoutHashFragments
It was introduced, because `Navigation.go` perserved hash fragments. We
actually don't need that behaviour and it has been corrected.

`goWithoutHashFragments` also didn't deal with absolute URLs. And it used
`location.origin` which is not supported by Internet Explorer. That is
fixed by our use of Modernizr though.
2018-06-21 10:29:32 +10:00
Maikel Linke
fb02bdd25a Simplify Navigation.go, not preserving hash fragments
I looked through the history and it looks like this function was a bit
flawed (preserving hash fragments) from the beginning. It has been
patched a few times without addressing the underlying issue that we want
more than just replacing the pathname. We want to go somewhere else.
2018-06-21 10:29:32 +10:00
Pau Pérez Fabregat
6cf09c936b Merge pull request #2345 from luisramos0/do-not-upcase-state
removed uppercase from state on shops and producers lists in the frontoffice
2018-06-20 21:30:10 +02:00
Matt-Yorkley
6e81871459 Specs for new EmbeddedPageService 2018-06-20 15:14:56 +01:00
Maikel
3399eba428 Merge pull request #2367 from frank-west-iii/issue-2297-edit-product-cancel
Move product bulk edit to product index route
2018-06-20 17:53:57 +10:00
Rob Harrington
a29a1bd047 Only show change warning for open order cycles 2018-06-20 16:28:36 +10:00
Rob Harrington
7af11da901 Use a SubscriptionsCount query object to provide counts to IndexOrderCycleSerializer 2018-06-20 13:06:06 +10:00
Rob Harrington
d5b1041481 Preload subscription counts for serialization in order cycle collection actions 2018-06-20 13:06:06 +10:00
Rob Harrington
8770122eae Request the subscription count for change warning each time, don't cache 2018-06-20 13:06:05 +10:00
Rob Harrington
86d7453d26 Ask user to confirm oc date change for open order cycles with subsciptions 2018-06-20 13:06:05 +10:00
Maikel Linke
bbe21b7804 Merge branch 'master' of github.com:openfoodfoundation/openfoodnetwork into issue-2297-edit-product-cancel 2018-06-20 10:31:17 +10:00
Matt-Yorkley
ff0e0d9f3d Move logic from ApplicationController to service and improve clarity 2018-06-20 01:28:35 +01:00
Matt-Yorkley
e73b378201 Adjust embedded response headers 2018-06-20 01:28:35 +01:00
Pau Pérez Fabregat
8da8a5a086 Merge pull request #2392 from openfoodfoundation/transifex
Transifex
2018-06-19 13:37:38 +02:00
Pau Pérez Fabregat
20c25cd030 Merge pull request #2368 from Matt-Yorkley/uk/admin_orders
Uk/admin orders
2018-06-19 11:00:35 +02:00
Frank West
3821b9e0da Fix ordering of Gemfile.lock
When we run bundle the gems are being reordered to be alphabetical.

Seems to have been committed on 26/05/2018 here:

7a64ad1cc1
2018-06-19 17:51:24 +10:00
Frank West
f7848b025f Add rack-rewrite to handle redirects
We are moving bulk edit to a different route and we want to be able to
handle redirects on this route. Handling this at the rack level before
the rails stack is the most performant way outside of rewrites on the
web server itself.
2018-06-19 17:51:23 +10:00
Frank West
8324b00999 Renames product bulk edit action to index
When a user hit cancel while editing a product it took them to the spree
products index page instead of the bulk edit page. The button was part
of a shared view for all resources so changing it's actions were not
readily available.

It was suggested that instead of carrying our own separate controller
action we could just override the index action of the products
controller with the bulk edit functionality instead. This has the
advantage of removing some overrides and allows us to not add
additional overrides in the future.
2018-06-19 17:51:23 +10:00
Pau Pérez Fabregat
3484996dbd Merge pull request #2335 from luisramos0/issue2334
Fixed missing translations on shops filter - delivery option
2018-06-19 09:34:13 +02:00