Commit Graph

1998 Commits

Author SHA1 Message Date
David Cook
a7ef243262 Enable all columns by default 2024-06-13 10:43:33 +10:00
David Cook
d81c3cb489 Show/hide columns based on checkboxes
The cols could have been a lot cleaner with simple classnames, but I preferred to mark up in a way that reveals the purpose (otherwise they could be used for styling).

It doesn't seem to be any faster comparing querySelector('[data]') vs class, or iterating through the dom nodes.
2024-06-12 14:58:00 +10:00
David Cook
50469fe53e Use consistent translation keys
Ensures that the column table names match the names in the selector.

I thought 'there must be a way to set the translation scope once'. With Rails, there's usually a way. Thankfully this one was quite simple. Or is it too much magic.. 🧙

https://coderwall.com/p/dvme9q/set-scope-of-i18n-translations-in-rails-with-a-block
2024-06-12 14:49:59 +10:00
David Cook
68da9c9e04 Add form to save column preferences 2024-06-12 14:49:53 +10:00
David Cook
a405f17c0b Merge pull request #12510 from cyrillefr/RemoveUnusedMissingIdsCheckRakeTasks
Deleting some used one-shot rake tasks
2024-05-27 13:53:21 +10:00
Filipe
88baf5e1de Merge pull request #12496 from isidzukuri/12355-remove-unused-discourse
[12355] Remove discourse
2024-05-23 19:28:02 +01:00
Rachel Arnould
163e9b6c9c Merge pull request #12505 from filipefurtad0/remove_deprecation
Removes deprecation strikethrough from tax report (by producer)
2024-05-23 17:14:28 +02:00
cyrillefr
8c0e20f53c Deleting some used one-shot rake taskes
- in relation to: Fix Rubocop Rails issues #11482
 - and  Require belongs_to associations by default #11297
 - and #12407 #12428 etc.
2024-05-23 10:07:56 +02:00
filipefurtad0
5ccecdd9ff Removes deprecation strikethrough from enterprise fees with tax report by producer 2024-05-22 20:38:11 +01:00
isidzukuri
621a95e913 Remove discourse 2024-05-21 09:02:45 +03:00
Maikel Linke
135128cf41 Remove obsolete Enterprise#next_collection_at
This was actually shown in one place and represents a user-facing
change. But you weren't able to edit the field which means that only
very old enterprises would have had this field set and were not able to
change it anymore.

I searched au-prod and found the following values in the database:

- "Friday 31st January"
- "From 4pm, Monday 30 September"
- "From 5pm-7pm Monday"
- "Saturday 27 April 12noon"
- "January 31st/February 1st"
- "Saturday 1st February"

They seem specific to a certain order cycle and have no value as
fallback any more. Seems safe to remove.
2024-05-16 07:57:02 +10:00
Maikel Linke
c981661fe0 Remove obsolete Enterprise#pickup_times 2024-05-16 07:57:02 +10:00
Maikel Linke
9464df8aae Remove obsolete Enterprise#distributor_info 2024-05-16 07:56:57 +10:00
Filipe
b3ac6bed87 Merge pull request #12428 from cyrillefr/RedundantPresenceValidationOnBelongs_part_III
Fix RedundantPresenceValidationOnBelongs on two files
2024-05-15 18:21:52 +01:00
Maikel
a75f3245a0 Revert "Fix Duplicate Language Display on New User Creation" 2024-05-03 15:07:47 +10:00
cyrillefr
5e18038a68 Fix RedundantPresenceValidationOnBelongs on two files
- presence: true is redundant since Rails 5.0 BUT applies
   with new default config of
   belongs_to_required_by_default to true.
   Lots of files with belongs_to_required_by_default = false
   (backward compatibility).
   So: deleting this setting implies to adding optional: true
 - added 'NOT NULL' constraints so model constraints match
   with contraints on DB tables.
 - corresponding migration files to match AR Models &
   DB tables
 - rake tasks to check corrupt data (ie: NULL/nil in id fields)
 - updated the todo
2024-05-01 15:43:09 +02:00
Gaetan Craig-Riou
04f77b5791 Merge pull request #12414 from cyrillefr/RedundantPresenceValidationOnBelongs_part_II
Fix RedundantPresenceValidationOnBelongs on some files (part II)
2024-05-01 13:00:47 +10:00
Gaetan Craig-Riou
442991ac7b Merge pull request #12413 from rioug/check-invalid-address-task
Add task to check for invalid address
2024-04-29 10:13:30 +10:00
Gaetan Craig-Riou
a977bd633b Move rake file to the correct folder 2024-04-29 09:58:13 +10:00
Filipe
f269584b8e Merge pull request #12392 from sergioosouzaa/fix/duplicate-language-display-new-user-11513
Fix Duplicate Language Display on New User Creation
2024-04-25 16:01:09 +01:00
cyrillefr
43005672a9 Fix RedundantPresenceValidationOnBelongs on other files
- presence: true is redundant since Rails 5.0 BUT applies
   with new default config of
   belongs_to_required_by_default to true.
   Lots of files with belongs_to_required_by_default = false
   (backward compatibility).
   So: deleting this setting implies to adding optional: true
 - added 'NOT NULL' constraints so model constraints match
   with contraints on DB tables.
 - corresponding migration files to match AR Models &
   DB tables
 - rake tasks to check corrupt data (ie: NULL/nil in id fields)
 - updated the todo
2024-04-24 15:19:17 +02:00
Gaetan Craig-Riou
77a8e4d29a Print code to run to delete address if needed 2024-04-24 16:49:47 +10:00
Gaetan Craig-Riou
9583bef0d8 Per review, handle case where a model can be linked to invalid addresses 2024-04-24 16:42:13 +10:00
Gaetan Craig-Riou
040e09414b Add ofn:data:check_invalid_address_used task
It checks for invalid addresses, ie address with address1, city, phone
or country_id set to null.
It will return:
- a list of invalid address in use (associated to another
model)
- a list of invalid address not in use, ie that we can delete
2024-04-24 15:34:33 +10:00
David Cook
5b043574a2 Merge pull request #12384 from mkllnk/mail-config
Don't pass invalid auth method "None" to net-smtp
2024-04-18 16:51:51 +10:00
Sergio Souza
51d90e782b remove the source_locale from the avaliable_locales method 2024-04-18 08:55:34 +10:00
cyrillefr
456905e69f Fix Rails/WhereExists rubocop offenses
- after discussion, dev team decided not to follow
- this particular rule, but rather to enforce the where().exists? rule
  instead.
- cf. https://github.com/openfoodfoundation/openfoodnetwork/pull/12363
2024-04-17 10:37:18 +02:00
Maikel Linke
1fc4270613 Remove indirection from MailSettings
We can simply merge the option hashes now because they are not
conditional anymore. Well, the magic `presence` method does the
conditional logic for us now.
2024-04-16 16:40:52 +10:00
Maikel Linke
7e2fcede61 Further simplify mail options logic
We were always adding this option anyway, so why not declare it to start
with?
2024-04-16 16:40:52 +10:00
Maikel Linke
a41019fbff Simplify SMTP auth method selection
Instead of using the auth method name, let's just not supply username
and password when we don't want to authenticate. The two affected
servers AU and CA don't have credentials set anyway. This is compatible.

The specs needed changing though.
2024-04-16 16:40:50 +10:00
Maikel Linke
d6f2a531aa Don't pass invalid auth method "None" to net-smtp
It's our magic word to not pass username and password on.
2024-04-16 16:18:49 +10:00
David Cook
3318c2622d Merge pull request #12352 from cyrillefr/FixRailsWhereEquals
Fix rubocop FixRailsWhereEquals
2024-04-11 11:43:03 +10:00
David Cook
d4da684f4a Merge pull request #12349 from openfoodfoundation/dependabot/bundler/rubocop-1.63.0
chore(deps-dev): bump rubocop from 1.62.1 to 1.63.0
2024-04-10 10:32:32 +10:00
cyrillefr
404fcf1f72 Fix FixRailsWhereEquals
- fixes offenses caused by RuboCop::Cop::Rails::WhereEquals cop
2024-04-09 10:44:02 +02:00
Maikel
a40b9eb44e Merge pull request #12316 from anansilva/6055-fix-rubocop-lint-constant-definition-in-block
Fix rubocop Lint/ConstantDefinitionInBlock group
2024-04-09 12:52:06 +10:00
Gaetan Craig-Riou
1509066b85 Apply new cop Style/MapIntoArray fix 2024-04-09 10:29:30 +10:00
Ana Nunes da Silva
d726a0e3cb Fix offense constant definition in block in users.rake
This rake has tests
2024-04-08 11:16:38 +01:00
Ana Nunes da Silva
5415fa2db8 Fix offense constant definition in block in import_product_images_rake.rb
Add a test to import product images rake
2024-04-08 11:16:38 +01:00
cyrillefr
84747ea064 Fix Rails::NegateInclude issues
- cop class: RuboCop::Cop::Rails::NegateInclude
 -  replaced !array.include?(2) by array.exclude?(2)
2024-04-04 14:42:42 +02:00
Matt-Yorkley
b22c42613a Update taxon querying in reports 2024-04-02 09:27:36 +11:00
Matt-Yorkley
c01bab5f27 Wrap commonly-repeated calls to Spree::Config to reduce unnecessary cache reads
These config values are relatively static but in some cases they can be called many times in the same request (like rendering a report or a large list of line_items in BOM). These values will now only get fetched from Redis/Postgres once at most per request/job.
2024-03-26 13:39:16 +00:00
Matt-Yorkley
fc1b686938 Don't generate packing reports unnecessarily when displaying the report form 2024-03-24 16:36:50 +00:00
Anthony Musyoki
25e3f30f97 Fix Rubocop Rails issue: Rails/FindEach 2024-03-20 15:34:30 +03:00
David Cook
acb53a6ddc Merge pull request #12273 from mkllnk/rubocop
Rubocop
2024-03-19 10:14:01 +11:00
Feruz Oripov
9d919938f3 Group Order && OrderCycle related services and specs 2024-03-16 19:07:08 +05:00
Maikel Linke
931ee2f9d2 Style Style/RedundantLineContinuation 2024-03-15 12:40:00 +11:00
Maikel
63a1931ce8 Merge pull request #12249 from mkllnk/test-users
Set known default password for sample users
2024-03-13 15:41:30 +11:00
cyrillefr
7d99197dde Requested changes: original fix moved up in code
- instead of selecting out unapplied tax rates in the total tax
    method, did it in the query_result instead. Reverted the
    total_excl_tax method to its initial state.
  - spec and logic of testing affected also.
2024-03-11 10:13:46 +01:00
cyrillefr
7fdf1a110d Fix incorrect results for multiple tax rates in report
- total_excl_tax would sum amounts and taxes without
    knowledge if taxes rates were really applied or not
  - spec shows use case described in issue 12066
2024-03-11 10:13:46 +01:00
Filipe
de9446f5f3 Merge pull request #12167 from mkllnk/haml-up
Update Haml syntax and gem to version 6
2024-03-07 15:36:29 +00:00