Commit Graph

55 Commits

Author SHA1 Message Date
Abdul Aziz Ali
b3570991f4 Rubocop. Fix cyclomatic complexity in fees controller #11326 2024-06-26 06:36:42 +08:00
Abdul Aziz Ali
e2aca63fff Rubocop. Change yield_self to then #11326 2024-06-12 08:52:43 +08:00
Abdul Aziz Ali
e537bda9b7 Display only per_item fees for oc incoming exchange #11326
Add per_item param to EnterpriseFee angular service and rails controller
2024-06-12 08:29:34 +08:00
bouaik
2e926e867c fix flash type when updating entreprise fees 2023-12-25 10:19:51 +01:00
Neal Chambers
416d6e538a Fix Style/HashSyntax 2023-09-09 09:00:38 +09:00
Neal Chambers
8fc0a20249 Add Additional Test for Model Creation 2023-07-18 08:17:34 +09:00
Neal Chambers
521af70959 Add Strong Params to Enterprise Fees Form 2023-07-18 08:17:34 +09:00
Neal Chambers
fb1ae855c2 Fix Metrics/ClassLength 2023-07-18 08:17:34 +09:00
Neal Chambers
1e4034534c Fix Layout/LineLength 2023-06-23 09:08:04 +09:00
Neal Chambers
252697b782 Rewrite If and Unless Statements to be more Readable 2023-06-09 16:39:26 +09:00
Neal Chambers
dde775d2b7 Remove Old Code and Comments 2023-06-08 15:20:04 +10:00
Mohamed ABDELLANI
7f52684488 add check_calculators_compatibility_with_taxes before running enterprise bulk update 2023-05-15 07:35:52 +01:00
Vishal Jain
755107ec9f Fix snail issue for all enterprise fees 2022-10-20 12:15:21 +05:30
Luis Azcuaga
e8fd89a6d2 Run rubocop over existing todo 2021-10-25 21:28:28 -05:00
mariodz95
578efa945e Fix snail when editing enterprise fees 2021-10-19 10:26:44 +02:00
Maikel Linke
129c4c92fa Catch JS error on OC page
Calling `when variant.id in enterprise_rules` raised an error when
enterprise_rules was null.

Fixing this then revealed a missing require statement in a controller.
2021-10-06 15:29:41 +11:00
Luis Ramos
e52937c113 Use rubocop auto correct to add frozen string literal to all files
This is an unsafe auto corection, we will need to trust our build here
2021-06-17 23:07:26 +01:00
Luis Ramos
23627c5453 Run rubocop -a (safe corrections) removing all exceptions so all possible fixes are applied
9290 issues fixed
2021-06-17 22:19:26 +01:00
Matt-Yorkley
25139178b5 Fix appending to collection (take 2) 2021-03-11 12:19:55 +00:00
Matt-Yorkley
aea8d1dc99 Fix appending to Relation in in EnterpriseFeesController 2021-03-11 12:19:55 +00:00
Luis Ramos
5d6d7f7ad0 Adapt enterprise fees code and specs to new namespace of Sets::EnterpriseFeeSet 2021-01-14 09:41:07 +00:00
Luis Ramos
96a351ad0e Adapt usage of Sets to their new location 2021-01-14 09:41:07 +00:00
Luis Ramos
0fb9f44dda Make all controllers use new Admin::ResourceController 2020-12-03 15:32:20 -08:00
Matt-Yorkley
d225294b6b Extract to PermittedAttributes::Calculator 2020-11-17 18:51:48 +00:00
Matt-Yorkley
3547b9fe56 Add missing calculator params 2020-11-17 18:51:48 +00:00
Matt-Yorkley
787f29105c Fix ForbiddenAttribute errors for bulk update of enterprise fees and order cycles
Example error:
As an administrator
    I want to manage simple order cycles
 updating many order cycle opening/closing times at once
     Failure/Error: raise ActiveModel::ForbiddenAttributesError, params.to_s

     ActiveModel::ForbiddenAttributesError:
       {"order_cycle_set"=>{"collection_attributes"=>{"0"=>{"id"=>62, "name"=>"Updated Order Cycle 1", "orders_open_at"=>"2040-12-01 12:00:00", "orders_close_at"=>"2040-12-01 12:00:01"}, "1"=>{"id"=>63, "name"=>"Updated Order Cycle 2", "orders_open_at"=>"2040-12-01 12:00:02", "orders_close_at"=>"2040-12-01 12:00:03"}, "2"=>{"id"=>64, "name"=>"Updated Order Cycle 3", "orders_open_at"=>"2040-12-01 12:00:04", "orders_close_at"=>"2040-12-01 12:00:05"}}}, "controller"=>"admin/order_cycles", "action"=>"bulk_update", "format"=>"json", "order_cycle"=>{}}
     # ./app/controllers/application_controller.rb:20:in `print_params'
     # ./lib/open_food_network/rack_request_blocker.rb:36:in `call'
     # ------------------
     # --- Caused by: ---
     # ActiveModel::ForbiddenAttributesError:
     #   ActiveModel::ForbiddenAttributesError
     #   ./app/models/model_set.rb:29:in `block in collection_attributes='
2020-11-17 18:51:48 +00:00
Luis Ramos
8a61257547 Rename all before_filter to before_action, it's the same function with a new name 2020-06-22 13:11:57 +01:00
Matt-Yorkley
53645517af Update deprecated #find_by_* methods 2020-02-22 11:06:51 +00:00
Matt-Yorkley
54a40fe79c Handle validation messages when saving new fees 2019-12-07 14:51:17 +01:00
luisramos0
86b0d71c7e Result of rubocop auto-correct and rebuilding rubocop_manual_todo 2019-05-28 12:57:29 +01:00
Hugo Daniel
a50786be34 Remove old do_not_remove_referenced_fees method 2018-11-15 17:59:06 +01:00
Julius Pabrinkis
ba0b17e168 Extract translations from controllers 2017-07-21 12:17:12 +10:00
Rob Harrington
caa8818f02 Adding option to 'Inherit From Product' for enterprise_fee tax categories 2016-03-02 11:56:46 +11:00
Rob Harrington
d01da727f0 Removing :bulk_update action from actions allowed on nil object, using collection_actions methods on controller instead 2016-01-15 09:07:49 +11:00
Rob Harrington
e3138c3cd2 Renaming order_cycle_enterprises_for as visible_enterprises 2015-04-11 22:25:23 +10:00
Rob Harrington
26d55baa35 Moving order cycle permissions to their own permissions class 2015-04-11 21:11:10 +10:00
Rob Harrington
104a8ddecf Refactor order_cycle_enterpises_for permission method, now requires an order cycle 2015-04-08 13:00:17 +10:00
Rob Harrington
d516795774 Fetching Enterprise Fees for order cycle, using new enterprisefee serializer 2015-04-06 13:06:21 +10:00
Rohan Mitchell
53fa71d1f3 Admin can set enterprise fee's tax category 2015-03-05 10:44:25 +11:00
Rohan Mitchell
adf4c0e387 Sort enterprises by name on enterprise fees admin page 2014-02-26 15:38:41 +11:00
Rohan Mitchell
2533e52189 After saving, maintain filter on enterprise fees by enterprise 2013-10-30 17:36:54 +11:00
Rohan Mitchell
5386fa72cc Enterprise fees admin page for a specific enterprise auto-selects that enterprise for new fees and only allows selection of managed enterprises 2013-10-30 17:00:05 +11:00
Rohan Mitchell
ea17e475a6 When viewing enterprise fees, only show those for the enterprise I select 2013-10-18 14:44:01 +11:00
Rohan Mitchell
a6877c6981 Only render calculator HTML in enterprise fee JSON if explicitly requested. Improves load time of order cycles page. 2013-10-16 10:37:09 +11:00
Rohan Mitchell
31a078a53c Enterprise manager can access enterprise fees for enterprises they manage - fixes fees on order cycles interface 2013-08-20 16:26:46 +10:00
Rohan Mitchell
2379cc0c3c Do not display double error when using js 2013-08-13 09:11:25 +10:00
Rohan Mitchell
d7cce918f5 Instead of protecting shipping methods from destruction when referenced by product distributions, protect enterprise fees 2013-08-12 14:22:11 +10:00
Rohan Mitchell
a19a43da79 Add blank enterprise fees in js rather than in controller 2013-07-30 11:34:10 +10:00
Rohan Mitchell
5ae13d6156 Order all the fees 2012-11-23 17:21:46 +11:00
Rohan Mitchell
5e0a5654ff Correctly index calculator fields. Adds ng-bind-html-unsafe-compiled. 2012-11-23 17:02:58 +11:00