Commit Graph

10169 Commits

Author SHA1 Message Date
Maikel
4930c9bc06 Merge pull request #2934 from mkllnk/manual-rubocop-todo-config
Add offending files to rubocop config
2018-11-05 10:37:03 +11:00
Maikel Linke
7ad40074a5 Make Code Climate show our real score ans split rubocop config
Our rubocop config hides all current violations. It allows us to have a
passing rubocop run on the current code and improve it gradually. It
detects new violations, but doesn't annoy us with all the existing ones.

Code Climate has its own way of remembering all current violations which
is more sophisticated than ours. The new config for Code Climate doesn't
hide any violations so that Code Climate can give us a realistic score
of code quality and warn us about every new violation.

Splitting the configuration into the main three parts gives a quicker
overview and makes maintaining the parts easier.
2018-11-05 10:19:30 +11:00
Maikel Linke
e798532a2f Add offending files to rubocop config
The file .rubocop_todo.yml is generated automatically and contains a
configuration to make all files pass. For a lot of cops it just lists
the offending files. But for some cops it sets a different metric.

Since we don't want these lax metrics, we override them in our config
file .rubocop.yml. This leads to a lot of offences again. This patch
lists all offending files for each cop to make rubocop pass. We can
improve the code over time and remove items from the list.
2018-11-05 10:11:35 +11:00
Pau Pérez Fabregat
3b85bbe911 Merge pull request #2923 from mkllnk/2882-extract-email-setup-in-specs
Extract email setup in specs for easy upgrade
2018-11-02 15:40:19 +01:00
Maikel
3259b3ecf1 Merge pull request #2912 from Matt-Yorkley/admin_orders_refactor
Admin orders refactor
v1.22.0
2018-11-02 16:57:28 +11:00
Maikel
cbfe1b535d Merge pull request #2871 from openfoodfoundation/dependabot/bundler/figaro-1.1.1
Bump figaro from 0.7.0 to 1.1.1
2018-11-02 12:09:53 +11:00
Maikel
931c1207da Merge pull request #2813 from openfoodfoundation/dependabot/bundler/haml-4.0.7
Bump haml from 4.0.4 to 4.0.7
2018-11-01 16:52:07 +11:00
Maikel
7c4370be69 Merge pull request #2963 from luisramos0/2960_migration
Fix variant_overrides permissions for overrides that belong to the supplier herself
2018-11-01 11:41:51 +11:00
luisramos0
079d4e0bf5 Fix variant_overrides permissions for overrides that belong to the supplier herself 2018-10-31 11:26:15 +00:00
Pau Pérez Fabregat
1fbeb43c3a Merge pull request #2958 from coopdevs/pull-translations
Update all locales with the latest Transifex translations
2018-10-31 10:52:02 +01:00
Pau Pérez Fabregat
fc6a2d4a53 Merge pull request #2959 from coopdevs/fix-name-error-on-migrate
Move default_url_options set up to an initializer
2018-10-31 10:51:06 +01:00
Pau Perez
f16897a0b8 Fix DE translations manually
We don't want 🇩🇪 to have a broken menu.
2018-10-31 08:39:25 +01:00
Pau Perez
2e2c7c56cb Move default_url_options set up to an initializer
For some reason running `bundle exec rake db:migrate RAILS_ENV=staging`
fails with:

```
rake aborted!
NameError: uninitialized constant Spree::Config
```

Running `bundle exec rails server` for instance, does not. There must be
a difference on the way a rake task and the rails commands load the app.

Moving this configuration to an initializer, at the end of the
initialization process, fixes it. The constant `Spree::Config` is
already loaded.

**This is preventing the release v1.22.0 from being staged and tested**
2018-10-30 19:45:04 +01:00
Pau Pérez Fabregat
e4b988c9a2 Merge pull request #2924 from kristinalim/fix-disable_hiding_of_offcanvas_upon_resize
Disable hiding of hamburger menu upon resize <= 1024px width
2018-10-30 19:00:14 +01:00
Pau Pérez Fabregat
b35b24d4ae Merge pull request #2914 from luisramos0/checkout-language-bug
Fix multi lingual issue in cart and checkout: the user language selection was not being used
2018-10-30 17:46:37 +01:00
Pau Pérez Fabregat
7ffa3a2ca1 Merge pull request #2913 from HugsDaniel/2905_password_reset_missing_translations
Add password confirmation, token and expired keys
2018-10-30 17:34:01 +01:00
Pau Pérez Fabregat
3d88199257 Merge pull request #2896 from Matt-Yorkley/email_https_links
Use https on all links in emails in production
2018-10-30 17:33:32 +01:00
Pau Pérez Fabregat
8e602d453b Merge pull request #2876 from luisramos0/subs-states-fix
Fix bug in subscriptions address controller where country states were not correctly returned
2018-10-30 17:32:34 +01:00
Pau Perez
7f177598f2 Update all locales with the latest Transifex translations 2018-10-30 15:13:57 +01:00
Maikel
d63670d675 Merge pull request #2846 from Matt-Yorkley/pi/rename_enterprise_fields
[Product Import] Rename enterprise fields and update template
2018-10-30 15:11:02 +11:00
Maikel
7609496df3 Merge pull request #2859 from albarnaz/instagram_pattern
Instagram pattern
2018-10-30 15:10:27 +11:00
Maikel
ee042f51a4 Merge pull request #2949 from pfac/pfac-fix-new-preferences-migration
Fix new preferences migration
2018-10-30 15:09:35 +11:00
Pau Pérez Fabregat
5fade045f8 Merge pull request #2928 from luisramos0/line_items_controller_spec
Reorganize LineItemsController's destroy line item specs
2018-10-29 16:09:20 +01:00
Pedro Costa
91e4f99c19 Fix new preferences migration
Why:

* In a clean environment, running the new preferences migration fails,
  due to a missing file from Spree core being manually required. This
  file has now been missing since ab707cf.

This change addresses the issue by:

* Copying the missing file from Spree Core 1.3.6.beta into the migration.
  This fixes the issue for now, but also means that a migration merge
  and/or rewrite might be in order for the future.
2018-10-29 14:53:01 +00:00
Matt-Yorkley
443515dae4 Improve comment in index action 2018-10-29 10:34:05 +00:00
Matt-Yorkley
f3124e5472 Explicitly add :host to actionmailer config 2018-10-26 22:42:47 +01:00
Matt-Yorkley
b826beb0d7 Inline hashes in tests 2018-10-26 21:38:57 +01:00
Matt-Yorkley
29492d61f9 Use #allow syntax 2018-10-26 21:38:57 +01:00
Matt-Yorkley
8c19d1afec Move tests from spree/admin/orders_controller_spec to api/orders_controller_spec and tidy up 2018-10-26 21:38:57 +01:00
Matt-Yorkley
033ae4f570 Add basic SearchOrders service spec 2018-10-26 21:38:57 +01:00
Matt-Yorkley
1f8f7b0495 Add new Api::OrdersController spec 2018-10-26 21:38:57 +01:00
Matt-Yorkley
46b1317159 Update orders resource js spec 2018-10-26 21:38:57 +01:00
Matt-Yorkley
334eebeab1 Move json to API and strip index action 2018-10-26 21:38:57 +01:00
Matt-Yorkley
0bd67bd06a Remove unnecessary Spree::Config fallback value 2018-10-26 21:38:57 +01:00
Matt-Yorkley
77251848ee Refactor Spree::Admin::OrdersController 2018-10-26 21:38:57 +01:00
luisramos0
09f8df6340 Reorganize LineItemsController's destroy line item specs to separate contexts with different test orders (completed_with_total and completed_with_fees) 2018-10-25 18:06:48 +01:00
Pau Pérez Fabregat
8a3f621b42 Merge pull request #2893 from luisramos0/deleted_products_break_inventory
Fix bug in inventory management page
2018-10-25 18:20:42 +02:00
Pau Pérez Fabregat
7cac4637fe Merge pull request #2916 from luisramos0/date-transl-fix
Add Portuguese and German to list of momentJS locales
2018-10-25 18:18:53 +02:00
Kristina Lim
2cc594dc98 Proceed to hide off-canvas when resized to >1024px 2018-10-25 20:36:27 +08:00
Kristina Lim
14eaa49204 Disable hiding the off-canvas upon window resize.
In some browsers for mobile devices, the address bar is automatically
hidden when scrolling down the page. This is not workable if the height
of the contents of the off-canvas exceeds the height of the screen,
because the latter portion of the contents stays hidden to the user.

https://github.com/openfoodfoundation/angular-foundation/blob/0.9.0-20180826174721/src/offcanvas/offcanvas.js
2018-10-25 19:29:19 +08:00
Maikel
acb8ec772e Merge pull request #2922 from mkllnk/update-rubocop-todo
Update rubocop todo list
2018-10-25 14:48:51 +11:00
Maikel
3cab3d1798 Merge pull request #2921 from openfoodfoundation/transifex
Transifex
2018-10-25 14:22:10 +11:00
Maikel Linke
cd5c23993a Update rubocop todo list
Since we activated more cops in 0ac16ce096
we had a lot of files missing in the todo list. They are likely from
other pull requests that have been open at the same time. This is a
quick update so that rubocop gives us some useful feedback again.
2018-10-25 14:08:04 +11:00
Maikel Linke
e6adb8a3b9 Extract email setup in specs for easy upgrade
The way we set up email sending completely changes with Spree 2. This
change encapsulates that code in a single method so that it can be
changed easily and doesn't create further merge conflicts while we are
still working on the master branch and the Spree upgrade.
2018-10-25 13:53:22 +11:00
Maikel
51a1787881 Merge pull request #2908 from Matt-Yorkley/bulk_orders_bug
Fix pagination conflict with LineItemsCtrl requests
2018-10-25 13:18:11 +11:00
Maikel Linke
dc5302ca08 Speed up database queries and make them scale
This commit makes use of three ActiveRecord features:

1. Using `select` instead of `all.map` enables ActiveRecord to nest one
select into the other, resulting in one more efficient query instead of
two.

2. Using `find_each` saves memory by loading records in batches.
https://api.rubyonrails.org/classes/ActiveRecord/Batches.html#method-i-find_each

3. Using `pluck` creates only an array, avoiding loading all the other
columns of the records into objects.

Running this on the current Canadian database, fixes the following
variant overrides:

```
[]
[]
[]
[]
[]
[]
[925, 924, 966, 965]
[]
[]
[]
[]
[462,
 863,
 464,
 822,
 949,
 947,
 944,
 939,
 942,
 946,
 945,
 943,
 438,
 937,
 938,
 941,
 940,
 467,
 952,
 875,
 453,
 953,
 454,
 951,
 487,
 460,
 457,
 528,
 527,
 486,
 459,
 458,
 461,
 529,
 530,
 950,
 642,
 384,
 380,
 643,
 385,
 381,
 644,
 386,
 382,
 960,
 959,
 379,
 640,
 377,
 375,
 532,
 639,
 376,
 374,
 646,
 390,
 389,
 637,
 406,
 408,
 647,
 391,
 393,
 633,
 396,
 400,
 398,
 645,
 388,
 387,
 648,
 394,
 392,
 536,
 632,
 399,
 397,
 395,
 634,
 403,
 401,
 635,
 404,
 402,
 636,
 407,
 405,
 535,
 534,
 638,
 410,
 409,
 948,
 533,
 537,
 531,
 877,
 880,
 894,
 893,
 672,
 671,
 673,
 674,
 703,
 714,
 715,
 716,
 717,
 862,
 864,
 879,
 876,
 865,
 881,
 878,
 463,
 954,
 866,
 823,
 957,
 958,
 955,
 956,
 899,
 897]
[]
[969]
```
2018-10-25 11:33:14 +11:00
Transifex-Openfoodnetwork
c17939631f Updating translations for config/locales/en_US.yml 2018-10-25 09:31:36 +11:00
Pau Pérez Fabregat
ce93c52dfe Merge pull request #2850 from Matt-Yorkley/password_change_logout
Password change logout
2018-10-24 11:43:09 +02:00
Pau Pérez Fabregat
9ef4852bd4 Merge pull request #2818 from nikobozi/refactor-variant-overrides-query
Move query from variant_overrides_controller to its model scope
2018-10-24 11:42:22 +02:00
Pau Pérez Fabregat
7651ee0909 Merge pull request #2798 from as1729/as1729-update-docs-Stripe-publishable_key-for-pr
Better docs for Stripe.publishable_key and Stripe.endpoint_secret.
2018-10-24 11:23:21 +02:00