Commit Graph

11202 Commits

Author SHA1 Message Date
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
Angel Perez
f9e8e2d86d I18n: cleanup for Admin English/Spanish strings
* Add missing exclamation marks
* Fix typos
* Remove duplicated keys
* Remove trailing whitespaces
* Replace single quotes with double quotes
* Replace untranslated strings
* Fix incorrect 'Spending proposal' assertion
2018-04-09 14:39:03 -04:00
Angel Perez
f36b58f605 I18n: cleanup for ActiveRecord English strings
* Remove duplicated strings
* Replace untranslated strings
2018-04-09 14:39:03 -04: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
65e2360650 Use a float smaller than 1 as a random seed
By using a random seed value smaller than 1, we solve the previous
situation[1] in a simpler way

This test is now obsolete.
It’s hard to write a tests to verify that even with a big seed in
params, we will covert it to a float smaller than 1.

We should refactor these `set_random_seed` methods into a nice model or
controller concern and test it thoroughly

[1]
https://github.com/AyuntamientoMadrid/consul/commit/ba3bf11526fc6ce9c66f
647c414946c61ff945fe
2018-04-05 22:16:54 +02:00
rgarcia
3dcbb6b976 Run random order tests without javascript
Speeds it up a little, there is no need to take into account javascript
in these tests
2018-04-05 22:16:54 +02:00
rgarcia
ef30dc1efe Add defensive test to display correctly a user's votes
This is a defensive test, just in case we decide to go back to using
`setseed` instead of the `modulus`[1] approach to display investments
in random order

The reason for this test is that `setseed` only ~works in the next
`select` statement. And as when loading a user’s votes for investments
we do a second `select` it does not work as expected 😌

To solve this… we could call `set_random_seed` before loading a user’s
votes for an investment[2]

[1] https://github.com/consul/consul/pull/2131
[2]
https://github.com/AyuntamientoMadrid/consul/blob/master/app/controllers
/budgets/investments_controller.rb#L37
2018-04-05 22:16:54 +02:00
rgarcia
ce3cb045f8 Convert random seed to a small value
We are trying out a modulus function to return investments in random
order https://github.com/consul/consul/pull/2131

However we ran into the gotcha of having a seed value too big for the
modulus function to work as expected

If the seed is bigger than the investment id, the records are returned
ordered by id

By dividing the seed by a big number, this problem seems to get fixed
2018-04-05 22:16:54 +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