Commit Graph

9098 Commits

Author SHA1 Message Date
Bertocq
b364fc475e Move assigned_valuators from helper to model
There's no good reason to call assigned_valuators(investment) when the
logic can be at the model.

Also removed the valuator_groups texts to be added in an independent
method
2018-04-11 21:07:01 +02:00
Alberto Calderón Queimadelos
494062300b Merge pull request #2585 from consul/document_upload_setting
Document upload setting
2018-04-10 13:59:32 +02:00
Bertocq
21ead40e26 Disable document upload & show with new setting
When Setting allow_attached_documents is disabled (false value) the user
should not be able to upload documents neither see the documents lists
2018-04-10 13:10:14 +02:00
Bertocq
e36c6c7781 Translate admin setting banner sections 2018-04-10 13:05:00 +02:00
Bertocq
35c156ba7a Create setting to enable/disable attached documents
Add setting to both seed and dev_seeds as well as a rake task to make it
easier to set.
2018-04-10 12:46:09 +02:00
iagirre
21a6d3495a Update PR with master
Rebase master branch so that this PR can
be updated with the latest changes.
Conflicts has been solved and some specs
updated to fit the new changes. dev_seeds
has been also adapted to the new format.
2018-04-09 16:11:06 +02:00
iagirre
d02b3e0486 Modifications to the spec to avoid using wait_for_ajax 2018-04-09 15:02:35 +02:00
iagirre
e2a91c6cc8 Modified the investments partial to fit the new budget_investments UI: valuating filter name has changed to under_valuation.
Modified the specs to fit the new UI for budget_investments
2018-04-09 15:02:35 +02:00
iagirre
b8cc10d218 Fix conflics after rebase 2018-04-09 15:02:35 +02:00
Alberto Calderón Queimadelos
01f421717d Merge pull request #2578 from consul/fix_valuation_heading_filters
Fix valuation heading filters
2018-04-06 12:02:27 +02:00
Bertocq
09fb4701b8 Fix Valuation Investment index heading filters
Why:

Heading filter where not being correctly displayed

How:

Increasing scenario to cover all possible combinations, and fixing the
heading_filters method of the Valuation Budget Investment Controller to
correctly:
  * Find how many investments the valuator can access
  * Count investments for each heading
2018-04-06 00:42:36 +02:00
Bertocq
0fceb1381f Fix line length at admin investment controller 2018-04-06 00:37:10 +02:00
Alberto Calderón Queimadelos
cbd06c2e1c Merge pull request #2576 from consul/refactor_for_valuator_groups
Add Valuator Group name validation & related specs
2018-04-06 00:22:58 +02:00
Bertocq
43d78c6c72 Adding Investment#by_valuator_group test scenario
Budget::Investment#by_valuator_group scope didn't had a test scenario
2018-04-06 00:22:41 +02:00
rgarcia
59805e9b73 Fix specs 2018-04-05 22:16:36 +02:00
Bertocq
48286f7de9 Validate ValuatorGroup#name presence & uniqueness
Why:

ValuatorGroup name should be unique and present to be able to identify
correctly each of them.

How:
  - Adding a presence & uniqueness validation at the model
  - Adding a sequenced value for name attribute at its factory
  - Adding missing model spec that covers validations
2018-04-05 22:12:06 +02:00
Raimond Garcia
1692abc54a Merge pull request #2374 from wairbut-m2c/upload_documents_feature
Upload documents feature
2018-04-05 19:39:12 +02:00
Raimond Garcia
5fae3c3c75 Merge pull request #2548 from wairbut-m2c/backport-let-manager-reset-users-password
Let managers reset user's password
2018-04-05 17:03:24 +02:00
Raimond Garcia
329a46888d Merge pull request #2575 from consul/no-budgets
Display message in budget's index when there are no budgets
2018-04-05 16:39:17 +02:00
decabeza
ef00eaa765 Adds missing content to budget investments mode view
This feature was already on Madrid fork and missing on backport
2018-04-05 14:53:22 +02:00
decabeza
b101b28d0f Adds view mode on proposals index 2018-04-05 14:52:56 +02:00
decabeza
563c1ebc93 Adds styles to no budgets message 2018-04-05 14:25:38 +02:00
rgarcia
39c6ac4a91 Display message in budget's index when there are no budgets
When there are no budgets we were seeing an exception in the budgets’
index

There are two parts to take into account here:
1) Making sure there is a current_budget present, otherwise we display
the “no budgets” message

2) The map helper is called from the controller, so we need to make
sure current_budget is present there too

Note: We could have added a bunch of `try` statements in the budgets’s
index, instead of using a conditional, however there are quite a few
`current_budget` calls so it seems more appropriate to use a conditional
2018-04-05 14:25:32 +02:00
Alberto Calderón Queimadelos
43390a632a Merge pull request #2574 from consul/rubocop_update
Update rubocop gem from 0.53.0 to 0.54.0
2018-04-05 09:20:43 +02:00
Raimond Garcia
65f5ab424b Merge pull request #2570 from consul/unfeasibility-explanation
Display unfeasibility explanation only when valuation has finished
2018-04-05 00:21:31 +02:00
Raimond Garcia
573885d0be Merge pull request #2569 from consul/change-email
Fix to change email address from my account
2018-04-05 00:21:20 +02:00
Raimond Garcia
787657e07e Merge pull request #2510 from consul/valuator-groups
Add valuator groups
2018-04-05 00:21:04 +02:00
Raimond Garcia
b9a1e19cbb Merge pull request #2568 from consul/gems
Update rails-html-sanitizer gem version to 1.0.4
2018-04-05 00:20:49 +02:00
Bertocq
9a21734805 Update rubocop gem from 0.53.0 to 0.54.0 2018-04-05 00:08:13 +02:00
Alberto Calderón Queimadelos
288ec75fcd Merge pull request #2524 from consul/rubocop_update
Rubocop & rubocop-rspec gem & config updates
2018-04-04 20:10:39 +02:00
Alberto Calderón Queimadelos
86d5fe3700 Merge pull request #2572 from consul/i18n_master
New Crowdin translations
2018-04-04 20:10:26 +02:00
Alberto Calderón Queimadelos
cb7e9f32f1 Merge pull request #2560 from consul/fix_route_deprecation_warning
Fix routes deprecation warning for `to:` usage
2018-04-04 20:10:11 +02:00
Alberto Calderón Queimadelos
d7d9f587da Merge pull request #2559 from consul/fix_date_new_to_use_timezone
Fix date parsing to take the TimeZone in account
2018-04-04 19:45:15 +02:00
Bertocq
746fef60da Add indonesian translations 2018-04-04 19:39:54 +02:00
Bertocq
3aaf466939 Update galician translations 2018-04-04 19:39:12 +02:00
Bertocq
3ef955101b Add german translations 2018-04-04 19:38:20 +02:00
Bertocq
16bf8bcdd0 Update nl translation 2018-04-04 19:37:07 +02:00
Bertocq
c863b0724a Update catalan translation 2018-04-04 19:36:42 +02:00
Bertocq
db02dd26ab Update french translations 2018-04-04 19:36:26 +02:00
Bertocq
c1bfd99be5 Update hebrew translations 2018-04-04 19:35:16 +02:00
Bertocq
988e7d44ed Update Valencian translations 2018-04-04 19:34:31 +02:00
Bertocq
2bf019f08b Disable DynamicAttributeDefinedStatically cop
rubocop-rspec includes a FactoryBot cop DynamicAttributeDefinedStatically
that enforces declaring dynamic attribute values in a block. It was
decided not to follow this convention. Explicitly disabling it gives
more insight about current rubocop rules.

http://www.rubydoc.info/gems/rubocop-rspec/1.24.0/RuboCop/Cop/RSpec/FactoryBot/DynamicAttributeDefinedStatically
2018-04-04 19:28:15 +02:00
Bertocq
e2c42a3c63 Enable StaticAttributeDefinedDynamically cop & fix
rubocop-rspec gem includes cops for FactoryBot like the new
 FactoryBot/StaticAttributeDefinedDynamically to enforce declaring
 static attribute values without a block.

* http://www.rubydoc.info/gems/rubocop-rspec/1.24.0/RuboCop/Cop/RSpec/FactoryBot/StaticAttributeDefinedDynamically
2018-04-04 19:28:15 +02:00
Bertocq
d3d9573086 Enable new Rails/HttpStatus cop without issues
rubocop-rspec 1.23.0 release introduced the cop RSpec/Rails/HttpStatus
to enforce consistent usage of the status format (numeric or symbolic).
* https://github.com/rubocop-rspec/rubocop-rspec/pull/553
* https://github.com/rubocop-rspec/rubocop-rspec/releases/tag/v1.23.0
2018-04-04 19:28:15 +02:00
Bertocq
1d0bf77cca Update rubocop-rspec gem to 1.24.0 from 1.22.1 2018-04-04 19:28:14 +02:00
Bertocq
b0c0578cbe Remove deprecated Performance/HashEachMethods cop
At release https://github.com/bbatsov/rubocop/releases/tag/v0.53.0 it
has been removed with https://github.com/bbatsov/rubocop/issues/5589
2018-04-04 19:26:31 +02:00
Bertocq
b2951b120a Update Rubocop gem to 0.53.0 2018-04-04 19:26:29 +02:00
rgarcia
c4b6ad9ee6 Use strings instead of method calls in expectations 2018-04-04 14:38:36 +02:00
rgarcia
71bb5b3dcf Fix display of unfeasibility explanation
We were missing a check to make sure valuation had finished before
displaying the unfeasibility explanation
2018-04-04 14:38:31 +02:00
Bertocq
633cc1283b Fix Date & DateTime parsings to use default timezone
Date.new(...) does not take into account the current timezone, while other
parts of the application do. By default always parsing any date with the
default timezone and converting the resulting Time to Date would prevent
this kind of issues

DateTime.parse(...).in_time_zone gives an unexpected result, as the
DateTime.parse(...) will create a DateTime with +0000 time zone and the
`in_time_zone` will modify the DateTime to adjust to the default zone.

Maybe its better explained with an example, using 'Lima' as timezone:

DateTime.parse("2015-01-01")
> Thu, 01 Jan 2015 00:00:00 +0000

DateTime.parse("2015-01-01").in_time_zone
> Wed, 31 Dec 2014 19:00:00 -05 -05:00

And that's not the desired date but the previous day!
2018-04-04 14:21:39 +02:00