Commit Graph

9172 Commits

Author SHA1 Message Date
Alberto García
223c06f588 Merge pull request #2567 from consul/mode-view
Mode view
2018-04-27 19:28:54 +02:00
Alberto García
6a0a710148 Merge pull request #2566 from consul/minor-fixes
Minor fixes
2018-04-27 19:27:34 +02:00
decabeza
02cef6dec5 Fixes missing i18n 2018-04-27 18:24:53 +02:00
decabeza
b93543cbf9 Shows message only if there is questions on legislation debate 2018-04-27 18:24:53 +02:00
decabeza
56f64779ba Fixes actions buttons on admin valuators index table 2018-04-27 18:24:53 +02:00
decabeza
3f7395fa19 Adds message on polls index if there are no open polls 2018-04-27 18:24:17 +02:00
decabeza
32711e0341 Adds map skip checkbox i18n for budget investments 2018-04-27 18:24:17 +02:00
decabeza
725c282ba5 Adds unicode_normalize for alt and title on images 2018-04-27 18:24:17 +02:00
decabeza
9a60f5370d Moves h3 tag outside of table on polls results 2018-04-27 18:24:17 +02:00
decabeza
1f82599380 Adds class on back link to admin budget investments show 2018-04-27 18:24:17 +02:00
decabeza
dba8b6a7c9 Improves i18n of admin budgets 2018-04-27 18:24:17 +02:00
Alberto Calderón Queimadelos
0ec57409d1 Merge pull request #2598 from consul/avoid_dev_seeds_output_in_specs
Avoid db:dev_seed log print when run from its test
2018-04-25 21:40:20 +02:00
Alberto Calderón Queimadelos
f330aea108 Merge pull request #2613 from consul/fixup_investments_map
Fix MapLocation json_data to return mappable ids
2018-04-25 21:15:21 +02:00
Bertocq
a44c830cd4 Fix MapLocation json_data to return mappable ids
Until we correctly make MapLocation relation with mappables a polymorphic
one... we'll need to return the investment_id and proposal_id values.

Right now it was returning the MapLocation ID, and the JS was making a
call searching for an Investment with the MapLocation ID... sometimes
finding a record with same ID but totally NOT the one associated to the
MapLocation.
2018-04-25 20:05:19 +02:00
Alberto Calderón Queimadelos
26f72e437b Merge pull request #2599 from consul/remove_sitemap_generator_output
Remove sitemap generator output when running specs
2018-04-15 12:15:42 +02:00
Bertocq
23b15490ce Remove sitemap generator output when running specs
When running tests there is no need to pollute rspec's output with any
kind of log/info.
2018-04-14 22:26:03 +02:00
Bertocq
fcdc24a78c Avoid db:dev_seed log print when run from its test
The db:dev_seed rake logs info as it progresses as information for the
developer. But that's not needed when ran from its tests file, and it
bloats the travis/rspec output with unnecessary information.

Now the task will always log info unless the rake task receives an
optional argument.
2018-04-14 20:28:43 +02:00
Bertocq
a31b80fd76 Remove duplicated mailer entry 2018-04-13 07:40:09 +02:00
Alberto Calderón Queimadelos
5e7c522cc7 Merge pull request #2592 from consul/investment_valuator_groups_csv_table
Add valuator groups  assigned to investments to admin tables & csv export
2018-04-11 22:52:13 +02:00
Bertocq
33b6fa3a02 Refactor Investment csv download with filters test
There's no need to check again headers in this scenario, previous one
already does it.

Correctly naming variables, as well as using explicit expectations is a
good idea.

Last but not least, expectations where reversed but by luck or lack of
attention where passing.
2018-04-11 21:32:59 +02:00
Bertocq
71003875ae Refactor Investment CSV export download scenario
The created investment didn't had all data to correctly assert each
column values are correctly exported.

The expectations checking if each particular text appears are invalid in
this test. The objective is to check that the downloaded file contents
are exactly as they should be... not particular parts checked in an
independent way as for example "Yes" could appear in two different
columns and just looking if the text appears is not a valid assertion.
2018-04-11 21:32:57 +02:00
Bertocq
aacac71362 Extract Budget Investment to_csv to its own class
The csv generation doesn't seem like a Model concern, at least not taking
into account the amount of lines of the method (36+). Just a simple ruby
class that encapsulates the logic makes it easier to read and maintain as
we increase the columns exported.. also customize in case other forks need
different values.
2018-04-11 21:30:16 +02:00
Bertocq
83f4f4f65c Remove unnecesary parameter at Investment to_csv
If there's only one usage of `to_csv` and the parameter has always the
same value... there's no good reason to bother using an additional argument.
2018-04-11 21:14:13 +02:00
Bertocq
1dc8d29f2d Add Valuator Groups list to investment csv & table
We've added the list of valuator groups assigned to each investment at
 both admin investment list and investment csv exported file
2018-04-11 21:12:46 +02:00
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